Skip to content

Commit

Permalink
Merge branch 'main' into task/WP-315--interactive-webhook-message
Browse files Browse the repository at this point in the history
  • Loading branch information
rstijerina authored Oct 9, 2023
2 parents 51c9348 + 982c7d6 commit 799c408
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ const DataFilesProjectMembers = ({
};

DataFilesProjectMembers.propTypes = {
projectId: PropTypes.string,
members: PropTypes.arrayOf(
PropTypes.shape({
username: PropTypes.string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const DataFilesAddButton = ({ readOnly }) => {
payload: { operation: 'upload', props: {} },
});
};
const err = useSelector((state) => state.files.error.FilesListing);
const hasError = useSelector((state) => state.files.error.FilesListing);
const { api, scheme } = useSelector(
(state) => state.files.params.FilesListing
);
Expand Down Expand Up @@ -60,7 +60,7 @@ const DataFilesAddButton = ({ readOnly }) => {

const disabled =
readOnly ||
err !== false ||
hasError !== false ||
api !== 'tapis' ||
(scheme !== 'private' && scheme !== 'projects');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@
.dropdown-menu {
border-color: var(--global-color-accent--normal);
border-radius: 0;
margin-top: 11px;
padding: 0;
margin: 11px 3px 0;
width: 200px;
vertical-align: top;
}
.dropdown-menu::before {
position: absolute;
top: -10px;
left: 65px;
left: 67px;
border-right: 10px solid transparent;
border-bottom: 10px solid var(--global-color-accent--normal);
border-left: 10px solid transparent;
Expand All @@ -42,7 +41,7 @@
.dropdown-menu::after {
position: absolute;
top: -9px;
left: 66px;
left: 68px;
border-right: 9px solid transparent;
border-bottom: 9px solid #ffffff;
border-left: 9px solid transparent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,18 @@ const OPERATION_MAP = {
case 'upload':
case 'move':
case 'copy': {
const destPath = response.path.split('/').slice(0, -1).join('/');
const projectName = findProjectTitle(projectList, response.systemId);
const { path, systemId, source } = response;
const destPath = path.split('/').slice(0, -1).join('/');
const projectName = findProjectTitle(projectList, systemId);

let op = mappedOp;

if (mappedOp === 'copied') {
const srcSystem =
response.source.split('/')[0] === 'https:'
? response.source.split('/')[7]
: response.source.split('/')[2];
const destSystem = response.systemId;
source.split('/')[0] === 'https:'
? source.split('/')[7]
: source.split('/')[2];
const destSystem = systemId;
if (srcSystem !== destSystem) {
op = 'started copying';
}
Expand All @@ -62,7 +63,7 @@ const OPERATION_MAP = {
} else {
dest =
destPath === '/' || destPath === ''
? `${findSystemDisplayName(systemList, response.systemId)}/`
? `${findSystemDisplayName(systemList, systemId)}/`
: destPath;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { DropdownSelector } from '_common';
import styles from './DataFilesSystemSelector.module.scss';

const DataFilesSystemSelector = ({
systemId,
systemAndHomeDirId,
section,
disabled,
operation,
Expand All @@ -17,11 +17,12 @@ const DataFilesSystemSelector = ({
(state) => state.systems.storage.configuration
);
const modalProps = useSelector((state) => state.files.modalProps[operation]);
const findSystem = (id) =>
const findSystem = (systemAndHomeDirPath) =>
systemList.find(
(system) => `${system.system}${system.homeDir || ''}` === id
(system) =>
`${system.system}${system.homeDir || ''}` === systemAndHomeDirPath
);
const [selectedSystem, setSelectedSystem] = useState(systemId);
const [selectedSystem, setSelectedSystem] = useState(systemAndHomeDirId);

const openSystem = useCallback(
(event) => {
Expand Down Expand Up @@ -69,7 +70,7 @@ const DataFilesSystemSelector = ({
};

useEffect(() => {
setSelectedSystem(systemId);
setSelectedSystem(systemAndHomeDirId);
}, []);

const dropdownSystems = systemList.filter(
Expand Down Expand Up @@ -111,7 +112,7 @@ const DataFilesSystemSelector = ({
};

DataFilesSystemSelector.propTypes = {
systemId: PropTypes.string,
systemAndHomeDirId: PropTypes.string,
section: PropTypes.string.isRequired,
disabled: PropTypes.bool,
operation: PropTypes.string.isRequired,
Expand All @@ -120,7 +121,7 @@ DataFilesSystemSelector.propTypes = {
};

DataFilesSystemSelector.defaultProps = {
systemId: '',
systemAndHomeDirId: '',
disabled: false,
showProjects: false,
excludedSystems: [],
Expand Down

0 comments on commit 799c408

Please sign in to comment.