From b5e48ed1d6c397965249df6037b2bffba076f846 Mon Sep 17 00:00:00 2001 From: woodjes Date: Fri, 28 Oct 2022 15:53:40 +0100 Subject: [PATCH 1/2] Fix to markdown context and rating edit button #CTCTOWATLZ-2582 #6269 --- .../section/EntityNamedNotesSection.svelte | 3 +- .../measurable-rating-app-section.js | 15 +- waltz-ng/package.json | 206 +++++++++--------- 3 files changed, 115 insertions(+), 109 deletions(-) diff --git a/waltz-ng/client/entity-named-note/components/section/EntityNamedNotesSection.svelte b/waltz-ng/client/entity-named-note/components/section/EntityNamedNotesSection.svelte index c91089a225..26b70b1f1b 100644 --- a/waltz-ng/client/entity-named-note/components/section/EntityNamedNotesSection.svelte +++ b/waltz-ng/client/entity-named-note/components/section/EntityNamedNotesSection.svelte @@ -218,7 +218,8 @@ {/if} - + {:else} diff --git a/waltz-ng/client/measurable-rating/components/app-section/measurable-rating-app-section.js b/waltz-ng/client/measurable-rating/components/app-section/measurable-rating-app-section.js index f61c0cf130..c6ecbb571c 100644 --- a/waltz-ng/client/measurable-rating/components/app-section/measurable-rating-app-section.js +++ b/waltz-ng/client/measurable-rating/components/app-section/measurable-rating-app-section.js @@ -24,6 +24,7 @@ import {determineStartingTab, loadAllData, mkTabs} from "../../measurable-rating import namedSettings from "../../../system/named-settings"; import {entity} from "../../../common/services/enums/entity"; import {editOperations} from "../../../common/services/enums/operation"; +import roles from "../../../user/system-roles"; /** @@ -56,7 +57,7 @@ const initialState = { }; -function controller($q, serviceBroker, settingsService) { +function controller($q, serviceBroker, settingsService, userService) { const vm = initialiseData(this, initialState); function determineIfRoadmapsAreEnabled() { @@ -94,16 +95,19 @@ function controller($q, serviceBroker, settingsService) { .loadViewData(CORE_API.InvolvementStore.findExistingInvolvementKindIdsForUser, [vm.parentEntityRef]) .then(r => r.data); + const userRolePromise = userService + .whoami() + .then(user => userService.hasRole(user, roles.RATING_EDITOR)); $q - .all([permissionsPromise, involvementsPromise]) - .then(([permissions, involvements]) => { + .all([permissionsPromise, involvementsPromise, userRolePromise]) + .then(([permissions, involvements, hasEditRole]) => { vm.hasEditPermissions = !_ .chain(permissions) .filter(d => d.subjectKind === entity.MEASURABLE_RATING.key && _.includes(editOperations, d.operation) && d.qualifierReference.kind === entity.MEASURABLE_CATEGORY.key) .filter(d => d.requiredInvolvementsResult.areAllUsersAllowed || !_.isEmpty(_.intersection(d.requiredInvolvementsResult.requiredInvolvementKindIds, involvements))) .isEmpty() - .value(); + .value() || hasEditRole; }); } @@ -164,7 +168,8 @@ function controller($q, serviceBroker, settingsService) { controller.$inject = [ "$q", "ServiceBroker", - "SettingsService" + "SettingsService", + "UserService" ]; diff --git a/waltz-ng/package.json b/waltz-ng/package.json index 114a66ae9d..c883ddc64a 100644 --- a/waltz-ng/package.json +++ b/waltz-ng/package.json @@ -1,105 +1,105 @@ { - "name": "waltz-ng", - "version": "0.0.0", - "description": "To start test server run: `npm run dev-server` and ensure java backend is running on 8443", - "main": "client/main.js", - "scripts": { - "build": "webpack --config webpack.prod.js -p --progress --profile --colors", - "build-debug": "webpack --config webpack.dev.js --progress --profile --colors", - "dev-server": "webpack-dev-server --config webpack.dev.js --progress --colors --port 8000 --host 0.0.0.0", - "postinstall": "patch-package", - "test": "mocha --require @babel/register test/**/*.js", - "test-and-build": "npm test && webpack --config webpack.prod.js -p --progress --profile --colors", - "test-server": "BUILD_ENV=test webpack-dev-server --config webpack.config.js --progress --colors --port 8000 --host 0.0.0.0", - "watch": "webpack --progress --watch --colors", - "watch-test": "npm test -- --watch" - }, - "dependencies": { - "@babel/polyfill": "7.12.1", - "@types/d3": "7.1.0", - "@uirouter/angularjs": "1.0.29", - "angular": "1.8.2", - "angular-animate": "1.8.2", - "angular-formly": "8.4.1", - "angular-formly-templates-bootstrap": "6.5.1", - "angular-loading-bar": "0.9.0", - "angular-local-storage": "0.7.1", - "angular-sanitize": "1.8.2", - "angular-tree-control": "0.2.28", - "angular-ui-bootstrap": "1.3.3", - "angular-ui-grid": "4.11.0", - "api-check": "7.5.5", - "bootstrap": "3.4.1", - "bootstrap-sass": "3.4.1", - "core-js": "3.19.0", - "d3": "7.1.1", - "d3-array": "1.2.4", - "d3-axis": "1.0.12", - "d3-collection": "1.0.7", - "d3-color": "1.0.4", - "d3-drag": "1.2.5", - "d3-dsv": "1.0.10", - "d3-ease": "1.0.7", - "d3-force": "1.0.6", - "d3-format": "1.0.2", - "d3-interpolate": "1.1.6", - "d3-path": "1.0.9", - "d3-sankey": "0.12.3", - "d3-scale": "1.0.7", - "d3-selection": "1.0.6", - "d3-selection-multi": "1.0.1", - "d3-shape": "1.0.6", - "d3-time-format": "2.0.5", - "d3-transition": "1.0.4", - "d3-zoom": "1.8.3", - "font-awesome": "4.7.0", - "html2canvas": "^1.4.1", - "json-stable-stringify": "1.0.1", - "lodash": "4.17.21", - "moment": "2.29.1", - "ng-showdown": "1.1.0", - "ng-tags-input": "3.2.0", - "patch-package": "6.4.7", - "satellizer": "0.15.5", - "svelte-flatpickr": "3.2.4", - "tippy.js": "^6.3.7", - "ui-select": "0.19.8", - "whatwg-fetch": "3.6.2", - "xlsx": "0.17.3" - }, - "devDependencies": { - "@babel/core": "7.16.0", - "@babel/preset-env": "7.16.0", - "@babel/register": "7.16.0", - "@playwright/test": "^1.24.2", - "babel-loader": "8.2.3", - "chai": "4.3.4", - "clean-webpack-plugin": "3.0.0", - "css-loader": "4.3.0", - "eslint": "7.32.0", - "file-loader": "6.2.0", - "git-rev-sync": "3.0.1", - "html-loader": "1.3.2", - "html-webpack-plugin": "3.2.0", - "mocha": "8.4.0", - "node-libs-browser": "2.2.1", - "raw-loader": "4.0.2", - "sass": "1.26.11", - "sass-loader": "10.0.2", - "simple-svelte-autocomplete": "2.4.0", - "speed-measure-webpack-plugin": "1.5.0", - "style-loader": "1.3.0", - "svelte": "3.44.1", - "svelte-loader": "3.1.2", - "svelte-preprocess": "4.9.8", - "thread-loader": "3.0.4", - "url-loader": "2.3.0", - "webpack": "4.46.0", - "webpack-cli": "3.3.12", - "webpack-dev-server": "3.11.2", - "webpack-merge": "5.1.4", - "webpack-visualizer-plugin": "0.1.11" - }, - "author": "", - "license": "MIT" + "name": "waltz-ng", + "version": "0.0.0", + "description": "To start test server run: `npm run dev-server` and ensure java backend is running on 8443", + "main": "client/main.js", + "scripts": { + "build": "webpack --config webpack.prod.js -p --progress --profile --colors", + "build-debug": "webpack --config webpack.dev.js --progress --profile --colors", + "dev-server": "webpack-dev-server --config webpack.dev.js --progress --colors --port 8000 --host 0.0.0.0", + "postinstall": "patch-package", + "test": "mocha --require @babel/register test/**/*.js", + "test-and-build": "npm test && webpack --config webpack.prod.js -p --progress --profile --colors", + "test-server": "BUILD_ENV=test webpack-dev-server --config webpack.config.js --progress --colors --port 8000 --host 0.0.0.0", + "watch": "webpack --progress --watch --colors", + "watch-test": "npm test -- --watch" + }, + "dependencies": { + "@babel/polyfill": "7.12.1", + "@types/d3": "7.1.0", + "@uirouter/angularjs": "1.0.29", + "angular": "1.8.2", + "angular-animate": "1.8.2", + "angular-formly": "8.4.1", + "angular-formly-templates-bootstrap": "6.5.1", + "angular-loading-bar": "0.9.0", + "angular-local-storage": "0.7.1", + "angular-sanitize": "1.8.2", + "angular-tree-control": "0.2.28", + "angular-ui-bootstrap": "1.3.3", + "angular-ui-grid": "4.11.0", + "api-check": "7.5.5", + "bootstrap": "3.4.1", + "bootstrap-sass": "3.4.1", + "core-js": "3.19.0", + "d3": "7.1.1", + "d3-array": "1.2.4", + "d3-axis": "1.0.12", + "d3-collection": "1.0.7", + "d3-color": "1.0.4", + "d3-drag": "1.2.5", + "d3-dsv": "1.0.10", + "d3-ease": "1.0.7", + "d3-force": "1.0.6", + "d3-format": "1.0.2", + "d3-interpolate": "1.1.6", + "d3-path": "1.0.9", + "d3-sankey": "0.12.3", + "d3-scale": "1.0.7", + "d3-selection": "1.0.6", + "d3-selection-multi": "1.0.1", + "d3-shape": "1.0.6", + "d3-time-format": "2.0.5", + "d3-transition": "1.0.4", + "d3-zoom": "1.8.3", + "font-awesome": "4.7.0", + "html2canvas": "^1.4.1", + "json-stable-stringify": "1.0.1", + "lodash": "4.17.21", + "moment": "2.29.1", + "ng-showdown": "1.1.0", + "ng-tags-input": "3.2.0", + "patch-package": "6.4.7", + "satellizer": "0.15.5", + "svelte-flatpickr": "3.2.4", + "tippy.js": "^6.3.7", + "ui-select": "0.19.8", + "whatwg-fetch": "3.6.2", + "xlsx": "0.17.3" + }, + "devDependencies": { + "@babel/core": "7.16.0", + "@babel/preset-env": "7.16.0", + "@babel/register": "7.16.0", + "@playwright/test": "^1.24.2", + "babel-loader": "8.2.3", + "chai": "4.3.4", + "clean-webpack-plugin": "3.0.0", + "css-loader": "4.3.0", + "eslint": "7.32.0", + "file-loader": "6.2.0", + "git-rev-sync": "3.0.1", + "html-loader": "1.3.2", + "html-webpack-plugin": "3.2.0", + "mocha": "8.4.0", + "node-libs-browser": "2.2.1", + "raw-loader": "4.0.2", + "sass": "1.26.11", + "sass-loader": "10.0.2", + "simple-svelte-autocomplete": "2.4.0", + "speed-measure-webpack-plugin": "1.5.0", + "style-loader": "1.3.0", + "svelte": "3.44.1", + "svelte-loader": "3.1.2", + "svelte-preprocess": "4.9.8", + "thread-loader": "3.0.4", + "url-loader": "2.3.0", + "webpack": "4.46.0", + "webpack-cli": "3.3.12", + "webpack-dev-server": "3.11.2", + "webpack-merge": "5.1.4", + "webpack-visualizer-plugin": "0.1.11" + }, + "author": "", + "license": "MIT" } From aa50159ab1bc3abdfcaa837f2420fd4fef6faf64 Mon Sep 17 00:00:00 2001 From: woodjes Date: Fri, 28 Oct 2022 15:57:08 +0100 Subject: [PATCH 2/2] Fix to source data ratings #CTCTOWATLZ-2582 #6269 --- waltz-model/src/main/java/org/finos/waltz/model/EntityKind.java | 1 + 1 file changed, 1 insertion(+) diff --git a/waltz-model/src/main/java/org/finos/waltz/model/EntityKind.java b/waltz-model/src/main/java/org/finos/waltz/model/EntityKind.java index 0c74a9625c..e1b41717e2 100644 --- a/waltz-model/src/main/java/org/finos/waltz/model/EntityKind.java +++ b/waltz-model/src/main/java/org/finos/waltz/model/EntityKind.java @@ -94,6 +94,7 @@ public enum EntityKind { SURVEY_TEMPLATE("Survey template"), SYSTEM("System"), TAG("Tag"), + USER_ROLE("User Role"), @Deprecated CAPABILITY("Capability"), // TO BE REMOVED IN 1.5