@ms-atlas-module/datastudio-datafactory 0.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @ms-atlas-module/datastudio-datafactory might be problematic. Click here for more details.
- package/_generated/ClientResources.js +1549 -0
- package/_generated/Framework.js +97 -0
- package/_generated/Svg.js +201 -0
- package/bootstrapper/BreadcrumbsKnockoutBinding.js +25 -0
- package/bootstrapper/CSS/Callout.css +43 -0
- package/bootstrapper/CSS/Common.css +22 -0
- package/bootstrapper/CSS/FormFields.css +133 -0
- package/bootstrapper/CSS/InlineBlock.css +34 -0
- package/bootstrapper/CSS/ParameterGroups.css +77 -0
- package/bootstrapper/CSS/Pivot.css +25 -0
- package/bootstrapper/CSS/Wizard.css +197 -0
- package/bootstrapper/CalloutBinding.js +52 -0
- package/bootstrapper/CollapsibleKnockoutBinding.js +70 -0
- package/bootstrapper/CopyBinding.js +150 -0
- package/bootstrapper/FilterFlyoutKnockoutBinding.js +114 -0
- package/bootstrapper/FormFields.js +397 -0
- package/bootstrapper/InlineBlockBinding.js +69 -0
- package/bootstrapper/JQueryUIBindings.js +152 -0
- package/bootstrapper/KnockoutBindings.js +635 -0
- package/bootstrapper/LoadingBinding.js +54 -0
- package/bootstrapper/MonacoEditorKnockoutBinding.js +67 -0
- package/bootstrapper/ParameterGroupsBinding.js +289 -0
- package/bootstrapper/PivotKnockoutBinding.js +61 -0
- package/bootstrapper/StatusCalendarFlyoutKnockoutBinding.js +398 -0
- package/bootstrapper/StatusCalendarKnockoutBinding.js +107 -0
- package/bootstrapper/TelemetryKnockoutBinding.js +68 -0
- package/bootstrapper/WinJSButtonKnockoutBinding.js +72 -0
- package/bootstrapper/WinJSKnockoutBindings.js +49 -0
- package/bootstrapper/WizardBinding.js +611 -0
- package/bootstrapper/startup.js +29 -0
- package/libs/VivaGraphControl/Content/CSS/Graph.css +157 -0
- package/libs/VivaGraphControl/Content/CSS/LightTheme.css +699 -0
- package/libs/VivaGraphControl/Content/Scripts/Viva.Controls/Base/Base.TriggerableLifetimeManager.js +190 -0
- package/libs/VivaGraphControl/Content/Scripts/Viva.Controls/Controls/Base/Base.js +647 -0
- package/libs/VivaGraphControl/Content/Scripts/Viva.Controls/Controls/Base/Image.js +113 -0
- package/libs/VivaGraphControl/Content/Scripts/Viva.Controls/Controls/Base/KnockoutExtensions.js +1064 -0
- package/libs/VivaGraphControl/Content/Scripts/Viva.Controls/Controls/DockedBalloon.js +18 -0
- package/libs/VivaGraphControl/Content/Scripts/Viva.Controls/Controls/Visualization/Graph/Animation.js +192 -0
- package/libs/VivaGraphControl/Content/Scripts/Viva.Controls/Controls/Visualization/Graph/Commands/MoveNodes.js +83 -0
- package/libs/VivaGraphControl/Content/Scripts/Viva.Controls/Controls/Visualization/Graph/Geometry.js +167 -0
- package/libs/VivaGraphControl/Content/Scripts/Viva.Controls/Controls/Visualization/Graph/GraphEntityViewModel.js +260 -0
- package/libs/VivaGraphControl/Content/Scripts/Viva.Controls/Controls/Visualization/Graph/GraphViewModel.js +338 -0
- package/libs/VivaGraphControl/Content/Scripts/Viva.Controls/Controls/Visualization/Graph/GraphWidget.Constants.js +178 -0
- package/libs/VivaGraphControl/Content/Scripts/Viva.Controls/Controls/Visualization/Graph/GraphWidget.js +5190 -0
- package/libs/VivaGraphControl/Content/Scripts/Viva.Controls/Controls/Visualization/Graph/MouseCapture.js +148 -0
- package/libs/VivaGraphControl/Content/Scripts/Viva.Controls/Controls/Visualization/Graph/SvgUtils.js +164 -0
- package/libs/VivaGraphControl/Content/Scripts/Viva.Controls/Util/Detection.js +658 -0
- package/libs/VivaGraphControl/Content/Scripts/Viva.Controls/Util/Resize.js +241 -0
- package/libs/VivaGraphControl/Content/Scripts/Viva.Controls/Util/Util.Private.js +236 -0
- package/libs/VivaGraphControl/Content/Scripts/Viva.Controls/Util/Util.js +905 -0
- package/libs/WinJS/WinJs.min.js +61909 -0
- package/libs/WinJS/ui-light.css +8500 -0
- package/package.json +15 -0
- package/scripts/AppContext.js +262 -0
- package/scripts/ExposureControl.js +11 -0
- package/scripts/Framework/Model/ActivityWindowCache.js +390 -0
- package/scripts/Framework/Model/ArmDataFactoryCache.js +77 -0
- package/scripts/Framework/Model/Contracts/Activity.js +83 -0
- package/scripts/Framework/Model/Contracts/ActivityWindow.js +185 -0
- package/scripts/Framework/Model/Contracts/BaseEncodable.js +106 -0
- package/scripts/Framework/Model/Contracts/Common.js +19 -0
- package/scripts/Framework/Model/Contracts/DataArtifact.js +100 -0
- package/scripts/Framework/Model/Contracts/Diagram.js +9 -0
- package/scripts/Framework/Model/Contracts/Encodable.js +113 -0
- package/scripts/Framework/Model/Contracts/Gateway.js +98 -0
- package/scripts/Framework/Model/Contracts/LinkedService.js +200 -0
- package/scripts/Framework/Model/Contracts/Pipeline.js +197 -0
- package/scripts/Framework/Model/DataCache.js +105 -0
- package/scripts/Framework/Model/DataFactoryCache.js +24 -0
- package/scripts/Framework/Model/Filter.js +186 -0
- package/scripts/Framework/Model/Helpers/ActivityWindowHelper.js +185 -0
- package/scripts/Framework/Model/MonitoringView.js +40 -0
- package/scripts/Framework/Shared/Constants.js +27 -0
- package/scripts/Framework/Shared/DataConstants.js +61 -0
- package/scripts/Framework/Shared/Disposable.js +53 -0
- package/scripts/Framework/Shared/IconResources.js +59 -0
- package/scripts/Framework/Shared/Resources/IbizaSvgs.js +241 -0
- package/scripts/Framework/Shared/TypeDeclarations.js +4 -0
- package/scripts/Framework/Telemetry/Telemetry.js +78 -0
- package/scripts/Framework/UI/Breadcrumbs.js +84 -0
- package/scripts/Framework/UI/Command.js +231 -0
- package/scripts/Framework/UI/ContextMenu.js +80 -0
- package/scripts/Framework/UI/Loader.js +11 -0
- package/scripts/Framework/UI/Menu.js +65 -0
- package/scripts/Framework/UI/PanelMessage.js +25 -0
- package/scripts/Framework/UI/Refresh.js +70 -0
- package/scripts/Framework/UI/Spinner.js +61 -0
- package/scripts/Framework/UI/StatusCalendar.js +1070 -0
- package/scripts/Framework/UI/Toolbar.js +84 -0
- package/scripts/Framework/Util/Datetime.js +258 -0
- package/scripts/Framework/Util/Log.js +10 -0
- package/scripts/Framework/Util/ResourceIdUtil.js +56 -0
- package/scripts/Framework/Util/Security.js +73 -0
- package/scripts/Framework/Util/Util.js +332 -0
- package/scripts/Framework/Views/HoverFlyout.js +92 -0
- package/scripts/Handlers/ErrorHandler.js +176 -0
- package/scripts/Handlers/MessageHandler.js +115 -0
- package/scripts/Handlers/MonitoringViewHandler.js +199 -0
- package/scripts/Handlers/RoutingHandler.js +364 -0
- package/scripts/Handlers/WinJSHandlers.js +265 -0
- package/scripts/MonitoringViewContext.js +75 -0
- package/scripts/Services/AzureInsightsService.js +162 -0
- package/scripts/Services/AzureResourceManagerService.js +869 -0
- package/scripts/Services/BaseService.js +232 -0
- package/scripts/Services/DataFactoryService.js +204 -0
- package/scripts/Services/HDInsightArmService.js +59 -0
- package/scripts/ViewContext.js +9 -0
- package/stylesheets/main.css +1042 -0
- package/views/Edit/DateTimeFilterViewModel.js +211 -0
- package/views/Edit/FilterViewModel.js +131 -0
- package/views/Shared/ProvisioningState.js +11 -0
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
define(["require", "exports", "./Log"], function (require, exports, Log) {
|
|
2
|
+
"use strict";
|
|
3
|
+
var logger = Log.getLogger({ loggerName: "Util" });
|
|
4
|
+
function objectToObservables(obj) {
|
|
5
|
+
if (ko.isObservable(obj)) {
|
|
6
|
+
return obj;
|
|
7
|
+
}
|
|
8
|
+
if (Array.isArray(obj)) {
|
|
9
|
+
for (var i = 0; i < obj.length; i++) {
|
|
10
|
+
obj[i] = objectToObservables(obj[i])();
|
|
11
|
+
}
|
|
12
|
+
return ko.observableArray(obj);
|
|
13
|
+
}
|
|
14
|
+
if (obj instanceof Object) {
|
|
15
|
+
for (var prop in obj) {
|
|
16
|
+
if (obj.hasOwnProperty(prop)) {
|
|
17
|
+
obj[prop] = objectToObservables(obj[prop]);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return ko.observable(obj);
|
|
21
|
+
}
|
|
22
|
+
return ko.observable(obj);
|
|
23
|
+
}
|
|
24
|
+
exports.objectToObservables = objectToObservables;
|
|
25
|
+
function mergeIntoObservableObject(observableObjectTarget, objectToMerge) {
|
|
26
|
+
var unwrapped = ko.unwrap(observableObjectTarget);
|
|
27
|
+
var _loop_1 = function (prop) {
|
|
28
|
+
if (unwrapped[prop] && ko.isObservable(unwrapped[prop])) {
|
|
29
|
+
if (Array.isArray(objectToMerge[prop])) {
|
|
30
|
+
var arr_1 = [];
|
|
31
|
+
objectToMerge[prop].forEach(function (e) {
|
|
32
|
+
arr_1.push(objectToObservables(e));
|
|
33
|
+
});
|
|
34
|
+
unwrapped[prop](arr_1);
|
|
35
|
+
} else if (objectToMerge[prop] instanceof Object) {
|
|
36
|
+
mergeIntoObservableObject(unwrapped[prop], objectToMerge[prop]);
|
|
37
|
+
} else {
|
|
38
|
+
unwrapped[prop](objectToMerge[prop]);
|
|
39
|
+
}
|
|
40
|
+
} else {
|
|
41
|
+
unwrapped[prop] = objectToObservables(objectToMerge[prop]);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
for (var prop in objectToMerge) {
|
|
45
|
+
_loop_1(prop);
|
|
46
|
+
}
|
|
47
|
+
for (var prop in unwrapped) {
|
|
48
|
+
if (objectToMerge[prop] === undefined) {
|
|
49
|
+
delete unwrapped[prop];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.mergeIntoObservableObject = mergeIntoObservableObject;
|
|
54
|
+
function mergeObservableObjects(target, source) {
|
|
55
|
+
var unwrappedTarget = ko.toJS(target);
|
|
56
|
+
var unwrappedSource = ko.toJS(source);
|
|
57
|
+
recursiveExtend(unwrappedTarget, unwrappedSource);
|
|
58
|
+
return objectToObservables(unwrappedTarget)();
|
|
59
|
+
}
|
|
60
|
+
exports.mergeObservableObjects = mergeObservableObjects;
|
|
61
|
+
function recursiveExtend(target, source) {
|
|
62
|
+
$.extend(true, target, source);
|
|
63
|
+
}
|
|
64
|
+
exports.recursiveExtend = recursiveExtend;
|
|
65
|
+
function koPropertyHasValue(property) {
|
|
66
|
+
if (property) {
|
|
67
|
+
var value = property();
|
|
68
|
+
return value instanceof Object
|
|
69
|
+
? !$.isEmptyObject(value)
|
|
70
|
+
: propertyHasValue(value);
|
|
71
|
+
}
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
exports.koPropertyHasValue = koPropertyHasValue;
|
|
75
|
+
function propertyHasValue(property) {
|
|
76
|
+
return !(property === undefined || property === null || property === "");
|
|
77
|
+
}
|
|
78
|
+
exports.propertyHasValue = propertyHasValue;
|
|
79
|
+
function curry(method, scope) {
|
|
80
|
+
var args = [];
|
|
81
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
82
|
+
args[_i - 2] = arguments[_i];
|
|
83
|
+
}
|
|
84
|
+
var previousArgs = args;
|
|
85
|
+
return function () {
|
|
86
|
+
var _args = [];
|
|
87
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
88
|
+
_args[_i - 0] = arguments[_i];
|
|
89
|
+
}
|
|
90
|
+
return method.apply(scope, previousArgs.concat(_args));
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
exports.curry = curry;
|
|
94
|
+
function ignoreDependencies(callback, context) {
|
|
95
|
+
var ignore = ko.computed(
|
|
96
|
+
{ read: callback, deferEvaluation: true },
|
|
97
|
+
context
|
|
98
|
+
);
|
|
99
|
+
try {
|
|
100
|
+
ignore();
|
|
101
|
+
} finally {
|
|
102
|
+
ignore.dispose();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.ignoreDependencies = ignoreDependencies;
|
|
106
|
+
function subscribeAndCall(observable, lambda, context) {
|
|
107
|
+
var subscription = context
|
|
108
|
+
? observable.subscribe(lambda, context)
|
|
109
|
+
: observable.subscribe(lambda);
|
|
110
|
+
if (context) {
|
|
111
|
+
lambda.call(context, observable());
|
|
112
|
+
} else {
|
|
113
|
+
lambda(observable());
|
|
114
|
+
}
|
|
115
|
+
return subscription;
|
|
116
|
+
}
|
|
117
|
+
exports.subscribeAndCall = subscribeAndCall;
|
|
118
|
+
function copySelectedText(value) {
|
|
119
|
+
if (value === void 0) {
|
|
120
|
+
value = "";
|
|
121
|
+
}
|
|
122
|
+
var succeeded = false;
|
|
123
|
+
try {
|
|
124
|
+
if (window.clipboardData) {
|
|
125
|
+
succeeded = window.clipboardData.setData("Text", value);
|
|
126
|
+
} else {
|
|
127
|
+
succeeded = document.execCommand("copy");
|
|
128
|
+
}
|
|
129
|
+
} catch (err) {
|
|
130
|
+
logger.logDebug("User declined to give keyboard access", err);
|
|
131
|
+
}
|
|
132
|
+
return succeeded;
|
|
133
|
+
}
|
|
134
|
+
exports.copySelectedText = copySelectedText;
|
|
135
|
+
var DefaultDict = (function () {
|
|
136
|
+
function DefaultDict(generator) {
|
|
137
|
+
this._map = {};
|
|
138
|
+
this.generator = generator;
|
|
139
|
+
}
|
|
140
|
+
DefaultDict.prototype.get = function (key, defaultValue) {
|
|
141
|
+
var val = this._map[key];
|
|
142
|
+
if (val === undefined) {
|
|
143
|
+
val = defaultValue === undefined ? this.generator() : defaultValue;
|
|
144
|
+
this._map[key] = val;
|
|
145
|
+
return val;
|
|
146
|
+
} else {
|
|
147
|
+
return val;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
DefaultDict.prototype.set = function (key, value) {
|
|
151
|
+
this._map[key] = value;
|
|
152
|
+
};
|
|
153
|
+
DefaultDict.prototype.keys = function () {
|
|
154
|
+
return Object.keys(this._map);
|
|
155
|
+
};
|
|
156
|
+
DefaultDict.prototype.dispose = function () {
|
|
157
|
+
for (var key in Object.keys(this._map)) {
|
|
158
|
+
var val = this._map[key];
|
|
159
|
+
if (val["dispose"]) {
|
|
160
|
+
val["dispose"]();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
return DefaultDict;
|
|
165
|
+
})();
|
|
166
|
+
exports.DefaultDict = DefaultDict;
|
|
167
|
+
function andFilter(first, second) {
|
|
168
|
+
first = first || null;
|
|
169
|
+
second = second || null;
|
|
170
|
+
if (!second) {
|
|
171
|
+
return first;
|
|
172
|
+
}
|
|
173
|
+
if (!first) {
|
|
174
|
+
return second;
|
|
175
|
+
}
|
|
176
|
+
return "({0} and {1})".format(first, second);
|
|
177
|
+
}
|
|
178
|
+
exports.andFilter = andFilter;
|
|
179
|
+
function hashCode(str) {
|
|
180
|
+
var hashCode = 0,
|
|
181
|
+
prime = 18446744073709551557;
|
|
182
|
+
var strLength = str.length;
|
|
183
|
+
for (var i = 0; i < strLength; i++) {
|
|
184
|
+
var char = str.charCodeAt(i);
|
|
185
|
+
hashCode = (hashCode * 128 + char) % prime;
|
|
186
|
+
}
|
|
187
|
+
return hashCode.toString();
|
|
188
|
+
}
|
|
189
|
+
exports.hashCode = hashCode;
|
|
190
|
+
function getAzureError(reason) {
|
|
191
|
+
var result = {
|
|
192
|
+
message: null,
|
|
193
|
+
code: null,
|
|
194
|
+
};
|
|
195
|
+
if (
|
|
196
|
+
reason &&
|
|
197
|
+
reason.status &&
|
|
198
|
+
reason.status < 500 &&
|
|
199
|
+
reason.status >= 400 &&
|
|
200
|
+
(reason.responseText || reason.responseJSON)
|
|
201
|
+
) {
|
|
202
|
+
var json = reason.responseJSON;
|
|
203
|
+
if (!json) {
|
|
204
|
+
try {
|
|
205
|
+
json = JSON.parse(reason.responseText);
|
|
206
|
+
} catch (e) {
|
|
207
|
+
json = reason.responseText;
|
|
208
|
+
return {
|
|
209
|
+
code: "",
|
|
210
|
+
message: json,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (json.error) {
|
|
215
|
+
result.message = json.error.message || "";
|
|
216
|
+
result.code = json.error.code || "";
|
|
217
|
+
} else {
|
|
218
|
+
result.message = json.message || "";
|
|
219
|
+
result.code = json.code || "";
|
|
220
|
+
}
|
|
221
|
+
return result;
|
|
222
|
+
} else {
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
exports.getAzureError = getAzureError;
|
|
227
|
+
function callIfKoHasValue(koVal, toCall) {
|
|
228
|
+
if (koPropertyHasValue(koVal)) {
|
|
229
|
+
toCall(koVal());
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
exports.callIfKoHasValue = callIfKoHasValue;
|
|
233
|
+
function stringArrayToStringMap(array) {
|
|
234
|
+
var stringMap = {};
|
|
235
|
+
array.forEach(function (key) {
|
|
236
|
+
stringMap[key] = true;
|
|
237
|
+
});
|
|
238
|
+
return stringMap;
|
|
239
|
+
}
|
|
240
|
+
exports.stringArrayToStringMap = stringArrayToStringMap;
|
|
241
|
+
function stringMapToStringArray(stringMap) {
|
|
242
|
+
var keys = [];
|
|
243
|
+
for (var key in stringMap) {
|
|
244
|
+
keys.push(key);
|
|
245
|
+
}
|
|
246
|
+
return keys;
|
|
247
|
+
}
|
|
248
|
+
exports.stringMapToStringArray = stringMapToStringArray;
|
|
249
|
+
function stringMapToValueArray(stringMap) {
|
|
250
|
+
var values = [];
|
|
251
|
+
for (var key in stringMap) {
|
|
252
|
+
values.push(stringMap[key]);
|
|
253
|
+
}
|
|
254
|
+
return values;
|
|
255
|
+
}
|
|
256
|
+
exports.stringMapToValueArray = stringMapToValueArray;
|
|
257
|
+
function shallowEqualityCheck(firstArray, secondArray) {
|
|
258
|
+
if (firstArray.length !== secondArray.length) {
|
|
259
|
+
return false;
|
|
260
|
+
}
|
|
261
|
+
for (var i = 0; i < firstArray.length; i++) {
|
|
262
|
+
if (firstArray[i] !== secondArray[i]) {
|
|
263
|
+
return false;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
return true;
|
|
267
|
+
}
|
|
268
|
+
exports.shallowEqualityCheck = shallowEqualityCheck;
|
|
269
|
+
function escapeHtml(input) {
|
|
270
|
+
return input
|
|
271
|
+
.replace(/&/g, "&")
|
|
272
|
+
.replace(/</g, "<")
|
|
273
|
+
.replace(/>/g, ">")
|
|
274
|
+
.replace(/"/g, """)
|
|
275
|
+
.replace(/'/g, "'")
|
|
276
|
+
.replace(/\//g, "/");
|
|
277
|
+
}
|
|
278
|
+
exports.escapeHtml = escapeHtml;
|
|
279
|
+
exports.entityNameRegex = /^([a-z]|[0-9]|_)([^.+?\/<>*%&:\\]){0,259}$/i;
|
|
280
|
+
function first(array, callback) {
|
|
281
|
+
var retVal = null;
|
|
282
|
+
array.some(function (val) {
|
|
283
|
+
if (callback(val)) {
|
|
284
|
+
retVal = val;
|
|
285
|
+
return true;
|
|
286
|
+
} else {
|
|
287
|
+
return false;
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
return retVal;
|
|
291
|
+
}
|
|
292
|
+
exports.first = first;
|
|
293
|
+
function tryParseJson(valToTry) {
|
|
294
|
+
try {
|
|
295
|
+
return JSON.parse(valToTry);
|
|
296
|
+
} catch (e) {
|
|
297
|
+
return undefined;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
exports.tryParseJson = tryParseJson;
|
|
301
|
+
function formatDataSize(size, precision) {
|
|
302
|
+
if (precision === void 0) {
|
|
303
|
+
precision = 3;
|
|
304
|
+
}
|
|
305
|
+
var units = [
|
|
306
|
+
ClientResources.unitBytesFull,
|
|
307
|
+
ClientResources.unitKilobytesShort,
|
|
308
|
+
ClientResources.unitMegabytesShort,
|
|
309
|
+
ClientResources.unitGigabytesShort,
|
|
310
|
+
ClientResources.unitTerabytesShort,
|
|
311
|
+
ClientResources.unitPetabytesShort,
|
|
312
|
+
];
|
|
313
|
+
if (size < 0) {
|
|
314
|
+
throw new Error("formatDataSize: Data size cannot be less than zero.");
|
|
315
|
+
}
|
|
316
|
+
var prefixDivisor = 1;
|
|
317
|
+
var sizeInPrefix;
|
|
318
|
+
for (var i = 0; i < units.length; i++) {
|
|
319
|
+
if (size < 1024 * prefixDivisor || i === units.length - 1) {
|
|
320
|
+
sizeInPrefix = size / prefixDivisor;
|
|
321
|
+
if (i === 0 || i === units.length - 1) {
|
|
322
|
+
return units[i].format(Math.round(sizeInPrefix));
|
|
323
|
+
} else {
|
|
324
|
+
return units[i].format(sizeInPrefix.toPrecision(precision));
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
prefixDivisor *= 1024;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
exports.formatDataSize = formatDataSize;
|
|
331
|
+
});
|
|
332
|
+
//# sourceMappingURL=Util.js.map
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
define(["require", "exports", "Hulljs", "../Util/Log"], function (
|
|
2
|
+
require,
|
|
3
|
+
exports,
|
|
4
|
+
Hulljs,
|
|
5
|
+
Log
|
|
6
|
+
) {
|
|
7
|
+
"use strict";
|
|
8
|
+
var logger = Log.getLogger({
|
|
9
|
+
loggerName: "HoverFlyout",
|
|
10
|
+
});
|
|
11
|
+
exports.ACTION_FOR_SHOW = "mouseenter";
|
|
12
|
+
exports.FLYOUT_SHOW_DELAY_MS = 200;
|
|
13
|
+
var flyoutClickeaterSelector = ".win-flyoutmenuclickeater";
|
|
14
|
+
var afterFlyoutShows, beforeFlyoutHides;
|
|
15
|
+
function setupFlyoutAutohide(flyout, anchor) {
|
|
16
|
+
var clickEaterMouseMoveListener;
|
|
17
|
+
var clickEaterElement = $(flyoutClickeaterSelector)[0];
|
|
18
|
+
var boundedConvexPolygon = null;
|
|
19
|
+
afterFlyoutShows = function () {
|
|
20
|
+
flyout.addEventListener("beforehide", beforeFlyoutHides);
|
|
21
|
+
var verticesToCover = getRectVertices(
|
|
22
|
+
flyout.element.getBoundingClientRect()
|
|
23
|
+
);
|
|
24
|
+
verticesToCover = verticesToCover.concat(
|
|
25
|
+
getRectVertices(anchor.getBoundingClientRect())
|
|
26
|
+
);
|
|
27
|
+
boundedConvexPolygon = Hulljs(verticesToCover, Infinity, [".x", ".y"]);
|
|
28
|
+
clickEaterElement.addEventListener(
|
|
29
|
+
"mousemove",
|
|
30
|
+
clickEaterMouseMoveListener
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
flyout.addEventListener("aftershow", afterFlyoutShows);
|
|
34
|
+
beforeFlyoutHides = function () {
|
|
35
|
+
clickEaterElement.removeEventListener(
|
|
36
|
+
"mousemove",
|
|
37
|
+
clickEaterMouseMoveListener
|
|
38
|
+
);
|
|
39
|
+
boundedConvexPolygon = null;
|
|
40
|
+
flyout.removeEventListener("aftershow", afterFlyoutShows);
|
|
41
|
+
flyout.removeEventListener("beforehide", beforeFlyoutHides);
|
|
42
|
+
};
|
|
43
|
+
clickEaterMouseMoveListener = function (mouseevent) {
|
|
44
|
+
var curPos = { x: mouseevent.clientX, y: mouseevent.clientY };
|
|
45
|
+
if (!isPointInsideConvexPolygon(curPos, boundedConvexPolygon)) {
|
|
46
|
+
flyout.hide();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
exports.setupFlyoutAutohide = setupFlyoutAutohide;
|
|
51
|
+
function removeListenersForElement(element) {
|
|
52
|
+
element.removeEventListener("aftershow", afterFlyoutShows);
|
|
53
|
+
element.removeEventListener("beforehide", beforeFlyoutHides);
|
|
54
|
+
}
|
|
55
|
+
exports.removeListenersForElement = removeListenersForElement;
|
|
56
|
+
function getRectVertices(clientRect) {
|
|
57
|
+
var x1 = clientRect.left;
|
|
58
|
+
var x2 = clientRect.left + clientRect.width;
|
|
59
|
+
var y1 = clientRect.top;
|
|
60
|
+
var y2 = clientRect.top + clientRect.height;
|
|
61
|
+
return [
|
|
62
|
+
{ x: x1, y: y1 },
|
|
63
|
+
{ x: x2, y: y1 },
|
|
64
|
+
{ x: x2, y: y2 },
|
|
65
|
+
{ x: x1, y: y2 },
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
function isPointInsideConvexPolygon(p, polygon) {
|
|
69
|
+
if (polygon.length < 3) {
|
|
70
|
+
logger.logError("Too few points specified for polygon");
|
|
71
|
+
}
|
|
72
|
+
var centroid = { x: 0, y: 0 };
|
|
73
|
+
for (var i = 0; i < polygon.length; i++) {
|
|
74
|
+
centroid.x += polygon[i].x / polygon.length;
|
|
75
|
+
centroid.y += polygon[i].y / polygon.length;
|
|
76
|
+
}
|
|
77
|
+
for (var i = 0; i < polygon.length; i++) {
|
|
78
|
+
var a = polygon[i];
|
|
79
|
+
var b = polygon[(i + 1) % polygon.length];
|
|
80
|
+
if (sideSign(p, a, b) * sideSign(centroid, a, b) < 0) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
function sideSign(a, l1, l2) {
|
|
87
|
+
var mf = l1.y - l2.y;
|
|
88
|
+
var mc = l2.y * l1.x - l1.y * l2.x;
|
|
89
|
+
return mf * a.x + mc - a.y * (l1.x - l2.x);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
//# sourceMappingURL=HoverFlyout.js.map
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
define(["require", "exports", "../Framework/Util/Log"], function (
|
|
2
|
+
require,
|
|
3
|
+
exports,
|
|
4
|
+
Log
|
|
5
|
+
) {
|
|
6
|
+
"use strict";
|
|
7
|
+
var logger = Log.getLogger({
|
|
8
|
+
loggerName: "ErrorHandler",
|
|
9
|
+
});
|
|
10
|
+
var ErrorHandler = (function () {
|
|
11
|
+
function ErrorHandler(appContext) {
|
|
12
|
+
this._permissionDenied = false;
|
|
13
|
+
this._appContext = appContext;
|
|
14
|
+
}
|
|
15
|
+
ErrorHandler.prototype.makeResourceFailedHandler = function (
|
|
16
|
+
resource,
|
|
17
|
+
url,
|
|
18
|
+
deferred
|
|
19
|
+
) {
|
|
20
|
+
var _this = this;
|
|
21
|
+
return function (error) {
|
|
22
|
+
var title = null,
|
|
23
|
+
html = null,
|
|
24
|
+
handler = null;
|
|
25
|
+
url = url || error.requestUrl || "No url specified in handler!";
|
|
26
|
+
var isUserError = false;
|
|
27
|
+
if (error.responseJSON) {
|
|
28
|
+
var code = error.responseJSON.code || error.responseJSON.error.code;
|
|
29
|
+
if (code) {
|
|
30
|
+
switch (code) {
|
|
31
|
+
case "InvalidSubscriptionId":
|
|
32
|
+
case "SubscriptionNotFound":
|
|
33
|
+
title = ClientResources.subscriptionNotFound;
|
|
34
|
+
html =
|
|
35
|
+
ClientResources.subscriptionNotFoundErrorMessageText.format(
|
|
36
|
+
_this._appContext.splitFactoryId().subscriptionId
|
|
37
|
+
);
|
|
38
|
+
handler = function (result) {
|
|
39
|
+
window.location.reload();
|
|
40
|
+
};
|
|
41
|
+
break;
|
|
42
|
+
case "AuthenticationFailed":
|
|
43
|
+
if (_this._permissionDenied) {
|
|
44
|
+
return;
|
|
45
|
+
} else {
|
|
46
|
+
_this._permissionDenied = true;
|
|
47
|
+
title = ClientResources.permissionDenied;
|
|
48
|
+
html =
|
|
49
|
+
ClientResources.resourcePermissionFaliedMessageText.format(
|
|
50
|
+
_this._appContext.splitFactoryId().dataFactoryName
|
|
51
|
+
);
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
case "ResourceNotFound":
|
|
55
|
+
title = ClientResources.resourceNotFound;
|
|
56
|
+
html = ClientResources.resourceNotFoundMessageText.format(
|
|
57
|
+
resource,
|
|
58
|
+
_this._appContext.splitFactoryId().dataFactoryName
|
|
59
|
+
);
|
|
60
|
+
break;
|
|
61
|
+
case "TableSliceOutOfRange":
|
|
62
|
+
title = ClientResources.tableSliceOutOfRange;
|
|
63
|
+
html =
|
|
64
|
+
error.responseJSON.message ||
|
|
65
|
+
error.responseJSON.error.message;
|
|
66
|
+
break;
|
|
67
|
+
case "AuthorizationFailed":
|
|
68
|
+
title = ClientResources.authorizationFailed;
|
|
69
|
+
html = html =
|
|
70
|
+
error.responseJSON.message ||
|
|
71
|
+
error.responseJSON.error.message;
|
|
72
|
+
break;
|
|
73
|
+
default:
|
|
74
|
+
title = ClientResources.errorOccurredTitle;
|
|
75
|
+
html =
|
|
76
|
+
error.responseJSON.message ||
|
|
77
|
+
error.responseJSON.error.message ||
|
|
78
|
+
ClientResources.resourceUnknownErrorMessageText.format(
|
|
79
|
+
resource,
|
|
80
|
+
_this._appContext.splitFactoryId().dataFactoryName
|
|
81
|
+
);
|
|
82
|
+
logger.logError("Unhandled backend error code: " + code);
|
|
83
|
+
}
|
|
84
|
+
if (isUserError) {
|
|
85
|
+
logger.logInfo(
|
|
86
|
+
"User error (code: {0}, url: {1}): {2}".format(
|
|
87
|
+
error.status,
|
|
88
|
+
url,
|
|
89
|
+
error.response
|
|
90
|
+
)
|
|
91
|
+
);
|
|
92
|
+
} else {
|
|
93
|
+
logger.logError(
|
|
94
|
+
"ADF backend error (code: {0}, url: {1}): {2}".format(
|
|
95
|
+
error.status,
|
|
96
|
+
url,
|
|
97
|
+
error.response
|
|
98
|
+
)
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (!title) {
|
|
104
|
+
switch (error.status) {
|
|
105
|
+
case 401:
|
|
106
|
+
case 403:
|
|
107
|
+
if (_this._permissionDenied) {
|
|
108
|
+
return;
|
|
109
|
+
} else {
|
|
110
|
+
_this._permissionDenied = true;
|
|
111
|
+
title = ClientResources.permissionDenied;
|
|
112
|
+
html =
|
|
113
|
+
ClientResources.resourcePermissionFaliedMessageText.format(
|
|
114
|
+
_this._appContext.splitFactoryId().dataFactoryName
|
|
115
|
+
);
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
case 404:
|
|
119
|
+
title = ClientResources.resourceNotFound;
|
|
120
|
+
html = ClientResources.resourceNotFoundMessageText.format(
|
|
121
|
+
resource,
|
|
122
|
+
_this._appContext.splitFactoryId().dataFactoryName
|
|
123
|
+
);
|
|
124
|
+
break;
|
|
125
|
+
default:
|
|
126
|
+
title = ClientResources.unknownError;
|
|
127
|
+
html = ClientResources.resourceUnknownErrorMessageText.format(
|
|
128
|
+
resource,
|
|
129
|
+
_this._appContext.splitFactoryId().dataFactoryName
|
|
130
|
+
);
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (!handler) {
|
|
135
|
+
handler = function (result) {};
|
|
136
|
+
}
|
|
137
|
+
if (isUserError) {
|
|
138
|
+
logger.logInfo(
|
|
139
|
+
'Resource error shown to user: {title: "{0}", message: "{1}", url: {2}}'.format(
|
|
140
|
+
title,
|
|
141
|
+
html,
|
|
142
|
+
url
|
|
143
|
+
)
|
|
144
|
+
);
|
|
145
|
+
} else {
|
|
146
|
+
logger.logError(
|
|
147
|
+
'Resource error shown to user: {title: "{0}", message: "{1}", url: {2}}'.format(
|
|
148
|
+
title,
|
|
149
|
+
html,
|
|
150
|
+
url
|
|
151
|
+
)
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
html = html.replace(/\n/g, "<br/>");
|
|
155
|
+
error.clientsideErrorMessage = html;
|
|
156
|
+
_this._appContext.dialogHandler.addRequest(
|
|
157
|
+
{
|
|
158
|
+
title: title,
|
|
159
|
+
innerHTML: html,
|
|
160
|
+
dismissalHandler: handler,
|
|
161
|
+
primaryCommandText: ClientResources.ok,
|
|
162
|
+
},
|
|
163
|
+
true
|
|
164
|
+
);
|
|
165
|
+
if (!deferred) {
|
|
166
|
+
throw error;
|
|
167
|
+
}
|
|
168
|
+
deferred.reject(error);
|
|
169
|
+
return deferred.promise;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
return ErrorHandler;
|
|
173
|
+
})();
|
|
174
|
+
exports.ErrorHandler = ErrorHandler;
|
|
175
|
+
});
|
|
176
|
+
//# sourceMappingURL=ErrorHandler.js.map
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
var __extends =
|
|
2
|
+
(this && this.__extends) ||
|
|
3
|
+
function (d, b) {
|
|
4
|
+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
5
|
+
function __() {
|
|
6
|
+
this.constructor = d;
|
|
7
|
+
}
|
|
8
|
+
d.prototype =
|
|
9
|
+
b === null ? Object.create(b) : ((__.prototype = b.prototype), new __());
|
|
10
|
+
};
|
|
11
|
+
define(["require", "exports"], function (require, exports) {
|
|
12
|
+
"use strict";
|
|
13
|
+
var MessageHandler = (function () {
|
|
14
|
+
function MessageHandler() {
|
|
15
|
+
this.state = null;
|
|
16
|
+
this.subscribers = {};
|
|
17
|
+
}
|
|
18
|
+
MessageHandler.prototype.pushState = function (
|
|
19
|
+
publisherName,
|
|
20
|
+
newState,
|
|
21
|
+
listeners
|
|
22
|
+
) {
|
|
23
|
+
if (listeners === void 0) {
|
|
24
|
+
listeners = null;
|
|
25
|
+
}
|
|
26
|
+
this.state = newState;
|
|
27
|
+
if (listeners === null) {
|
|
28
|
+
listeners = Object.keys(this.subscribers);
|
|
29
|
+
}
|
|
30
|
+
this.notifySubscribers(publisherName, listeners);
|
|
31
|
+
};
|
|
32
|
+
MessageHandler.prototype.register = function (newSubscriber) {
|
|
33
|
+
var subscriptions = [];
|
|
34
|
+
if (!(newSubscriber.name in this.subscribers)) {
|
|
35
|
+
this.subscribers[newSubscriber.name] = subscriptions;
|
|
36
|
+
} else {
|
|
37
|
+
subscriptions = this.subscribers[newSubscriber.name];
|
|
38
|
+
}
|
|
39
|
+
subscriptions.push(newSubscriber);
|
|
40
|
+
};
|
|
41
|
+
MessageHandler.prototype.unregister = function (oldSubscriber) {
|
|
42
|
+
if (!(oldSubscriber.name in this.subscribers)) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
var index = this.subscribers[oldSubscriber.name].indexOf(oldSubscriber);
|
|
46
|
+
if (index !== -1) {
|
|
47
|
+
this.subscribers[oldSubscriber.name].splice(index, 1);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
MessageHandler.prototype.getState = function () {
|
|
51
|
+
return this.state;
|
|
52
|
+
};
|
|
53
|
+
MessageHandler.prototype.notifySubscribers = function (
|
|
54
|
+
publisherName,
|
|
55
|
+
subscriberNames
|
|
56
|
+
) {
|
|
57
|
+
var _this = this;
|
|
58
|
+
subscriberNames.forEach(function (name) {
|
|
59
|
+
if (name === publisherName) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
_this.subscribers[name].forEach(function (subscriber) {
|
|
63
|
+
subscriber.callback(_this.state, publisherName);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
return MessageHandler;
|
|
68
|
+
})();
|
|
69
|
+
exports.MessageHandler = MessageHandler;
|
|
70
|
+
var DefaultMessageHandler = (function (_super) {
|
|
71
|
+
__extends(DefaultMessageHandler, _super);
|
|
72
|
+
function DefaultMessageHandler(defaultState, isEmpty) {
|
|
73
|
+
_super.call(this);
|
|
74
|
+
this.isEmpty = isEmpty;
|
|
75
|
+
this.setDefaultState(defaultState);
|
|
76
|
+
}
|
|
77
|
+
DefaultMessageHandler.prototype.pushState = function (
|
|
78
|
+
publisherName,
|
|
79
|
+
newState,
|
|
80
|
+
listeners
|
|
81
|
+
) {
|
|
82
|
+
if (listeners === void 0) {
|
|
83
|
+
listeners = null;
|
|
84
|
+
}
|
|
85
|
+
if (this.isEmpty(newState)) {
|
|
86
|
+
newState = this.defaultState;
|
|
87
|
+
}
|
|
88
|
+
_super.prototype.pushState.call(this, publisherName, newState, listeners);
|
|
89
|
+
};
|
|
90
|
+
DefaultMessageHandler.prototype.setDefaultState = function (state) {
|
|
91
|
+
this.defaultState = state;
|
|
92
|
+
if (this.isEmpty(this.state)) {
|
|
93
|
+
this.state = state;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
return DefaultMessageHandler;
|
|
97
|
+
})(MessageHandler);
|
|
98
|
+
var SelectionHandler = (function (_super) {
|
|
99
|
+
__extends(SelectionHandler, _super);
|
|
100
|
+
function SelectionHandler() {
|
|
101
|
+
_super.apply(this, arguments);
|
|
102
|
+
}
|
|
103
|
+
return SelectionHandler;
|
|
104
|
+
})(DefaultMessageHandler);
|
|
105
|
+
exports.SelectionHandler = SelectionHandler;
|
|
106
|
+
var ActivityRunUpdateHandler = (function (_super) {
|
|
107
|
+
__extends(ActivityRunUpdateHandler, _super);
|
|
108
|
+
function ActivityRunUpdateHandler() {
|
|
109
|
+
_super.apply(this, arguments);
|
|
110
|
+
}
|
|
111
|
+
return ActivityRunUpdateHandler;
|
|
112
|
+
})(MessageHandler);
|
|
113
|
+
exports.ActivityRunUpdateHandler = ActivityRunUpdateHandler;
|
|
114
|
+
});
|
|
115
|
+
//# sourceMappingURL=MessageHandler.js.map
|