Skip to content

Commit 2d6d01f

Browse files
feat(core): replace input output decorators with signal-based inputs and add trivy workflow
replace input output decorators with signal-based inputs and add trivy workflow BREAKING CHANGE: Yes GH-97
1 parent d4358da commit 2d6d01f

14 files changed

Lines changed: 292 additions & 204 deletions

.github/workflows/trivy.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Trivy Scan
4+
5+
# Controls when the action will run. Triggers the workflow on push or pull request
6+
# events but only for the master branch
7+
on:
8+
pull_request:
9+
branches: [master]
10+
types: [opened, synchronize, reopened]
11+
12+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
13+
jobs:
14+
# This workflow contains a single job called "trivy"
15+
trivy:
16+
# The type of runner that the job will run on
17+
runs-on: [self-hosted, linux, codebuild]
18+
19+
# Steps represent a sequence of tasks that will be executed as part of the job
20+
steps:
21+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
22+
- uses: actions/checkout@v3
23+
24+
- name: Run Trivy vulnerability scanner in repo mode
25+
uses: aquasecurity/trivy-action@0.28.0
26+
with:
27+
scan-type: "fs"
28+
scan-ref: "${{ github.workspace }}"
29+
trivy-config: "${{ github.workspace }}/trivy.yaml"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,4 @@
109109
"tmp": "^0.2.4",
110110
"js-yaml": "^4.1.0"
111111
}
112-
}
112+
}
Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {TestBed} from '@angular/core/testing';
22
import {BuilderService, ElementService, NodeService} from '../classes';
33
import {BuilderComponent} from './builder.component';
4+
import {LocalizationProviderService} from '../services';
45

56
describe('BuilderComponent', () => {
67
beforeEach(async () => {
@@ -9,23 +10,52 @@ describe('BuilderComponent', () => {
910
providers: [
1011
{
1112
provide: BuilderService,
12-
useValue: {},
13+
useValue: {
14+
restore: jasmine.createSpy('restore').and.returnValue(
15+
Promise.resolve({
16+
events: [],
17+
actions: [],
18+
elseActions: [],
19+
groups: [],
20+
process: {id: 'test-process'},
21+
state: {},
22+
}),
23+
),
24+
},
1325
},
1426
{
1527
provide: NodeService,
16-
useValue: {},
28+
useValue: {
29+
getGroups: jasmine.createSpy('getGroups').and.returnValue([]),
30+
},
1731
},
1832
{
1933
provide: ElementService,
2034
useValue: {},
2135
},
36+
{
37+
provide: LocalizationProviderService,
38+
useValue: {
39+
setLocalizedStrings: jasmine.createSpy('setLocalizedStrings'),
40+
getLocalizedString: (key: string) => key,
41+
},
42+
},
2243
],
2344
}).compileComponents();
2445
});
2546

2647
it('should create', () => {
2748
const fixture = TestBed.createComponent(BuilderComponent);
2849
const app = fixture.componentInstance;
50+
51+
// Set required inputs
52+
fixture.componentRef.setInput('state', {});
53+
fixture.componentRef.setInput('localizedStringMap', {});
54+
fixture.componentRef.setInput('diagram', '');
55+
fixture.componentRef.setInput('templateMap', {});
56+
fixture.componentRef.setInput('allColumns', []);
57+
58+
fixture.detectChanges();
2959
expect(app).toBeTruthy();
3060
});
3161
});

projects/workflows-creator/src/lib/builder/builder.component.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[isFirst]="i === 0"
77
[nodeType]="types.EVENT"
88
[eventGroups]="eventGroups"
9-
[templateMap]="templateMap"
9+
[templateMap]="templateMap()"
1010
(add)="openPopup(types.GROUP, $event)"
1111
(remove)="onGroupRemove(i)"
1212
(eventAdded)="onEventAdded($event)"
@@ -24,8 +24,8 @@
2424
[isLast]="true"
2525
[isFirst]="true"
2626
[nodeType]="types.GROUP"
27-
[templateMap]="templateMap"
28-
[allColumns]="allColumns"
27+
[templateMap]="templateMap()"
28+
[allColumns]="allColumns()"
2929
(eventAdded)="onEventAdded($event)"
3030
(eventRemoved)="onEventRemoved()"
3131
(actionAdded)="onActionAdded($event)"
@@ -51,8 +51,8 @@
5151
[isLast]="true"
5252
[isFirst]="true"
5353
[nodeType]="types.GROUP"
54-
[templateMap]="templateMap"
55-
[allColumns]="allColumns"
54+
[templateMap]="templateMap()"
55+
[allColumns]="allColumns()"
5656
(eventAdded)="onEventAdded($event)"
5757
(eventRemoved)="onEventRemoved()"
5858
(actionAdded)="onActionAdded($event)"

0 commit comments

Comments
 (0)