From 63986854a2ea1a455223a33ce18288ccaefbac4c Mon Sep 17 00:00:00 2001 From: William Reynolds Date: Mon, 25 Sep 2017 19:38:08 -0600 Subject: [PATCH 1/5] Initial hack at deep-copy improvements for large number of records. --- package-lock.json | 930 +---------------------------- package.json | 2 +- src/index.html | 1 + src/js/lib/bootstrap-notify.min.js | 78 +++ src/js/main.js | 215 +++++-- 5 files changed, 267 insertions(+), 959 deletions(-) create mode 100644 src/js/lib/bootstrap-notify.min.js diff --git a/package-lock.json b/package-lock.json index b9ddfd9..9238523 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ago-assistant", - "version": "2.7.2", + "version": "2.8.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1454,7 +1454,6 @@ "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", - "dev": true, "requires": { "babel-runtime": "6.26.0", "core-js": "2.5.0", @@ -1465,7 +1464,6 @@ "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", - "dev": true, "requires": { "core-js": "2.5.0", "regenerator-runtime": "0.11.0" @@ -1474,22 +1472,19 @@ "regenerator-runtime": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz", - "integrity": "sha512-/aA0kLeRb5N9K0d4fw7ooEbI+xDe+DKD499EQqygGqeS8N3xto15p09uY2xj7ixP81sNPXvRLnAQIqdVStgb1A==", - "dev": true + "integrity": "sha512-/aA0kLeRb5N9K0d4fw7ooEbI+xDe+DKD499EQqygGqeS8N3xto15p09uY2xj7ixP81sNPXvRLnAQIqdVStgb1A==" } } }, "core-js": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.0.tgz", - "integrity": "sha1-VpwFCRi+ZIazg3VSAorgRmtxcIY=", - "dev": true + "integrity": "sha1-VpwFCRi+ZIazg3VSAorgRmtxcIY=" }, "regenerator-runtime": { "version": "0.10.5", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", - "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", - "dev": true + "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=" } } }, @@ -2280,7 +2275,6 @@ "requires": { "anymatch": "1.3.2", "async-each": "1.0.1", - "fsevents": "1.1.2", "glob-parent": "2.0.0", "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "is-binary-path": "1.0.1", @@ -3161,905 +3155,6 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "fsevents": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz", - "integrity": "sha512-Sn44E5wQW4bTHXvQmvSHwqbuiXtduD6Rrjm2ZtUEGbyrig+nUH3t/QD4M4/ZXViY556TBpRgZkHLDx3JxPwxiw==", - "dev": true, - "optional": true, - "requires": { - "nan": "2.7.0", - "node-pre-gyp": "0.6.36" - }, - "dependencies": { - "abbrev": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "ajv": { - "version": "4.11.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" - } - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "aproba": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "1.0.0", - "readable-stream": "2.2.9" - } - }, - "asn1": { - "version": "0.2.3", - "bundled": true, - "dev": true, - "optional": true - }, - "assert-plus": { - "version": "0.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "asynckit": { - "version": "0.4.0", - "bundled": true, - "dev": true, - "optional": true - }, - "aws-sign2": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "aws4": { - "version": "1.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "balanced-match": { - "version": "0.4.2", - "bundled": true, - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "tweetnacl": "0.14.5" - } - }, - "block-stream": { - "version": "0.0.9", - "bundled": true, - "dev": true, - "requires": { - "inherits": "2.0.3" - } - }, - "boom": { - "version": "2.10.1", - "bundled": true, - "dev": true, - "requires": { - "hoek": "2.16.3" - } - }, - "brace-expansion": { - "version": "1.1.7", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "0.4.2", - "concat-map": "0.0.1" - } - }, - "buffer-shims": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "caseless": { - "version": "0.12.0", - "bundled": true, - "dev": true, - "optional": true - }, - "co": { - "version": "4.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "combined-stream": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "requires": { - "delayed-stream": "1.0.0" - } - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "cryptiles": { - "version": "2.0.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "boom": "2.10.1" - } - }, - "dashdash": { - "version": "1.14.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "debug": { - "version": "2.6.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.4.2", - "bundled": true, - "dev": true, - "optional": true - }, - "delayed-stream": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "ecc-jsbn": { - "version": "0.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "extend": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "extsprintf": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "forever-agent": { - "version": "0.6.1", - "bundled": true, - "dev": true, - "optional": true - }, - "form-data": { - "version": "2.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.15" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "fstream": { - "version": "1.0.11", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "inherits": "2.0.3", - "mkdirp": "0.5.1", - "rimraf": "2.6.1" - } - }, - "fstream-ignore": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fstream": "1.0.11", - "inherits": "2.0.3", - "minimatch": "3.0.4" - } - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "1.1.1", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.2" - } - }, - "getpass": { - "version": "0.1.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "graceful-fs": { - "version": "4.1.11", - "bundled": true, - "dev": true - }, - "har-schema": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "optional": true - }, - "har-validator": { - "version": "4.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ajv": "4.11.8", - "har-schema": "1.0.5" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "hawk": { - "version": "3.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" - } - }, - "hoek": { - "version": "2.16.3", - "bundled": true, - "dev": true - }, - "http-signature": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.0", - "sshpk": "1.13.0" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "ini": { - "version": "1.3.4", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "is-typedarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "isstream": { - "version": "0.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "jodid25519": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "jsbn": { - "version": "0.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "json-schema": { - "version": "0.2.3", - "bundled": true, - "dev": true, - "optional": true - }, - "json-stable-stringify": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsonify": "0.0.0" - } - }, - "json-stringify-safe": { - "version": "5.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "jsonify": { - "version": "0.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "jsprim": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.0.2", - "json-schema": "0.2.3", - "verror": "1.3.6" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "mime-db": { - "version": "1.27.0", - "bundled": true, - "dev": true - }, - "mime-types": { - "version": "2.1.15", - "bundled": true, - "dev": true, - "requires": { - "mime-db": "1.27.0" - } - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "node-pre-gyp": { - "version": "0.6.36", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "mkdirp": "0.5.1", - "nopt": "4.0.1", - "npmlog": "4.1.0", - "rc": "1.2.1", - "request": "2.81.0", - "rimraf": "2.6.1", - "semver": "5.3.0", - "tar": "2.2.1", - "tar-pack": "3.4.0" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1.1.0", - "osenv": "0.1.4" - } - }, - "npmlog": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "1.1.4", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "oauth-sign": { - "version": "0.8.2", - "bundled": true, - "dev": true, - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "performance-now": { - "version": "0.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "1.0.7", - "bundled": true, - "dev": true - }, - "punycode": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "optional": true - }, - "qs": { - "version": "6.4.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "0.4.2", - "ini": "1.3.4", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.2.9", - "bundled": true, - "dev": true, - "requires": { - "buffer-shims": "1.0.0", - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "1.0.1", - "util-deprecate": "1.0.2" - } - }, - "request": { - "version": "2.81.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "4.2.1", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.15", - "oauth-sign": "0.8.2", - "performance-now": "0.2.0", - "qs": "6.4.0", - "safe-buffer": "5.0.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.2", - "tunnel-agent": "0.6.0", - "uuid": "3.0.1" - } - }, - "rimraf": { - "version": "2.6.1", - "bundled": true, - "dev": true, - "requires": { - "glob": "7.1.2" - } - }, - "safe-buffer": { - "version": "5.0.1", - "bundled": true, - "dev": true - }, - "semver": { - "version": "5.3.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sntp": { - "version": "1.0.9", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "hoek": "2.16.3" - } - }, - "sshpk": { - "version": "1.13.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jodid25519": "1.0.2", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "string_decoder": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "5.0.1" - } - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "stringstream": { - "version": "0.0.5", - "bundled": true, - "dev": true, - "optional": true - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "2.2.1", - "bundled": true, - "dev": true, - "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.11", - "inherits": "2.0.3" - } - }, - "tar-pack": { - "version": "3.4.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "2.6.8", - "fstream": "1.0.11", - "fstream-ignore": "1.0.5", - "once": "1.4.0", - "readable-stream": "2.2.9", - "rimraf": "2.6.1", - "tar": "2.2.1", - "uid-number": "0.0.6" - } - }, - "tough-cookie": { - "version": "2.3.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "punycode": "1.4.1" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "bundled": true, - "dev": true, - "optional": true - }, - "uid-number": { - "version": "0.0.6", - "bundled": true, - "dev": true, - "optional": true - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "uuid": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "verror": { - "version": "1.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "extsprintf": "1.0.2" - } - }, - "wide-align": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - } - } - }, "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", @@ -4916,13 +4011,6 @@ "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", "dev": true }, - "nan": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.7.0.tgz", - "integrity": "sha1-2Vv3IeyHfgjbJ27T/G63j5CDrUY=", - "dev": true, - "optional": true - }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -5974,11 +5062,6 @@ "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=", "dev": true }, - "string_decoder": { - "version": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, "string-similarity": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/string-similarity/-/string-similarity-1.2.0.tgz", @@ -5998,6 +5081,11 @@ "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" } }, + "string_decoder": { + "version": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, "strip-ansi": { "version": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", diff --git a/package.json b/package.json index b16eab5..9b7aef0 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "url": "https://github.com/Esri/ago-assistant.git" }, "config": { - "appId": "4E1s0Mv5r0c2l6W8", + "appId": "gTU08ExBxqo5u3aI", "portalUrl": "https://www.arcgis.com" }, "scripts": { diff --git a/src/index.html b/src/index.html index a98bd3b..fab1bbd 100644 --- a/src/index.html +++ b/src/index.html @@ -461,6 +461,7 @@

Copy information

{name: "jquery.ui", location: location.pathname.replace(/\/[^/]*$/, '') + "/js/lib", main: "jquery-ui-1.11.4.min"}, {name: "jquery.bootstrap", location: location.pathname.replace(/\/[^/]*$/, '') + "/js/lib/bootstrap/js", main: "bootstrap-3.3.4.min"}, {name: "bootstrap-shim", location: location.pathname.replace(/\/[^/]*$/, '') + "/js/lib", main: "bootstrap-shim"}, + {name: "bootstrap-notify", location: location.pathname.replace(/\/[^/]*$/, '') + "/js/lib", main: "bootstrap-notify.min"}, {name: "mustache", location: location.pathname.replace(/\/[^/]*$/, '') + "/js/lib", main: "mustache-0.7.2"}, {name: "nprogress", location: location.pathname.replace(/\/[^/]*$/, '') + "/js/lib", main: "nprogress-0.1.6"}, {name: "highlight", location: location.pathname.replace(/\/[^/]*$/, '') + "/js/lib", main: "highlight-8.3.min"}, diff --git a/src/js/lib/bootstrap-notify.min.js b/src/js/lib/bootstrap-notify.min.js new file mode 100644 index 0000000..399b6c8 --- /dev/null +++ b/src/js/lib/bootstrap-notify.min.js @@ -0,0 +1,78 @@ +/* Project: Bootstrap Growl = v3.1.3 | Description: Turns standard Bootstrap alerts into "Growl-like" notifications. | Author: Mouse0270 aka Robert McIntosh | License: MIT License | Website: https://github.com/mouse0270/bootstrap-growl */ +!function(t) { +"function" == typeof define && define.amd ? define(["jquery"], t):t("object" == typeof exports ? require("jquery"):jQuery) +; }(function(t) { + function e(e, i, n) { + var i = {content: {message: "object" == typeof i ? i.message:i, title: i.title ? i.title:"", icon: i.icon ? i.icon:"", url: i.url ? i.url:"#", target: i.target ? i.target:"-"}};n = t.extend(!0, {}, i, n), this.settings = t.extend(!0, {}, s, n), this._defaults = s, "-" == this.settings.content.target && (this.settings.content.target = this.settings.url_target), this.animations = {start: "webkitAnimationStart oanimationstart MSAnimationStart animationstart", end: "webkitAnimationEnd oanimationend MSAnimationEnd animationend"}, "number" == typeof this.settings.offset && (this.settings.offset = {x: this.settings.offset, y: this.settings.offset}), this.init(); +} var s = {element: "body", position: null, type: "info", allow_dismiss: !0, newest_on_top: !1, showProgressbar: !1, placement: {from: "top", align: "right"}, offset: 20, spacing: 10, z_index: 1031, delay: 5e3, timer: 1e3, url_target: "_blank", mouse_over: null, animate: {enter: "animated fadeInDown", exit: "animated fadeOutUp"}, onShow: null, onShown: null, onClose: null, onClosed: null, icon_type: "class", template: "
{1} {2}
"};String.format = function() { +for (var t = arguments[0], e = 1;e < arguments.length;e++)t = t.replace(RegExp("\\{" + (e - 1) + "\\}", "gm"), arguments[e]);return t; + }, t.extend(e.prototype, {init: function() { +var t = this;this.buildNotify(), this.settings.content.icon && this.setIcon(), "#" != this.settings.content.url && this.styleURL(), this.placement(), this.bind(), this.notify = {$ele: this.$ele, update: function(e, s) { +var i = {};"string" == typeof e ? i[e] = s:i = e;for (var e in i) switch(e) { + case "type":this.$ele.removeClass("alert-" + t.settings.type), this.$ele.find("[data-notify=\"progressbar\"] > .progress-bar").removeClass("progress-bar-" + t.settings.type), t.settings.type = i[e], this.$ele.addClass("alert-" + i[e]).find("[data-notify=\"progressbar\"] > .progress-bar").addClass("progress-bar-" + i[e]);break;case "icon":var n = this.$ele.find("[data-notify=\"icon\"]");"class" == t.settings.icon_type.toLowerCase() ? n.removeClass(t.settings.content.icon).addClass(i[e]):(n.is("img") || n.find("img"), n.attr("src", i[e]));break;case "progress":var a = t.settings.delay - t.settings.delay * (i[e] / 100);this.$ele.data("notify-delay", a), this.$ele.find("[data-notify=\"progressbar\"] > div").attr("aria-valuenow", i[e]).css("width", i[e] + "%");break;case "url":this.$ele.find("[data-notify=\"url\"]").attr("href", i[e]);break;case "target":this.$ele.find("[data-notify=\"url\"]").attr("target", i[e]);break;default:this.$ele.find("[data-notify=\"" + e + "\"]").html(i[e]) +;} var o = this.$ele.outerHeight() + parseInt(t.settings.spacing) + parseInt(t.settings.offset.y);t.reposition(o) + ;}, close: function() { + t.close(); +}} +;}, buildNotify: function() { +var e = this.settings.content;this.$ele = t(String.format(this.settings.template, this.settings.type, e.title, e.message, e.url, e.target)), this.$ele.attr("data-notify-position", this.settings.placement.from + "-" + this.settings.placement.align), this.settings.allow_dismiss || this.$ele.find("[data-notify=\"dismiss\"]").css("display", "none"), (this.settings.delay <= 0 && !this.settings.showProgressbar || !this.settings.showProgressbar) && this.$ele.find("[data-notify=\"progressbar\"]").remove() ; +}, setIcon: function() { +"class" == this.settings.icon_type.toLowerCase() ? this.$ele.find("[data-notify=\"icon\"]").addClass(this.settings.content.icon):this.$ele.find("[data-notify=\"icon\"]").is("img") ? this.$ele.find("[data-notify=\"icon\"]").attr("src", this.settings.content.icon):this.$ele.find("[data-notify=\"icon\"]").append("\"Notify") ; +}, styleURL: function() { +this.$ele.find("[data-notify=\"url\"]").css({backgroundImage: "url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)", height: "100%", left: "0px", position: "absolute", top: "0px", width: "100%", zIndex: this.settings.z_index + 1}), this.$ele.find("[data-notify=\"dismiss\"]").css({position: "absolute", right: "10px", top: "5px", zIndex: this.settings.z_index + 2}); +}, placement: function() { +var e = this, +s = this.settings.offset.y, +i = {display: "inline-block", margin: "0px auto", position: this.settings.position ? this.settings.position:"body" === this.settings.element ? "fixed":"absolute", transition: "all .5s ease-in-out", zIndex: this.settings.z_index}, +n = !1, +a = this.settings;switch (t("[data-notify-position=\"" + this.settings.placement.from + "-" + this.settings.placement.align + "\"]:not([data-closing=\"true\"])").each(function() { +return s = Math.max(s, parseInt(t(this).css(a.placement.from)) + parseInt(t(this).outerHeight()) + parseInt(a.spacing)); + }), 1 == this.settings.newest_on_top && (s = this.settings.offset.y), i[this.settings.placement.from] = s + "px", this.settings.placement.align) { +case "left":case "right":i[this.settings.placement.align] = this.settings.offset.x + "px";break;case "center":i.left = 0, i.right = 0; + } this.$ele.css(i).addClass(this.settings.animate.enter), t.each(Array("webkit", "moz", "o", "ms", ""), function(t, s) { + e.$ele[0].style[s + "AnimationIterationCount"] = 1; + }), t(this.settings.element).append(this.$ele), 1 == this.settings.newest_on_top && (s = parseInt(s) + parseInt(this.settings.spacing) + this.$ele.outerHeight(), this.reposition(s)), t.isFunction(e.settings.onShow) && e.settings.onShow.call(this.$ele), this.$ele.one(this.animations.start, function() { + n = !0 ; +}).one(this.animations.end, function() { +t.isFunction(e.settings.onShown) && e.settings.onShown.call(this); + }), setTimeout(function() { +n || t.isFunction(e.settings.onShown) && e.settings.onShown.call(this) + ;}, 600) ; +}, bind: function() { +var e = this;if (this.$ele.find("[data-notify=\"dismiss\"]").on("click", function() { +e.close() +;}), this.$ele.mouseover(function() { +t(this).data("data-hover", "true") +; }).mouseout(function() { + t(this).data("data-hover", "false") +; }), this.$ele.data("data-hover", "false"), this.settings.delay > 0) { + e.$ele.data("notify-delay", e.settings.delay);var s = setInterval(function() { +var t = parseInt(e.$ele.data("notify-delay")) - e.settings.timer;if ("false" === e.$ele.data("data-hover") && "pause" == e.settings.mouse_over || "pause" != e.settings.mouse_over) { +var i = (e.settings.delay - t) / e.settings.delay * 100;e.$ele.data("notify-delay", t), e.$ele.find("[data-notify=\"progressbar\"] > div").attr("aria-valuenow", i).css("width", i + "%") +; }t <= -e.settings.timer && (clearInterval(s), e.close()); + }, e.settings.timer); +} + }, close: function() { +var e = this, + s = parseInt(this.$ele.css(this.settings.placement.from)), +i = !1;this.$ele.data("closing", "true").addClass(this.settings.animate.exit), e.reposition(s), t.isFunction(e.settings.onClose) && e.settings.onClose.call(this.$ele), this.$ele.one(this.animations.start, function() { +i = !0; + }).one(this.animations.end, function() { +t(this).remove(), t.isFunction(e.settings.onClosed) && e.settings.onClosed.call(this) ; +}), setTimeout(function() { +i || (e.$ele.remove(), e.settings.onClosed && e.settings.onClosed(e.$ele)) + ;}, 600) +; }, reposition: function(e) { + var s = this, +i = "[data-notify-position=\"" + this.settings.placement.from + "-" + this.settings.placement.align + "\"]:not([data-closing=\"true\"])", +n = this.$ele.nextAll(i);1 == this.settings.newest_on_top && (n = this.$ele.prevAll(i)), n.each(function() { + t(this).css(s.settings.placement.from, e), e = parseInt(e) + parseInt(s.settings.spacing) + t(this).outerHeight(); +}) ; +}}), t.notify = function(t, s) { +var i = new e(this, t, s);return i.notify +;}, t.notifyDefaults = function(e) { +return s = t.extend(!0, {}, s, e) +;}, t.notifyClose = function(e) { + "undefined" == typeof e || "all" == e ? t("[data-notify]").find("[data-notify=\"dismiss\"]").trigger("click"):t("[data-notify-position=\"" + e + "\"]").find("[data-notify=\"dismiss\"]").trigger("click") +;}; + }); diff --git a/src/js/main.js b/src/js/main.js index 481e60b..2fce169 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -9,7 +9,8 @@ require([ "clipboard", "highlight", "jquery.ui", - "bootstrap-shim" + "bootstrap-shim", + "bootstrap-notify" ], function( jquery, portalSelf, @@ -22,6 +23,28 @@ require([ hljs ) { + var unsaved = {}; + var isDirty = function() { + var dirty = false; + for (var key in unsaved) { + dirty = unsaved[key] || dirty; + } + return dirty; + }; + + window.onload = function() { + window.addEventListener("beforeunload", function(e) { + if (!isDirty()) { + return undefined; + } + + var confirmationMessage = "It looks like you have been editing something. " + + "If you leave before saving, your changes will be lost."; + (e || window.event).returnValue = confirmationMessage; // Gecko + IE + return confirmationMessage; // Gecko + Webkit, Safari, Chrome etc. + }); + }; + // *** ArcGIS OAuth *** var appInfo = new arcgisOAuthInfo({ appId: "", // Set this in config.json. @@ -846,12 +869,13 @@ require([ * item. Looks for a period in the name to indicate * that it is a file based item, e.g. roads.kmz. */ - var checkData = function(id, name){ + var checkData = function(id, name) { return new Promise(function(resolve, reject) { - if ((!name) || ((name) && (name.indexOf('.') < 0))) { + if ((!name) || ((name) && (name.indexOf(".") < 0))) { resolve(portal.itemData(id)); + } else { + resolve(null); } - else { resolve(null); } }); }; @@ -1426,6 +1450,7 @@ require([ // Preserve the icon and label on the cloned button. var clone = jquery("#" + id + "_clone"); + clone.find(".itemTitle").text(""); var span = jquery("#" + id + "_clone > span"); clone.text(name); @@ -1434,10 +1459,60 @@ require([ clone.append("

"); var messages = jquery("#" + id + "_clone").find(".messages"); + + if (!window.notifies) { + window.notifies = []; + } + var finishText; + var finishType; + unsaved[name] = true; + var notify = jquery.notify({ + title: "" + name + ": ", + message: "" + }, { + type: "info", + allow_dismiss: false, + showProgressbar: true, + placement: { + from: "bottom", + align: "right" + }, + delay: 0, + onClosed: function() { + console.log("closed", notify); + notify = jquery.notify({ + title: "" + name + ": ", + message: finishText + }, { + type: finishType, + allow_dismiss: true, + placement: { + from: "bottom", + align: "right" + }, + delay: 0 + }); + window.notifies.push(notify); + } + }); + window.notifies.push(notify); + + var setMessage = function(message) { + messages.text(message); + notify.update("message", message); + }; + var finishMessage = function(type, message) { + finishText = message; + finishType = type; + setMessage(message); + notify.close(); + delete unsaved[name]; + }; + serviceDescription.name = name; var serviceDefinition = serviceDescription; delete serviceDefinition.layers; - messages.text("creating service"); + setMessage("Creating service"); messages.after(""); destinationPortal.createService(destinationPortal.username, folder, JSON.stringify(serviceDefinition)).then(function(service) { clone.attr("data-id", service.itemId); @@ -1486,10 +1561,10 @@ require([ clone.removeClass("btn-info"); if (errors) { clone.addClass("btn-warning"); - messages.text("Incomplete--check console"); + finishMessage("danger", "Incomplete--check console"); } else { clone.addClass("btn-success"); - messages.text("Copy OK"); + finishMessage("success", "Copy successful"); } } }; @@ -1520,54 +1595,120 @@ require([ layer.indexes = []; }); - - messages.text("updating definition"); + setMessage("Updating definition"); + var startTime = new Date(); + var getTimeRemaining = function(miliseconds) { + var seconds = miliseconds / 1000; + var hours = Math.floor(seconds / 3600); + var minutes = Math.floor((seconds - hours * 3600) / 60); + seconds = Math.floor(seconds - hours * 3600 - minutes * 60); + var timeRemaining; + if (hours) { + if (hours < 2) { + timeRemaining = hours + " hours, " + minutes + " minutes"; + } else { + timeRemaining = Math.round(hours + minutes / 60) + " hours"; + } + } else if (minutes) { + if (minutes < 2) { + timeRemaining = minutes + " minutes, " + seconds + " seconds"; + } else { + timeRemaining = Math.round(minutes + seconds / 60) + " minutes"; + } + } else { + timeRemaining = seconds + " seconds"; + } + return timeRemaining; + }; destinationPortal.addToServiceDefinition(service.serviceurl, JSON.stringify(definition)) .then(function(response) { if (!("error" in response)) { + var totalNumberOfRecords = 0; + var numberOfFinishedRecords = 0; + var totalNumberOfLayers = layers.length; + var numberOfFinishedLayers = 0; jquery.each(layers, function(i, v) { var layerId = v.id; portal.layerRecordCount(description.url, layerId) .then(function(records) { var offset = 0; layerJobs[layerId].recordCount = records.count; + totalNumberOfLayers -= 1; + totalNumberOfRecords += records.count; // Set the count manually in weird cases where maxRecordCount is negative. var count = definition.layers[layerId].maxRecordCount < 1 ? 1000 : definition.layers[layerId].maxRecordCount; + console.log("Copying records, " + count + " at a time"); var x = 1; // eslint-disable-line no-unused-vars - while (offset <= records.count) { - x++; - messages.text("harvesting data"); - portal.harvestRecords(description.url, layerId, offset, count) - // the linter doesn't like anonymous callback functions within loops - /* eslint-disable no-loop-func */ - .then(function(serviceData) { - messages.text("adding features for " + layerCount + " layers"); - destinationPortal.addFeatures(service.serviceurl, layerId, JSON.stringify(serviceData.features)) - .then(function(result) { - layerJobs[layerId].attempted += serviceData.features.length; - layerJobs[layerId].added += result.addResults.length; - reportResult(layerId); - }) - .catch(function() { // Catch on addFeatures. - layerJobs[layerId].attempted += serviceData.features.length; - reportResult(layerId); - }); - }) - .catch(function() { // Catch on harvestRecords. - messages.text("Incomplete—check console"); - console.info("Errors creating service " + name); - console.info("Failed to retrieve all records."); - }); - /* eslint-enable no-loop-func */ - offset += count; + + + + var totalWorkers = Math.min(Math.ceil(records.count / count), 20); + var harvestRecords = function(descUrl, lyrId, startRecord, stopRecord, numRecordsPer) { + portal.harvestRecords(descUrl, lyrId, startRecord, numRecordsPer) + .then(function(serviceData) { + if (totalNumberOfLayers) { + setMessage("Adding features for " + layerCount + " layers"); + } else { + var recordsProgress = numberOfFinishedRecords / totalNumberOfRecords * 100; + var timeRemaining = getTimeRemaining((new Date() - startTime) / recordsProgress * (100 - recordsProgress)); + notify.update("progress", recordsProgress); + setMessage( + "Adding features (" + + numberOfFinishedRecords.toLocaleString("en") + + " out of " + totalNumberOfRecords.toLocaleString("en") + + ")" + + (numberOfFinishedRecords ? ". About " + timeRemaining + " remaining." : "") + ); + } + destinationPortal.addFeatures(service.serviceurl, lyrId, JSON.stringify(serviceData.features)) + .then(function(result) { + layerJobs[lyrId].attempted += serviceData.features.length; + layerJobs[lyrId].added += result.addResults.length; + numberOfFinishedRecords += result.addResults.length; + + var recordsProgress = numberOfFinishedRecords / totalNumberOfRecords * 100; + var timeRemaining = getTimeRemaining((new Date() - startTime) / recordsProgress * (100 - recordsProgress)); + notify.update("progress", recordsProgress); + setMessage( + "Adding features (" + + numberOfFinishedRecords.toLocaleString("en") + + " out of " + totalNumberOfRecords.toLocaleString("en") + + ")" + + (numberOfFinishedRecords ? ". About " + timeRemaining + " remaining." : "") + ); + + reportResult(lyrId); + startRecord += totalWorkers * numRecordsPer; + if (stopRecord > startRecord) { + numRecordsPer = (stopRecord - startRecord < numRecordsPer) ? stopRecord - startRecord : numRecordsPer; + harvestRecords(descUrl, lyrId, startRecord, stopRecord, numRecordsPer); + } else { + numberOfFinishedLayers++; + } + }) + .catch(function() { // Catch on addFeatures. + layerJobs[lyrId].attempted += serviceData.features.length; + reportResult(lyrId); + }); + }) + .catch(function() { // Catch on harvestRecords. + finishMessage("danger", "Incomplete—check console"); + console.info("Errors creating service " + name); + console.info("Failed to retrieve all records."); + }); + + }; + for (var i = 0; i < totalWorkers; i++) { + harvestRecords(description.url, layerId, i * count, records.count, count, totalWorkers); } + }); }); } else { clone.find("img").remove(); clone.removeClass("btn-info"); clone.addClass("btn-danger"); - messages.text("Failed—check console"); + finishMessage("danger", "Failed—check console"); console.info("Copy summary for " + name); console.warn(response.error.message); response.error.details.forEach(function(detail) { @@ -1579,7 +1720,7 @@ require([ clone.find("img").remove(); clone.removeClass("btn-info"); clone.addClass("btn-danger"); - messages.text("Failed—check console"); + finishMessage("danger", "Failed—check console"); console.info("Errors creating service " + name); console.warn("Failed to create the service."); }); From 2ec919e4d9837d0029cff5661e46d39ed9b11cf9 Mon Sep 17 00:00:00 2001 From: William Reynolds Date: Fri, 17 Nov 2017 17:07:31 -0700 Subject: [PATCH 2/5] Added new portal.util method `copyHostedFeatureService` for `deepCopyFeatureService` use. Fixed typo in `addItem.js`. Updated default `request` timeout to 5 minutes instead of 2. Added `update('allow_dismiss,...)` to bootstrap-notify.min.js. --- package.json | 2 +- src/css/styles.css | 43 +- src/index.html | 4 +- src/js/lib/bootstrap-notify.min.js | 83 ++-- src/js/main.js | 426 +++++++----------- src/js/portal/content/addItem.js | 2 +- src/js/portal/portal.js | 4 + src/js/portal/request.js | 8 +- .../portal/util/copyHostedFeatureService.js | 363 +++++++++++++++ src/js/portal/util/index.js | 4 +- src/templates.html | 14 +- 11 files changed, 627 insertions(+), 326 deletions(-) create mode 100644 src/js/portal/util/copyHostedFeatureService.js diff --git a/package.json b/package.json index 9b7aef0..b16eab5 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "url": "https://github.com/Esri/ago-assistant.git" }, "config": { - "appId": "gTU08ExBxqo5u3aI", + "appId": "4E1s0Mv5r0c2l6W8", "portalUrl": "https://www.arcgis.com" }, "scripts": { diff --git a/src/css/styles.css b/src/css/styles.css index 184243d..eaa1f63 100644 --- a/src/css/styles.css +++ b/src/css/styles.css @@ -2,6 +2,7 @@ body { background: #fff; padding-top: 50px; overflow-y: hidden; + min-width: 750px; } .dropArea { @@ -25,12 +26,32 @@ body { border-style: dashed; } +#mainContainer { + width: 100%; + position: absolute; + bottom: 0; +} + .itemArea { background: #fff; overflow-y: auto; padding-top: 10px; } +#itemsContainer { + display: flex; +} + +#itemsArea { + min-width: 300px; + max-width: 550px; +} + +#dropArea { + flex: 1 0 0px; + padding: 10px 15px 0 15px; +} + .accordion-inner { background: #fff; } @@ -94,6 +115,10 @@ body { margin-right: 10px; } +.itemHeader .icon { + margin-left: 0; +} + .edit-controls { position: absolute; top: -38px; @@ -218,7 +243,6 @@ body { .itemDetailsDiv { position: relative; - margin-left: 15px; font-size: 0.8em; } @@ -247,3 +271,20 @@ body { table.hljs-ln { width: 100%; } + +.content-item { + display: flex; + flex-direction: column; +} + +.content-item.ui-draggable-dragging { + max-width: 450px; +} + +.itemHeader { + display: flex; +} + +.itemTitle { + flex: 1 0 20px; +} diff --git a/src/index.html b/src/index.html index e25d768..b0819ed 100644 --- a/src/index.html +++ b/src/index.html @@ -103,7 +103,7 @@

Copy

-
+