dynamic service_account from the api group

This commit is contained in:
msramalho
2025-02-11 22:44:50 +00:00
parent cce25b1ba6
commit e45c4726a9
3 changed files with 17 additions and 17 deletions

View File

@@ -32,9 +32,8 @@
</v-col>
<v-col cols="12" sm="12" class="pt-0" v-if="group != 'please select'">
<span>
<code>{{ group }}</code><br/>
<span class="text-medium-emphasis mb-1">
{{ groupPermissions.description }}
<strong>{{ group }}</strong>: {{ groupPermissions.description }}
</span>
<ul>
<li>
@@ -52,8 +51,12 @@
displayPermissionValue(groupPermissions?.max_archive_lifespan_months, " months") }}</strong>
</li>
<li>You <strong>{{ groupPermissions?.manually_trigger_sheet ? "can" : "cannot" }}</strong> manually
trigger sheeets in this group. </li>
trigger sheets in this group. </li>
</ul>
<p v-if="!actionIsCreate" class="text-medium-emphasis mt-2">
<strong>NOTE:</strong> invite <a :href="`mailto:${groupPermissions?.service_account_email}`">{{
groupPermissions?.service_account_email }}</a> to the sheet, see further instructions below.
</p>
</span>
</v-col>
@@ -149,7 +152,7 @@ export default {
this.loading = true;
this.newSheetId = "";
this.$store.dispatch("createSheet", this.sheetName).then((res) => {
this.$store.dispatch("createSheet", { name: this.sheetName, service_account_email: this.groupPermissions.service_account_email }).then((res) => {
this.$store.dispatch("checkUserUsage");
if (!res.success) throw new Error(res.result);
this.newSheetId = res.result;

View File

@@ -15,11 +15,11 @@
<v-expansion-panel-title>Instructions</v-expansion-panel-title>
<v-expansion-panel-text>
<ol>
<li>Choose a sheet name;</li>
<li>Choose a group: this will impact where/how to archive;</li>
<li>Choose a frequency: how often to archive;</li>
<li>Press "create" and wait;</li>
<li>Sheet will appear in "Your Sheets" below.</li>
<li>Choose a sheet name</li>
<li>Choose a group: this will impact where/how to archive</li>
<li>Choose a frequency: how often to archive</li>
<li>Press "create" and wait</li>
<li>Sheet will appear in "Your Sheets" below</li>
</ol>
<small>
<b>NB:</b> This new sheet will be shared with the
@@ -39,15 +39,12 @@
<v-expansion-panel-title>Instructions</v-expansion-panel-title>
<v-expansion-panel-text>
<ol style="margin-bottom: 1em">
<li>
Invite
<code>bellingcat-auto-archiver-api@bellingcat-auto-archiver-b85db.iam.gserviceaccount.com</code>
into your spreadsheet
</li>
<li>Choose a group to associate with this Google Sheet</li>
<li>Invite the provided email as Editor to your Google Sheet</li>
<li>
Make sure you have the following <b>mandatory</b> column names:
<ul>
<li><code>Link</code> where you will put the URLs.</li>
<li><code>Link</code> where you will put the URLs</li>
<li>
<code>Archive Status</code> to monitor progress and success
of archiver

View File

@@ -225,7 +225,7 @@ export default createStore({
}
},
async createSheet({ state, dispatch, commit }, name) {
async createSheet({ state, dispatch, commit }, {name, service_account_email}) {
return new Promise(async (resolve, reject) => {
try {
// create new sheet
@@ -355,7 +355,7 @@ export default createStore({
role: "writer",
type: "user",
emailAddress:
"bellingcat-auto-archiver-api@bellingcat-auto-archiver-b85db.iam.gserviceaccount.com",
service_account_email,
},
});