mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 02:44:55 +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.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}
|
||||
|
||||
@ -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', () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user