Adding filter bar
[aai/sparky-fe.git] / src / generic-components / graph / TempCreateAttributes.js
1 /*
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6  * Copyright © 2017 Amdocs
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *       http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  *
21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22  */
23 import React from 'react';
24
25
26 export default {
27   createNodeAttributes: () => {
28     return {
29       className: 'node'
30     };
31   },
32   createShapeAttributes: () => {
33     return {
34       r: 3
35     };
36   },
37   createCircleStyle: () => {
38     return {
39       fill: 'rgb(98, 102, 104)',
40       stroke: 'rgb(78, 82, 84)',
41       strokeWidth: 1
42     };
43   },
44   createLinkAttributes: () => {
45     return {
46       className: 'link',
47       x1: 50,
48       y1: 50,
49       x2: 100,
50       y2: 500,
51     };
52   },
53   createLineStyle: () => {
54     return {
55       stroke: 'rgb(217, 218, 218)',
56       strokeWidth: 1
57     };
58   },
59   createTestCircle: () => {
60     return React.createElement('circle', {
61       cx: '100',
62       cy: '100',
63       r: '15',
64       fill: 'rgb(255, 255, 255)',
65       stroke: 'rgb(98, 102, 104)',
66       strokeWidth: '3'
67     });
68   },
69   getNodeLinkArray: () => {
70     return {
71       'graphMeta': {
72         'aaiEntityNodeDescriptors': {
73           'generalNodeClass': {
74             'class': 'aai-entity-node general-node',
75             'visualElements': [
76               {
77                 'type': 'circle',
78                 'class': 'outer',
79                 'svgAttributes': {
80                   'r': '16'
81                 }
82               },
83               {
84                 'type': 'circle',
85                 'class': 'inner',
86                 'svgAttributes': {
87                   'r': '10'
88                 }
89               },
90               {
91                 'type': 'text',
92                 'class': 'id-type-label',
93                 'displayKey': 'itemType',
94                 'shapeAttributes': {
95                   'offset': {
96                     'x': '0',
97                     'y': '33'
98                   }
99                 }
100               },
101               {
102                 'type': 'text',
103                 'class': 'id-value-label',
104                 'displayKey': 'itemNameValue',
105                 'shapeAttributes': {
106                   'offset': {
107                     'x': '0',
108                     'y': '48'
109                   }
110                 }
111               }
112             ]
113           },
114           'searchedNodeClass': {
115             'class': 'aai-entity-node search-node',
116             'visualElements': [
117               {
118                 'type': 'circle',
119                 'class': 'outer',
120                 'svgAttributes': {
121                   'r': '16'
122                 }
123               },
124               {
125                 'type': 'circle',
126                 'class': 'inner',
127                 'svgAttributes': {
128                   'r': '10'
129                 }
130               },
131               {
132                 'type': 'text',
133                 'class': 'id-type-label',
134                 'displayKey': 'itemType',
135                 'shapeAttributes': {
136                   'offset': {
137                     'x': '0',
138                     'y': '33'
139                   }
140                 }
141               },
142               {
143                 'type': 'text',
144                 'class': 'id-value-label',
145                 'displayKey': 'itemNameValue',
146                 'shapeAttributes': {
147                   'offset': {
148                     'x': '0',
149                     'y': '48'
150                   }
151                 }
152               }
153             ]
154           },
155           'selectedSearchedNodeClass': {
156             'class': 'aai-entity-node selected-search-node',
157             'visualElements': [
158               {
159                 'type': 'circle',
160                 'class': 'outer',
161                 'svgAttributes': {
162                   'r': '31'
163                 }
164               },
165               {
166                 'type': 'circle',
167                 'class': 'inner',
168                 'svgAttributes': {
169                   'r': '20'
170                 }
171               },
172               {
173                 'type': 'text',
174                 'class': 'id-type-label',
175                 'displayKey': 'itemType',
176                 'shapeAttributes': {
177                   'offset': {
178                     'x': '0',
179                     'y': '48'
180                   }
181                 }
182               },
183               {
184                 'type': 'text',
185                 'class': 'id-value-label',
186                 'displayKey': 'itemNameValue',
187                 'shapeAttributes': {
188                   'offset': {
189                     'x': '0',
190                     'y': '63'
191                   }
192                 }
193               },
194               {
195                 'type': 'button',
196                 'name': 'icon_ellipses',
197                 'class': 'node-button',
198                 'shapeAttributes': {
199                   'offset': {
200                     'x': '33',
201                     'y': '-35'
202                   }
203                 },
204                 'svgAttributes': {
205                   'className': 'node-button',
206                   'r': '10'
207                 }
208               },
209               {
210                 'type': 'button',
211                 'name': 'icon_triangle_warning',
212                 'class': 'node-button',
213                 'shapeAttributes': {
214                   'offset': {
215                     'x': '46',
216                     'y': '-12'
217                   }
218                 },
219                 'svgAttributes': {
220                   'className': 'node-button',
221                   'r': '10'
222                 }
223               }
224             ]
225           },
226           'selectedNodeClass': {
227             'class': 'aai-entity-node selected-node',
228             'visualElements': [
229               {
230                 'type': 'circle',
231                 'class': 'outer',
232                 'svgAttributes': {
233                   'r': '31'
234                 }
235               },
236               {
237                 'type': 'circle',
238                 'class': 'inner',
239                 'svgAttributes': {
240                   'r': '20'
241                 }
242               },
243               {
244                 'type': 'text',
245                 'class': 'id-type-label',
246                 'displayKey': 'itemType',
247                 'shapeAttributes': {
248                   'offset': {
249                     'x': '0',
250                     'y': '48'
251                   }
252                 }
253               },
254               {
255                 'type': 'text',
256                 'class': 'id-value-label',
257                 'displayKey': 'itemNameValue',
258                 'shapeAttributes': {
259                   'offset': {
260                     'x': '0',
261                     'y': '63'
262                   }
263                 }
264               },
265               {
266                 'type': 'button',
267                 'name': 'icon_ellipses',
268                 'class': 'node-button',
269                 'shapeAttributes': {
270                   'offset': {
271                     'x': '33',
272                     'y': '-35'
273                   }
274                 },
275                 'svgAttributes': {
276                   'className': 'node-button',
277                   'r': '10'
278                 }
279               },
280               {
281                 'type': 'button',
282                 'name': 'icon_triangle_warning',
283                 'class': 'node-button',
284                 'shapeAttributes': {
285                   'offset': {
286                     'x': '46',
287                     'y': '-12'
288                   }
289                 },
290                 'svgAttributes': {
291                   'className': 'node-button',
292                   'r': '10'
293                 }
294               }
295             ]
296           }
297         },
298         'numNodes': 6,
299         'numLinks': 5,
300         'renderTimeInMs': 4550,
301         'numLinksResolvedSuccessfullyFromCache': 0,
302         'numLinksResolvedSuccessfullyFromServer': 7,
303         'numLinkResolveFailed': 0
304       },
305       'nodes': [{
306         'id': 'TRINITY-PSERVER',
307         'itemType': 'pserver',
308         'itemNameKey': 'pserver.TRINITY-PSERVER',
309         'itemNameValue': 'TRINITY-PSERVER',
310         'itemProperties': {
311           'hostname': 'TRINITY-PSERVER',
312           'in-maint': 'false',
313           'resource-version': '1455590484'
314         },
315         'nodeMeta': {
316           'className': 'selectedSearchedNodeClass',
317           'nodeDebug': null,
318           'selfLinkResponseTimeInMs': 628,
319           'relationshipNode': false,
320           'searchTarget': true,
321           'enrichableNode': false,
322           'nodeValidated': true,
323           'nodeIssue': true
324         }
325       }, {
326         'id': 'TRINITYSIL',
327         'itemType': 'complex',
328         'itemNameKey': 'complex.TRINITYSIL',
329         'itemNameValue': 'TRINITYSIL',
330         'itemProperties': {
331           'country': 'USA',
332           'postal-code': '07748',
333           'city': 'Middletown',
334           'physical-location-id': 'TRINITYSIL',
335           'resource-version': '1459957457',
336           'street1': 'Trinity',
337           'state': 'NJ',
338           'physical-location-type': 'Trinity',
339           'region': 'US'
340         },
341         'nodeMeta': {
342           'className': 'generalNodeClass',
343           'nodeDebug': null,
344           'selfLinkResponseTimeInMs': 644,
345           'relationshipNode': false,
346           'searchTarget': false,
347           'enrichableNode': false,
348           'nodeValidated': true,
349           'nodeIssue': false
350         }
351       }, {
352         'id': 'c385bb3e-6ebd-4898-bc92-792e0ac2db50',
353         'itemType': 'vserver',
354         'itemNameKey': 'vserver.c385bb3e-6ebd-4898-bc92-792e0ac2db50',
355         'itemNameValue': 'c385bb3e-6ebd-4898-bc92-792e0ac2db50',
356         'itemProperties': {
357           'in-maint': 'false',
358           'resource-version': '1475160142',
359           'vserver-name': 'bems0001vm001',
360           'prov-status': 'ACTIVE',
361           'vserver-id': 'c385bb3e-6ebd-4898-bc92-792e0ac2db50',
362           'vserver-name2': 'bems0001vm001bem001-1452',
363           'vserver-selflink': 'TRINITY vserverLink',
364           'is-closed-loop-disabled': 'false'
365         },
366         'nodeMeta': {
367           'className': 'generalNodeClass',
368           'nodeDebug': null,
369           'selfLinkResponseTimeInMs': 2633,
370           'relationshipNode': false,
371           'searchTarget': false,
372           'enrichableNode': false
373         }
374       }, {
375         'id': '7c73d776-001d-4042-a958-37f2e419ed10',
376         'itemType': 'vserver',
377         'itemNameKey': 'vserver.7c73d776-001d-4042-a958-37f2e419ed10',
378         'itemNameValue': '7c73d776-001d-4042-a958-37f2e419ed10',
379         'itemProperties': {
380           'resource-version': '1477075390',
381           'vserver-name': 'nsbg0001vm002',
382           'prov-status': 'NVTPROV',
383           'vserver-id': '7c73d776-001d-4042-a958-37f2e419ed10',
384           'vserver-name2': 'VM-19631',
385           'vserver-selflink': 'TRINITY vserverLink'
386         },
387         'nodeMeta': {
388           'className': 'generalNodeClass',
389           'nodeDebug': null,
390           'selfLinkResponseTimeInMs': 2368,
391           'relationshipNode': false,
392           'searchTarget': false,
393           'enrichableNode': false
394         }
395       }, {
396         'id': 'fc6be93d-915e-4034-a8f9-463b70130614',
397         'itemType': 'vserver',
398         'itemNameKey': 'vserver.fc6be93d-915e-4034-a8f9-463b70130614',
399         'itemNameValue': 'fc6be93d-915e-4034-a8f9-463b70130614',
400         'itemProperties': {
401           'resource-version': '1477075398',
402           'vserver-name': 'nsbg0001vm004',
403           'prov-status': 'NVTPROV',
404           'vserver-id': 'fc6be93d-915e-4034-a8f9-463b70130614',
405           'vserver-name2': 'VM-19630',
406           'vserver-selflink': 'TRINITY vserverLink'
407         },
408         'nodeMeta': {
409           'className': 'generalNodeClass',
410           'nodeDebug': null,
411           'selfLinkResponseTimeInMs': 2621,
412           'relationshipNode': false,
413           'searchTarget': false,
414           'enrichableNode': false
415         }
416       }, {
417         'id': '8555c2ed-6818-43c5-8cf5-cd36b0169031',
418         'itemType': 'vserver',
419         'itemNameKey': 'vserver.8555c2ed-6818-43c5-8cf5-cd36b0169031',
420         'itemNameValue': '8555c2ed-6818-43c5-8cf5-cd36b0169031',
421         'itemProperties': {
422           'resource-version': '1477075396',
423           'vserver-name': 'nsbg0001vm003',
424           'prov-status': 'NVTPROV',
425           'vserver-id': '8555c2ed-6818-43c5-8cf5-cd36b0169031',
426           'vserver-name2': 'VM-19629',
427           'vserver-selflink': 'TRINITY vserverLink'
428         },
429         'nodeMeta': {
430           'className': 'generalNodeClass',
431           'nodeDebug': null,
432           'selfLinkResponseTimeInMs': 2663,
433           'relationshipNode': false,
434           'searchTarget': false,
435           'enrichableNode': false
436         }
437       }],
438       'links': [{
439         'id': 'TRINITY-PSERVER_TRINITYSIL',
440         'source': 'TRINITY-PSERVER',
441         'target': 'TRINITYSIL'
442       }, {
443         'id': 'TRINITY-PSERVER_c385bb3e-6ebd-4898-bc92-792e0ac2db50',
444         'source': 'TRINITY-PSERVER',
445         'target': 'c385bb3e-6ebd-4898-bc92-792e0ac2db50'
446       }, {
447         'id': 'TRINITY-PSERVER_7c73d776-001d-4042-a958-37f2e419ed10',
448         'source': 'TRINITY-PSERVER',
449         'target': '7c73d776-001d-4042-a958-37f2e419ed10'
450       }, {
451         'id': 'TRINITY-PSERVER_fc6be93d-915e-4034-a8f9-463b70130614',
452         'source': 'TRINITY-PSERVER',
453         'target': 'fc6be93d-915e-4034-a8f9-463b70130614'
454       }, {
455         'id': 'TRINITY-PSERVER_8555c2ed-6818-43c5-8cf5-cd36b0169031',
456         'source': 'TRINITY-PSERVER',
457         'target': '8555c2ed-6818-43c5-8cf5-cd36b0169031'
458       }]
459     };
460   }
461 };