lint: linting (grumble, grumble)
This commit is contained in:
parent
d676d5d7f6
commit
97e08ebb15
@ -55,7 +55,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(["currentPromptName"]),
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -98,7 +98,7 @@ export default {
|
||||
}
|
||||
|
||||
action(overwrite, rename);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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"
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -89,7 +89,7 @@ export default {
|
||||
return this.$route.path === "/settings/users/new";
|
||||
},
|
||||
...mapState(["loading"]),
|
||||
...mapGetters(["currentPrompt", "currentPromptName"])
|
||||
...mapGetters(["currentPrompt", "currentPromptName"]),
|
||||
},
|
||||
watch: {
|
||||
$route: "fetchData",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user