lint: linting (grumble, grumble)

This commit is contained in:
ArthurMousatov 2023-08-23 22:50:48 -04:00
parent d676d5d7f6
commit 97e08ebb15
9 changed files with 41 additions and 45 deletions

View File

@ -55,7 +55,7 @@ export default {
},
computed: {
...mapGetters(["currentPromptName"]),
}
},
};
</script>

View File

@ -22,14 +22,16 @@
>.
</p>
<template v-if="user.perm.create">
<button
class="button button--flat"
@click="createDir()"
:aria-label="$t('sidebar.newFolder')"
:title="$t('sidebar.newFolder')"
>
<span style="vertical-align: bottom;">{{ $t("sidebar.newFolder") }}</span>
</button>
<button
class="button button--flat"
@click="createDir()"
:aria-label="$t('sidebar.newFolder')"
:title="$t('sidebar.newFolder')"
>
<span style="vertical-align: bottom">{{
$t("sidebar.newFolder")
}}</span>
</button>
</template>
</div>
</template>
@ -143,17 +145,17 @@ export default {
this.selected = event.currentTarget.dataset.url;
this.$emit("update:selected", this.selected);
},
createDir: async function (){
this.$store.commit('showHover', {
prompt: 'newDir',
createDir: async function () {
this.$store.commit("showHover", {
prompt: "newDir",
action: null,
confirm: null,
props:{
props: {
redirect: false,
base: this.current === this.$route.path ? null : this.current,
}
})
}
},
});
},
},
};
</script>

View File

@ -98,7 +98,7 @@ export default {
}
action(overwrite, rename);
}
},
},
};
</script>

View File

@ -68,13 +68,10 @@ export default {
// Build the path of the new directory.
let uri;
if (this.base)
uri = this.base;
else if (this.isFiles)
uri = this.$route.path + "/";
else
uri = "/";
if (this.base) uri = this.base;
else if (this.isFiles) uri = this.$route.path + "/";
else uri = "/";
if (!this.isListing) {
uri = url.removeLastDir(uri) + "/";
@ -82,13 +79,11 @@ export default {
uri += encodeURIComponent(this.name) + "/";
uri = uri.replace("//", "/");
try {
await api.post(uri);
if (this.redirect) {
this.$router.push({ path: uri });
}
else if (!this.base){
} else if (!this.base) {
const res = await api.fetch(url.removeLastDir(uri) + "/");
this.$store.commit("updateRequest", res);
}

View File

@ -1,6 +1,12 @@
<template>
<div>
<component v-if="showOverlay" :ref="currentPromptName" :is="currentPromptName" v-bind="currentPrompt.props"></component>
<component
v-if="showOverlay"
:ref="currentPromptName"
:is="currentPromptName"
v-bind="currentPrompt.props"
>
</component>
<div v-show="showOverlay" @click="resetPrompts" class="overlay"></div>
</div>
</template>
@ -87,10 +93,8 @@ export default {
showOverlay: function () {
return (
this.currentPrompt !== null &&
this.currentPrompt.prompt
!== "search" &&
this.currentPrompt.prompt
!== "more"
this.currentPrompt.prompt !== "search" &&
this.currentPrompt.prompt !== "more"
);
},
},

View File

@ -44,11 +44,13 @@ 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;
return state.prompts.length > 0
? state.prompts[state.prompts.length - 1]
: null;
},
currentPromptName: (_, getters) => {
return getters.currentPrompt?.prompt;
}
},
};
export default getters;

View File

@ -23,8 +23,8 @@ const mutations = {
prompt: value.prompt, // Should not be null
confirm: value?.confirm,
action: value?.action,
props: value?.props
})
props: value?.props,
});
},
showError: (state) => {
state.prompts.push("error");

View File

@ -297,14 +297,7 @@ export default {
};
},
computed: {
...mapState([
"req",
"selected",
"user",
"multiple",
"selected",
"loading",
]),
...mapState(["req", "selected", "user", "multiple", "selected", "loading"]),
...mapGetters(["selectedCount", "currentPrompt"]),
nameSorted() {
return this.req.sorting.by === "name";

View File

@ -89,7 +89,7 @@ export default {
return this.$route.path === "/settings/users/new";
},
...mapState(["loading"]),
...mapGetters(["currentPrompt", "currentPromptName"])
...mapGetters(["currentPrompt", "currentPromptName"]),
},
watch: {
$route: "fetchData",