cmmn-js-properties-panel-flowable 2.0.0-next.1 → 2.0.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -493,6 +493,20 @@ ul.cpp-properties-tabs-links > li.cpp-active a {
|
|
|
493
493
|
.cpp-properties-tab.cpp-active {
|
|
494
494
|
display: block;
|
|
495
495
|
}
|
|
496
|
+
.cpp-problems {
|
|
497
|
+
margin: 0;
|
|
498
|
+
padding-left: 16px;
|
|
499
|
+
font-size: 12px;
|
|
500
|
+
}
|
|
501
|
+
.cpp-problems .cpp-problem {
|
|
502
|
+
margin: 2px 0 6px;
|
|
503
|
+
}
|
|
504
|
+
.cpp-problems .cpp-problem-error {
|
|
505
|
+
color: #cc3b3b;
|
|
506
|
+
}
|
|
507
|
+
.cpp-problems .cpp-problem-info {
|
|
508
|
+
color: #666;
|
|
509
|
+
}
|
|
496
510
|
.cpp-extensions {
|
|
497
511
|
font-size: 12px;
|
|
498
512
|
overflow-x: auto;
|
|
@@ -53,6 +53,9 @@ var historyTimeToLive = require('./parts/HistoryTimeToLiveProps');
|
|
|
53
53
|
// extensions
|
|
54
54
|
var extensionsProps = require('./parts/ExtensionsProps');
|
|
55
55
|
|
|
56
|
+
// problems of the model
|
|
57
|
+
var problemsProps = require('./parts/ProblemsProps');
|
|
58
|
+
|
|
56
59
|
|
|
57
60
|
var getListenerLabel = function(listener, translate) {
|
|
58
61
|
|
|
@@ -80,7 +83,9 @@ var getListenerLabel = function(listener, translate) {
|
|
|
80
83
|
};
|
|
81
84
|
|
|
82
85
|
|
|
83
|
-
function createGeneralTabGroups(element, cmmnFactory, elementRegistry, itemRegistry, cmmnRules, translate) {
|
|
86
|
+
function createGeneralTabGroups(element, cmmnFactory, elementRegistry, itemRegistry, cmmnRules, translate, problems) {
|
|
87
|
+
|
|
88
|
+
var problemsGroup = problemsProps(element, problems, translate);
|
|
84
89
|
|
|
85
90
|
var generalGroup = {
|
|
86
91
|
id: 'general',
|
|
@@ -144,6 +149,7 @@ function createGeneralTabGroups(element, cmmnFactory, elementRegistry, itemRegis
|
|
|
144
149
|
historyTimeToLive(historyTimeToLiveGroup, element, cmmnFactory, elementRegistry, itemRegistry, translate);
|
|
145
150
|
|
|
146
151
|
return [
|
|
152
|
+
problemsGroup,
|
|
147
153
|
generalGroup,
|
|
148
154
|
detailsGroup,
|
|
149
155
|
implementationGroup,
|
|
@@ -418,7 +424,10 @@ function createDefinitionTabGroups(element, cmmnFactory, elementRegistry, itemRe
|
|
|
418
424
|
* @param {CmmnFactory} cmmnFactory
|
|
419
425
|
* @param {ElementRegistry} elementRegistry
|
|
420
426
|
*/
|
|
421
|
-
function FlowablePropertiesProvider(eventBus, cmmnFactory, elementRegistry, itemRegistry, cmmnRules, translate) {
|
|
427
|
+
function FlowablePropertiesProvider(eventBus, cmmnFactory, elementRegistry, itemRegistry, cmmnRules, translate, injector) {
|
|
428
|
+
|
|
429
|
+
// the problems of the opened model, when the editor has them
|
|
430
|
+
var problems = injector && injector.get('problems', false);
|
|
422
431
|
|
|
423
432
|
PropertiesActivator.call(this, eventBus);
|
|
424
433
|
|
|
@@ -427,7 +436,7 @@ function FlowablePropertiesProvider(eventBus, cmmnFactory, elementRegistry, item
|
|
|
427
436
|
var generalTab = {
|
|
428
437
|
id: 'general',
|
|
429
438
|
label: translate('General'),
|
|
430
|
-
groups: createGeneralTabGroups(element, cmmnFactory, elementRegistry, itemRegistry, cmmnRules, translate)
|
|
439
|
+
groups: createGeneralTabGroups(element, cmmnFactory, elementRegistry, itemRegistry, cmmnRules, translate, problems)
|
|
431
440
|
};
|
|
432
441
|
|
|
433
442
|
var rulesTab = {
|
|
@@ -503,7 +512,8 @@ FlowablePropertiesProvider.$inject = [
|
|
|
503
512
|
'elementRegistry',
|
|
504
513
|
'itemRegistry',
|
|
505
514
|
'cmmnRules',
|
|
506
|
-
'translate'
|
|
515
|
+
'translate',
|
|
516
|
+
'injector'
|
|
507
517
|
];
|
|
508
518
|
|
|
509
519
|
inherits(FlowablePropertiesProvider, PropertiesActivator);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var escapeHTML = require('../../../Utils').escapeHTML;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A group with the problems of the selected element, from the `problems`
|
|
8
|
+
* service of cmmn-js: what is lost on save or not shown first, then what
|
|
9
|
+
* is kept but not recognised. Hidden when the element has none, or when
|
|
10
|
+
* the editor has no `problems` service.
|
|
11
|
+
*
|
|
12
|
+
* @param {djs.model.Base} element
|
|
13
|
+
* @param {Problems} [problems]
|
|
14
|
+
* @param {Function} translate
|
|
15
|
+
*
|
|
16
|
+
* @return {Object} group
|
|
17
|
+
*/
|
|
18
|
+
module.exports = function(element, problems, translate) {
|
|
19
|
+
|
|
20
|
+
function getProblems(element) {
|
|
21
|
+
return problems ? problems.getProblems(element) : [];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
id: 'problems',
|
|
26
|
+
label: translate('Problems'),
|
|
27
|
+
enabled: function(element) {
|
|
28
|
+
return getProblems(element).length > 0;
|
|
29
|
+
},
|
|
30
|
+
entries: [
|
|
31
|
+
{
|
|
32
|
+
id: 'problems',
|
|
33
|
+
html: '<ul class="cpp-problems"></ul>',
|
|
34
|
+
get: function(element, node) {
|
|
35
|
+
var target = node && node.querySelector('.cpp-problems');
|
|
36
|
+
|
|
37
|
+
if (target) {
|
|
38
|
+
target.innerHTML = getProblems(element).map(function(problem) {
|
|
39
|
+
return '<li class="cpp-problem cpp-problem-' + escapeHTML(problem.severity) + '">' +
|
|
40
|
+
escapeHTML(problem.message) +
|
|
41
|
+
'</li>';
|
|
42
|
+
}).join('');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return {};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
};
|
|
50
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cmmn-js-properties-panel-flowable",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.2",
|
|
4
4
|
"description": "A simple properties panel for cmmn-js with flowable namespaces",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "eslint .",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@jylups/cmmn-js": "^0.22.0-next.
|
|
31
|
+
"@jylups/cmmn-js": "^0.22.0-next.8",
|
|
32
32
|
"chai": "^4.1.2",
|
|
33
33
|
"diagram-js": "^15.29.0",
|
|
34
34
|
"eslint": "^5.2.0",
|
package/styles/properties.less
CHANGED
|
@@ -327,6 +327,25 @@ label.cpp-hidden {
|
|
|
327
327
|
@import "./groups";
|
|
328
328
|
@import "./tabs";
|
|
329
329
|
|
|
330
|
+
// problems of the selected element
|
|
331
|
+
.cpp-problems {
|
|
332
|
+
margin: 0;
|
|
333
|
+
padding-left: 16px;
|
|
334
|
+
font-size: 12px;
|
|
335
|
+
|
|
336
|
+
.cpp-problem {
|
|
337
|
+
margin: 2px 0 6px;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.cpp-problem-error {
|
|
341
|
+
color: #cc3b3b;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.cpp-problem-info {
|
|
345
|
+
color: #666;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
330
349
|
// read-only view of extension attributes and elements
|
|
331
350
|
.cpp-extensions {
|
|
332
351
|
font-size: 12px;
|