Skip to content

Commit

Permalink
make label visible for trust boundary box
Browse files Browse the repository at this point in the history
  • Loading branch information
jgadsden authored Feb 10, 2025
2 parents 0062b90 + 4f734dc commit 9fe3655
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 36 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/.trivyignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ CVE-2022-37434
# request version prior to 2.88.2
# this vulnerability is for the build system, not run time, so ignore
CVE-2023-28155

# https://avd.aquasec.com/nvd/cve-2024-9143
# alpine 3.20.3 is pulling in a Low priority vuln for libcrypto3 version 3.3.2-r2,
# ignore for now until alpine is updated
CVE-2024-9143
2 changes: 1 addition & 1 deletion td.vue/src/service/x6/shapes/actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ports } from '../ports.js';

const name = 'actor';

// actor (rectangle, white background)
// actor (rectangle, transparent background)
export const ActorShape = Shape.Rect.define({
constructorName: name,
width: 150,
Expand Down
26 changes: 7 additions & 19 deletions td.vue/src/service/x6/shapes/trust-boundary-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { tc } from '@/i18n/index.js';

const name = 'trust-boundary-box';

// trust boundary box (dotted line, gray opaque background)
// trust boundary box (dotted line, transparent background)
export const TrustBoundaryBox = Shape.Rect.define({
constructorName: name,
width: 500,
Expand All @@ -19,32 +19,20 @@ export const TrustBoundaryBox = Shape.Rect.define({
fill: 'transparent',
fillOpacity: 0
},
headerText: {
label: {
text: tc('threatmodel.shapes.trustBoundary'),
fill: '#333',
strokeWidth: 0
},
header: {
rx: 10,
ry: 10,
strokeWidth: 0,
fillOpacity: 0
textAnchor : 'bottom',
textVerticalAnchor : 'top',
refX: '15%',
refY: '12'
}
}
});

TrustBoundaryBox.prototype.setLabel = function (label) {
this.setAttrByPath('headerText/text', label);
};

TrustBoundaryBox.prototype.getLabel = function () {
return this.getAttrByPath('headerText/text');
};

TrustBoundaryBox.prototype.type = 'tm.BoundaryBox';

TrustBoundaryBox.prototype.setName = function (name) {
this.setAttrByPath('headerText/text', name);
this.setAttrByPath('label/text', name);
};

TrustBoundaryBox.prototype.updateStyle = function () {};
Expand Down
17 changes: 1 addition & 16 deletions td.vue/tests/unit/service/x6/shapes/trust-boundary-box.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,7 @@ describe('service/x6/shapes/trust-boundary-box.js', () => {
it('sets the name', () => {
const name = 'tbbName';
victim.setName(name);
expect(victim.setAttrByPath).toHaveBeenCalledWith('headerText/text', name);
});
});

describe('getLabel', () => {
it('gets the label', () => {
victim.getLabel();
expect(victim.getAttrByPath).toHaveBeenCalledWith('headerText/text');
});
});

describe('setLabel', () => {
it('sets the label', () => {
const name = 'tbbName';
victim.setLabel(name);
expect(victim.setAttrByPath).toHaveBeenCalledWith('headerText/text', name);
expect(victim.setAttrByPath).toHaveBeenCalledWith('label/text', name);
});
});

Expand Down

0 comments on commit 9fe3655

Please sign in to comment.