-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
282 lines (236 loc) · 13.3 KB
/
index.html
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<html>
<head>
<script type="text/javascript" src="js/libs/three.js"></script>
<script type="text/javascript" src="js/libs/vue.js"></script>
<script type="text/javascript" src="js/libs/three-orbit-controls.js"></script>
<script type="text/javascript" src="js/libs/three-transform-controls.js"></script>
<script type="text/javascript" src="js/libs/slds-colors.js"></script>
<link type="text/css" rel="stylesheet" href="css/style.css"/>
<link type="text/css" rel="stylesheet" href="slds/assets/styles/salesforce-lightning-design-system.css"/>
<title>Unravel</title>
</head>
<body>
<div class="unravel" id="unravel">
<div v-if="preview && popup.selection == false" class="unravel-preview slds-card" v-bind-class="{'_object': preview.links }">
<div class="slds-text-title_caps">{{ preview.links ? 'Object Details' : 'Link Details'}}</div>
<p style="color: #1589ee">{{ preview.label }}</p>
<i><p>{{ preview.name }}</p></i>
<div v-if="!preview.links">
<br/>
<p>Relationship from {{ preview.object }} to {{ preview.target }}</p>
</div>
<div v-if="previewRelationships.length > 0">
<br/>
<div class="slds-text-title_caps">Relationships</div>
<p v-for="l in previewRelationships">{{ l.target }} ({{ l.name }})</p>
</div>
<div v-if="previewChildren.length > 0">
<br/>
<div class="slds-text-title_caps">Children</div>
<p v-for="l in previewChildren">{{ l.object }} ({{ l.name }})</p>
</div>
</div>
<div v-if="loading.generic == true" class="slds-spinner_container" style="z-index: 100000000">
<div v-if="rendered == false" role="status" class="slds-spinner slds-spinner_medium">
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
</div>
</div>
<div v-if="loading.objects == true" class="slds-spinner_container" v-bind-class="{'alt': rendered == true}">
<div v-if="rendered == false" role="status" class="slds-spinner slds-spinner_medium slds-spinner_inverse">
<span class="slds-assistive-text">Loading</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
</div>
<span style="color: white">Loading data, this may take a few minutes..</span>
</div>
<table v-if="popup.error == true" class="unravel-selection">
<tr>
<td>
<div class="slds-card">
<div class="slds-text-title_caps" style="margin-bottom: 5px;">There was an issue</div>
<p style="margin-bottom: 10px" v-if="configurations.length == 0">
There was an issue with Unravel, please check the message below:
</p>
<p>
{{ error }}
</p>
</div>
</td>
</tr>
</table>
<table v-if="loading.objects == false && popup.selection == true" class="unravel-selection">
<tr>
<td>
<div class="slds-card">
<div class="slds-text-title_caps" style="margin-bottom: 5px;">Get Started</div>
<p style="margin-bottom: 10px" v-if="configurations.length == 0">
Create a new configuration to begin.
</p>
<p v-if="configurations.length > 0">
Load an existing Unravel configuration or create a new one below.
</p>
<ul v-if="configurations.length > 0" class="unravel-options">
<li v-on-click="loadConfiguration(c)" v-for="(c, i) in configurations">
{{ c.Name }} [{{ c.aptk_unravel__Target__c }}]
<a v-on-click.stop="deleteConfiguration(c, i)" style="float: right;" class="slds-link">Remove</a>
</li>
</ul>
<button v-if="!configuration.Id" style="width: 100%" class="slds-button slds-button--brand" v-on-click.stop="loadMetadata()">Create New Configuration</button>
<button v-if="configuration.Id" style="width: 100%" class="slds-button slds-button--brand" v-on-click.stop="loadMetadata(true)">Create New Configuration</button>
<button v-if="configuration.Id && loading.generic == false" v-on-click="closePopups()" style="margin-top: 10px; width: 100%" class="slds-button slds-button--neutral">
Cancel
</button>
</div>
</td>
</tr>
</table>
<table v-if="loading.objects == false && popup.create == true" class="unravel-selection">
<tr>
<td>
<div class="slds-card">
<div class="slds-text-title_caps" style="margin-bottom: 5px;">{{ popup.edit == true ? 'Update' : 'Create' }} configuration</div>
<p>
Select the objects you would like to unravel below.
<br/>
Click an object to select / remove it.
<br/><br/>
From the selected objects you also need to specify a target object for Unravel to base the data model generation on.
</p>
<div style="margin-top: 10px" class="slds-form-element">
<label class="slds-form-element__label">Configuration Name</label>
<div class="slds-form-element__control">
<input class="slds-input" v-model="name"/>
</div>
</div>
<div style="margin-top: 10px" class="slds-form-element" role="group" aria-labelledby="picklist-group-label">
<div class="slds-form-element__control">
<div class="slds-dueling-list">
<div class="slds-dueling-list__column">
<span class="slds-form-element__label">All Objects</span>
<div class="slds-form-element">
<div class="slds-form-element__control slds-input-has-icon slds-input-has-icon_left">
<img class="slds-icon slds-input__icon slds-input__icon_left slds-icon-text-default" src="slds/assets/icons/utility/search_60.png"/>
<input v-model="search.all" type="text" placeholder="Search objects.." class="slds-input" />
</div>
</div>
<div class="slds-dueling-list__options">
<ul class="slds-listbox slds-listbox_vertical">
<li v-on-click="selectObject(object)" v-for="object in sortedAllObjects" class="slds-listbox__item">
<div class="slds-listbox__option slds-listbox__option_plain slds-media slds-media_small slds-media_inline">
<span class="slds-media__body">
<img src="slds/assets/icons/utility/add_60.png"/>
<span class="slds-truncate">{{ object.name }}</span>
</span>
</div>
</li>
</ul>
</div>
</div>
<div class="slds-dueling-list__column">
<div style="width: 20px"></div>
</div>
<div class="slds-dueling-list__column">
<span class="slds-form-element__label">Selected Objects</span>
<div class="slds-form-element">
<div class="slds-form-element__control slds-input-has-icon slds-input-has-icon_left">
<img class="slds-icon slds-input__icon slds-input__icon_left slds-icon-text-default" src="slds/assets/icons/utility/search_60.png"/>
<input v-model="search.selected" type="text" placeholder="Search objects.." class="slds-input" />
</div>
</div>
<div class="slds-dueling-list__options">
<ul class="slds-listbox slds-listbox_vertical">
<li v-on-click="removeObject(i, object)" v-for="(object, i) in sortedSelectedObjects" class="slds-listbox__item">
<div class="slds-listbox__option slds-listbox__option_plain slds-media slds-media_small slds-media_inline">
<span class="slds-media__body">
<img src="slds/assets/icons/utility/delete_60.png"/>
<span class="slds-truncate">{{ object }}</span>
</span>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div style="margin-top: 10px" class="slds-form-element">
<label class="slds-form-element__label" for="select-01">Select Label</label>
<div class="slds-form-element__control">
<div class="slds-select_container">
<select class="slds-select" v-model="target">
<option v-bind-value="null">-- Select a target --</option>
<option v-for="object in selectedObjects">{{ object }}</option>
</select>
</div>
</div>
</div>
<button v-on-click="saveConfiguration()" v-bind-disabled="selectedObjects.length == 0 || target == null || name == ''" style="margin-top: 10px; width: 100%" class="slds-button slds-button_brand">
{{ popup.edit == true ? 'Update Configuration' : 'Start Unravelling' }}
</button>
<button v-if="configuration.Id" v-on-click="closePopups()" style="margin-top: 10px; width: 100%" class="slds-button slds-button--neutral">
Cancel
</button>
<button v-if="!configuration.Id" v-on-click="popup.create = false; popup.selection = true" style="margin-top: 10px; width: 100%" class="slds-button slds-button--neutral">
Back
</button>
</div>
</td>
</tr>
</table>
<span v-if="rendered == true" class="unravel-controls">
Hold the left mouse button to rotate.<br/>
Hold the right mouse button to pan.<br/>
Scroll the mouse wheel to zoom.<br/><br/>
Hover over any object or link to find out more.
</span>
<nav v-if="rendered == true" class="unravel-objects slds-nav-vertical">
<div class="unravel-objects-title">
<h1>
<span style="cursor: pointer" v-on-click.stop="popup.selection = true">
<img class="slds-button__icon" src="slds/assets/icons/utility/rows.svg"/>
<b style="padding-left: 5px">Unraveller</b>
</span>
<button title="Toggle all object transparency" v-on-click.stop="setAllGhost()" v-bind-style="{'opacity': ghost == true ? '0.5' : '1'}" class="slds-button slds-button_icon slds-float_right">
<img class="slds-button__icon" src="slds/assets/icons/utility/preview.svg"/>
</button>
</h1>
</div>
<div class="slds-nav-vertical__section">
<ul>
<li v-bind-title="o.target == true ? 'Rendering data model based on ' + o.label : 'Click to re-render data model based on ' + o.label" v-bind-class="{'slds-is-active': o.target == true}" class="slds-nav-vertical__item" v-for="o in sortedObjects">
<a v-on-click.stop="setTarget(o)" class="slds-nav-vertical__action">
<span>{{ o.label }}</span>
<button title="Toggle object transparency" v-on-click.stop="setGhost(o)" v-bind-style="{'opacity': o.ghost == true ? '0.5' : '1'}" class="slds-button slds-button_icon slds-float_right">
<img class="slds-button__icon" src="slds/assets/icons/utility/preview_60.png"/>
</button>
</a>
</li>
</ul>
</div>
<div class="unravel-objects-picker">
<button v-on-click="editConfiguration()" class="slds-button slds-button_neutral">Update Configuration</button>
</div>
</nav>
<div v-bind-style="{'pointer-events': popup.selection == true ? 'none' : 'all'}" id="unravel-canvas" class="unravel-canvas"></div>
</div>
<script type="text/javascript" src="js/modules/factory.js"></script>
<script type="text/javascript" src="js/modules/render.js"></script>
<script type="text/javascript" src="js/modules/mapper.js"></script>
<script type="text/javascript" src="js/modules/remote.js"></script>
<script type="text/javascript">
$Permission = 'true';
$Globals = {
font: "{!URLFOR($Resource.UnravellerResources, 'font.json')}"
}
$Remote.setActions({
getObjects: '{!$RemoteAction.UnravelCore.getObjects}',
getObjectData: '{!$RemoteAction.UnravelCore.getObjectData}',
getConfigurations: '{!$RemoteAction.UnravelCore.getConfigurations}',
saveConfiguration: '{!$RemoteAction.UnravelCore.saveConfiguration}'
});
</script>
<script type="text/javascript" src="js/app.js"></script>
</body>
</html>