feat: Added some styling + removed unused parts of prompt code (#2659)

This commit is contained in:
ArthurMousatov 2023-08-23 15:54:24 -04:00
parent 46445a2392
commit 696c9bd2dd
4 changed files with 10 additions and 22 deletions

View File

@ -16,8 +16,7 @@
:aria-label="$t('sidebar.newFolder')" :aria-label="$t('sidebar.newFolder')"
:title="$t('sidebar.newFolder')" :title="$t('sidebar.newFolder')"
> >
<i class="material-icons">create_new_folder</i> <span style="vertical-align: bottom;">{{ $t("sidebar.newFolder") }}</span>
<span>{{ $t("sidebar.newFolder") }}</span>
</button> </button>
</template> </template>
<button <button

View File

@ -74,7 +74,6 @@ export default {
if (this.redirect) { if (this.redirect) {
this.$router.push({ path: uri }); this.$router.push({ path: uri });
}else{ }else{
console.log(uri);
const res = await api.fetch(url.removeLastDir(uri) + "/"); const res = await api.fetch(url.removeLastDir(uri) + "/");
this.$store.commit("updateRequest", res); this.$store.commit("updateRequest", res);
} }

View File

@ -3,41 +3,33 @@ import moment from "moment";
const mutations = { const mutations = {
closeHovers: (state) => { closeHovers: (state) => {
state.show = null;
state.prompts.pop(); state.prompts.pop();
console.log(state.prompts);
state.showConfirm = null;
state.showAction = null;
}, },
toggleShell: (state) => { toggleShell: (state) => {
state.showShell = !state.showShell; state.showShell = !state.showShell;
}, },
showHover: (state, value) => { showHover: (state, value) => {
console.log(value);
if (typeof value !== "object") { if (typeof value !== "object") {
state.show = value;
state.prompts.push({ state.prompts.push({
prompt: value, prompt: value,
confirm: null, confirm: null,
action: null, action: null,
props: {}, props: null,
}); });
return; return;
} }
state.show = value.prompt; state.prompts.push({
state.prompts.push(value); prompt: value.prompt, // Should not be null
state.showConfirm = value.confirm; confirm: value?.confirm,
if (value.action !== undefined) { action: value?.action,
state.showAction = value.action; props: value?.props
} })
}, },
showError: (state) => { showError: (state) => {
state.show = "error";
state.prompts.push("error"); state.prompts.push("error");
}, },
showSuccess: (state) => { showSuccess: (state) => {
state.show = "success";
state.prompts.push("success"); state.prompts.push("success");
}, },
setLoading: (state, value) => { setLoading: (state, value) => {
@ -88,7 +80,6 @@ const mutations = {
updateRequest: (state, value) => { updateRequest: (state, value) => {
state.oldReq = state.req; state.oldReq = state.req;
state.req = value; state.req = value;
console.log(state.req)
}, },
updateClipboard: (state, value) => { updateClipboard: (state, value) => {
state.clipboard.key = value.key; state.clipboard.key = value.key;

View File

@ -301,12 +301,11 @@ export default {
"req", "req",
"selected", "selected",
"user", "user",
"show",
"multiple", "multiple",
"selected", "selected",
"loading", "loading",
]), ]),
...mapGetters(["selectedCount"]), ...mapGetters(["selectedCount", "currentPrompt"]),
nameSorted() { nameSorted() {
return this.req.sorting.by === "name"; return this.req.sorting.by === "name";
}, },
@ -443,7 +442,7 @@ export default {
}, },
keyEvent(event) { keyEvent(event) {
// No prompts are shown // No prompts are shown
if (this.show !== null) { if (this.currentPrompt !== null) {
return; return;
} }