-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchange-sets-component-ts.content.ts
More file actions
39 lines (34 loc) · 1.2 KB
/
change-sets-component-ts.content.ts
File metadata and controls
39 lines (34 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// eslint-disable-next-line jsdoc/require-jsdoc
export const changeSetsComponentTsContent: string = `import { Component, OnInit } from '@angular/core';
import { ChangeSet, ChangeSetEntity, ChangeSetsComponent, ChangeSetsConfig } from 'ngx-material-change-sets';
import { DecoratorTypes, NgxMatEntityBaseInputComponent } from 'ngx-material-entity';
import { LodashUtilities } from '../../utilities/lodash.utilities';
export interface ChangeSetsInputMetadata {
changeSetsApiBaseUrl: string,
config?: Partial<ChangeSetsConfig>
}
@Component({
selector: 'app-change-sets-input',
templateUrl: './change-sets-input.component.html',
standalone: true,
imports: [ChangeSetsComponent]
})
export class ChangeSetsInputComponent extends NgxMatEntityBaseInputComponent<
ChangeSetEntity,
DecoratorTypes.CUSTOM,
ChangeSet[],
ChangeSetsInputMetadata
> implements OnInit {
e: ChangeSetEntity = {
id: '',
changeSets: []
};
config: Partial<ChangeSetsConfig> = {
canResetAndRollback: false
};
override ngOnInit(): void {
super.ngOnInit();
this.e = LodashUtilities.cloneDeep(this.entity);
this.e.changeSets = this.e.changeSets ?? [];
}
}`;