Skip to content

Commit

Permalink
Merge pull request Ferlab-Ste-Justine#434 from Ferlab-Ste-Justine/fea…
Browse files Browse the repository at this point in the history
…t/SJIP-758

feat(cavatica): SJIP-758 add loading state for copy cavatica files
  • Loading branch information
lflangis authored Apr 17, 2024
2 parents a0ae228 + fa068a9 commit cb13e5d
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 8 deletions.
3 changes: 3 additions & 0 deletions packages/ui/Release.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 9.14.0 2024-04-17
- feat: SJIP-758 Add loading state for copy cavatica file

### 9.13.1 2024-04-17
- fix: FLUI-130 Adjust some values for the landing page components

Expand Down
4 changes: 2 additions & 2 deletions packages/ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ferlab/ui",
"version": "9.13.1",
"version": "9.14.0",
"description": "Core components for scientific research data portals",
"publishConfig": {
"access": "public"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ const CavaticaAnalyse = ({

if (cavatica.bulkImportData.status === CAVATICA_ANALYSE_STATUS.analyzed) {
setModalState(ModalState.analyse);
return;
}
}, [cavatica.bulkImportData.status]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button, Divider, List, Modal, ModalFuncProps, Space, Tag, TreeSelect, T
import { groupBy } from 'lodash';
import { LegacyDataNode } from 'rc-tree-select/lib/TreeSelect';

import { ICavaticaBulkImportData, ICavaticaProjects } from './type';
import { CAVATICA_ANALYSE_STATUS, ICavaticaBulkImportData, ICavaticaProjects } from './type';

import styles from './CavaticaAnalyzeModal.module.scss';

Expand Down Expand Up @@ -115,7 +115,10 @@ const CavaticaAnalyseModal = ({
<Modal
className={styles.cavaticaAnalyseModal}
destroyOnClose
okButtonProps={{ disabled: selectedTreeNode === undefined }}
okButtonProps={{
disabled: selectedTreeNode === undefined,
loading: bulkImportData.status === CAVATICA_ANALYSE_STATUS.pending_copy,
}}
okText={dictionary.copyFiles}
onOk={() => {
if (selectedTreeNode) {
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/src/components/Widgets/Cavatica/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export enum CAVATICA_ANALYSE_STATUS {
unauthorize = 'unauthorize_files',
upload_limit_reached = 'upload_limit_reached',
pending_analyse = 'pending_analyse',
pending_copy = 'pending_copy',
copied = 'copied',
analyzed = 'analyzed',
unknow = 'unknow',
generic_error = 'generic_error',
Expand Down
6 changes: 3 additions & 3 deletions storybook/stories/Components/Cavatica/Cavatica.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default {

export const CavaticaBasicStory = () => (
<>
<h2>Cavatica with loading</h2>
<h2>Cavatica Widget with loading</h2>
<div style={{width: '400px' }}>
<CavaticaWidget
id={'1'}
Expand Down Expand Up @@ -69,7 +69,7 @@ export const CavaticaBasicStory = () => (

export const CavaticaFetchProjectErrorStory = () => (
<>
<h2>Cavatica with with a failed attemp to fetch project</h2>
<h2>Cavatica Widget with with a failed attemp to fetch project</h2>
<div style={{width: '400px' }}>
<CavaticaWidget
id={'1'}
Expand Down Expand Up @@ -118,7 +118,7 @@ export const CavaticaFetchProjectErrorStory = () => (

export const CavaticaAuthErrorStory = () => (
<>
<h2>Cavatica with authentification error</h2>
<h2>Cavatica Widget with authentification error</h2>
<div style={{width: '400px' }}>
<CavaticaWidget
id={'1'}
Expand Down

0 comments on commit cb13e5d

Please sign in to comment.