mirror of
https://github.com/strapi/strapi.git
synced 2025-11-26 23:22:01 +00:00
CM: EditView - Hide stage select while the entity is being created
This commit is contained in:
parent
af17acfec5
commit
4ee17ed052
@ -99,7 +99,7 @@ export function InformationBoxEE() {
|
|||||||
<Information.Root>
|
<Information.Root>
|
||||||
<Information.Title />
|
<Information.Title />
|
||||||
|
|
||||||
{hasReviewWorkflowsEnabled && (
|
{hasReviewWorkflowsEnabled && !isCreatingEntry && (
|
||||||
<Field error={formattedError} name={ATTRIBUTE_NAME} id={ATTRIBUTE_NAME}>
|
<Field error={formattedError} name={ATTRIBUTE_NAME} id={ATTRIBUTE_NAME}>
|
||||||
<Flex direction="column" gap={2} alignItems="stretch">
|
<Flex direction="column" gap={2} alignItems="stretch">
|
||||||
<FieldLabel>
|
<FieldLabel>
|
||||||
@ -116,7 +116,6 @@ export function InformationBoxEE() {
|
|||||||
defaultValue={{ value: activeWorkflowStage?.id, label: activeWorkflowStage?.name }}
|
defaultValue={{ value: activeWorkflowStage?.id, label: activeWorkflowStage?.name }}
|
||||||
error={formattedError}
|
error={formattedError}
|
||||||
inputId={ATTRIBUTE_NAME}
|
inputId={ATTRIBUTE_NAME}
|
||||||
isDisabled={isCreatingEntry}
|
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
isSearchable={false}
|
isSearchable={false}
|
||||||
isClearable={false}
|
isClearable={false}
|
||||||
|
|||||||
@ -111,7 +111,7 @@ describe('EE | Content Manager | EditView | InformationBox', () => {
|
|||||||
expect(queryByRole('combobox')).toBeInTheDocument();
|
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({
|
useCMEditViewDataManager.mockReturnValue({
|
||||||
initialData: {
|
initialData: {
|
||||||
[STAGE_ATTRIBUTE_NAME]: STAGE_FIXTURE,
|
[STAGE_ATTRIBUTE_NAME]: STAGE_FIXTURE,
|
||||||
@ -123,8 +123,7 @@ describe('EE | Content Manager | EditView | InformationBox', () => {
|
|||||||
const { queryByRole } = setup();
|
const { queryByRole } = setup();
|
||||||
const select = queryByRole('combobox');
|
const select = queryByRole('combobox');
|
||||||
|
|
||||||
expect(select).toBeInTheDocument();
|
expect(select).not.toBeInTheDocument();
|
||||||
expect(select).toHaveAttribute('disabled');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('renders an enabled select input, if the entity is edited', () => {
|
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');
|
const select = queryByRole('combobox');
|
||||||
|
|
||||||
expect(select).toBeInTheDocument();
|
expect(select).toBeInTheDocument();
|
||||||
expect(select).not.toHaveAttribute('disabled');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('renders a select input, if a workflow stage is assigned to the entity', () => {
|
it('renders a select input, if a workflow stage is assigned to the entity', () => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user