workflow fixes

This commit is contained in:
msramalho
2024-11-13 16:39:04 +01:00
parent 50a257d6e8
commit 7745588d50
4 changed files with 20 additions and 18 deletions

View File

@@ -139,7 +139,7 @@ export default {
const j = await response.json();
if (response.status === 201) {
this.showSnackbar(`Sheet created successfully!`, "green");
// this.$store.dispatch("refreshDocs"); //TODO: implement this
this.$store.dispatch("getSheets");
} else {
throw new Error(JSON.stringify(j));
}

View File

@@ -86,7 +86,6 @@ export default createStore({
commit("setUser", response.user);
dispatch("checkActiveUser");
dispatch("checkUserGroups");
dispatch("getSheets");
}
commit("setUser", null);
@@ -124,7 +123,7 @@ export default createStore({
}
},
async checkActiveUser({ state, commit }) {
async checkActiveUser({ state, dispatch, commit }) {
try {
commit("setErrorMessage", "");
const r = await fetch(
@@ -139,6 +138,9 @@ export default createStore({
);
const response = await r.json();
commit("setUserActiveState", response.active);
if (response.active === true) {
dispatch("getSheets");
}
} catch (error) {
console.error("checkActiveUser (firebase.js): ", error);
commit("setErrorMessage", "Unable to check user status against the API");
@@ -170,7 +172,7 @@ export default createStore({
try {
commit("setLoading", true);
commit("setErrorMessage", "");
if(state.user?.active === false) return;
if (state.user?.active === false) return;
fetch(`${state.API_ENDPOINT}/sheet/mine`, {
method: "GET",
@@ -381,7 +383,6 @@ export default createStore({
//TODO: merge these into single endpoint in the future
store.dispatch("checkActiveUser");
store.dispatch("checkUserGroups");
store.dispatch("getSheets");
}
}).catch((error) => {
console.error("Error checking token expiration:", error);

View File

@@ -5,9 +5,10 @@
<v-card elevation="12">
<v-card-title class="text-center my-3">
Search archives by URL
TODO: toggle between all/and my latest
</v-card-title>
<v-card-text>
<!-- TODO: toggle between all/and my latest, maybe with tabs like sheets -->
<v-form>
<v-row>
<v-col cols="12" md="6">
@@ -190,7 +191,7 @@ export default {
}
})
.catch(error => {
console.error("/url/search ", error);
console.error("/url/search", error);
this.snackbarMessage = `Error searching for archives: ${error}`;
this.snackbar = true;
})

View File

@@ -1,13 +1,12 @@
<template>
<v-container class="pane" fluid v-if="!user || !user.active" >
<v-container class="pane" fluid v-if="!user || !user.active">
<v-row>
<v-col>
<v-alert color="orange" icon="mdi-information" v-if="user && !user.active">
To use this tool you need a Google account and <strong>permission from the Bellingcat team</strong>.<br />
You can do so HERE: TODO.
<v-alert color="orange" icon="mdi-information" v-if="user && !user.active" class="text-center" style="font-size:x-large">
To use this tool you need <strong>permission from Bellingcat's tech team</strong>. You can ask for access via <a href="https://forms.gle/crqBXUtyZcbLhiRQ9" target="_blank">this form</a>.
</v-alert>
<v-card style="margin-bottom: 1em">
<v-card-text>
<v-card>
<v-card-text>
<v-card-title class="text-center">
Welcome to the Auto Archiver Setup Tool
</v-card-title>
@@ -17,12 +16,13 @@
data.
</v-alert>
<p>
This tool can be used to archive digital content via single URL or Google Sheets, you can also search for archived content.
This tool can be used to archive digital content via single URL or Google Sheets, you can also search for
archived content.
</p>
<p v-if="!user || !user.active">
To use this tool you need a Google account and <strong>permission from the Bellingcat team</strong>.
</p>
</v-card-text>
<div class="text-center">
<v-btn v-if="!user" @click="$store.dispatch('signin')" size="large">Sign In</v-btn>
</div>
</v-card-text>
</v-card>
</v-col>
</v-row>