-
Notifications
You must be signed in to change notification settings - Fork 115
destination folder section #4747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/test-library
Are you sure you want to change the base?
destination folder section #4747
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature/test-library #4747 +/- ##
=====================================================
Coverage 72.59% 72.59%
=====================================================
Files 79 79
Lines 905 905
Branches 124 124
=====================================================
Hits 657 657
Misses 224 224
Partials 24 24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| import { Folder, foldersSelector } from 'controllers/testCase'; | ||
| import { useImportTestCase } from './useImportTestCase'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| import { Folder, foldersSelector } from 'controllers/testCase'; | |
| import { useImportTestCase } from './useImportTestCase'; | |
| import { Folder, foldersSelector } from 'controllers/testCase'; | |
| import { useImportTestCase } from './useImportTestCase'; |
| dispatch(hideModalAction()); | ||
| }; | ||
|
|
||
| const setTargetAndForm = (next: 'root' | 'existing') => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's create type for 'root' | 'existing' union and use here and in useState above
| useEffect(() => { | ||
| change('importTarget', target); | ||
|
|
||
| if (folderIdFromUrl && existingOptions.some((o) => Number(o.value) === folderIdFromUrl)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (folderIdFromUrl && existingOptions.some((o) => Number(o.value) === folderIdFromUrl)) { | |
| if (folderIdFromUrl && existingOptions.some((option) => Number(option.value) === folderIdFromUrl)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (folderIdFromUrl && existingOptions.some((o) => Number(o.value) === folderIdFromUrl)) { | |
| if (folderIdFromUrl && existingOptions.some(({ value }) => Number(value) === folderIdFromUrl)) { |
|
|
||
| const isWithinSize = (file: File) => file.size <= MAX_FILE_SIZE_BYTES; | ||
|
|
||
| const hasExistingOptions = existingOptions.length > 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const hasExistingOptions = existingOptions.length > 0; | |
| const hasExistingOptions = !isEmpty(existingOptions); |
| } from 'controllers/testCase/actionCreators'; | ||
| import { getTestCaseRequestParams } from 'pages/inside/testCaseLibraryPage/utils'; | ||
| import { testCasesPageSelector } from 'controllers/testCase'; | ||
| import { useCallback } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Order of imports
| &__segmented { | ||
| display: flex; | ||
| gap: 4px; | ||
| background: $COLOR--bg-200; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| background: $COLOR--bg-200; | |
| background: var(--rp-ui-base-bg-200); |
| }: InjectedFormProps<ImportTestCaseFormValues, ImportModalData> & ImportModalData) => { | ||
| const { formatMessage } = useIntl(); | ||
| const [file, setFile] = useState<File | null>(null); | ||
| const [folderIdFromUrl] = useState<number | undefined>(() => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do not we have set action here?
| if (importTarget === 'existing') { | ||
| const resolvedId = existingFolderId ?? folderIdFromUrl; | ||
|
|
||
| if (!file || resolvedId == null) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add an empty line after if here and below.
| className={cx( | ||
| 'import-test-case-modal__segmented-btn', | ||
| target === 'root' && 'is-active', | ||
| )} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| className={cx( | |
| 'import-test-case-modal__segmented-btn', | |
| target === 'root' && 'is-active', | |
| )} | |
| className={cx('import-test-case-modal__segmented-btn', { | |
| 'is-active': target === 'root' | |
| })} |
Also you can create const isRootTarget and reuse it here and for target === 'existing' as !isRootTarget.
| folderName: commonValidators.requiredField(folderName), | ||
| }), | ||
| initialValues: { folderName: DEFAULT_FOLDER_NAME, importTarget: undefined }, | ||
| validate: (values): FormErrors<ImportTestCaseFormValues> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| validate: (values): FormErrors<ImportTestCaseFormValues> => { | |
| validate: ({ importTarget, folderName }): FormErrors<ImportTestCaseFormValues> => { |
| defaultMessage: 'File size should be up to {size} MB', | ||
| }, | ||
| specifyLocation: { | ||
| id: 'import.specifyLocation', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| id: 'import.specifyLocation', | |
| id: 'ImportTestCaseModal.specifyLocation', |
And below. Could you please use the full path in the id as a key (not just createRoot but createNewRootFolder)
|
Please add visuals |
517a536 to
c5bf0c5
Compare
…tion-folder-selection
|



PR Checklist
developfor features/bugfixes, other if mentioned in the task)npm run lint) prior to submission? Enable the git hook on commit in your IDE to run it and format the code automatically.npm run build)?devnpm script)manage:translationsscript?Visuals