diff --git a/CHANGELOG.md b/CHANGELOG.md index cb8100c2f..16c992d04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ All notable changes to this project will be documented in this file. The format ### Fixed - Fixed create/edit/delete rights for organization admins. +- Organization, department and product filter in admin panel should no longer + disappear when search result count reaches certain threshold. +- Improved WCAG compliance with respect to text color contrast. +- Fixed a problem that would sometimes cause an "infinite spinner" when a new + version of the app was deployed. ### Changed @@ -14,7 +19,27 @@ All notable changes to this project will be documented in this file. The format current item's about page. - Made links clickable in the description of objects, key results and goals. - It is no longer possible to close open modals or drawers by clicking outside - them. This is meant to prevent accidental data loss in unsaved forms. + them. This is meant to prevent accidental data loss in unsaved forms. Drawers + can however still be closed by outside click after form submission. +- Items in the admin panel now links directly to each respective item about page + with the edit drawer opened. +- The currently active item tab is now kept when navigating between + organizational items. +- Validation in forms are now less "eager" and errors are only displayed after + attempted form submissions. +- Administration of measurements has been moved to drawers and follows the same + pattern as when editing OKRs and other items. +- Detail views for both objectives and key results are now shown as panes in the + OKR timeline view. The number of simultaneously visible panes depends on the + viewport size (and is otherwise stacked). Clicking objectives in the timeline + now toggles the detail pane rather than adding objectives to a list. To group + objectives in a list (and see combined progression), the meta key must now be + pressed while selecting one or more objectives. + +### Removed + +- The admin panel tab has been completely removed from the item tab bar (all + functionality moved to drawers). ## [3.9.0] 2023-09-01 @@ -39,12 +64,6 @@ All notable changes to this project will be documented in this file. The format - Progression values are now required to be positive on entry, both from the web interface and from the API. - The design of the period selector has been refreshed. -- Detail views for both objectives and key results are now shown as panes in the - OKR timeline view. The number of simultaneously visible panes depends on the - viewport size (and is otherwise stacked). Clicking objectives in the timeline - now toggles the detail pane rather than adding objectives to a list. To group - objectives in a list (and see combined progression), the meta key must now be - pressed while selecting one or more objectives. ### Removed diff --git a/firestore.rules b/firestore.rules index 5c4587c20..8d391cf01 100644 --- a/firestore.rules +++ b/firestore.rules @@ -39,14 +39,14 @@ service cloud.firestore { return isSignedIn() && (isAdminOfOrg || isAdminFromOrgOfProdOrDep); } - /** - * Return true if the current user is an admin of the organization that - * `document` belongs to. - * - * The document can belong to an organization either by a transitive link - * (`document` → `parent` → `organization`) or directly - * (`document` → `parent`). - */ + // + // Return true if the current user is an admin of the organization that + // `document` belongs to. + // + // The document can belong to an organization either by a transitive link + // (`document` → `parent` → `organization`) or directly + // (`document` → `parent`). + // function isAdminOfParent(document, type) { let userDoc = getUserDoc(); let userIsAdmin = isAdmin(); @@ -78,9 +78,9 @@ service cloud.firestore { return userIsTeamMember; } - /** - * Return true if the current user is a member of `document.parent`. - */ + // + // Return true if the current user is a member of `document.parent`. + // function isMemberOfParent(document, type) { let userRef = /databases/$(database)/documents/users/$(request.auth.token.email); let doc = getAfter(/databases/$(database)/documents/$(type)/$(document)); @@ -89,6 +89,32 @@ service cloud.firestore { return userIsMemberOfParent; } + // + // Return true if the current user is a member of the parent of the + // document's objective *before* performing the action. + // + function isMemberOfObjectiveParentBefore(document, type) { + let userRef = /databases/$(database)/documents/users/$(request.auth.token.email); + let doc = get(/databases/$(database)/documents/$(type)/$(document)); + let objectiveDoc = get(doc.data.objective); + let parentDoc = get(objectiveDoc.data.parent); + let userIsMemberOfParent = userRef in parentDoc.data.team; + return userIsMemberOfParent; + } + + // + // Return true if the current user is a member of the parent of the + // document's objective *after* performing the action. + // + function isMemberOfObjectiveParentAfter(document, type) { + let userRef = /databases/$(database)/documents/users/$(request.auth.token.email); + let doc = getAfter(/databases/$(database)/documents/$(type)/$(document)); + let objectiveDoc = getAfter(doc.data.objective); + let parentDoc = getAfter(objectiveDoc.data.parent); + let userIsMemberOfParent = userRef in parentDoc.data.team; + return userIsMemberOfParent; + } + function isSelf(document) { let user = document == request.auth.token.email; return user; @@ -158,11 +184,11 @@ service cloud.firestore { allow delete: if isSuperAdmin(); } - /* - * TODO: Needs to be extended with rules for `create` and `delete`. - */ + // TODO: Should also allow create/delete by organization admins. match /objectiveContributors/{document} { allow read: if isSignedIn(); + allow create: if isSuperAdmin() || isMemberOfObjectiveParentAfter(document, 'objectiveContributors'); + allow delete: if isSuperAdmin() || isMemberOfObjectiveParentBefore(document, 'objectiveContributors'); } match /periods/{document} { diff --git a/src/components/ArchivedRestore.vue b/src/components/ArchivedRestore.vue index e462f105d..9fded365e 100644 --- a/src/components/ArchivedRestore.vue +++ b/src/components/ArchivedRestore.vue @@ -1,7 +1,10 @@