Skip to content
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

Added URL support to object view #1831

Merged
merged 2 commits into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ import { connect } from "react-redux";
import history from "../../../../../../history";
import { decodeFileName, encodeFileName } from "../../../../../../common/utils";
import { setModalErrorSnackMessage } from "../../../../../../actions";
import { BucketObject } from "./types";
import { BucketObjectItem } from "./types";
import { CreateNewPathIcon } from "../../../../../../icons";

interface ICreateFolder {
classes: any;
modalOpen: boolean;
bucketName: string;
folderName: string;
setModalErrorSnackMessage: typeof setModalErrorSnackMessage;
onClose: () => any;
existingFiles: BucketObject[];
existingFiles: BucketObjectItem[];
setModalErrorSnackMessage: typeof setModalErrorSnackMessage;
}

const styles = (theme: Theme) =>
Expand Down Expand Up @@ -74,8 +74,9 @@ const CreateFolderModal = ({
? decodedFolderName
: `${decodedFolderName}/`;
}
const sharesName = (record: BucketObject) =>
const sharesName = (record: BucketObjectItem) =>
record.name === folderPath + pathUrl;

if (existingFiles.findIndex(sharesName) !== -1) {
setModalErrorSnackMessage({
errorMessage: "Folder cannot have the same name as an existing file",
Expand All @@ -84,8 +85,8 @@ const CreateFolderModal = ({
return;
}
const newPath = `/buckets/${bucketName}/browse/${encodeFileName(
`${folderPath}${pathUrl}`
)}/`;
`${folderPath}${pathUrl}/`
)}`;
history.push(newPath);
onClose();
};
Expand Down