feat: add new folder button to move/create dialogs (#2667)

---------

Co-authored-by: Oleg Lobanov <oleg@lobanov.me>
This commit is contained in:
ArthurMousatov
2023-08-26 18:28:58 -04:00
committed by GitHub
parent 374bbd3ec1
commit 5994224468
21 changed files with 199 additions and 129 deletions

View File

@@ -3,30 +3,34 @@ import moment from "moment";
const mutations = {
closeHovers: (state) => {
state.show = null;
state.showConfirm = null;
state.showAction = null;
state.prompts.pop();
},
toggleShell: (state) => {
state.showShell = !state.showShell;
},
showHover: (state, value) => {
if (typeof value !== "object") {
state.show = value;
state.prompts.push({
prompt: value,
confirm: null,
action: null,
props: null,
});
return;
}
state.show = value.prompt;
state.showConfirm = value.confirm;
if (value.action !== undefined) {
state.showAction = value.action;
}
state.prompts.push({
prompt: value.prompt, // Should not be null
confirm: value?.confirm,
action: value?.action,
props: value?.props,
});
},
showError: (state) => {
state.show = "error";
state.prompts.push("error");
},
showSuccess: (state) => {
state.show = "success";
state.prompts.push("success");
},
setLoading: (state, value) => {
state.loading = value;
@@ -74,8 +78,15 @@ const mutations = {
}
},
updateRequest: (state, value) => {
const selectedItems = state.selected.map((i) => state.req.items[i]);
state.oldReq = state.req;
state.req = value;
state.selected = [];
if (!state.req?.items) return;
state.selected = state.req.items
.filter((item) => selectedItems.some((rItem) => rItem.url === item.url))
.map((item) => item.index);
},
updateClipboard: (state, value) => {
state.clipboard.key = value.key;