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