CM: EditView - Hide stage select while the entity is being created

This commit is contained in:
Gustav Hansen 2023-04-12 14:58:37 +02:00
parent af17acfec5
commit 4ee17ed052
2 changed files with 3 additions and 6 deletions

View File

@ -99,7 +99,7 @@ export function InformationBoxEE() {
<Information.Root>
<Information.Title />
{hasReviewWorkflowsEnabled && (
{hasReviewWorkflowsEnabled && !isCreatingEntry && (
<Field error={formattedError} name={ATTRIBUTE_NAME} id={ATTRIBUTE_NAME}>
<Flex direction="column" gap={2} alignItems="stretch">
<FieldLabel>
@ -116,7 +116,6 @@ export function InformationBoxEE() {
defaultValue={{ value: activeWorkflowStage?.id, label: activeWorkflowStage?.name }}
error={formattedError}
inputId={ATTRIBUTE_NAME}
isDisabled={isCreatingEntry}
isLoading={isLoading}
isSearchable={false}
isClearable={false}

View File

@ -111,7 +111,7 @@ describe('EE | Content Manager | EditView | InformationBox', () => {
expect(queryByRole('combobox')).toBeInTheDocument();
});
it('renders a disabled select input, if the entity is created', () => {
it('does not render the select input, if the entity is created', () => {
useCMEditViewDataManager.mockReturnValue({
initialData: {
[STAGE_ATTRIBUTE_NAME]: STAGE_FIXTURE,
@ -123,8 +123,7 @@ describe('EE | Content Manager | EditView | InformationBox', () => {
const { queryByRole } = setup();
const select = queryByRole('combobox');
expect(select).toBeInTheDocument();
expect(select).toHaveAttribute('disabled');
expect(select).not.toBeInTheDocument();
});
it('renders an enabled select input, if the entity is edited', () => {
@ -140,7 +139,6 @@ describe('EE | Content Manager | EditView | InformationBox', () => {
const select = queryByRole('combobox');
expect(select).toBeInTheDocument();
expect(select).not.toHaveAttribute('disabled');
});
it('renders a select input, if a workflow stage is assigned to the entity', () => {