From edf060164d8051b410c4d8117787e900357890a9 Mon Sep 17 00:00:00 2001 From: "Anne M. P." Date: Thu, 5 Oct 2023 11:55:57 +0200 Subject: [PATCH 1/5] Add contributors to objective --- firestore.indexes.json | 41 ++++++++ firestore.rules | 1 + src/components/drawers/EditKeyResult.vue | 122 +++++++++++++++++++++-- 3 files changed, 155 insertions(+), 9 deletions(-) diff --git a/firestore.indexes.json b/firestore.indexes.json index ef4f1e42d..31d88087f 100644 --- a/firestore.indexes.json +++ b/firestore.indexes.json @@ -283,6 +283,24 @@ "order": "DESCENDING" } ] + }, + { + "collectionGroup": "objectiveContributors", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "archived", + "order": "ASCENDING" + }, + { + "fieldPath": "item", + "order": "ASCENDING" + }, + { + "fieldPath": "objective", + "order": "ASCENDING" + } + ] } ], "fieldOverrides": [ @@ -469,6 +487,29 @@ "queryScope": "COLLECTION_GROUP" } ] + }, + { + "collectionGroup": "objectiveContributors", + "fieldPath": "auto", + "ttl": false, + "indexes": [ + { + "order": "ASCENDING", + "queryScope": "COLLECTION" + }, + { + "order": "DESCENDING", + "queryScope": "COLLECTION" + }, + { + "arrayConfig": "CONTAINS", + "queryScope": "COLLECTION" + }, + { + "arrayConfig": "CONTAINS", + "queryScope": "COLLECTION_GROUP" + } + ] } ] } diff --git a/firestore.rules b/firestore.rules index 8d391cf01..c8648737a 100644 --- a/firestore.rules +++ b/firestore.rules @@ -188,6 +188,7 @@ service cloud.firestore { match /objectiveContributors/{document} { allow read: if isSignedIn(); allow create: if isSuperAdmin() || isMemberOfObjectiveParentAfter(document, 'objectiveContributors'); + allow update: if isSuperAdmin() || isMemberOfObjectiveParentAfter(document, 'objectiveContributors'); allow delete: if isSuperAdmin() || isMemberOfObjectiveParentBefore(document, 'objectiveContributors'); } diff --git a/src/components/drawers/EditKeyResult.vue b/src/components/drawers/EditKeyResult.vue index d423229c6..e065af318 100644 --- a/src/components/drawers/EditKeyResult.vue +++ b/src/components/drawers/EditKeyResult.vue @@ -35,16 +35,16 @@ :rows="2" :label="$t('fields.description')" /> - - + />