-
Notifications
You must be signed in to change notification settings - Fork 116
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:
|
app/src/pages/inside/testCaseLibraryPage/importTestCaseModal/importTestCaseModal.tsx
Show resolved
Hide resolved
app/src/pages/inside/testCaseLibraryPage/importTestCaseModal/importTestCaseModal.tsx
Outdated
Show resolved
Hide resolved
app/src/pages/inside/testCaseLibraryPage/importTestCaseModal/importTestCaseModal.tsx
Outdated
Show resolved
Hide resolved
app/src/pages/inside/testCaseLibraryPage/importTestCaseModal/importTestCaseModal.tsx
Outdated
Show resolved
Hide resolved
app/src/pages/inside/testCaseLibraryPage/importTestCaseModal/useImportTestCase.ts
Outdated
Show resolved
Hide resolved
| &__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)
This comment was marked as resolved.
This comment was marked as resolved.
517a536 to
c5bf0c5
Compare
…tion-folder-selection
|
| const apiError = error as ApiError; | ||
|
|
||
| const errorCode = apiError?.response?.data?.errorCode; | ||
| if (errorCode === 4001) { |
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.
Is there such error code?
| const isRootTarget = target === 'root'; | ||
|
|
||
| const isExistingTarget = target === 'existing'; | ||
|
|
||
| const hasExistingOptions = !isEmpty(existingOptions); | ||
|
|
||
| const hasFolderIdFromUrl = folderIdFromUrl != null; |
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 isRootTarget = target === 'root'; | |
| const isExistingTarget = target === 'existing'; | |
| const hasExistingOptions = !isEmpty(existingOptions); | |
| const hasFolderIdFromUrl = folderIdFromUrl != null; | |
| const isRootTarget = target === 'root'; | |
| const isExistingTarget = target === 'existing'; | |
| const hasExistingOptions = !isEmpty(existingOptions); | |
| const hasFolderIdFromUrl = folderIdFromUrl != null; |
|
|
||
| const handleRemove = () => setFile(null); | ||
| const handleRemove = (fileId: string) => { | ||
| setAttachedFiles((prev) => prev.filter((f) => f.id !== fileId)); |
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.
| setAttachedFiles((prev) => prev.filter((f) => f.id !== fileId)); | |
| setAttachedFiles((prevFiles) => prevFiles.filter(({ id }) => id !== fileId)); |
| setFile(null); | ||
| }; | ||
|
|
||
| const filesWithError: AttachmentFile[] = attachedFiles.map((item) => ({ |
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 filesWithError: AttachmentFile[] = attachedFiles.map((item) => ({ | |
| const filesWithError: AttachmentFile[] = attachedFiles.map((file) => ({ |
| ); | ||
| } | ||
|
|
||
| if (target === 'existing' && hasExistingOptions) { |
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 (target === 'existing' && hasExistingOptions) { | |
| if (isExistingTarget && hasExistingOptions) { |
| <div className={cx('import-test-case-modal__location-title')}> | ||
| {formatMessage(messages.specifyLocation)} | ||
| </div> | ||
|
|
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.
| > | ||
| {formatMessage(messages.createNewRootFolder)} | ||
| </button> | ||
|
|
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.



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