Skip to content

Commit

Permalink
Merge pull request #6284 from deutschebank/db-contrib/waltz-6278-smal…
Browse files Browse the repository at this point in the history
…l-fixes-entity-kind-note-ratings

Db contrib/waltz 6278 small fixes entity kind note ratings
  • Loading branch information
davidwatkins73 authored Nov 3, 2022
2 parents 30b08af + 8e3c744 commit 84082a1
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";


/**
Expand Down Expand Up @@ -56,7 +57,7 @@ const initialState = {
};


function controller($q, serviceBroker, settingsService) {
function controller($q, serviceBroker, settingsService, userService) {
const vm = initialiseData(this, initialState);

function determineIfRoadmapsAreEnabled() {
Expand Down Expand Up @@ -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;
});
}

Expand Down Expand Up @@ -164,7 +168,8 @@ function controller($q, serviceBroker, settingsService) {
controller.$inject = [
"$q",
"ServiceBroker",
"SettingsService"
"SettingsService",
"UserService"
];


Expand Down
206 changes: 103 additions & 103 deletions waltz-ng/package.json
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit 84082a1

Please sign in to comment.