Skip to content

Commit 2c23232

Browse files
chore(okms): remove data template on secret creation
1 parent 782295e commit 2c23232

File tree

3 files changed

+0
-23
lines changed

3 files changed

+0
-23
lines changed

packages/manager/apps/okms/src/modules/secret-manager/pages/create-secret/SecretForm.component.spec.tsx

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { act, render, screen, waitFor } from '@testing-library/react';
1515
import userEvent from '@testing-library/user-event';
1616
import { labels, initTestI18n } from '@/common/utils/tests/init.i18n';
1717
import { SecretForm } from './SecretForm.component';
18-
import { SECRET_DATA_TEMPLATE } from './SecretForm.constants';
1918
import {
2019
changeOdsInputValueByTestId,
2120
clickJsonEditorToggle,
@@ -143,18 +142,4 @@ describe('Secrets creation form test suite', () => {
143142
);
144143
},
145144
);
146-
147-
it('should display the template in the data input', async () => {
148-
// GIVEN
149-
const user = userEvent.setup();
150-
await renderSecretForm(MOCK_OKMS_ID);
151-
152-
// WHEN
153-
await clickJsonEditorToggle(user);
154-
const inputData = screen.getByTestId(SECRET_FORM_FIELD_TEST_IDS.INPUT_DATA);
155-
expect(inputData).toBeInTheDocument();
156-
157-
// THEN
158-
expect(inputData).toHaveValue(SECRET_DATA_TEMPLATE);
159-
});
160145
});

packages/manager/apps/okms/src/modules/secret-manager/pages/create-secret/SecretForm.component.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import {
2828
} from '@secret-manager/validation';
2929
import { SECRET_FORM_TEST_IDS } from '@secret-manager/pages/create-secret/SecretForm.constants';
3030
import { SecretFormBackLink } from './BackLink.component';
31-
import { SECRET_DATA_TEMPLATE } from './SecretForm.constants';
3231
import { PATH_LABEL } from '@/constants';
3332

3433
type SecretFormProps = {
@@ -54,11 +53,6 @@ export const SecretForm = ({ okmsId }: SecretFormProps) => {
5453
const form = useForm({
5554
mode: 'onTouched',
5655
resolver: zodResolver(secretSchema),
57-
defaultValues: {
58-
path: '',
59-
// Prefill data with a template to help the user with the JSON format
60-
data: SECRET_DATA_TEMPLATE,
61-
},
6256
});
6357

6458
const {

packages/manager/apps/okms/src/modules/secret-manager/pages/create-secret/SecretForm.constants.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@ export const SECRET_FORM_TEST_IDS = {
22
INPUT_PATH: 'secret-input-path',
33
SUBMIT_BUTTON: 'secret-submit-button',
44
};
5-
6-
export const SECRET_DATA_TEMPLATE = `{"login": "admin","password": "my_secret_password"}`;

0 commit comments

Comments
 (0)