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

---------

Co-authored-by: Oleg Lobanov <oleg@lobanov.me>
This commit is contained in:
ArthurMousatovandOleg Lobanov authored and GitHub committed 2023-08-27 00:28:58 +02:00
1 parent 374bbd3ec1
commit 5994224468
21 files changed
+199 -129

No files matched your search

+8
View File
@@ -43,6 +43,14 @@ const getters = {
return files.sort((a, b) => a.progress - b.progress);
},
currentPrompt: (state) => {
return state.prompts.length > 0
? state.prompts[state.prompts.length - 1]
: null;
},
currentPromptName: (_, getters) => {
return getters.currentPrompt?.prompt;
},
};
export default getters;
+1 -3
View File
@@ -20,10 +20,8 @@ const state = {
reload: false,
selected: [],
multiple: false,
show: null,
prompts: [],
showShell: false,
showConfirm: null,
showAction: null,
};
export default new Vuex.Store({
+22 -11
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;