diff --git a/packages/editor-ui/src/components/SourceControlPushModal.ee.test.ts b/packages/editor-ui/src/components/SourceControlPushModal.ee.test.ts index e9ce1f21753f3..c7691340fd2a7 100644 --- a/packages/editor-ui/src/components/SourceControlPushModal.ee.test.ts +++ b/packages/editor-ui/src/components/SourceControlPushModal.ee.test.ts @@ -82,7 +82,7 @@ describe('SourceControlPushModal', () => { vi.spyOn(route, 'fullPath', 'get').mockReturnValue('/home/workflows'); - const { getAllByTestId } = renderModal({ + const { getByTestId, getAllByTestId } = renderModal({ pinia: createTestingPinia(), props: { data: { @@ -92,7 +92,7 @@ describe('SourceControlPushModal', () => { }, }); - const files = getAllByTestId('source-control-push-modal-file'); + const files = getAllByTestId('source-control-push-modal-file-checkbox'); expect(files).toHaveLength(2); await userEvent.click(files[0]); @@ -101,11 +101,50 @@ describe('SourceControlPushModal', () => { await userEvent.click(within(files[0]).getByRole('checkbox')); expect(within(files[0]).getByRole('checkbox')).not.toBeChecked(); + expect(within(files[1]).getByRole('checkbox')).not.toBeChecked(); await userEvent.click(within(files[1]).getByRole('checkbox')); + expect(within(files[0]).getByRole('checkbox')).not.toBeChecked(); expect(within(files[1]).getByRole('checkbox')).toBeChecked(); await userEvent.click(files[1]); + expect(within(files[0]).getByRole('checkbox')).not.toBeChecked(); + expect(within(files[1]).getByRole('checkbox')).not.toBeChecked(); + + await userEvent.click(within(files[0]).getByText('My workflow 2')); + expect(within(files[0]).getByRole('checkbox')).toBeChecked(); + expect(within(files[1]).getByRole('checkbox')).not.toBeChecked(); + + await userEvent.click(within(files[1]).getByText('My workflow 1')); + expect(within(files[0]).getByRole('checkbox')).toBeChecked(); + expect(within(files[1]).getByRole('checkbox')).toBeChecked(); + + await userEvent.click(within(files[1]).getByText('My workflow 1')); + expect(within(files[0]).getByRole('checkbox')).toBeChecked(); + expect(within(files[1]).getByRole('checkbox')).not.toBeChecked(); + + await userEvent.click(getByTestId('source-control-push-modal-toggle-all')); + expect(within(files[0]).getByRole('checkbox')).toBeChecked(); + expect(within(files[1]).getByRole('checkbox')).toBeChecked(); + + await userEvent.click(within(files[0]).getByText('My workflow 2')); + await userEvent.click(within(files[1]).getByText('My workflow 1')); + expect(within(files[0]).getByRole('checkbox')).not.toBeChecked(); + expect(within(files[1]).getByRole('checkbox')).not.toBeChecked(); + expect( + within(getByTestId('source-control-push-modal-toggle-all')).getByRole('checkbox'), + ).not.toBeChecked(); + + await userEvent.click(within(files[0]).getByText('My workflow 2')); + await userEvent.click(within(files[1]).getByText('My workflow 1')); + expect(within(files[0]).getByRole('checkbox')).toBeChecked(); + expect(within(files[1]).getByRole('checkbox')).toBeChecked(); + expect( + within(getByTestId('source-control-push-modal-toggle-all')).getByRole('checkbox'), + ).toBeChecked(); + + await userEvent.click(getByTestId('source-control-push-modal-toggle-all')); + expect(within(files[0]).getByRole('checkbox')).not.toBeChecked(); expect(within(files[1]).getByRole('checkbox')).not.toBeChecked(); }); }); diff --git a/packages/editor-ui/src/components/SourceControlPushModal.ee.vue b/packages/editor-ui/src/components/SourceControlPushModal.ee.vue index f0d262ba5554f..0a0d99389a330 100644 --- a/packages/editor-ui/src/components/SourceControlPushModal.ee.vue +++ b/packages/editor-ui/src/components/SourceControlPushModal.ee.vue @@ -262,63 +262,66 @@ function getStatusText(file: SourceControlAggregatedFile): string {
- + {{ i18n.baseText('settings.sourceControl.modals.push.description') }} {{ i18n.baseText('settings.sourceControl.modals.push.description.learnMore') }} -
- - - {{ i18n.baseText('settings.sourceControl.modals.push.workflowsToCommit') }} - - - ({{ stagedWorkflowFiles.length }}/{{ workflowFiles.length }}) - - -
- + +
@@ -398,16 +401,16 @@ function getStatusText(file: SourceControlAggregatedFile): string { &:last-child { margin-bottom: 0; } -} -.listItemCheckbox { - display: inline-flex !important; - margin-bottom: 0 !important; - margin-right: var(--spacing-2xs) !important; + &.hiddenListItem { + display: none !important; + } } -.listItemStatus { - margin-left: auto; +.selectAll { + float: left; + clear: both; + margin: 0 0 var(--spacing-2xs); } .footer { @@ -416,3 +419,12 @@ function getStatusText(file: SourceControlAggregatedFile): string { justify-content: flex-end; } + +