Merge from ecomp 718fd196 - Modern UI
[vid.git] / vid-webpack-master / src / app / shared / components / searchMembersModal / members-table / element-table-row.model.ts
1 import {VnfMember} from "../../../models/VnfMember";
2 import {Observable} from "rxjs";
3 import {CustomTableColumnDefinition} from "./elements-table.component";
4
5 export class ElementTableRowModel extends VnfMember {
6   isSelected: boolean = false;
7 }
8
9
10 /*******************************************************************************************************************************
11                 ModalInformation
12  *  @type: popup type (VPN, NETWORK, VNFGROUP)
13  *  @title: popup title
14  *  @description: popup upper message
15  *  @topButtonText: (optional)
16  *    @text: button text
17  *    @action: button action
18  *  @backAction : arrow back button action (can close the modal/move to next step)
19  *  @uniqObjectField: uniq object field that we can find in O(1)
20  *  @maxSelectRow: max number of row that user can select (default = no limit)(optional)
21  *  @getElements: function that should return Observable<any[]> of collection of elements to show in the table
22  *  @noElementsMsg : when there are no element some message should shown
23  *  @searchFields : extra information in the left section
24  *  @criteria: extra criteria on table content (optional)
25  *  @tableHeaders : table headers
26  *  @tableContent: table td's information.
27
28  ******************************************************************************************************************************/
29
30 export class  ModalInformation {
31   type : string;
32   currentCriteriaInfo? : Object;
33   title ?: string;
34   description ?: string;
35   topButton?: {
36     text ?: string,
37     action ?: (...args) => any
38   };
39   searchButton?: {
40     text ?: string,
41     action ?: (...args)=> any
42   };
43   backAction? : (...args) => any;
44   uniqObjectField : string;
45   maxSelectRow ?: number;
46   getElements : (...args) => Observable<any[]>;
47   noElementsMsg : string;
48   searchFields: ISearchField[];
49   criteria ?: ICriteria[];
50   tableHeaders : CustomTableColumnDefinition[];
51   tableContent : ITableContent[];
52   serviceModelId: string;
53 }
54
55
56 export interface ISearchField {
57   title: string;
58   value: any;
59   dataTestId: string;
60   type : string;
61 }
62
63
64 export interface ICriteria {
65   label: string;
66   defaultValue: any;
67   onInit?: (...args) => Observable<string>;
68   onChange? : (...arg) => void;
69   type : string;
70   dataTestId : string;
71   isRequired ?: boolean;
72   currentValue ?: any;
73 }
74
75
76 export interface ITableContent {
77   id : string;
78   contents : {id : string[], value : string[], prefix ?: string, type? : string}[];
79 }
80
81 export enum SearchFieldItemType {
82   LABEL = 'LABEL',
83   DROPDOWN = 'DROPDOWN'
84 }
85
86
87
88