Skip to content

Commit 3492f30

Browse files
committed
[NAE-1684] Frontend component for data field caseRef
- add petriflow lib and petriflow canvas
1 parent fb106b5 commit 3492f30

File tree

4 files changed

+29
-5
lines changed

4 files changed

+29
-5
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
ide
1+
<div class="outer">
2+
<petriflow-svg-canvas class="canvas"></petriflow-svg-canvas>
3+
</div>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.outer {
2+
display: flex;
3+
min-height: 50%;
4+
max-height: 100%;
5+
}
Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
1-
import {Component, Input} from '@angular/core';
1+
import {AfterViewInit, Component, Input} from '@angular/core';
22
import {CaseRefField} from '@netgrif/components-core';
3+
import {
4+
PetriflowCanvasConfigurationService,
5+
PetriflowCanvasFactoryService,
6+
PetriflowCanvasService
7+
} from '@netgrif/petriflow.svg';
38

49
@Component({
510
selector: 'nc-case-ref-field',
611
templateUrl: './case-ref-field.component.html',
712
styleUrls: ['./case-ref-field.component.scss']
813
})
9-
export class CaseRefFieldComponent {
14+
export class CaseRefFieldComponent implements AfterViewInit{
1015

1116
@Input() public dataField: CaseRefField;
1217

13-
constructor(){
18+
constructor(private _petriflowCanvasService: PetriflowCanvasService, private _petriflowFactoryService: PetriflowCanvasFactoryService,
19+
private _petriflowConfigService: PetriflowCanvasConfigurationService){
1420
}
21+
22+
ngAfterViewInit(): void {
23+
const transition = this._petriflowFactoryService.createTransition(new DOMPoint(100, 100));
24+
this._petriflowConfigService.addTransitionEvents(transition);
25+
26+
const place = this._petriflowFactoryService.createPlace(1, new DOMPoint(150, 100));
27+
this._petriflowConfigService.addPlaceEvents(place);
28+
}
29+
1530
}

projects/netgrif-components/src/lib/data-fields/data-fields.module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ import { EasymdeWrapperComponent } from './text-field/rich-textarea-field/easymd
6262
import {BrowserModule} from '@angular/platform-browser';
6363
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
6464
import { CaseRefFieldComponent } from './case-ref-field/case-ref-field.component';
65+
import {PetriflowCanvasModule} from '@netgrif/petriflow.svg';
6566

6667
@NgModule({
6768
declarations: [
@@ -138,7 +139,8 @@ import { CaseRefFieldComponent } from './case-ref-field/case-ref-field.component
138139
MatProgressSpinnerModule,
139140
CurrencyModule,
140141
BrowserModule,
141-
BrowserAnimationsModule
142+
BrowserAnimationsModule,
143+
PetriflowCanvasModule
142144
],
143145
providers: [
144146
{ provide: DateAdapter, useClass: CustomDateAdapter }

0 commit comments

Comments
 (0)