author int64 4.98k 943k | date stringdate 2017-04-15 16:45:02 2022-02-25 15:32:15 | timezone int64 -46,800 39.6k | hash stringlengths 40 40 | message stringlengths 8 468 | mods listlengths 1 16 | language stringclasses 9 values | license stringclasses 2 values | repo stringclasses 119 values | original_message stringlengths 12 491 | is_CCS int64 1 1 | commit_type stringclasses 129 values | commit_scope stringlengths 1 44 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
217,922 | 06.06.2018 15:31:42 | -7,200 | 8ae4db814d7eb4dc918f3b4a3d55b2bc7ad0d44b | fix: fixed a critical which was breaking recipes search in production | [
{
"change_type": "MODIFY",
"diff": "alt=\"{{item.itemId | itemName | i18n}}\">\n</a>\n<h4 mat-line>{{item.itemId | itemName | i18n}}</h4>\n- <p mat-line *ngIf=\"item.job !== undefined && getJob(item.job).abbreviation !== 'ADV'\">\n- <img src=\"https://www.garlandtools.org/db/images/{{getJob(item.job).abbreviation}}.png\"\n+ <p mat-line *ngIf=\"item.job !== undefined && getJob(item.job)?.abbreviation !== 'ADV'\">\n+ <img src=\"https://www.garlandtools.org/db/images/{{getJob(item.job)?.abbreviation}}.png\"\nalt=\"getJob(item.job)?.abbreviation\" class=\"crafted-by\"> {{item.lvl}} <span\n[innerHtml]=\"getStars(item.stars)\"></span>\n</p>\n",
"new_path": "src/app/pages/recipes/recipes/recipes.component.html",
"old_path": "src/app/pages/recipes/recipes/recipes.component.html"
},
{
"change_type": "MODIFY",
"diff": "alt=\"{{item.itemId | itemName | i18n}}\">\n</a>\n<h4 mat-line>{{item.itemId | itemName | i18n}}</h4>\n- <p mat-line *ngIf=\"item.job !== undefined && getJob(item.job).abbreviation !== 'ADV'\">\n- <img src=\"https://www.garlandtools.org/db/images/{{getJob(item.job).abbreviation}}.png\"\n+ <p mat-line *ngIf=\"item.job !== undefined && getJob(item.job)?.abbreviation !== 'ADV'\">\n+ <img src=\"https://www.garlandtools.org/db/images/{{getJob(item.job)?.abbreviation}}.png\"\nalt=\"getJob(item.job)?.abbreviation\" class=\"crafted-by\"> {{item.lvl}} <span\n[innerHtml]=\"getStars(item.stars)\"></span>\n</p>\n",
"new_path": "src/app/pages/simulator/components/recipe-choice-popup/recipe-choice-popup.component.html",
"old_path": "src/app/pages/simulator/components/recipe-choice-popup/recipe-choice-popup.component.html"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | fix: fixed a critical which was breaking recipes search in production | 1 | fix | null |
679,913 | 06.06.2018 15:33:26 | -3,600 | 720b1f189dbe4552160149715c308edf632be3c6 | docs(rstream-graph): update api docs & readme | [
{
"change_type": "MODIFY",
"diff": "@@ -12,7 +12,10 @@ Declarative, reactive dataflow graph construction using\n[@thi.ng/atom](https://github.com/thi-ng/umbrella/tree/master/packages/atom) and [@thi.ng/transducers](https://github.com/thi-ng/umbrella/tree/master/packages/transducers)\nprimitives.\n-Stream subscription types act as graph nodes and attached transducers as graph edges, transforming data for downstream consumers / nodes. Theoretically, allows cycles and is not restricted to DAG topologies, but care must be taken to avoid CPU hogging (user's responsibility).\n+Stream subscription types act as graph nodes and attached transducers as\n+graph edges, transforming data for downstream consumers / nodes.\n+Theoretically, allows cycles and is not restricted to DAG topologies,\n+but care must be taken to avoid CPU hogging (user's responsibility).\n## Installation\n@@ -67,7 +70,7 @@ const graph = rsg.initGraph(state, {\nmul: {\nfn: rsg.mul,\nins: {\n- a: { stream: \"add\" },\n+ a: { stream: \"/add/node\" },\nb: { stream: () => rs.fromIterable([10, 20, 30]) }\n},\n}\n@@ -87,7 +90,8 @@ setTimeout(() => state.resetIn(\"a\", 10), 1000);\n// result: 360\n```\n-Please documentation in the source code for further details.\n+Please see documentation in the source code & test cases for further\n+details.\n## Authors\n",
"new_path": "packages/rstream-graph/README.md",
"old_path": "packages/rstream-graph/README.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -23,8 +23,8 @@ export interface Node {\n* A dataflow graph spec is simply an object where keys are node names\n* and their values are either pre-existing @thi.ng/rstream\n* `ISubscribable`s, functions returning `ISubscribable`s or\n- * `NodeSpec`s, defining inputs and the operation to be applied to\n- * produce a result stream.\n+ * `NodeSpec`s, defining a node's inputs, outputs and the operation to\n+ * be applied to produce one or more result streams.\n*/\nexport type GraphSpec = IObjectOf<\nNodeSpec |\n@@ -33,15 +33,17 @@ export type GraphSpec = IObjectOf<\n/**\n* Specification for a single \"node\" in the dataflow graph. Nodes here\n- * are actually streams (or just generally any form of @thi.ng/rstream\n- * subscription), usually with an associated transducer to transform /\n- * combine the inputs and produce values for the node's result stream.\n+ * are actually streams / qsubscriptions (or just generally any form of\n+ * @thi.ng/rstream `ISubscribable`), usually with an associated\n+ * transducer to transform / combine the inputs and produce values for\n+ * the node's result stream.\n*\n- * The `fn` function is responsible to produce such a stream construct.\n- * The keys used to specify inputs in the `ins` object are dictated by\n- * the actual node `fn` used. Most node functions with multiple inputs\n- * are implemented as `StreamSync` instances and the input IDs are used\n- * to locally rename input streams within the `StreamSync` container.\n+ * The `fn` function is responsible to produce such a stream transformer\n+ * construct. The keys used to specify inputs in the `ins` object are\n+ * dictated by the actual node `fn` used. Most node functions with\n+ * multiple inputs are implemented as `StreamSync` instances and the\n+ * input IDs are used to locally rename input streams within the\n+ * `StreamSync` container.\n*\n* Alo see `initGraph` and `nodeFromSpec` (in /src/nodes.ts) for more\n* details how these specs are compiled into stream constructs.\n@@ -64,22 +66,23 @@ export interface NodeSpec {\n* { path: [\"nested\", \"src\", \"path\"] }\n* ```\n*\n- * 2) Reference path to another node in the GraphSpec object. See\n- * `@thi.ng/resolve-map` for details.\n+ * 2) Reference path to another node's output in the GraphSpec object.\n+ * See `@thi.ng/resolve-map` for details.\n*\n* ```\n- * { stream: \"/path/to/node-id\" } // absolute\n- * { stream: \"../../path/to/node-id\" } // relative\n- * { stream: \"node-id\" } // sibling\n+ * { stream: \"/node-id/node\" } // main node output\n+ * { stream: \"/node-id/outs/foo\" } // specific output\n* ```\n*\n* 3) Reference another node indirectly. The passed in `resolve`\n- * function can be used to lookup other nodes, e.g. the following\n- * spec looks up node \"src\" and adds a transformed subscription,\n- * which is then used as input for current node.\n+ * function can be used to lookup other nodes, with the same logic as\n+ * above. E.g. the following spec looks up the main output of node\n+ * \"abc\" and adds a transformed subscription, which is then used as\n+ * input for current node.\n*\n* ```\n- * { stream: (resolve) => resolve(\"src\").subscribe(map(x => x * 10)) }\n+ * { stream: (resolve) =>\n+ * resolve(\"/abc/node\").subscribe(map(x => x * 10)) }\n* ```\n*\n* 4) Provide an external input stream:\n@@ -95,8 +98,8 @@ export interface NodeSpec {\n* { const: () => 1 }\n* ```\n*\n- * If the optional `xform` is given, a subscription with the transducer\n- * is added to the input and then used as input instead.\n+ * If the optional `xform` is given, a subscription with the given\n+ * transducer is added to the input and then used as input instead.\n*/\nexport interface NodeInputSpec {\nid?: string;\n",
"new_path": "packages/rstream-graph/src/api.ts",
"old_path": "packages/rstream-graph/src/api.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | docs(rstream-graph): update api docs & readme | 1 | docs | rstream-graph |
217,922 | 06.06.2018 15:49:26 | -7,200 | 588b74d90d4f860d2a4699d334394450bed5a32a | chore: change http for https in garlandtools data loading | [
{
"change_type": "MODIFY",
"diff": "@@ -15,7 +15,7 @@ export class GarlandToolsService {\npublic preload(): void {\nif (this.gt.jobCategories === undefined) {\n- this.http.get<GarlandToolsData>('http://www.garlandtools.org/db/doc/core/en/2/data.json')\n+ this.http.get<GarlandToolsData>('https://www.garlandtools.org/db/doc/core/en/2/data.json')\n.subscribe(data => this.gt = Object.assign(this.gt, data));\n}\n}\n",
"new_path": "src/app/core/api/garland-tools.service.ts",
"old_path": "src/app/core/api/garland-tools.service.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | chore: change http for https in garlandtools data loading | 1 | chore | null |
724,198 | 06.06.2018 16:49:43 | -28,800 | a864ed3f7835828ca532a7ffd4cbded47fe48ffb | fix: type definition of classes method | [
{
"change_type": "MODIFY",
"diff": "@@ -56,7 +56,7 @@ interface BaseWrapper {\nvisible (): boolean\nattributes(): { [name: string]: string }\n- classes(): Array<string> | void\n+ classes(): Array<string>\nprops(): { [name: string]: any }\nhasAttribute (attribute: string, value: string): boolean\n",
"new_path": "packages/test-utils/types/index.d.ts",
"old_path": "packages/test-utils/types/index.d.ts"
}
] | JavaScript | MIT License | vuejs/vue-test-utils | fix: type definition of classes method (#685) | 1 | fix | null |
724,111 | 06.06.2018 16:49:59 | -28,800 | 0437e2638ed782ad19760c46057f6d5e00a8521c | docs: zn update | [
{
"change_type": "MODIFY",
"diff": "@@ -126,4 +126,4 @@ describe('Foo', () => {\n})\n```\n-- **See also:** [Wrapper](wrapper/README.md)\n+- **See also:** [Wrapper](wrapper/)\n",
"new_path": "docs/api/mount.md",
"old_path": "docs/api/mount.md"
},
{
"change_type": "MODIFY",
"diff": "## find(selector)\n-Returns [`Wrapper`](../wrapper/) of first DOM node or Vue component matching selector.\n+Returns `Wrapper` of first DOM node or Vue component matching selector.\nUse any valid [selector](../selectors.md).\n@@ -30,5 +30,3 @@ expect(barByName.is(Bar)).toBe(true)\nconst fooRef = wrapper.find({ ref: 'foo' })\nexpect(fooRef.is(Foo)).toBe(true)\n```\n-\n-- **See also:** [Wrapper](../wrapper/)\n",
"new_path": "docs/api/wrapper/find.md",
"old_path": "docs/api/wrapper/find.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -22,5 +22,3 @@ expect(div.is('div')).toBe(true)\nconst bar = wrapper.findAll(Bar).at(0)\nexpect(bar.is(Bar)).toBe(true)\n```\n-\n-- **See also:** [Wrapper](../wrapper/)\n",
"new_path": "docs/api/wrapper/findAll.md",
"old_path": "docs/api/wrapper/findAll.md"
}
] | JavaScript | MIT License | vuejs/vue-test-utils | docs: zn update (#674) | 1 | docs | null |
791,676 | 06.06.2018 18:36:31 | -7,200 | ac264c0894c9ddc5781afa427d54d47b1d2f4c8c | extension(popup): integration test for popup | [
{
"change_type": "MODIFY",
"diff": "@@ -247,7 +247,7 @@ async function initPopup() {\n});\n// bind throttling control button\n- const lanternCheckbox = /** @type {HTMLInputElement} */ (find('lantern-checkbox'));\n+ const lanternCheckbox = /** @type {HTMLInputElement} */ (find('#lantern-checkbox'));\nlanternCheckbox.addEventListener('change', async () => {\nconst settings = await background.loadSettings();\nsettings.useDevTools = !lanternCheckbox.checked;\n@@ -255,7 +255,7 @@ async function initPopup() {\n});\n// bind Generate Report button\n- const generateReportButton = find('generate-report');\n+ const generateReportButton = find('#generate-report');\ngenerateReportButton.addEventListener('click', () => {\nbackground.loadSettings().then(settings => {\nonGenerateReportButtonClick(background, settings);\n@@ -263,14 +263,14 @@ async function initPopup() {\n});\n// bind View Options button\n- const generateOptionsEl = find('configure-options');\n+ const generateOptionsEl = find('#configure-options');\nconst optionsEl = find('.options');\ngenerateOptionsEl.addEventListener('click', () => {\noptionsEl.classList.add(subpageVisibleClass);\n});\n// bind Save Options button\n- const okButton = find('ok');\n+ const okButton = find('#ok');\nokButton.addEventListener('click', () => {\n// Save settings when options page is closed.\nconst checkboxes = /** @type {NodeListOf<HTMLInputElement>} */\n",
"new_path": "lighthouse-extension/app/src/popup.js",
"old_path": "lighthouse-extension/app/src/popup.js"
},
{
"change_type": "MODIFY",
"diff": "\"scripts\": {\n\"watch\": \"gulp watch\",\n\"build\": \"gulp build:production\",\n- \"test\": \"mocha test/extension-test.js\"\n+ \"test\": \"mocha test/**/*-test.js\"\n},\n\"devDependencies\": {\n\"babel-plugin-syntax-object-rest-spread\": \"^6.13.0\",\n",
"new_path": "lighthouse-extension/package.json",
"old_path": "lighthouse-extension/package.json"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | extension(popup): integration test for popup (#5412) | 1 | extension | popup |
791,676 | 06.06.2018 18:39:26 | -7,200 | d385645bd5d72e9a5c71e77c1d3728803f236ce5 | core(preload): only allow same origin (domain + subdomains) | [
{
"change_type": "MODIFY",
"diff": "*/\n'use strict';\n+const URL = require('../lib/url-shim');\nconst Audit = require('./audit');\nconst UnusedBytes = require('./byte-efficiency/byte-efficiency-audit');\nconst THRESHOLD_IN_MS = 100;\n@@ -57,6 +58,20 @@ class UsesRelPreloadAudit extends Audit {\nreturn requests;\n}\n+ /**\n+ *\n+ * @param {LH.WebInspector.NetworkRequest} request\n+ * @param {LH.WebInspector.NetworkRequest} mainResource\n+ * @return {boolean}\n+ */\n+ static shouldPreload(request, mainResource) {\n+ if (request._isLinkPreload || request.protocol === 'data') {\n+ return false;\n+ }\n+\n+ return URL.rootDomainsMatch(request.url, mainResource.url);\n+ }\n+\n/**\n* Computes the estimated effect of preloading all the resources.\n* @param {Set<string>} urls The array of byte savings results per resource\n@@ -159,8 +174,8 @@ class UsesRelPreloadAudit extends Audit {\n/** @type {Set<string>} */\nconst urls = new Set();\nfor (const networkRecord of criticalRequests) {\n- if (!networkRecord._isLinkPreload && networkRecord.protocol !== 'data') {\n- urls.add(networkRecord._url);\n+ if (UsesRelPreloadAudit.shouldPreload(networkRecord, mainResource)) {\n+ urls.add(networkRecord.url);\n}\n}\n",
"new_path": "lighthouse-core/audits/uses-rel-preload.js",
"old_path": "lighthouse-core/audits/uses-rel-preload.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -17,6 +17,12 @@ const Util = require('../report/html/renderer/util.js');\nconst URL = /** @type {!Window[\"URL\"]} */ (typeof self !== 'undefined' && self.URL) ||\nrequire('url').URL;\n+// 25 most used tld plus one domains from http archive.\n+// @see https://github.com/GoogleChrome/lighthouse/pull/5065#discussion_r191926212\n+const listOfTlds = [\n+ 'com', 'co', 'gov', 'edu', 'ac', 'org', 'go', 'gob', 'or', 'net', 'in', 'ne', 'nic', 'gouv',\n+ 'web', 'spb', 'blog', 'jus', 'kiev', 'mil', 'wi', 'qc', 'ca', 'bel', 'on',\n+];\n/**\n* There is fancy URL rewriting logic for the chrome://settings page that we need to work around.\n* Why? Special handling was added by Chrome team to allow a pushState transition between chrome:// pages.\n@@ -87,6 +93,54 @@ class URLShim extends URL {\n}\n}\n+ /**\n+ * Gets the tld of a domain\n+ *\n+ * @param {string} hostname\n+ * @return {string} tld\n+ */\n+ static getTld(hostname) {\n+ const tlds = hostname.split('.').slice(-2);\n+\n+ if (!listOfTlds.includes(tlds[0])) {\n+ return `.${tlds[tlds.length - 1]}`;\n+ }\n+\n+ return `.${tlds.join('.')}`;\n+ }\n+\n+ /**\n+ * Check if rootDomains matches\n+ *\n+ * @param {string} urlA\n+ * @param {string} urlB\n+ */\n+ static rootDomainsMatch(urlA, urlB) {\n+ let urlAInfo;\n+ let urlBInfo;\n+ try {\n+ urlAInfo = new URL(urlA);\n+ urlBInfo = new URL(urlB);\n+ } catch (err) {\n+ return false;\n+ }\n+\n+ if (!urlAInfo.hostname || !urlBInfo.hostname) {\n+ return false;\n+ }\n+\n+ const tldA = URLShim.getTld(urlAInfo.hostname);\n+ const tldB = URLShim.getTld(urlBInfo.hostname);\n+\n+ // get the string before the tld\n+ const urlARootDomain = urlAInfo.hostname.replace(new RegExp(`${tldA}$`), '')\n+ .split('.').splice(-1)[0];\n+ const urlBRootDomain = urlBInfo.hostname.replace(new RegExp(`${tldB}$`), '')\n+ .split('.').splice(-1)[0];\n+\n+ return urlARootDomain === urlBRootDomain;\n+ }\n+\n/**\n* @param {string} url\n* @param {{numPathParts: number, preserveQuery: boolean, preserveHost: boolean}=} options\n",
"new_path": "lighthouse-core/lib/url-shim.js",
"old_path": "lighthouse-core/lib/url-shim.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -50,14 +50,18 @@ describe('Performance: uses-rel-preload audit', () => {\nit('should suggest preload resource', () => {\nconst rootNode = buildNode(1, 'http://example.com');\n- const mainDocumentNode = buildNode(2, 'http://www.example.com');\n+ const mainDocumentNode = buildNode(2, 'http://www.example.com:3000');\nconst scriptNode = buildNode(3, 'http://www.example.com/script.js');\nconst scriptAddedNode = buildNode(4, 'http://www.example.com/script-added.js');\n+ const scriptSubNode = buildNode(5, 'http://sub.example.com/script-sub.js');\n+ const scriptOtherNode = buildNode(6, 'http://otherdomain.com/script-other.js');\nmainDocumentNode.setIsMainDocument(true);\nmainDocumentNode.addDependency(rootNode);\nscriptNode.addDependency(mainDocumentNode);\nscriptAddedNode.addDependency(scriptNode);\n+ scriptSubNode.addDependency(scriptNode);\n+ scriptOtherNode.addDependency(scriptNode);\nmockGraph = rootNode;\nmockSimulator = {\n@@ -69,41 +73,63 @@ describe('Performance: uses-rel-preload audit', () => {\nconst mainDocumentNodeLocal = nodesByUrl.get(mainDocumentNode.record.url);\nconst scriptNodeLocal = nodesByUrl.get(scriptNode.record.url);\nconst scriptAddedNodeLocal = nodesByUrl.get(scriptAddedNode.record.url);\n+ const scriptSubNodeLocal = nodesByUrl.get(scriptSubNode.record.url);\n+ const scriptOtherNodeLocal = nodesByUrl.get(scriptOtherNode.record.url);\nconst nodeTimings = new Map([\n[rootNodeLocal, {starTime: 0, endTime: 500}],\n[mainDocumentNodeLocal, {startTime: 500, endTime: 1000}],\n[scriptNodeLocal, {startTime: 1000, endTime: 2000}],\n[scriptAddedNodeLocal, {startTime: 2000, endTime: 3250}],\n+ [scriptSubNodeLocal, {startTime: 2000, endTime: 3000}],\n+ [scriptOtherNodeLocal, {startTime: 2000, endTime: 3500}],\n]);\nif (scriptAddedNodeLocal.getDependencies()[0] === mainDocumentNodeLocal) {\nnodeTimings.set(scriptAddedNodeLocal, {startTime: 1000, endTime: 2000});\n}\n- return {timeInMs: 3250, nodeTimings};\n+ if (scriptSubNodeLocal.getDependencies()[0] === mainDocumentNodeLocal) {\n+ nodeTimings.set(scriptSubNodeLocal, {startTime: 1000, endTime: 2000});\n+ }\n+\n+ if (scriptOtherNodeLocal.getDependencies()[0] === mainDocumentNodeLocal) {\n+ nodeTimings.set(scriptOtherNodeLocal, {startTime: 1000, endTime: 2500});\n+ }\n+\n+ return {timeInMs: 3500, nodeTimings};\n},\n};\nconst mainResource = Object.assign({}, defaultMainResource, {\n- url: 'http://www.example.com',\n+ url: 'http://www.example.com:3000',\nredirects: [''],\n});\nconst networkRecords = [\n{\nrequestId: '2',\n_isLinkPreload: false,\n- _url: 'http://www.example.com',\n+ url: 'http://www.example.com:3000',\n},\n{\nrequestId: '3',\n_isLinkPreload: false,\n- _url: 'http://www.example.com/script.js',\n+ url: 'http://www.example.com/script.js',\n},\n{\nrequestId: '4',\n_isLinkPreload: false,\n- _url: 'http://www.example.com/script-added.js',\n+ url: 'http://www.example.com/script-added.js',\n+ },\n+ {\n+ requestId: '5',\n+ _isLinkPreload: false,\n+ url: 'http://sub.example.com/script-sub.js',\n+ },\n+ {\n+ requestId: '6',\n+ _isLinkPreload: false,\n+ url: 'http://otherdomain.com/script-other.js',\n},\n];\n@@ -120,6 +146,14 @@ describe('Performance: uses-rel-preload audit', () => {\nrequest: networkRecords[2],\nchildren: {},\n},\n+ '5': {\n+ request: networkRecords[3],\n+ children: {},\n+ },\n+ '6': {\n+ request: networkRecords[4],\n+ children: {},\n+ },\n},\n},\n},\n@@ -131,7 +165,9 @@ describe('Performance: uses-rel-preload audit', () => {\nreturn UsesRelPreload.audit(mockArtifacts(networkRecords, chains, mainResource), {}).then(\noutput => {\nassert.equal(output.rawValue, 1250);\n- assert.equal(output.details.items.length, 1);\n+ assert.equal(output.details.items.length, 2);\n+ assert.equal(output.details.items[0].url, 'http://www.example.com/script-added.js');\n+ assert.equal(output.details.items[1].url, 'http://sub.example.com/script-sub.js');\n}\n);\n});\n",
"new_path": "lighthouse-core/test/audits/uses-rel-preload-test.js",
"old_path": "lighthouse-core/test/audits/uses-rel-preload-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -92,6 +92,61 @@ describe('URL Shim', () => {\nassert.equal(URL.getOrigin(urlD), null);\n});\n+ describe('getTld', () => {\n+ it('returns the correct tld', () => {\n+ assert.equal(URL.getTld('example.com'), '.com');\n+ assert.equal(URL.getTld('example.co.uk'), '.co.uk');\n+ assert.equal(URL.getTld('example.com.br'), '.com.br');\n+ assert.equal(URL.getTld('example.tokyo.jp'), '.jp');\n+ });\n+ });\n+\n+ describe('rootDomainsMatch', () => {\n+ it('matches a subdomain and a root domain', () => {\n+ const urlA = 'http://example.com/js/test.js';\n+ const urlB = 'http://example.com/';\n+ const urlC = 'http://sub.example.com/js/test.js';\n+ const urlD = 'http://sub.otherdomain.com/js/test.js';\n+\n+ assert.ok(URL.rootDomainsMatch(urlA, urlB));\n+ assert.ok(URL.rootDomainsMatch(urlA, urlC));\n+ assert.ok(!URL.rootDomainsMatch(urlA, urlD));\n+ assert.ok(!URL.rootDomainsMatch(urlB, urlD));\n+ });\n+\n+ it(`doesn't break on urls without a valid host`, () => {\n+ const urlA = 'http://example.com/js/test.js';\n+ const urlB = 'data:image/jpeg;base64,foobar';\n+ const urlC = 'anonymous:90';\n+ const urlD = '!!garbage';\n+ const urlE = 'file:///opt/lighthouse/index.js';\n+\n+ assert.ok(!URL.rootDomainsMatch(urlA, urlB));\n+ assert.ok(!URL.rootDomainsMatch(urlA, urlC));\n+ assert.ok(!URL.rootDomainsMatch(urlA, urlD));\n+ assert.ok(!URL.rootDomainsMatch(urlA, urlE));\n+ assert.ok(!URL.rootDomainsMatch(urlB, urlC));\n+ assert.ok(!URL.rootDomainsMatch(urlB, urlD));\n+ assert.ok(!URL.rootDomainsMatch(urlB, urlE));\n+ });\n+\n+ it(`matches tld plus domains`, () => {\n+ const coUkA = 'http://example.co.uk/js/test.js';\n+ const coUkB = 'http://sub.example.co.uk/js/test.js';\n+ const testUkA = 'http://example.test.uk/js/test.js';\n+ const testUkB = 'http://sub.example.test.uk/js/test.js';\n+ const ltdBrA = 'http://example.ltd.br/js/test.js';\n+ const ltdBrB = 'http://sub.example.ltd.br/js/test.js';\n+ const privAtA = 'http://examplepriv.at/js/test.js';\n+ const privAtB = 'http://sub.examplepriv.at/js/test.js';\n+\n+ assert.ok(URL.rootDomainsMatch(coUkA, coUkB));\n+ assert.ok(URL.rootDomainsMatch(testUkA, testUkB));\n+ assert.ok(URL.rootDomainsMatch(ltdBrA, ltdBrB));\n+ assert.ok(URL.rootDomainsMatch(privAtA, privAtB));\n+ });\n+ });\n+\ndescribe('getURLDisplayName', () => {\nit('respects numPathParts option', () => {\nconst url = 'http://example.com/a/deep/nested/file.css';\n",
"new_path": "lighthouse-core/test/lib/url-shim-test.js",
"old_path": "lighthouse-core/test/lib/url-shim-test.js"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core(preload): only allow same origin (domain + subdomains) (#5065) | 1 | core | preload |
679,913 | 06.06.2018 23:39:50 | -3,600 | 57f1ed5fd8576d2b299ddb17d231b4508147e4b9 | feat(resolve-map): add ES6 destructuring shorthands for function vals
add _resolveFunction()
add tests
update docs & readme | [
{
"change_type": "MODIFY",
"diff": "@@ -47,22 +47,43 @@ resolveMap({a: 1, b: {c: \"@d\", d: \"@/a\"} })\n// { a: 1, b: { c: 1, d: 1 } }\n```\n-If a value is a function, it is called with a single arg `resolve`, a\n-function which accepts a path (**without `@` prefix**) to look up other\n-values. The return value of the user provided function is used as final\n-value for that key. This mechanism can be used to compute derived values\n-of other values stored anywhere in the root object. **Function values\n-will always be called only once.** Therefore, in order to associate a\n-function as value to a key, it needs to be wrapped with an additional\n-function, as shown for the `e` key in the example below. Similarly, if\n-an actual string value should happen to start with `@`, it needs to be\n-wrapped in a function (see `f` key below).\n+If a value is a function, it is called using two possible conventions:\n+\n+1) If the user function uses ES6 object destructuring for its first\n+ argument, the given object keys are resolved prior to calling the\n+ function and the resolved values provided as first argument and a\n+ general `resolve` function as second argument.\n+2) If no de-structure form is found in the function's arguments, the\n+ function is only called with `resolve` as argument.\n+\n+**Important:** Since ES6 var names can't contain special characters,\n+destructured keys are ALWAYS looked up as siblings of the currently\n+processed value.\n+\n+```ts\n+// `c` uses ES6 destructuring form to look up `a` & `b` values\n+{a: 1, b: 2, c: ({a,b}) => a + b }\n+=>\n+// { a: 1, b: 2, c: 3 }\n+```\n+\n+The single arg `resolve` function accepts a path (**without `@`\n+prefix**) to look up any other values in the object. The return value of\n+the user provided function is used as final value for that key in the\n+object. This mechanism can be used to compute derived values of other\n+values stored anywhere in the root object. **Function values will always\n+be called only once.** Therefore, in order to associate a function as\n+final value to a key, it MUST be wrapped with an additional function, as\n+shown for the `e` key in the example below. Similarly, if an actual\n+string value should happen to start with `@`, it needs to be wrapped in\n+a function (see `f` key below).\n```ts\n// `a` is derived from 1st array element in `b.d`\n// `b.c` is looked up from `b.d[0]`\n// `b.d[1]` is derived from calling `e(2)`\n// `e` is a wrapped function\n+// `f` is wrapped to ignore `@` prefix\nres = resolveMap({\na: (resolve) => resolve(\"b/c\") * 100,\nb: { c: \"@d/0\", d: [2, (resolve) => resolve(\"../../e\")(2) ] },\n@@ -107,27 +128,22 @@ import * as tx from \"@thi.ng/transducers\";\n// provided later\nconst stats = {\n// sequence average\n- mean: ($) => tx.reduce(tx.mean(), $(\"src\")),\n+ mean: ({src}) => tx.reduce(tx.mean(), src),\n// sequence range\n- range: ($) => $(\"max\") - $(\"min\"),\n+ range: ({min,max}) => max - min,\n// computes sequence min val\n- min: ($) => tx.reduce(tx.min(), $(\"src\")),\n+ min: ({src}) => tx.reduce(tx.min(), src),\n// computes sequence max val\n- max: ($) => tx.reduce(tx.max(), $(\"src\")),\n+ max: ({src}) => tx.reduce(tx.max(), src),\n// sorted copy\n- sorted: ($) => [...$(\"src\")].sort((a, b) => a - b),\n+ sorted: ({src}) => [...src].sort((a, b) => a - b),\n// standard deviation\n- sd: ($)=> {\n- const src = $(\"src\");\n- const mean = $(\"mean\");\n- return Math.sqrt(\n+ sd: ({src, mean})=>\n+ Math.sqrt(\ntx.transduce(tx.map((x) => Math.pow(x - mean, 2)), tx.add(), src) /\n- (src.length - 1)\n- );\n- },\n+ (src.length - 1)),\n// compute 10th - 90th percentiles\n- percentiles: ($) => {\n- const sorted = $(\"sorted\");\n+ percentiles: ({sorted}) => {\nreturn tx.transduce(\ntx.map((x) => sorted[Math.floor(x / 100 * sorted.length)]),\ntx.push(),\n",
"new_path": "packages/resolve-map/README.md",
"old_path": "packages/resolve-map/README.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -7,6 +7,10 @@ import { getIn, mutIn } from \"@thi.ng/paths\";\nconst SEMAPHORE = Symbol(\"SEMAPHORE\");\n+const RE_ARGS = /^(function\\s+\\w+)?\\s*\\(\\{([\\w\\s,]+)\\}/\n+\n+export type ResolveFn = (path: string) => any;\n+\nexport type LookupPath = PropertyKey[];\n/**\n@@ -30,13 +34,35 @@ export type LookupPath = PropertyKey[];\n* // { a: 1, b: { c: 1, d: 1 } }\n* ```\n*\n- * If a value is a function, it is called with a single arg `resolve`, a\n- * function which accepts a path (**without `@` prefix**) to look up\n- * other values. The return value of the user provided function is used\n- * as final value for that key. This mechanism can be used to compute\n+ * If a value is a function, it is called using two possible\n+ * conventions:\n+ *\n+ * 1) If the user function uses ES6 object destructuring for its first\n+ * argument, the given object keys are resolved prior to calling the\n+ * function and the resolved values provided as first argument and a\n+ * general `resolve` function as second argument.\n+ * 2) If no de-structure form is found in the function's arguments, the\n+ * function is only called with `resolve` as argument.\n+ *\n+ * **Important:** Since ES6 var names can't contain special characters,\n+ * destructured keys are ALWAYS looked up as siblings of the currently\n+ * processed value.\n+ *\n+ * ```\n+ * // `c` uses ES6 destructuring form to look up `a` & `b` values\n+ * {a: 1, b: 2, c: ({a,b}) => a + b }\n+ * =>\n+ * // { a: 1, b: 2, c: 3 }\n+ * ```\n+ *\n+ * The single arg `resolve` function accepts a path (**without `@`\n+ * prefix**) to look up any other values in the object.\n+ *\n+ * The return value of the user provided function is used as final value\n+ * for that key in the object. This mechanism can be used to compute\n* derived values of other values stored anywhere in the root object.\n* **Function values will always be called only once.** Therefore, in\n- * order to associate a function as value to a key, it needs to be\n+ * order to associate a function as final value to a key, it MUST be\n* wrapped with an additional function, as shown for the `e` key in the\n* example below. Similarly, if an actual string value should happen to\n* start with `@`, it needs to be wrapped in a function (see `f` key\n@@ -93,8 +119,10 @@ const _resolve = (root: any, path: LookupPath, resolved: any) => {\nlet rv = SEMAPHORE;\nlet v = getIn(root, path);\nconst pp = path.join(\"/\");\n- console.log(\"resolve\", pp, resolved[pp]);\nif (!resolved[pp]) {\n+ if (pp.length > 1) {\n+ resolved[path.slice(0, path.length - 1).join(\"/\")] = true;\n+ }\nif (isPlainObject(v)) {\nresolveMap(v, root, path, resolved);\n} else if (isArray(v)) {\n@@ -102,7 +130,7 @@ const _resolve = (root: any, path: LookupPath, resolved: any) => {\n} else if (isString(v) && v.charAt(0) === \"@\") {\nrv = _resolvePath(root, absPath(path, v), resolved);\n} else if (isFunction(v)) {\n- rv = v((p: string) => _resolvePath(root, absPath(path, p, 0), resolved));\n+ rv = _resolveFunction(v, (p: string) => _resolvePath(root, absPath(path, p, 0), resolved));\n}\nif (rv !== SEMAPHORE) {\nmutIn(root, path, rv);\n@@ -113,6 +141,31 @@ const _resolve = (root: any, path: LookupPath, resolved: any) => {\nreturn v;\n};\n+/**\n+ * Resolution helper for function values. Checks if the user function\n+ * uses ES6 object destructuring for its first argument and if so\n+ * resolves the given keys before calling the function and provides\n+ * their values as first arg. If no de-structure form is found, calls\n+ * function only with `resolve` as argument.\n+ *\n+ * See `resolveMap` comments for further details.\n+ *\n+ * @param fn\n+ * @param resolve\n+ */\n+const _resolveFunction = (fn: (x: any, r?: ResolveFn) => any, resolve: ResolveFn) => {\n+ const match = RE_ARGS.exec(fn.toString());\n+ if (match) {\n+ const args = {};\n+ for (let k of match[2].replace(/\\s/g, \"\").split(/,/g)) {\n+ args[k] = resolve(k);\n+ }\n+ return fn(args, resolve);\n+ } else {\n+ return fn(resolve);\n+ }\n+};\n+\n/**\n* If the value at given path is still unresolved, repeatedly calls\n* `_resolve` by stepwise descending along given path and returns final\n",
"new_path": "packages/resolve-map/src/index.ts",
"old_path": "packages/resolve-map/src/index.ts"
},
{
"change_type": "MODIFY",
"diff": "+import * as tx from \"@thi.ng/transducers\";\nimport * as assert from \"assert\";\n+\nimport { resolveMap } from \"../src/index\";\ndescribe(\"resolve-map\", () => {\n@@ -65,5 +67,34 @@ describe(\"resolve-map\", () => {\n{ a: 1, b: { c: 1, d: 1 }, e: 1 }\n);\nassert.equal(n, 1);\n- })\n+ });\n+\n+ it(\"destructure\", () => {\n+ const stats = {\n+ // sequence average\n+ mean: ({ src }) => tx.reduce(tx.mean(), src),\n+ // sequence range\n+ range: ({ min, max }) => max - min,\n+ // computes sequence min val\n+ min: ({ src }) => tx.reduce(tx.min(), src),\n+ // computes sequence max val\n+ max: ({ src }) => tx.reduce(tx.max(), src),\n+ // sorted copy\n+ sorted: ({ src }) => [...src].sort((a, b) => a - b),\n+ // standard deviation\n+ sd: ({ src, mean }) =>\n+ Math.sqrt(\n+ tx.transduce(tx.map((x: number) => Math.pow(x - mean, 2)), tx.add(), src) /\n+ (src.length - 1)),\n+ // compute 10th - 90th percentiles\n+ percentiles: ({ sorted }) => {\n+ return tx.transduce(\n+ tx.map((x: number) => sorted[Math.floor(x / 100 * sorted.length)]),\n+ tx.push(),\n+ tx.range(10, 100, 5)\n+ );\n+ }\n+ };\n+ console.log(resolveMap({ ...stats, src: () => [1, 6, 7, 2, 4, 11, -3] }));\n+ });\n});\n",
"new_path": "packages/resolve-map/test/index.ts",
"old_path": "packages/resolve-map/test/index.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | feat(resolve-map): add ES6 destructuring shorthands for function vals
- add _resolveFunction()
- add tests
- update docs & readme | 1 | feat | resolve-map |
679,913 | 07.06.2018 03:19:10 | -3,600 | 0fc2305eb1565338d119513c6365b5215376d503 | fix(rstream-graph): rename `resolveMap` => `resolve` due to upstream changes | [
{
"change_type": "MODIFY",
"diff": "@@ -5,7 +5,7 @@ import { isPlainObject } from \"@thi.ng/checks/is-plain-object\";\nimport { isString } from \"@thi.ng/checks/is-string\";\nimport { illegalArgs } from \"@thi.ng/errors/illegal-arguments\";\nimport { getIn } from \"@thi.ng/paths\";\n-import { absPath, resolveMap } from \"@thi.ng/resolve-map\";\n+import { absPath, resolve } from \"@thi.ng/resolve-map\";\nimport { ISubscribable } from \"@thi.ng/rstream/api\";\nimport { fromIterableSync } from \"@thi.ng/rstream/from/iterable\";\nimport { fromView } from \"@thi.ng/rstream/from/view\";\n@@ -28,7 +28,7 @@ import {\n* Dataflow graph initialization function. Takes a state Atom (or `null`\n* if not needed) and an object of `NodeSpec` values or functions\n* returning `Node` objects. Calls `nodeFromSpec` for each spec and then\n- * recursively resolves references via thi.ng/resolve-map `resolveMap`.\n+ * recursively resolves references via thi.ng/resolve-map `resolve`.\n* Returns new initialized graph object of `Node` objects and\n* `@thi.ng/rstream` stream constructs. Does NOT mutate original\n* `GraphSpec` object.\n@@ -46,17 +46,17 @@ export const initGraph = (state: IAtom<any>, spec: GraphSpec): Graph => {\nres[id] = <any>n;\n}\n}\n- return resolveMap(res);\n+ return resolve(res);\n};\nconst isNodeSpec = (x: any): x is NodeSpec =>\nisPlainObject(x) && isFunction((<any>x).fn);\n/**\n- * Transforms a single `NodeSpec` into a lookup function for\n- * `resolveMap` (which is called from `initGraph`). When that function\n- * is called, recursively resolves all specified input streams and calls\n- * this spec's `fn` to produce a new stream from these inputs.\n+ * Transforms a single `NodeSpec` into a lookup function for `resolve`\n+ * (which is called from `initGraph`). When that function is called,\n+ * recursively resolves all specified input streams and calls this\n+ * spec's `fn` to produce a new stream from these inputs.\n*\n* If the spec includes the optional `outs` keys, it also creates the\n* subscriptions for each of the given output keys, which then can be\n",
"new_path": "packages/rstream-graph/src/graph.ts",
"old_path": "packages/rstream-graph/src/graph.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | fix(rstream-graph): rename `resolveMap` => `resolve` due to upstream changes | 1 | fix | rstream-graph |
730,429 | 07.06.2018 10:02:44 | 14,400 | aff906d138d2525f861907fd42f03e4d72c32946 | feat(all): remove roster feature flag | [
{
"change_type": "MODIFY",
"diff": "@@ -3,7 +3,6 @@ import {Map} from 'immutable';\nexport const STORE_FEATURE = 'features/STORE_FEATURE';\nexport const FEATURE_MENTIONS = 'js-widgets-mentions';\n-export const FEATURE_ROSTER = 'js-widgets-roster';\nexport const initialState = new Map({\nitems: new Map()\n",
"new_path": "packages/node_modules/@ciscospark/redux-module-features/src/index.js",
"old_path": "packages/node_modules/@ciscospark/redux-module-features/src/index.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -16,10 +16,7 @@ import RosterWidget from '@ciscospark/widget-roster';\nimport FilesWidget from '@ciscospark/widget-files';\nimport {ICONS} from '@ciscospark/react-component-icon';\n-import {\n- getFeature,\n- FEATURE_ROSTER\n-} from '@ciscospark/redux-module-features';\n+import {getFeature} from '@ciscospark/redux-module-features';\nimport {\nupdateWidgetStatus,\n@@ -200,10 +197,6 @@ export default compose(\nprops: {\nonClickClose: props.handleSecondaryDismiss,\nonClickMenu: props.handleMenuClick\n- },\n- feature: {\n- type: 'developer',\n- key: FEATURE_ROSTER\n}\n},\n{\n",
"new_path": "packages/node_modules/@ciscospark/widget-space/src/enhancers/activity-menu.js",
"old_path": "packages/node_modules/@ciscospark/widget-space/src/enhancers/activity-menu.js"
},
{
"change_type": "DELETE",
"diff": "-import {assert} from 'chai';\n-\n-import {elements as mainElements} from './main';\n-import {elements as rosterElements} from './roster';\n-\n-/**\n- *\n- * Feature Flag Tests Journeys\n- *\n- * @export\n- * @param {any} browserWithAllTheFeatures\n- * @param {any} browserWithNoFeatures\n- */\n-export default function featureFlagTests(browserWithAllTheFeatures, browserWithNoFeatures) {\n- describe('Roster Feature Flag', () => {\n- it('has a roster for user with feature flag', () => {\n- browserWithAllTheFeatures.click(mainElements.menuButton);\n- browserWithAllTheFeatures.waitForVisible(mainElements.activityMenu);\n- assert.isTrue(browserWithAllTheFeatures.isVisible(rosterElements.peopleButton));\n- browserWithAllTheFeatures.click(mainElements.exitButton);\n- });\n-\n- it('does not have a roster for user without flag', () => {\n- browserWithNoFeatures.click(mainElements.menuButton);\n- browserWithNoFeatures.waitForVisible(mainElements.activityMenu);\n- assert.isFalse(browserWithNoFeatures.isVisible(rosterElements.peopleButton));\n- browserWithNoFeatures.click(mainElements.exitButton);\n- });\n- });\n-}\n",
"new_path": null,
"old_path": "test/journeys/lib/test-helpers/space-widget/featureFlags.js"
},
{
"change_type": "MODIFY",
"diff": "import {assert} from 'chai';\n-export const FEATURE_FLAG_ROSTER = 'js-widgets-roster';\n-\nexport const elements = {\nrosterWidget: '.ciscospark-roster',\ncloseButton: 'button[aria-label=\"Close\"]',\n",
"new_path": "test/journeys/lib/test-helpers/space-widget/roster.js",
"old_path": "test/journeys/lib/test-helpers/space-widget/roster.js"
},
{
"change_type": "MODIFY",
"diff": "import {assert} from 'chai';\n-import '@ciscospark/internal-plugin-feature';\nimport '@ciscospark/plugin-logger';\nimport CiscoSpark from '@ciscospark/spark-core';\nimport testUsers from '@ciscospark/test-helper-test-users';\nimport {\nelements as rosterElements,\n- hasParticipants,\n- FEATURE_FLAG_ROSTER\n+ hasParticipants\n} from '../../../lib/test-helpers/space-widget/roster';\nimport {elements, openMenuAndClickButton} from '../../../lib/test-helpers/space-widget/main';\nimport {jobNames, renameJob, updateJobStatus} from '../../../lib/test-helpers';\n@@ -45,8 +43,7 @@ describe('Widget Space: One on One: Data API', () => {\n}\n}\n});\n- return spock.spark.internal.device.register()\n- .then(() => spock.spark.internal.feature.setFeature('developer', FEATURE_FLAG_ROSTER, true));\n+ return spock.spark.internal.device.register();\n}));\nbefore('create mccoy', () => testUsers.create({count: 1, config: {displayName: mccoyName}})\n",
"new_path": "test/journeys/specs/oneOnOne/dataApi/basic.js",
"old_path": "test/journeys/specs/oneOnOne/dataApi/basic.js"
},
{
"change_type": "DELETE",
"diff": "-import {assert} from 'chai';\n-import '@ciscospark/internal-plugin-feature';\n-import '@ciscospark/plugin-logger';\n-import CiscoSpark from '@ciscospark/spark-core';\n-import testUsers from '@ciscospark/test-helper-test-users';\n-\n-import {elements as rosterElements, FEATURE_FLAG_ROSTER} from '../../../lib/test-helpers/space-widget/roster';\n-import {updateJobStatus} from '../../../lib/test-helpers';\n-\n-describe('Widget Space: One on One: Data API', () => {\n- const browserLocal = browser.select('browserLocal');\n- const browserRemote = browser.select('browserRemote');\n-\n- const menuButton = 'button[aria-label=\"Main Menu\"]';\n- const activityMenu = '.ciscospark-activity-menu';\n- const jobName = 'react-widget-oneOnOne-dataApi';\n-\n- let allPassed = true;\n- let userWithAllTheFeatures, userWithNoFeatures;\n-\n- before('load browsers', () => {\n- browser.url('data-api/space.html');\n- });\n-\n- before('create main user', () => testUsers.create({count: 1, config: {displayName: 'All Features'}})\n- .then((users) => {\n- [userWithAllTheFeatures] = users;\n- userWithAllTheFeatures.spark = new CiscoSpark({\n- credentials: {\n- authorization: userWithAllTheFeatures.token\n- },\n- config: {\n- logger: {\n- level: 'error'\n- }\n- }\n- });\n- return userWithAllTheFeatures.spark.internal.device.register()\n- .then(() => userWithAllTheFeatures.spark.internal.feature.setFeature('developer', FEATURE_FLAG_ROSTER, true));\n- }));\n-\n- before('create basic user', () => testUsers.create({count: 1, config: {displayName: 'No Features'}})\n- .then((users) => {\n- [userWithNoFeatures] = users;\n- userWithNoFeatures.spark = new CiscoSpark({\n- credentials: {\n- authorization: userWithNoFeatures.token\n- },\n- config: {\n- logger: {\n- level: 'error'\n- }\n- }\n- });\n- return userWithNoFeatures.spark.internal.device.register()\n- .then(() => userWithNoFeatures.spark.internal.feature.setFeature('developer', FEATURE_FLAG_ROSTER, false));\n- }));\n-\n- before('pause to let test users establish', () => browser.pause(5000));\n-\n- before('open widget local', () => {\n- browserLocal.execute((localAccessToken, localToUserEmail) => {\n- const csmmDom = document.createElement('div');\n- csmmDom.setAttribute('class', 'ciscospark-widget');\n- csmmDom.setAttribute('data-toggle', 'ciscospark-space');\n- csmmDom.setAttribute('data-access-token', localAccessToken);\n- csmmDom.setAttribute('data-to-person-email', localToUserEmail);\n- csmmDom.setAttribute('data-initial-activity', 'message');\n- document.getElementById('ciscospark-widget').appendChild(csmmDom);\n- window.loadBundle('/dist-space/bundle.js');\n- }, userWithAllTheFeatures.token.access_token, userWithNoFeatures.email);\n- browserLocal.waitForVisible(`[placeholder=\"Send a message to ${userWithNoFeatures.displayName}\"]`);\n- });\n-\n- before('open widget remote', () => {\n- browserRemote.execute((localAccessToken, localToUserEmail) => {\n- const csmmDom = document.createElement('div');\n- csmmDom.setAttribute('class', 'ciscospark-widget');\n- csmmDom.setAttribute('data-toggle', 'ciscospark-space');\n- csmmDom.setAttribute('data-access-token', localAccessToken);\n- csmmDom.setAttribute('data-to-person-email', localToUserEmail);\n- csmmDom.setAttribute('data-initial-activity', 'message');\n- document.getElementById('ciscospark-widget').appendChild(csmmDom);\n- window.loadBundle('/dist-space/bundle.js');\n- }, userWithNoFeatures.token.access_token, userWithAllTheFeatures.email);\n- browserRemote.waitForVisible(`[placeholder=\"Send a message to ${userWithAllTheFeatures.displayName}\"]`);\n- });\n-\n- describe('Feature Flags', () => {\n- describe('Roster Feature Flag', () => {\n- it('has a roster for user with feature flag', () => {\n- browserLocal.click(menuButton);\n- browserLocal.waitForVisible(activityMenu);\n- assert.isTrue(browserLocal.isVisible(rosterElements.peopleButton));\n- });\n-\n- it('does not have a roster for user without flag', () => {\n- browserRemote.click(menuButton);\n- browserRemote.waitForVisible(activityMenu);\n- assert.isFalse(browserRemote.isVisible(rosterElements.peopleButton));\n- });\n- });\n- });\n-\n- /* eslint-disable-next-line func-names */\n- afterEach(function () {\n- allPassed = allPassed && (this.currentTest.state === 'passed');\n- });\n-\n- after(() => {\n- updateJobStatus(jobName, allPassed);\n- });\n-});\n",
"new_path": null,
"old_path": "test/journeys/specs/oneOnOne/dataApi/features.js"
},
{
"change_type": "MODIFY",
"diff": "import {assert} from 'chai';\n-import '@ciscospark/internal-plugin-feature';\nimport '@ciscospark/plugin-logger';\nimport CiscoSpark from '@ciscospark/spark-core';\nimport testUsers from '@ciscospark/test-helper-test-users';\nimport {jobNames, renameJob, updateJobStatus} from '../../../lib/test-helpers';\n-import {elements as rosterElements, hasParticipants, FEATURE_FLAG_ROSTER} from '../../../lib/test-helpers/space-widget/roster';\n+import {elements as rosterElements, hasParticipants} from '../../../lib/test-helpers/space-widget/roster';\nimport {runAxe} from '../../../lib/axe';\nimport {elements, openMenuAndClickButton} from '../../../lib/test-helpers/space-widget/main';\n@@ -39,8 +38,7 @@ describe('Widget Space: One on One', () => {\n}\n}\n});\n- return spock.spark.internal.device.register()\n- .then(() => spock.spark.internal.feature.setFeature('developer', FEATURE_FLAG_ROSTER, true));\n+ return spock.spark.internal.device.register();\n}));\nbefore('create mccoy', () => testUsers.create({count: 1, config: {displayName: mccoyName}})\n",
"new_path": "test/journeys/specs/oneOnOne/global/basic.js",
"old_path": "test/journeys/specs/oneOnOne/global/basic.js"
},
{
"change_type": "DELETE",
"diff": "-import {assert} from 'chai';\n-import '@ciscospark/internal-plugin-feature';\n-import '@ciscospark/plugin-logger';\n-import CiscoSpark from '@ciscospark/spark-core';\n-import testUsers from '@ciscospark/test-helper-test-users';\n-\n-import {elements as rosterElements, FEATURE_FLAG_ROSTER} from '../../../lib/test-helpers/space-widget/roster';\n-import {updateJobStatus} from '../../../lib/test-helpers';\n-\n-describe('Widget Space: One on One', () => {\n- const browserLocal = browser.select('browserLocal');\n- const browserRemote = browser.select('browserRemote');\n-\n- const menuButton = 'button[aria-label=\"Main Menu\"]';\n- const activityMenu = '.ciscospark-activity-menu';\n- const jobName = 'react-widget-oneOnOne-global';\n-\n- let allPassed = true;\n- let userWithAllTheFeatures, userWithNoFeatures;\n-\n- before('load browsers', () => {\n- browser.url('/space.html?basic');\n- });\n-\n- before('create main user', () => testUsers.create({count: 1, config: {displayName: 'All Features'}})\n- .then((users) => {\n- [userWithAllTheFeatures] = users;\n- userWithAllTheFeatures.spark = new CiscoSpark({\n- credentials: {\n- authorization: userWithAllTheFeatures.token\n- },\n- config: {\n- logger: {\n- level: 'error'\n- }\n- }\n- });\n- return userWithAllTheFeatures.spark.internal.device.register()\n- .then(() => userWithAllTheFeatures.spark.internal.feature.setFeature('developer', FEATURE_FLAG_ROSTER, true));\n- }));\n-\n- before('create basic user', () => testUsers.create({count: 1, config: {displayName: 'No Features'}})\n- .then((users) => {\n- [userWithNoFeatures] = users;\n- userWithNoFeatures.spark = new CiscoSpark({\n- credentials: {\n- authorization: userWithNoFeatures.token\n- },\n- config: {\n- logger: {\n- level: 'error'\n- }\n- }\n- });\n- return userWithNoFeatures.spark.internal.device.register()\n- .then(() => userWithNoFeatures.spark.internal.feature.setFeature('developer', FEATURE_FLAG_ROSTER, false));\n- }));\n-\n- before('pause to let test users establish', () => browser.pause(5000));\n-\n- before('open widget local', () => {\n- browserLocal.execute((localAccessToken, localToUserEmail) => {\n- const options = {\n- accessToken: localAccessToken,\n- toPersonEmail: localToUserEmail,\n- initialActivity: 'message'\n- };\n- window.openSpaceWidget(options);\n- }, userWithAllTheFeatures.token.access_token, userWithNoFeatures.email);\n- browserLocal.waitForVisible(`[placeholder=\"Send a message to ${userWithNoFeatures.displayName}\"]`);\n- });\n-\n- before('open widget remote', () => {\n- browserRemote.execute((localAccessToken, localToUserEmail) => {\n- const options = {\n- accessToken: localAccessToken,\n- toPersonEmail: localToUserEmail,\n- initialActivity: 'message'\n- };\n- window.openSpaceWidget(options);\n- }, userWithNoFeatures.token.access_token, userWithAllTheFeatures.email);\n- browserRemote.waitForVisible(`[placeholder=\"Send a message to ${userWithAllTheFeatures.displayName}\"]`);\n- });\n-\n- describe('Feature Flags', () => {\n- describe('Roster Feature Flag', () => {\n- it('has a roster for user with feature flag', () => {\n- browserLocal.click(menuButton);\n- browserLocal.waitForVisible(activityMenu);\n- assert.isTrue(browserLocal.isVisible(rosterElements.peopleButton));\n- });\n-\n- it('does not have a roster for user without flag', () => {\n- browserRemote.click(menuButton);\n- browserRemote.waitForVisible(activityMenu);\n- assert.isFalse(browserRemote.isVisible(rosterElements.peopleButton));\n- });\n- });\n- });\n-\n- /* eslint-disable-next-line func-names */\n- afterEach(function () {\n- allPassed = allPassed && (this.currentTest.state === 'passed');\n- });\n-\n- after(() => {\n- updateJobStatus(jobName, allPassed);\n- });\n-});\n",
"new_path": null,
"old_path": "test/journeys/specs/oneOnOne/global/features.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -11,8 +11,7 @@ import {\nelements as rosterElements,\ncanSearchForParticipants,\nhasParticipants,\n- searchForPerson,\n- FEATURE_FLAG_ROSTER\n+ searchForPerson\n} from '../../../lib/test-helpers/space-widget/roster';\ndescribe('Widget Space: Data API', () => {\n@@ -47,7 +46,6 @@ describe('Widget Space: Data API', () => {\n}\n});\nreturn marty.spark.internal.device.register()\n- .then(() => marty.spark.internal.feature.setFeature('developer', FEATURE_FLAG_ROSTER, true))\n.then(() => marty.spark.internal.mercury.connect());\n}));\n",
"new_path": "test/journeys/specs/space/dataApi/basic.js",
"old_path": "test/journeys/specs/space/dataApi/basic.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,7 +5,6 @@ import CiscoSpark from '@ciscospark/spark-core';\nimport {switchToMeet} from '../../../lib/test-helpers/space-widget/main';\nimport {updateJobStatus} from '../../../lib/test-helpers';\n-import {FEATURE_FLAG_ROSTER} from '../../../lib/test-helpers/space-widget/roster';\nimport {elements, declineIncomingCallTest, hangupDuringCallTest} from '../../../lib/test-helpers/space-widget/meet';\ndescribe('Widget Space: Data API', () => {\n@@ -34,8 +33,7 @@ describe('Widget Space: Data API', () => {\n}\n}\n});\n- return marty.spark.internal.mercury.connect()\n- .then(() => marty.spark.internal.feature.setFeature('developer', FEATURE_FLAG_ROSTER, true));\n+ return marty.spark.internal.mercury.connect();\n}));\nbefore('create docbrown', () => testUsers.create({count: 1, config: {displayName: 'Emmett Brown'}})\n@@ -51,8 +49,7 @@ describe('Widget Space: Data API', () => {\n}\n}\n});\n- return docbrown.spark.internal.device.register()\n- .then(() => docbrown.spark.internal.feature.setFeature('developer', FEATURE_FLAG_ROSTER, true));\n+ return docbrown.spark.internal.device.register();\n}));\nbefore('create lorraine', () => testUsers.create({count: 1, config: {displayName: 'Lorraine Baines'}})\n",
"new_path": "test/journeys/specs/space/dataApi/meet.js",
"old_path": "test/journeys/specs/space/dataApi/meet.js"
},
{
"change_type": "DELETE",
"diff": "-import '@ciscospark/internal-plugin-conversation';\n-import '@ciscospark/internal-plugin-feature';\n-import '@ciscospark/plugin-logger';\n-import CiscoSpark from '@ciscospark/spark-core';\n-import testUsers from '@ciscospark/test-helper-test-users';\n-\n-import {updateJobStatus} from '../../lib/test-helpers';\n-import featureFlagTests from '../../lib/test-helpers/space-widget/featureFlags';\n-import {FEATURE_FLAG_ROSTER} from '../../lib/test-helpers/space-widget/roster';\n-\n-\n-describe('Widget Space Feature Flags', () => {\n- const browserLocal = browser.select('browserLocal');\n- const browserRemote = browser.select('browserRemote');\n- const jobName = 'react-widget-space-global';\n-\n- let allPassed = true;\n- let conversation;\n- let userWithAllTheFeatures, userWithNoFeatures1, userWithNoFeatures2;\n-\n- before('create test users', () => Promise.all([\n- testUsers.create({count: 1, config: {displayName: 'All Features'}})\n- .then((users) => {\n- [userWithAllTheFeatures] = users;\n- userWithAllTheFeatures.spark = new CiscoSpark({\n- credentials: {\n- authorization: userWithAllTheFeatures.token\n- },\n- config: {\n- logger: {\n- level: 'error'\n- }\n- }\n- });\n- return userWithAllTheFeatures.spark.internal.device.register()\n- .then(() => userWithAllTheFeatures.spark.internal.feature.setFeature('developer', FEATURE_FLAG_ROSTER, true));\n- }),\n- testUsers.create({count: 2, config: {displayName: 'No Features'}})\n- .then((users) => {\n- [userWithNoFeatures1, userWithNoFeatures2] = users;\n- userWithNoFeatures1.spark = new CiscoSpark({\n- credentials: {\n- authorization: userWithNoFeatures1.token\n- },\n- config: {\n- logger: {\n- level: 'error'\n- }\n- }\n- });\n- return userWithNoFeatures1.spark.internal.device.register()\n- .then(() => userWithNoFeatures1.spark.internal.feature.setFeature('developer', FEATURE_FLAG_ROSTER, false));\n- })\n- ]));\n-\n- before('pause to let test users establish', () => browser.pause(5000));\n-\n- before('create space', () => userWithAllTheFeatures.spark.internal.conversation.create({\n- displayName: 'Widget Feature Flag Test Space',\n- participants: [userWithAllTheFeatures, userWithNoFeatures1, userWithNoFeatures2]\n- }).then((c) => {\n- conversation = c;\n- return conversation;\n- }));\n-\n- describe('Browser Global', () => {\n- before('load browsers', () => {\n- browser.url('/space.html?basic');\n- });\n-\n- before('open widget local', () => {\n- browserLocal.execute((localAccessToken, spaceId) => {\n- const options = {\n- accessToken: localAccessToken,\n- spaceId,\n- initialActivity: 'message'\n- };\n- window.openSpaceWidget(options);\n- }, userWithAllTheFeatures.token.access_token, conversation.id);\n- browserLocal.waitForVisible(`[placeholder=\"Send a message to ${conversation.displayName}\"]`);\n- });\n-\n- before('open widget remote', () => {\n- browserRemote.execute((localAccessToken, spaceId) => {\n- const options = {\n- accessToken: localAccessToken,\n- spaceId,\n- initialActivity: 'message'\n- };\n- window.openSpaceWidget(options);\n- }, userWithNoFeatures1.token.access_token, conversation.id);\n- browserRemote.waitForVisible(`[placeholder=\"Send a message to ${conversation.displayName}\"]`);\n- });\n-\n- describe('Feature Flag Tests', () => {\n- featureFlagTests(browserLocal, browserRemote);\n- });\n- });\n-\n- describe('Data API', () => {\n- before('load browsers', () => {\n- browser.url('/data-api/space.html');\n- });\n-\n- before('open widget local', () => {\n- browserLocal.execute((localAccessToken, spaceId) => {\n- const csmmDom = document.createElement('div');\n- csmmDom.setAttribute('class', 'ciscospark-widget');\n- csmmDom.setAttribute('data-toggle', 'ciscospark-space');\n- csmmDom.setAttribute('data-access-token', localAccessToken);\n- csmmDom.setAttribute('data-space-id', spaceId);\n- csmmDom.setAttribute('data-initial-activity', 'message');\n- document.getElementById('ciscospark-widget').appendChild(csmmDom);\n- window.loadBundle('/dist-space/bundle.js');\n- }, userWithAllTheFeatures.token.access_token, conversation.id);\n- browserLocal.waitForVisible(`[placeholder=\"Send a message to ${conversation.displayName}\"]`);\n- });\n-\n- before('open widget remote', () => {\n- browserRemote.execute((localAccessToken, spaceId) => {\n- const csmmDom = document.createElement('div');\n- csmmDom.setAttribute('class', 'ciscospark-widget');\n- csmmDom.setAttribute('data-toggle', 'ciscospark-space');\n- csmmDom.setAttribute('data-access-token', localAccessToken);\n- csmmDom.setAttribute('data-space-id', spaceId);\n- csmmDom.setAttribute('data-initial-activity', 'message');\n- document.getElementById('ciscospark-widget').appendChild(csmmDom);\n- window.loadBundle('/dist-space/bundle.js');\n- }, userWithNoFeatures1.token.access_token, conversation.id);\n- browserRemote.waitForVisible(`[placeholder=\"Send a message to ${conversation.displayName}\"]`);\n- });\n-\n- describe('Feature Flag Tests', () => {\n- featureFlagTests(browserLocal, browserRemote);\n- });\n- });\n-\n- /* eslint-disable-next-line func-names */\n- afterEach(function () {\n- allPassed = allPassed && (this.currentTest.state === 'passed');\n- });\n-\n- after(() => {\n- updateJobStatus(jobName, allPassed);\n- });\n-});\n",
"new_path": null,
"old_path": "test/journeys/specs/space/featureFlags.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -11,8 +11,7 @@ import {\nelements as rosterElements,\ncanSearchForParticipants,\nhasParticipants,\n- searchForPerson,\n- FEATURE_FLAG_ROSTER\n+ searchForPerson\n} from '../../../lib/test-helpers/space-widget/roster';\nimport {elements, openMenuAndClickButton} from '../../../lib/test-helpers/space-widget/main';\n@@ -46,7 +45,6 @@ describe('Widget Space', () => {\n}\n});\nreturn marty.spark.internal.device.register()\n- .then(() => marty.spark.internal.feature.setFeature('developer', FEATURE_FLAG_ROSTER, true))\n.then(() => marty.spark.internal.mercury.connect());\n}));\n",
"new_path": "test/journeys/specs/space/global/basic.js",
"old_path": "test/journeys/specs/space/global/basic.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -6,7 +6,6 @@ import CiscoSpark from '@ciscospark/spark-core';\nimport {updateJobStatus} from '../../../lib/test-helpers';\nimport {switchToMeet} from '../../../lib/test-helpers/space-widget/main';\nimport {clearEventLog} from '../../../lib/events';\n-import {FEATURE_FLAG_ROSTER} from '../../../lib/test-helpers/space-widget/roster';\nimport {elements, declineIncomingCallTest, hangupDuringCallTest, callEventTest} from '../../../lib/test-helpers/space-widget/meet';\ndescribe('Widget Space', () => {\n@@ -35,8 +34,7 @@ describe('Widget Space', () => {\n}\n}\n});\n- return marty.spark.internal.mercury.connect()\n- .then(() => marty.spark.internal.feature.setFeature('developer', FEATURE_FLAG_ROSTER, true));\n+ return marty.spark.internal.mercury.connect();\n}));\nbefore('create docbrown', () => testUsers.create({count: 1, config: {displayName: 'Emmett Brown'}})\n@@ -52,8 +50,7 @@ describe('Widget Space', () => {\n}\n}\n});\n- return docbrown.spark.internal.device.register()\n- .then(() => docbrown.spark.internal.feature.setFeature('developer', FEATURE_FLAG_ROSTER, true));\n+ return docbrown.spark.internal.device.register();\n}));\nbefore('create lorraine', () => testUsers.create({count: 1, config: {displayName: 'Lorraine Baines'}})\n",
"new_path": "test/journeys/specs/space/global/meet.js",
"old_path": "test/journeys/specs/space/global/meet.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -34,10 +34,6 @@ The \"oneOnOne\" test suite opens a space widget between two individuals. The test\n- closes the people roster widget\n- accessibility\n- should have no accessibility violations\n- - Feature Flags (Test Users Created)\n- - Roster Feature Flag\n- - has a roster for user with feature flag\n- - does not have a roster for user without flag\n- Meet widget (Test Users Created)\n- pre call experience\n- has a call button\n@@ -118,10 +114,6 @@ The \"oneOnOne\" test suite opens a space widget between two individuals. The test\n- has the total count of participants\n- has the participants listed\n- closes the people roster widget\n- - Feature Flags (Test Users Created)\n- - Roster Feature Flag\n- - has a roster for user with feature flag\n- - does not have a roster for user without flag\n- Meet widget (Test Users Created)\n- pre call experience\n- has a call button\n@@ -321,22 +313,6 @@ The \"space\" test suite opens a space widget to a group space and creates three t\n- start call setting\n- starts call when set to true\n-- Feature Flags\n- - Global\n- - Roster Feature Flag\n- - has a roster for user with feature flag\n- - does not have a roster for user without flag\n- - Group Calling Feature Flag\n- - has a call option for user with feature flag\n- - does not have a call option for user without flag\n- - Data API\n- - Roster Feature Flag\n- - has a roster for user with feature flag\n- - does not have a roster for user without flag\n- - Group Calling Feature Flag\n- - has a call option for user with feature flag\n- - does not have a call option for user without flag\n-\n### Recents Suite\nThe \"recents\" test suite opens a recents widget and does things via the sdk that should be reflected in the recents widget. The tests are performed by instantiating the widget in two separate ways: via the data-api and via the global javascript method.\n",
"new_path": "test/journeys/testplan.md",
"old_path": "test/journeys/testplan.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -112,12 +112,10 @@ exports.config = {\n],\noneOnOne: [\n'./test/journeys/specs/oneOnOne/dataApi/basic.js',\n- './test/journeys/specs/oneOnOne/dataApi/features.js',\n'./test/journeys/specs/oneOnOne/dataApi/meet.js',\n'./test/journeys/specs/oneOnOne/dataApi/messaging.js',\n'./test/journeys/specs/oneOnOne/dataApi/startup-settings.js',\n'./test/journeys/specs/oneOnOne/global/basic.js',\n- './test/journeys/specs/oneOnOne/global/features.js',\n'./test/journeys/specs/oneOnOne/global/meet.js',\n'./test/journeys/specs/oneOnOne/global/messaging.js'\n],\n@@ -128,8 +126,7 @@ exports.config = {\n'./test/journeys/specs/space/dataApi/startup-settings.js',\n'./test/journeys/specs/space/global/basic.js',\n'./test/journeys/specs/space/global/meet.js',\n- './test/journeys/specs/space/global/messaging.js',\n- './test/journeys/specs/space/featureFlags.js'\n+ './test/journeys/specs/space/global/messaging.js'\n],\nrecents: [\n'./test/journeys/specs/recents/dataApi/basic.js',\n@@ -141,13 +138,11 @@ exports.config = {\nintegration: [\n'./test/journeys/specs/multiple/index.js',\n'./test/journeys/specs/oneOnOne/dataApi/basic.js',\n- './test/journeys/specs/oneOnOne/dataApi/features.js',\n'./test/journeys/specs/oneOnOne/dataApi/guest.js',\n'./test/journeys/specs/oneOnOne/dataApi/meet.js',\n'./test/journeys/specs/oneOnOne/dataApi/messaging.js',\n'./test/journeys/specs/oneOnOne/dataApi/startup-settings.js',\n'./test/journeys/specs/oneOnOne/global/basic.js',\n- './test/journeys/specs/oneOnOne/global/features.js',\n'./test/journeys/specs/oneOnOne/global/guest.js',\n'./test/journeys/specs/oneOnOne/global/meet.js',\n'./test/journeys/specs/oneOnOne/global/messaging.js',\n@@ -159,8 +154,7 @@ exports.config = {\n'./test/journeys/specs/space/dataApi/startup-settings.js',\n'./test/journeys/specs/space/global/basic.js',\n'./test/journeys/specs/space/global/meet.js',\n- './test/journeys/specs/space/global/messaging.js',\n- './test/journeys/specs/space/featureFlags.js'\n+ './test/journeys/specs/space/global/messaging.js'\n],\nguest: [\n'./test/journeys/specs/oneOnOne/dataApi/guest.js',\n",
"new_path": "wdio.conf.js",
"old_path": "wdio.conf.js"
}
] | JavaScript | MIT License | webex/react-widgets | feat(all): remove roster feature flag | 1 | feat | all |
730,429 | 07.06.2018 10:07:52 | 14,400 | 46a8e8188b5a8d4df359f5c769a3212a03ee6195 | feat(widget-message): remove mentions feature flag | [
{
"change_type": "MODIFY",
"diff": "@@ -2,8 +2,6 @@ import {Map} from 'immutable';\nexport const STORE_FEATURE = 'features/STORE_FEATURE';\n-export const FEATURE_MENTIONS = 'js-widgets-mentions';\n-\nexport const initialState = new Map({\nitems: new Map()\n});\n",
"new_path": "packages/node_modules/@ciscospark/redux-module-features/src/index.js",
"old_path": "packages/node_modules/@ciscospark/redux-module-features/src/index.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -10,10 +10,6 @@ import {autobind} from 'core-decorators';\nimport {constructFiles} from '@ciscospark/react-component-utils';\nimport {fetchAvatarsForUsers} from '@ciscospark/redux-module-avatar';\n-import {\n- getFeature,\n- FEATURE_MENTIONS\n-} from '@ciscospark/redux-module-features';\nimport {\nacknowledgeActivityOnServer,\n@@ -146,10 +142,6 @@ export class MessageWidget extends Component {\n&& nextProps.activityCount !== props.activityCount) {\nthis.scrollHeight = this.activityList.getScrollHeight();\n}\n-\n- if (!nextProps.features.hasIn(['items', FEATURE_MENTIONS])) {\n- props.getFeature('developer', FEATURE_MENTIONS, nextProps.sparkInstance);\n- }\n}\ncomponentDidUpdate(prevProps) {\n@@ -628,7 +620,6 @@ export class MessageWidget extends Component {\nconst {\nconversation,\nconversationId,\n- features,\nsparkInstance,\ncurrentUser,\nmuteNotifications,\n@@ -642,7 +633,6 @@ export class MessageWidget extends Component {\nconst isLoadingHistoryUp = conversation.getIn(['status', 'isLoadingHistoryUp']);\nconst toUser = this.getToUserFromConversation(conversation);\nconst displayName = conversation.get('displayName') || toUser && toUser.get('displayName');\n- const showMentions = features.getIn(['items', FEATURE_MENTIONS]);\nreturn (\n<Dropzone\n@@ -683,7 +673,7 @@ export class MessageWidget extends Component {\nconversation={conversation}\nonSubmit={this.handleMessageSubmit}\nplaceholder={formatMessage(messages.messageComposerPlaceholder, {displayName})}\n- showMentions={showMentions}\n+ showMentions\nsparkInstance={sparkInstance}\n/>\n</div>\n@@ -748,7 +738,6 @@ const injectedPropTypes = {\nupdateWidgetState: PropTypes.func.isRequired,\nspace: PropTypes.object.isRequired,\nfeatures: PropTypes.object.isRequired,\n- getFeature: PropTypes.func.isRequired,\nparticipants: PropTypes.array.isRequired,\nactivities: PropTypes.object.isRequired,\nconversationId: PropTypes.string\n@@ -797,7 +786,6 @@ export default connect(\nsubscribeToPresenceUpdates,\nunsubscribeFromPresenceUpdates,\nupdateHasNewMessage,\n- updateWidgetState,\n- getFeature\n+ updateWidgetState\n}, dispatch)\n)(ConnectedMessageWidget);\n",
"new_path": "packages/node_modules/@ciscospark/widget-message/src/container.js",
"old_path": "packages/node_modules/@ciscospark/widget-message/src/container.js"
}
] | JavaScript | MIT License | webex/react-widgets | feat(widget-message): remove mentions feature flag | 1 | feat | widget-message |
791,690 | 07.06.2018 12:46:05 | 25,200 | 13a133ddb13274a49c11c2089d4a805b741dc1a0 | core(main-resource): work with hash URLs | [
{
"change_type": "MODIFY",
"diff": "'use strict';\nconst ComputedArtifact = require('./computed-artifact');\n+const URL = require('../../lib/url-shim');\n/**\n* @fileoverview This artifact identifies the main resource on the page. Current solution assumes\n@@ -21,18 +22,18 @@ class MainResource extends ComputedArtifact {\n* @param {LH.ComputedArtifacts} artifacts\n* @return {Promise<LH.WebInspector.NetworkRequest>}\n*/\n- compute_(data, artifacts) {\n- const {URL, devtoolsLog} = data;\n- return artifacts.requestNetworkRecords(devtoolsLog)\n- .then(requests => {\n- const mainResource = requests.find(request => request.url === URL.finalUrl);\n+ async compute_(data, artifacts) {\n+ const finalUrl = data.URL.finalUrl;\n+ const requests = await artifacts.requestNetworkRecords(data.devtoolsLog);\n+ // equalWithExcludedFragments is expensive, so check that the finalUrl starts with the request first\n+ const mainResource = requests.find(request => finalUrl.startsWith(request.url) &&\n+ URL.equalWithExcludedFragments(request.url, finalUrl));\nif (!mainResource) {\nthrow new Error('Unable to identify the main resource');\n}\nreturn mainResource;\n- });\n}\n}\n",
"new_path": "lighthouse-core/gather/computed/main-resource.js",
"old_path": "lighthouse-core/gather/computed/main-resource.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -56,4 +56,19 @@ describe('MainResource computed artifact', () => {\nassert.equal(output.url, 'https://en.m.wikipedia.org/wiki/Main_Page');\n});\n});\n+\n+ it('should identify correct main resource with hash URLs', () => {\n+ const networkRecords = [\n+ {url: 'https://beta.httparchive.org/reports'},\n+ {url: 'https://beta.httparchive.org/reports/state-of-the-web'},\n+ ];\n+\n+ computedArtifacts.requestNetworkRecords = _ => Promise.resolve(networkRecords);\n+ const URL = {finalUrl: 'https://beta.httparchive.org/reports/state-of-the-web#pctHttps'};\n+ const artifacts = {URL};\n+\n+ return computedArtifacts.requestMainResource(artifacts).then(output => {\n+ assert.equal(output.url, 'https://beta.httparchive.org/reports/state-of-the-web');\n+ });\n+ });\n});\n",
"new_path": "lighthouse-core/test/gather/computed/main-resource-test.js",
"old_path": "lighthouse-core/test/gather/computed/main-resource-test.js"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core(main-resource): work with hash URLs (#5422) | 1 | core | main-resource |
573,227 | 07.06.2018 13:39:27 | 25,200 | 6be3fb7c07483ee1991eba9aaa9ad4897c5a4965 | fix(server): address req and res close event changes in Node v10.x | [
{
"change_type": "MODIFY",
"diff": "@@ -1091,6 +1091,7 @@ Server.prototype._onHandlerError = function _onHandlerError(err, req, res) {\nreturn;\n}\n+ // Handlers don't continue when error happen\nres._handlersFinished = true;\n// Preserve handler err for finish event\n@@ -1138,27 +1139,29 @@ Server.prototype._setupRequest = function _setupRequest(req, res) {\n}\n// Request lifecycle events\n- // attach a listener for 'close' events, this will let us set\n- // a flag so that we can stop processing the request if the client closes\n+\n+ // attach a listener for 'aborted' events, this will let us set\n+ // a flag so that we can stop processing the request if the client aborts\n// the connection (or we lose the connection).\n// we consider a closed request as flushed from metrics point of view\n- function onClose() {\n- res._flushed = true;\n- req._timeFlushed = process.hrtime();\n-\n- res.removeListener('finish', onFinish);\n- res.removeListener('error', onError);\n+ function onReqAborted() {\n+ // Request was aborted, override the status code\n+ var err = new errors.RequestCloseError();\n+ err.statusCode = 444;\n+\n+ // For backward compatibility we only set connection state to \"close\"\n+ // for RequestCloseError, also aborted is always immediatly followed\n+ // by a \"close\" event.\n+ // We don't set _connectionState to \"close\" in the happy path\nreq._connectionState = 'close';\n- // Request was aborted or closed. Override the status code\n- res.statusCode = 444;\n-\n- self._finishReqResCycle(req, res, new errors.RequestCloseError());\n+ // Set status code and err for audit as req is already closed connection\n+ res.statusCode = err.statusCode;\n+ res.err = err;\n}\n- req.once('close', onClose);\n// Response lifecycle events\n- function onFinish() {\n+ function onResFinish() {\nvar processHrTime = process.hrtime();\nres._flushed = true;\n@@ -1170,22 +1173,28 @@ Server.prototype._setupRequest = function _setupRequest(req, res) {\nreq._timeUseEnd = req._timeUseEnd || processHrTime;\nreq._timeRouteEnd = req._timeRouteEnd || processHrTime;\n- req.removeListener('close', onClose);\n- res.removeListener('error', onError);\n-\n- // Do not trigger false\n+ // In Node < 10 \"close\" event dont fire always\n+ // https://github.com/nodejs/node/pull/20611\nself._finishReqResCycle(req, res);\n}\n- function onError(err) {\n+\n+ // We are handling when connection is being closed prematurely outside of\n+ // restify. It's not because the req is aborted.\n+ function onResClose() {\nres._flushed = true;\n- req._timeFlushed = process.hrtime();\n- req.removeListener('close', onClose);\n- res.removeListener('finish', onFinish);\n- self._finishReqResCycle(req, res, err);\n+ // Finish may already set the req._timeFlushed\n+ req._timeFlushed = req._timeFlushed || process.hrtime();\n+\n+ self._finishReqResCycle(req, res, res.err);\n}\n- res.once('finish', onFinish);\n- res.once('error', onError);\n+\n+ // Request events\n+ req.once('aborted', onReqAborted);\n+\n+ // Response events\n+ res.once('finish', onResFinish);\n+ res.once('close', onResClose);\n// attach a listener for the response's 'redirect' event\nres.on('redirect', function onRedirect(redirectLocation) {\n@@ -1256,7 +1265,6 @@ Server.prototype._routeErrorResponse = function _routeErrorResponse(\n) {\nvar self = this;\n- // if (self.handleUncaughtExceptions) {\nif (self.listenerCount('uncaughtException') > 1) {\nself.emit('uncaughtException', req, res, req.route, err);\nreturn;\n",
"new_path": "lib/server.js",
"old_path": "lib/server.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -676,16 +676,23 @@ describe('audit logger', function() {\nassert.ok(data);\nassert.ok(data.req_id);\nassert.isNumber(data.latency);\n- assert.equal(444, data.res.statusCode);\n+ assert.equal(data.res.statusCode, 444);\ndone();\n});\nSERVER.get('/audit', function(req, res, next) {\n- req.emit('close');\n+ setTimeout(function() {\nres.send();\nnext();\n+ }, 100);\n});\n- CLIENT.get('/audit', function(err, req, res) {});\n+ CLIENT.get(\n+ {\n+ path: '/audit',\n+ requestTimeout: 50\n+ },\n+ function(err, req, res) {}\n+ );\n});\n});\n",
"new_path": "test/plugins/audit.test.js",
"old_path": "test/plugins/audit.test.js"
},
{
"change_type": "MODIFY",
"diff": "// external requires\nvar assert = require('chai').assert;\n+\nvar restify = require('../../lib/index.js');\nvar restifyClients = require('restify-clients');\n@@ -27,8 +28,7 @@ describe('request metrics plugin', function() {\nCLIENT = restifyClients.createJsonClient({\nurl: 'http://127.0.0.1:' + PORT,\ndtrace: helper.dtrace,\n- retry: false,\n- requestTimeout: 200\n+ retry: false\n});\ndone();\n@@ -103,6 +103,7 @@ describe('request metrics plugin', function() {\nit('should return metrics with pre error', function(done) {\nSERVER.on('uncaughtException', function(req, res, route, err) {\nassert.ok(err);\n+ res.send(err);\n});\nSERVER.on(\n@@ -139,6 +140,7 @@ describe('request metrics plugin', function() {\nit('should return metrics with use error', function(done) {\nSERVER.on('uncaughtException', function(req, res, route, err) {\nassert.ok(err);\n+ res.send(err);\n});\nSERVER.on(\n@@ -242,11 +244,17 @@ describe('request metrics plugin', function() {\n}\n);\n- CLIENT.get('/foo?a=1', function(err, _, res) {\n+ CLIENT.get(\n+ {\n+ path: '/foo?a=1',\n+ requestTimeout: 200\n+ },\n+ function(err, _, res) {\n// request should timeout\nassert.ok(err);\nassert.equal(err.name, 'RequestTimeoutError');\n- });\n+ }\n+ );\n});\nit('should handle uncaught exceptions', function(done) {\n@@ -260,6 +268,7 @@ describe('request metrics plugin', function() {\n{\nserver: SERVER\n},\n+ // TODO: test timeouts if any of the following asserts fails\nfunction(err, metrics, req, res, route) {\nassert.ok(err);\nassert.equal(err.name, 'Error');\n",
"new_path": "test/plugins/metrics.test.js",
"old_path": "test/plugins/metrics.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -1934,6 +1934,29 @@ test(\"should emit 'after' on successful request\", function(t) {\n});\n});\n+test(\"should emit 'after' on successful request with work\", function(t) {\n+ SERVER.on('after', function(req, res, route, err) {\n+ t.ifError(err);\n+ t.end();\n+ });\n+\n+ SERVER.get('/foobar', function(req, res, next) {\n+ // with timeouts we are testing that request lifecycle\n+ // events are firing in the correct order\n+ setTimeout(function() {\n+ res.send('hello world');\n+ setTimeout(function() {\n+ next();\n+ }, 500);\n+ }, 500);\n+ });\n+\n+ CLIENT.get('/foobar', function(err, _, res) {\n+ t.ifError(err);\n+ t.equal(res.statusCode, 200);\n+ });\n+});\n+\ntest(\"should emit 'after' on errored request\", function(t) {\nSERVER.on('after', function(req, res, route, err) {\nt.ok(err);\n@@ -1995,6 +2018,7 @@ test(\nSERVER.on('after', function(req, res, route, err) {\nt.ok(err);\nt.equal(req.connectionState(), 'close');\n+ t.equal(res.statusCode, 444);\nt.equal(err.name, 'RequestCloseError');\nt.end();\n});\n",
"new_path": "test/server.test.js",
"old_path": "test/server.test.js"
}
] | JavaScript | MIT License | restify/node-restify | fix(server): address req and res close event changes in Node v10.x (#1672) | 1 | fix | server |
573,227 | 07.06.2018 14:01:22 | 25,200 | a0e183b32ade06c6f57a1dd3e9f8f742f8340849 | chore(package): update minor dependencies | [
{
"change_type": "MODIFY",
"diff": "\"csv\": \"^1.1.1\",\n\"escape-regexp-component\": \"^1.0.2\",\n\"ewma\": \"^2.0.1\",\n- \"find-my-way\": \"^1.12.0\",\n+ \"find-my-way\": \"^1.13.0\",\n\"formidable\": \"^1.2.1\",\n\"http-signature\": \"^1.2.0\",\n\"lodash\": \"^4.17.10\",\n\"documentation\": \"^5.3.3\",\n\"eslint\": \"^4.19.1\",\n\"eslint-config-prettier\": \"2.9.0\",\n- \"eslint-plugin-jsdoc\": \"^3.6.3\",\n+ \"eslint-plugin-jsdoc\": \"^3.7.1\",\n\"eslint-plugin-prettier\": \"^2.6.0\",\n\"filed\": \"^0.1.0\",\n\"glob\": \"^7.1.2\",\n\"nsp\": \"^2.8.1\",\n\"ora\": \"^1.3.0\",\n\"pre-commit\": \"^1.2.2\",\n- \"prettier\": \"^1.12.1\",\n+ \"prettier\": \"^1.13.4\",\n\"proxyquire\": \"^1.8.0\",\n\"restify-clients\": \"^1.5.2\",\n\"rimraf\": \"^2.6.2\",\n",
"new_path": "package.json",
"old_path": "package.json"
}
] | JavaScript | MIT License | restify/node-restify | chore(package): update minor dependencies (#1675) | 1 | chore | package |
807,849 | 07.06.2018 17:29:36 | 25,200 | f674f354f0260c57d885c181e16c9ce23ac252a8 | fix(project): Report syntax errors in root package.json
Fixes | [
{
"change_type": "MODIFY",
"diff": "@@ -448,6 +448,23 @@ describe(\"core-command\", () => {\n}\n});\n+ it(\"throws JSONError when root package.json has syntax error\", async () => {\n+ expect.assertions(1);\n+\n+ const cwd = await initFixture(\"basic\");\n+\n+ await fs.writeFile(\n+ path.join(cwd, \"package.json\"), // trailing comma ...v\n+ '{ \"name\": \"invalid\", \"lerna\": { \"version\": \"1.0.0\" }, }'\n+ );\n+\n+ try {\n+ await testFactory({ cwd });\n+ } catch (err) {\n+ expect(err.prefix).toBe(\"JSONError\");\n+ }\n+ });\n+\nit(\"throws ENOLERNA when lerna.json is not found\", async () => {\nexpect.assertions(1);\n",
"new_path": "core/command/__tests__/command.test.js",
"old_path": "core/command/__tests__/command.test.js"
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"pkg-prop-syntax-error\",\n+ \"version\": \"0.0.0-root\",\n+ \"private\": true,\n+ \"lerna\": {\n+ \"loglevel\": \"success\",\n+ \"command\": {\n+ \"publish\": {\n+ \"loglevel\": \"verbose\"\n+ }\n+ },\n+ \"version\": \"1.0.0\"\n+ },,\n+}\n",
"new_path": "core/project/__fixtures__/pkg-prop-syntax-error/package.json",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -85,6 +85,19 @@ describe(\"Project\", () => {\n});\n});\n+ it(\"errors when root package.json is not valid JSON\", async () => {\n+ expect.assertions(2);\n+\n+ const cwd = await initFixture(\"pkg-prop-syntax-error\");\n+\n+ try {\n+ const project = new Project(cwd); // eslint-disable-line no-unused-vars\n+ } catch (err) {\n+ expect(err.name).toBe(\"ValidationError\");\n+ expect(err.prefix).toBe(\"JSONError\");\n+ }\n+ });\n+\nit(\"extends local shared config\", async () => {\nconst cwd = await initFixture(\"extends\");\nconst project = new Project(cwd);\n",
"new_path": "core/project/__tests__/project.test.js",
"old_path": "core/project/__tests__/project.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -111,7 +111,11 @@ class Project {\nvalue: manifest,\n});\n} catch (err) {\n- // syntax errors are already caught and reported by constructor\n+ // redecorate JSON syntax errors, avoid debug dump\n+ if (err.name === \"JSONError\") {\n+ throw new ValidationError(err.name, err.message);\n+ }\n+\n// try again next time\n}\n",
"new_path": "core/project/index.js",
"old_path": "core/project/index.js"
}
] | JavaScript | MIT License | lerna/lerna | fix(project): Report syntax errors in root package.json
Fixes #1452 | 1 | fix | project |
573,195 | 08.06.2018 00:23:08 | 25,200 | 06f3fc839a8c82d7c2c8b9c7ad12d622a62b2e32 | chore: lift json regex to top of file | [
{
"change_type": "MODIFY",
"diff": "@@ -10,6 +10,7 @@ var jsonParser = require('./jsonBodyParser');\nvar formParser = require('./formBodyParser');\nvar multipartParser = require('./multipartBodyParser');\nvar fieldedTextParser = require('./fieldedTextBodyParser.js');\n+var regex = require('./utils/regex');\n///--- Globals\n@@ -162,12 +163,6 @@ function bodyParser(options) {\nvar parser;\nvar type = req.contentType().toLowerCase();\n- var jsonPatternMatcher = new RegExp('^application/[a-zA-Z.]+\\\\+json');\n- // map any +json to application/json\n- if (jsonPatternMatcher.test(type)) {\n- type = 'application/json';\n- }\n-\nswitch (type) {\ncase 'application/json':\nparser = parseJson[0];\n@@ -192,6 +187,18 @@ function bodyParser(options) {\nbreak;\n}\n+ // if we find no matches from the direct string comparisons, perform\n+ // more expensive regex matches. map any +json to application/json.\n+ // theoretically these could be mapped to application/json prior to the\n+ // switch statement, but putting it here allows us to skip the regex\n+ // entirely unless absolutely necessary. additional types could be\n+ // added later at some point.\n+ if (!parser) {\n+ if (regex.jsonContentType.test(type)) {\n+ parser = parseJson[0];\n+ }\n+ }\n+\nif (parser) {\nparser(req, res, next);\n} else if (opts && opts.rejectUnknown) {\n",
"new_path": "lib/plugins/bodyParser.js",
"old_path": "lib/plugins/bodyParser.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -6,6 +6,7 @@ var assert = require('assert-plus');\nvar errors = require('restify-errors');\nvar bodyReader = require('./bodyReader');\n+var regex = require('./utils/regex');\n///--- API\n@@ -28,14 +29,17 @@ function jsonBodyParser(options) {\n// save original body on req.rawBody and req._body\nreq.rawBody = req._body = req.body;\n- var jsonPatternMatcher = new RegExp('^application/[a-zA-Z.]+\\\\+json');\nvar contentType = req.getContentType();\n- if (contentType !== 'application/json' || !req.body) {\n- if (!jsonPatternMatcher.test(contentType)) {\n+ // check for empty body first, don't pay regex tax unless necessary.\n+ // for content type, check for exact match and any of the *+json types\n+ if (\n+ !req.body ||\n+ (contentType !== 'application/json' &&\n+ !regex.jsonContentType.test(contentType))\n+ ) {\nreturn next();\n}\n- }\nvar params;\n",
"new_path": "lib/plugins/jsonBodyParser.js",
"old_path": "lib/plugins/jsonBodyParser.js"
},
{
"change_type": "ADD",
"diff": "+'use strict';\n+\n+module.exports = {\n+ jsonContentType: new RegExp('^application/[a-zA-Z.]+\\\\+json')\n+};\n",
"new_path": "lib/plugins/utils/regex.js",
"old_path": null
}
] | JavaScript | MIT License | restify/node-restify | chore: lift json regex to top of file (#1670) | 1 | chore | null |
217,922 | 08.06.2018 08:46:28 | -7,200 | 9cb553d6f85e4133ac7229c08da7890a17e56cdc | fix: fixed an error with wrong amount in trade popup in some cases
closes | [
{
"change_type": "MODIFY",
"diff": "@@ -13,7 +13,9 @@ import {DataModel} from '../../core/database/storage/data-model';\nexport class ListRow extends DataModel {\nicon?: number;\nid: number;\n+ // The amount of items needed for the craft.\namount: number;\n+ // The amount of crafts needed to get the amount of items needed.\namount_needed?: number;\ndone: number;\nused: number;\n",
"new_path": "src/app/model/list/list-row.ts",
"old_path": "src/app/model/list/list-row.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -13,6 +13,6 @@ export class TradeDetailsPopupComponent {\n}\ngetTotal(trade: Trade): number {\n- return Math.ceil((trade.currencyAmount / trade.itemAmount) * (this.data.amount_needed - this.data.done));\n+ return Math.ceil((trade.currencyAmount / trade.itemAmount) * (this.data.amount - this.data.done));\n}\n}\n",
"new_path": "src/app/modules/item/trade-details-popup/trade-details-popup.component.ts",
"old_path": "src/app/modules/item/trade-details-popup/trade-details-popup.component.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | fix: fixed an error with wrong amount in trade popup in some cases
closes #403 | 1 | fix | null |
217,922 | 08.06.2018 08:52:20 | -7,200 | 6af36efd20594870e8208c86141ffbefcc47ec24 | style: stripped results in items search page
closes | [
{
"change_type": "MODIFY",
"diff": "</div>\n<div *ngIf=\"results.length > 0 && !loading\">\n- <mat-list-item *ngFor=\"let item of results\" class=\"recipes-list-row\">\n+ <mat-list-item *ngFor=\"let item of results; let even = even\" class=\"recipes-list-row\" [class.even]=\"even\">\n<a mat-list-avatar href=\"{{item.itemId | itemLink | i18n}}\" target=\"_blank\">\n<img mat-list-avatar [appXivdbTooltip]=\"item.itemId\" src=\"{{item.icon | icon}}\"\nalt=\"{{item.itemId | itemName | i18n}}\">\n",
"new_path": "src/app/pages/recipes/recipes/recipes.component.html",
"old_path": "src/app/pages/recipes/recipes/recipes.component.html"
},
{
"change_type": "MODIFY",
"diff": "}\n}\n+.even {\n+ background: rgba(0, 0, 0, .3);\n+}\n+\n.only-recipes {\nfont-size: 14px;\n}\n",
"new_path": "src/app/pages/recipes/recipes/recipes.component.scss",
"old_path": "src/app/pages/recipes/recipes/recipes.component.scss"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | style: stripped results in items search page
closes #402 | 1 | style | null |
217,922 | 08.06.2018 09:11:39 | -7,200 | 7c8f7eb46b09ec963eeb81d2f9beaafe08c661a5 | fix: dungeon and trial icons are now properly displayed
closes | [
{
"change_type": "MODIFY",
"diff": "@@ -36,8 +36,6 @@ export class ItemData {\nif (raw === undefined) {\nreturn undefined;\n}\n- const type = [undefined, 'Raid', 'Dungeon', 'Guildhest', 'Trial', 'PvP', 'PvP', undefined, undefined, 'Deep Dungeons',\n- 'Treasure Hunt', 'Seasonal Event'][raw.obj.t];\nreturn {\nid: raw.obj.i,\nname: {\n@@ -46,12 +44,7 @@ export class ItemData {\nfr: raw.obj.n,\nja: raw.obj.n,\n},\n- type: {\n- fr: type,\n- en: type,\n- de: type,\n- ja: type\n- }\n+ icon: +raw.obj.c\n};\n}\n}\n",
"new_path": "src/app/model/garland-tools/item-data.ts",
"old_path": "src/app/model/garland-tools/item-data.ts"
},
{
"change_type": "MODIFY",
"diff": "import {I18nName} from './i18n-name';\n+\nexport interface Instance {\nid: number;\n- type: I18nName;\n+ icon: number;\nname: I18nName;\n}\n",
"new_path": "src/app/model/list/instance.ts",
"old_path": "src/app/model/list/instance.ts"
},
{
"change_type": "MODIFY",
"diff": "<div mat-dialog-content>\n<mat-list>\n<mat-list-item *ngFor=\"let instance of data.instances\">\n- <img src=\"https://www.garlandtools.org/db/images/{{instance.type | i18n}}.png\"\n- mat-list-avatar\n- alt=\"{{instance.type | i18n}}\">\n+ <img [src]=\"instance.icon | instanceIcon\"\n+ mat-list-avatar>\n<b mat-line>{{instance.name | i18n}}</b>\n</mat-list-item>\n</mat-list>\n",
"new_path": "src/app/modules/item/instances-details-popup/instances-details-popup.component.html",
"old_path": "src/app/modules/item/instances-details-popup/instances-details-popup.component.html"
},
{
"change_type": "MODIFY",
"diff": "<div *ngIf=\"item.instances !== undefined && item.instances.length > 0\">\n<button mat-icon-button [ngClass]=\"{'icon-button':true, 'compact': settings.compactLists}\"\n(click)=\"openInstancesDetails(item)\">\n- <img matTooltip=\"{{getI18n(item.instances[0].type)}}\"\n+ <img matTooltip=\"{{item.instances[0].name | i18n}}\"\nmatTooltipPosition=\"above\"\n- src=\"https://www.garlandtools.org/db/images/{{getI18n(item.instances[0].type)}}.png\"\n+ [src]=\"item.instances[0].icon | instanceIcon\"\n[ngClass]=\"{'currency':true, 'compact': settings.compactLists}\">\n</button>\n</div>\n</div>\n<div *ngIf=\"item.instances !== undefined && item.instances.length > 0\">\n<button mat-icon-button (click)=\"openInstancesDetails(item)\">\n- <img matTooltip=\"{{getI18n(item.instances[0].type)}}\"\n+ <img matTooltip=\"{{item.instances[0].name | i18n}}\"\nmatTooltipPosition=\"above\"\n- src=\"https://www.garlandtools.org/db/images/{{getI18n(item.instances[0].type)}}.png\"\n+ [src]=\"item.instances[0].icon | instanceIcon\"\nclass=\"currency\">\n</button>\n</div>\n",
"new_path": "src/app/modules/item/item/item.component.html",
"old_path": "src/app/modules/item/item/item.component.html"
},
{
"change_type": "ADD",
"diff": "+import {Pipe, PipeTransform} from '@angular/core';\n+\n+@Pipe({\n+ name: 'instanceIcon'\n+})\n+export class InstanceIconPipe implements PipeTransform {\n+\n+ transform(id: number, fallback?: string): string {\n+ if (id === 0) {\n+ return fallback;\n+ }\n+ return `https://www.garlandtools.org/db/icons/instance/type/${id}.png`;\n+ }\n+\n+}\n",
"new_path": "src/app/pipes/instance-icon.pipe.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -10,6 +10,7 @@ import {ActionIconPipe} from './action-icon.pipe';\nimport {JobAbbrIconPipe} from './job-abbr.pipe';\nimport {JobNameIconPipe} from './job-name.pipe';\nimport {AbsolutePipe} from './absolute.pipe';\n+import {InstanceIconPipe} from './instance-icon.pipe';\n@NgModule({\ndeclarations: [\n@@ -24,6 +25,7 @@ import {AbsolutePipe} from './absolute.pipe';\nJobAbbrIconPipe,\nJobNameIconPipe,\nAbsolutePipe,\n+ InstanceIconPipe,\n],\nexports: [\nItemNamePipe,\n@@ -37,6 +39,7 @@ import {AbsolutePipe} from './absolute.pipe';\nJobAbbrIconPipe,\nJobNameIconPipe,\nAbsolutePipe,\n+ InstanceIconPipe,\n]\n})\nexport class PipesModule {\n",
"new_path": "src/app/pipes/pipes.module.ts",
"old_path": "src/app/pipes/pipes.module.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | fix: dungeon and trial icons are now properly displayed
closes #400 | 1 | fix | null |
217,922 | 08.06.2018 10:23:26 | -7,200 | 059bc9fddc9285362aff3f973f66d4e5d57d56a6 | fix: fixed an issue with simulator link on items that have multiple recipes
closes | [
{
"change_type": "MODIFY",
"diff": "<div *ngIf=\"!recipe\">\n<div *ngFor=\"let craft of item.craftedBy\">\n<mat-menu #simulatorMenu=\"matMenu\">\n- <button mat-menu-item routerLink=\"/simulator/{{item.id}}\">{{'SIMULATOR.New_rotation' |\n+ <button mat-menu-item routerLink=\"/simulator/{{item.id}}/{{craft.recipeId}}\">\n+ {{'SIMULATOR.New_rotation' |\ntranslate}}\n</button>\n<button mat-menu-item\n*ngFor=\"let rotation of rotations$ | async\"\n- routerLink=\"/simulator/{{item.id}}/{{rotation.$key}}\">{{rotation.getName()}}\n+ routerLink=\"/simulator/{{item.id}}/{{craft.recipeId}}/{{rotation.$key}}\">\n+ {{rotation.getName()}}\n</button>\n<mat-divider></mat-divider>\n<a href=\"{{craft | simulatorLink:'http://ffxiv-beta.lokyst.net' | i18n}}\"\n",
"new_path": "src/app/modules/item/item/item.component.html",
"old_path": "src/app/modules/item/item/item.component.html"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | fix: fixed an issue with simulator link on items that have multiple recipes
closes #401 | 1 | fix | null |
217,922 | 08.06.2018 12:06:57 | -7,200 | ccd625025194c728195ba4eca7172ba168c3f878 | feat: updated the /about page | [
{
"change_type": "MODIFY",
"diff": "<li>Victoria Valyntara</li>\n<li>Chris</li>\n<li>Neraud</li>\n- <li>S'Irle</li>\n+ <li>S'Irle Alythia</li>\n<li>Cathanys</li>\n<li>Tataru Taru</li>\n<li>wootnik</li>\n<li>Pr0num</li>\n- <li>Marrie Lumia</li>\n- <li>Naticus</li>\n+ <li>M'Marrie Lumia</li>\n<li>PiraSiraly</li>\n<li>Kaffey33</li>\n<li>Raltz Klamar</li>\n+ <li>Betrayer</li>\n+ <li>Mipha Polaali</li>\n+ <li>Emmingly</li>\n+ <li>Reaver Liem</li>\n+ <li>Othello Rhin</li>\n+ <li>Chaele Akiyama</li>\n+ <li>Chapaille Aren</li>\n+ <li>Delmania Shadowstar</li>\n+ <li>Dr Dead</li>\n+ <li>Ascobol</li>\n</ul>\n<h2>{{'ABOUT.Contributors' | translate}}</h2>\n<li>Duvo</li>\n<li>Nezdek</li>\n<li>Pr0num</li>\n+ <li>Tataru Taru</li>\n+ <li>Tarulia Delacre</li>\n+ <li>absense</li>\n+ <li>Ascobol</li>\n+ <li>Nivrelia Lockster</li>\n+ <li>superjugy</li>\n</ul>\n",
"new_path": "src/app/pages/about/about/about.component.html",
"old_path": "src/app/pages/about/about/about.component.html"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | feat: updated the /about page | 1 | feat | null |
679,913 | 08.06.2018 12:12:41 | -3,600 | 244bf213e96166df69571771b8b98cdd82c64e39 | feat(hiccup-css): add class scoping support
add CSSOpts.scope field
update formatRule() to inject class suffixing transducer if needed | [
{
"change_type": "MODIFY",
"diff": "@@ -62,6 +62,10 @@ export interface CSSOpts {\n* Current tree depth. Internal use only. Ignore.\n*/\ndepth: number;\n+ /**\n+ * Optional scoping suffix for CSS classes\n+ */\n+ scope: string;\n}\nexport const DEFAULT_VENDORS = [\n",
"new_path": "packages/hiccup-css/src/api.ts",
"old_path": "packages/hiccup-css/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -4,6 +4,8 @@ import { isIterable } from \"@thi.ng/checks/is-iterable\";\nimport { isPlainObject } from \"@thi.ng/checks/is-plain-object\";\nimport { isString } from \"@thi.ng/checks/is-string\";\nimport { illegalArgs } from \"@thi.ng/errors/illegal-arguments\";\n+import { Transducer } from \"@thi.ng/transducers/api\";\n+import { comp } from \"@thi.ng/transducers/func/comp\";\nimport { permutations } from \"@thi.ng/transducers/iter/permutations\";\nimport { repeat } from \"@thi.ng/transducers/iter/repeat\";\nimport { str } from \"@thi.ng/transducers/rfn/str\";\n@@ -17,12 +19,14 @@ const EMPTY = new Set<string>();\nconst NO_SPACES = \":[\";\n-// like tx.comp(), but avoiding import to save space\n-const xfSel = ((a, b) => (x) => a(b(x)))(\n+const xfSel = comp(\nflatten(),\nmap((x: string) => NO_SPACES.indexOf(x.charAt(0)) >= 0 ? x : \" \" + x)\n);\n+const withScope = (xf: Transducer<any, any>, scope: string) =>\n+ comp(xf, map((x) => isString(x) && x.indexOf(\" .\") == 0 ? x + scope : x));\n+\nexport function expand(acc: string[], parent: any[], rules: any[], opts: CSSOpts) {\nconst n = rules.length;\nconst sel: string[] = [];\n@@ -34,7 +38,7 @@ export function expand(acc: string[], parent: any[], rules: any[], opts: CSSOpts\n} else if (isIterable(r) && !isString(r)) {\nexpand(acc, makeSelector(parent, sel), [...r], opts);\n} else if ((isFn = isFunction(r)) || opts.fns[r]) {\n- if (i === 0) {\n+ if (!parent.length) {\nif (opts.fns[r]) {\nopts.fns[r].apply(null, rules.slice(i + 1))(acc, opts);\nreturn true;\n@@ -64,16 +68,19 @@ export function expand(acc: string[], parent: any[], rules: any[], opts: CSSOpts\n}\nfunction makeSelector(parent: any[], curr: any[]) {\n- return parent.length ? [...permutations(parent, curr)] : curr;\n+ return parent.length ?\n+ [...permutations(parent, curr)] :\n+ curr;\n}\nfunction formatRule(parent: any[], sel: any[], curr: any, opts: CSSOpts) {\nconst f = opts.format;\nconst space = indent(opts);\n+ const xf = opts.scope ? withScope(xfSel, opts.scope) : xfSel;\nreturn [\nspace,\ntransduce(\n- map((sel: any[]) => transduce(xfSel, str(), isArray(sel) ? sel : [sel]).trim()),\n+ map((sel: any[]) => transduce(xf, str(), isArray(sel) ? sel : [sel]).trim()),\nstr(f.ruleSep),\nmakeSelector(parent, sel)),\nf.declStart,\n",
"new_path": "packages/hiccup-css/src/impl.ts",
"old_path": "packages/hiccup-css/src/impl.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | feat(hiccup-css): add class scoping support
- add CSSOpts.scope field
- update formatRule() to inject class suffixing transducer if needed | 1 | feat | hiccup-css |
679,913 | 08.06.2018 12:15:46 | -3,600 | 8d6e6c8685ebd1da8eec36110025e56797823be8 | feat(hiccup-css): add injectStyleSheet() | [
{
"change_type": "MODIFY",
"diff": "@@ -4,6 +4,7 @@ export * from \"./comment\";\nexport * from \"./conditional\";\nexport * from \"./css\";\nexport * from \"./import\";\n+export * from \"./inject\";\nexport * from \"./keyframes\";\nexport * from \"./media\";\nexport * from \"./namespace\";\n",
"new_path": "packages/hiccup-css/src/index.ts",
"old_path": "packages/hiccup-css/src/index.ts"
},
{
"change_type": "ADD",
"diff": "+// https://davidwalsh.name/add-rules-stylesheets\n+\n+/**\n+ * Injects given CSS string as global stylesheet in DOM head. If `first`\n+ * is true, inserts it as first stylesheet, else (default) appends it.\n+ *\n+ * Returns created style DOM element.\n+ *\n+ * @param css\n+ * @param first\n+ */\n+export const injectStyleSheet = (css: string, first = false) => {\n+ const head = document.getElementsByTagName(\"head\")[0];\n+ const sheet = document.createElement(\"style\");\n+ sheet.setAttribute(\"type\", \"text/css\");\n+ if ((<any>sheet).styleSheet !== undefined) {\n+ (<any>sheet).styleSheet.cssText = css;\n+ } else {\n+ sheet.textContent = css;\n+ }\n+ if (first) {\n+ head.insertBefore(sheet, head.firstChild);\n+ } else {\n+ head.appendChild(sheet);\n+ }\n+ return sheet;\n+};\n",
"new_path": "packages/hiccup-css/src/inject.ts",
"old_path": null
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | feat(hiccup-css): add injectStyleSheet() | 1 | feat | hiccup-css |
217,922 | 08.06.2018 13:21:45 | -7,200 | 80f6a21b1f8e8816428944c64e515e1ef4a042cb | chore: second part of about page update | [
{
"change_type": "MODIFY",
"diff": "<li>Pr0num</li>\n<li>M'Marrie Lumia</li>\n<li>PiraSiraly</li>\n- <li>Kaffey33</li>\n+ <li>Kaffey</li>\n<li>Raltz Klamar</li>\n<li>Betrayer</li>\n<li>Mipha Polaali</li>\n<li>Delmania Shadowstar</li>\n<li>Dr Dead</li>\n<li>Ascobol</li>\n+ <li>Elias Timm</li>\n</ul>\n<h2>{{'ABOUT.Contributors' | translate}}</h2>\n",
"new_path": "src/app/pages/about/about/about.component.html",
"old_path": "src/app/pages/about/about/about.component.html"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | chore: second part of about page update | 1 | chore | null |
217,922 | 08.06.2018 13:40:28 | -7,200 | a51fdc9a871067daf1d173d645e60e4c985ae74d | chore: updated outdated version threshold for lists | [
{
"change_type": "MODIFY",
"diff": "@@ -370,7 +370,7 @@ export class List extends DataWithPermissions {\n}\nlet res = false;\nres = res || (this.version === undefined);\n- res = res || semver.ltr(this.version, '4.0.5');\n+ res = res || semver.ltr(this.version, '4.1.7');\nreturn res;\n}\n",
"new_path": "src/app/model/list/list.ts",
"old_path": "src/app/model/list/list.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | chore: updated outdated version threshold for lists | 1 | chore | null |
791,690 | 08.06.2018 14:11:41 | 25,200 | e02d517b62d3523592e26c2a6ab50c136184d4d8 | extension: allow use of ES2018 features | [
{
"change_type": "MODIFY",
"diff": "@@ -185,8 +185,7 @@ class OptimizedImages extends Gatherer {\n}\n/** @type {LH.Artifacts.OptimizedImage} */\n- // @ts-ignore TODO(bckenny): fix browserify/Object.spread. See https://github.com/GoogleChrome/lighthouse/issues/5152\n- const image = Object.assign({failed: false}, stats, record);\n+ const image = {failed: false, ...stats, ...record};\nresults.push(image);\n} catch (err) {\n// Track this with Sentry since these errors aren't surfaced anywhere else, but we don't\n@@ -199,8 +198,7 @@ class OptimizedImages extends Gatherer {\n});\n/** @type {LH.Artifacts.OptimizedImageError} */\n- // @ts-ignore TODO(bckenny): see above browserify/Object.spread TODO.\n- const imageError = Object.assign({failed: true, errMsg: err.message}, record);\n+ const imageError = {failed: true, errMsg: err.message, ...record};\nresults.push(imageError);\n}\n}\n",
"new_path": "lighthouse-core/gather/gatherers/dobetterweb/optimized-images.js",
"old_path": "lighthouse-core/gather/gatherers/dobetterweb/optimized-images.js"
},
{
"change_type": "MODIFY",
"diff": "// generated on 2016-03-19 using generator-chrome-extension 0.5.4\n'use strict';\n+\n+const fs = require('fs');\n+// HACK: patch astw before it's required to use acorn with ES2018\n+// We add the right acorn version to package.json deps, resolve the path to it here,\n+// and then inject the modified require statement into astw's code.\n+// see https://github.com/GoogleChrome/lighthouse/issues/5152\n+const acornPath = require.resolve('acorn');\n+const astwPath = require.resolve('astw/index.js');\n+const astwOriginalContent = fs.readFileSync(astwPath, 'utf8');\n+const astwPatchedContent = astwOriginalContent\n+ .replace('ecmaVersion: opts.ecmaVersion || 8', 'ecmaVersion: 2018')\n+ .replace(`require('acorn')`, `require(${JSON.stringify(acornPath)})`);\n+fs.writeFileSync(astwPath, astwPatchedContent);\n+\nconst del = require('del');\nconst gutil = require('gulp-util');\nconst runSequence = require('run-sequence');\n",
"new_path": "lighthouse-extension/gulpfile.js",
"old_path": "lighthouse-extension/gulpfile.js"
},
{
"change_type": "MODIFY",
"diff": "\"scripts\": {\n\"watch\": \"gulp watch\",\n\"build\": \"gulp build:production\",\n+ \"debug-build\": \"node --inspect-brk ./node_modules/.bin/gulp build:production\",\n\"test\": \"mocha test/**/*-test.js\"\n},\n\"devDependencies\": {\n+ \"acorn\": \"^5.5.3\",\n\"babel-plugin-syntax-object-rest-spread\": \"^6.13.0\",\n\"brfs\": \"^1.6.1\",\n\"browserify\": \"^16.2.0\",\n\"through2\": \"^2.0.1\"\n},\n\"resolutions\": {\n- \"browserify/insert-module-globals/lexical-scope/astw\": \"2.2.0\"\n+ \"browserify/insert-module-globals/lexical-scope/astw\": \"2.2.0\",\n+ \"**/astw/acorn\": \"5.5.3\"\n},\n\"dependencies\": {}\n}\n",
"new_path": "lighthouse-extension/package.json",
"old_path": "lighthouse-extension/package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -22,18 +22,14 @@ acorn-node@^1.2.0, acorn-node@^1.3.0:\nacorn \"^5.4.1\"\nxtend \"^4.0.1\"\n+acorn@5.5.3, acorn@^4.0.3, acorn@^5.0.0, acorn@^5.4.1, acorn@^5.5.3:\n+ version \"5.5.3\"\n+ resolved \"https://registry.yarnpkg.com/acorn/-/acorn-5.5.3.tgz#f473dd47e0277a08e28e9bec5aeeb04751f0b8c9\"\n+\nacorn@^3.0.4:\nversion \"3.3.0\"\nresolved \"https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a\"\n-acorn@^4.0.3:\n- version \"4.0.13\"\n- resolved \"https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787\"\n-\n-acorn@^5.0.0, acorn@^5.4.1:\n- version \"5.5.3\"\n- resolved \"https://registry.yarnpkg.com/acorn/-/acorn-5.5.3.tgz#f473dd47e0277a08e28e9bec5aeeb04751f0b8c9\"\n-\nacorn@^5.1.1:\nversion \"5.1.2\"\nresolved \"https://registry.yarnpkg.com/acorn/-/acorn-5.1.2.tgz#911cb53e036807cf0fa778dc5d370fbd864246d7\"\n",
"new_path": "lighthouse-extension/yarn.lock",
"old_path": "lighthouse-extension/yarn.lock"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | extension: allow use of ES2018 features (#5377) | 1 | extension | null |
217,922 | 08.06.2018 20:23:01 | -7,200 | 581f27829b84e7280b44c0040f06b597ec7e952b | feat: new /desktop page that redirects to github latest release | [
{
"change_type": "MODIFY",
"diff": "\"destination\": \"/index.html\"\n}\n],\n- \"headers\": [{\n+ \"redirects\": [\n+ {\n+ \"source\": \"/desktop\",\n+ \"destination\": \"https://github.com/Supamiu/ffxiv-teamcraft/releases/latest\",\n+ \"type\": 301\n+ }\n+ ],\n+ \"headers\": [\n+ {\n\"source\": \"**\",\n- \"headers\": [{\n+ \"headers\": [\n+ {\n\"key\": \"Cache-control\",\n\"value\": \"no-cache, must-revalidate\"\n- }]\n- }]\n+ }\n+ ]\n+ }\n+ ]\n}\n}\n",
"new_path": "firebase.json",
"old_path": "firebase.json"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | feat: new /desktop page that redirects to github latest release | 1 | feat | null |
724,020 | 09.06.2018 02:57:20 | 10,800 | b4331ff229da3a6679aa5451af602bb958cf66d5 | feat: Add setValue method | [
{
"change_type": "MODIFY",
"diff": "@@ -32,6 +32,9 @@ declare interface BaseWrapper { // eslint-disable-line no-undef\nsetData(data: Object): void,\nsetComputed(computed: Object): void,\nsetMethods(methods: Object): void,\n+ setValue(value: any): void,\n+ setChecked(checked: boolean): void,\n+ setSelected(): void,\nsetProps(data: Object): void,\ntrigger(type: string, options: Object): void,\ndestroy(): void\n",
"new_path": "flow/wrapper.flow.js",
"old_path": "flow/wrapper.flow.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -117,6 +117,18 @@ export default class ErrorWrapper implements BaseWrapper {\nthrowError(`find did not return ${this.selector}, cannot call setProps() on empty Wrapper`)\n}\n+ setValue (): void {\n+ throwError(`find did not return ${this.selector}, cannot call setValue() on empty Wrapper`)\n+ }\n+\n+ setChecked (): void {\n+ throwError(`find did not return ${this.selector}, cannot call setChecked() on empty Wrapper`)\n+ }\n+\n+ setSelected (): void {\n+ throwError(`find did not return ${this.selector}, cannot call setSelected() on empty Wrapper`)\n+ }\n+\ntrigger (): void {\nthrowError(`find did not return ${this.selector}, cannot call trigger() on empty Wrapper`)\n}\n",
"new_path": "packages/test-utils/src/error-wrapper.js",
"old_path": "packages/test-utils/src/error-wrapper.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -181,6 +181,24 @@ export default class WrapperArray implements BaseWrapper {\nthis.wrappers.forEach(wrapper => wrapper.setProps(props))\n}\n+ setValue (value: any): void {\n+ this.throwErrorIfWrappersIsEmpty('setValue')\n+\n+ this.wrappers.forEach(wrapper => wrapper.setValue(value))\n+ }\n+\n+ setChecked (checked: boolean): void {\n+ this.throwErrorIfWrappersIsEmpty('setChecked')\n+\n+ this.wrappers.forEach(wrapper => wrapper.setChecked(checked))\n+ }\n+\n+ setSelected (): void {\n+ this.throwErrorIfWrappersIsEmpty('setSelected')\n+\n+ throwError('setSelected must be called on a single wrapper, use at(i) to access a wrapper')\n+ }\n+\ntrigger (event: string, options: Object): void {\nthis.throwErrorIfWrappersIsEmpty('trigger')\n",
"new_path": "packages/test-utils/src/wrapper-array.js",
"old_path": "packages/test-utils/src/wrapper-array.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -543,6 +543,114 @@ export default class Wrapper implements BaseWrapper {\norderWatchers(this.vm || this.vnode.context.$root)\n}\n+ /**\n+ * Sets element value and triggers input event\n+ */\n+ setValue (value: any) {\n+ const el = this.element\n+\n+ if (!el) {\n+ throwError('cannot call wrapper.setValue() on a wrapper without an element')\n+ }\n+\n+ const tag = el.tagName\n+ const type = this.attributes().type\n+ const event = 'input'\n+\n+ if (tag === 'SELECT') {\n+ throwError('wrapper.setValue() cannot be called on a <select> element. Use wrapper.setSelected() instead')\n+ } else if (tag === 'INPUT' && type === 'checkbox') {\n+ throwError('wrapper.setValue() cannot be called on a <input type=\"checkbox\" /> element. Use wrapper.setChecked() instead')\n+ } else if (tag === 'INPUT' && type === 'radio') {\n+ throwError('wrapper.setValue() cannot be called on a <input type=\"radio\" /> element. Use wrapper.setChecked() instead')\n+ } else if (tag === 'INPUT' || tag === 'textarea') {\n+ // $FlowIgnore\n+ el.value = value\n+ this.trigger(event)\n+ } else {\n+ throwError('wrapper.setValue() cannot be called on this element')\n+ }\n+ }\n+\n+ /**\n+ * Checks radio button or checkbox element\n+ */\n+ setChecked (checked: boolean) {\n+ if (typeof checked !== 'undefined') {\n+ if (typeof checked !== 'boolean') {\n+ throwError('wrapper.setChecked() must be passed a boolean')\n+ }\n+ } else {\n+ checked = true\n+ }\n+\n+ const el = this.element\n+\n+ if (!el) {\n+ throwError('cannot call wrapper.setChecked() on a wrapper without an element')\n+ }\n+\n+ const tag = el.tagName\n+ const type = this.attributes().type\n+ const event = 'change'\n+\n+ if (tag === 'SELECT') {\n+ throwError('wrapper.setChecked() cannot be called on a <select> element. Use wrapper.setSelected() instead')\n+ } else if (tag === 'INPUT' && type === 'checkbox') {\n+ // $FlowIgnore\n+ if (el.checked !== checked) {\n+ this.trigger('click')\n+ this.trigger(event)\n+ }\n+ } else if (tag === 'INPUT' && type === 'radio') {\n+ if (!checked) {\n+ throwError('wrapper.setChecked() cannot be called with parameter false on a <input type=\"radio\" /> element.')\n+ } else {\n+ // $FlowIgnore\n+ if (!el.checked) {\n+ this.trigger('click')\n+ this.trigger(event)\n+ }\n+ }\n+ } else if (tag === 'INPUT' || tag === 'textarea') {\n+ throwError('wrapper.setChecked() cannot be called on \"text\" inputs. Use wrapper.setValue() instead')\n+ } else {\n+ throwError('wrapper.setChecked() cannot be called on this element')\n+ }\n+ }\n+\n+ /**\n+ * Selects <option></option> element\n+ */\n+ setSelected () {\n+ const el = this.element\n+\n+ if (!el) {\n+ throwError('cannot call wrapper.setSelected() on a wrapper without an element')\n+ }\n+\n+ const tag = el.tagName\n+ const type = this.attributes().type\n+ const event = 'change'\n+\n+ if (tag === 'OPTION') {\n+ // $FlowIgnore\n+ el.selected = true\n+ // $FlowIgnore\n+ createWrapper(el.parentElement, this.options).trigger(event)\n+ } else if (tag === 'SELECT') {\n+ throwError('wrapper.setSelected() cannot be called on select. Call it on one of its options')\n+ } else if (tag === 'INPUT' && type === 'checkbox') {\n+ throwError('wrapper.setSelected() cannot be called on a <input type=\"checkbox\" /> element. Use wrapper.setChecked() instead')\n+ } else if (tag === 'INPUT' && type === 'radio') {\n+ throwError('wrapper.setSelected() cannot be called on a <input type=\"radio\" /> element. Use wrapper.setChecked() instead')\n+ } else if (tag === 'INPUT' || tag === 'textarea') {\n+ throwError('wrapper.setSelected() cannot be called on \"text\" inputs. Use wrapper.setValue() instead')\n+ } else {\n+ throwError('wrapper.setSelected() cannot be called on this element')\n+ }\n+ }\n+\n/**\n* Return text of wrapper element\n*/\n",
"new_path": "packages/test-utils/src/wrapper.js",
"old_path": "packages/test-utils/src/wrapper.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -72,6 +72,11 @@ interface BaseWrapper {\nsetData (data: object): void\nsetMethods (data: object): void\nsetProps (props: object): void\n+\n+ setValue (value: any): void\n+ setChecked (checked: boolean): void\n+ setSelected (): void\n+\ntrigger (eventName: string, options?: object): void\ndestroy (): void\n}\n@@ -98,6 +103,7 @@ export interface Wrapper<V extends Vue> extends BaseWrapper {\nhtml (): string\ntext (): string\nname (): string\n+ setSelected(): void\nemitted (event?: string): { [name: string]: Array<Array<any>> }\nemittedByOrder (): Array<{ name: string, args: Array<any> }>\n",
"new_path": "packages/test-utils/types/index.d.ts",
"old_path": "packages/test-utils/types/index.d.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -63,6 +63,10 @@ array = wrapper.findAll(ClassComponent)\narray = wrapper.findAll({ ref: 'myButton' })\narray = wrapper.findAll({ name: 'my-button' })\n+wrapper.setChecked(true)\n+wrapper.setValue('some string')\n+wrapper.setSelected()\n+\nlet str: string = wrapper.html()\nstr = wrapper.text()\nstr = wrapper.name()\n",
"new_path": "packages/test-utils/types/test/wrapper.ts",
"old_path": "packages/test-utils/types/test/wrapper.ts"
},
{
"change_type": "ADD",
"diff": "+<template>\n+ <div>\n+ <input type=\"checkbox\" v-model=\"checkboxVal\">\n+ <input type=\"radio\" v-model=\"radioVal\" id=\"radioFoo\" value=\"radioFooResult\">\n+ <input type=\"radio\" v-model=\"radioVal\" id=\"radioBar\" value=\"radioBarResult\">\n+ <input type=\"text\" v-model=\"textVal\">\n+ <select v-model=\"selectVal\">\n+ <option value=\"selectA\"></option>\n+ <option value=\"selectB\"></option>\n+ <option value=\"selectC\"></option>\n+ </select>\n+ <label id=\"label-el\"></label>\n+\n+ <span class=\"checkboxResult\" v-if=\"checkboxVal\">checkbox checked</span>\n+ <span class=\"counter\">{{ counter }}</span>\n+ {{ textVal }}\n+ {{ selectVal }}\n+ {{ radioVal }}\n+ </div>\n+</template>\n+\n+<script>\n+ export default {\n+ name: 'component-with-input',\n+ data () {\n+ return {\n+ checkboxVal: undefined,\n+ textVal: undefined,\n+ radioVal: undefined,\n+ selectVal: undefined,\n+ counter: 0\n+ }\n+ },\n+\n+ watch: {\n+ checkboxVal () {\n+ this.counter++\n+ },\n+ radioVal () {\n+ this.counter++\n+ }\n+ }\n+ }\n+</script>\n",
"new_path": "test/resources/components/component-with-input.vue",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import ComponentWithInput from '~resources/components/component-with-input.vue'\n+import { describeWithShallowAndMount } from '~resources/utils'\n+\n+describeWithShallowAndMount('setChecked', (mountingMethod) => {\n+ it('sets element checked true with no option passed', () => {\n+ const wrapper = mountingMethod(ComponentWithInput)\n+ const input = wrapper.find('input[type=\"checkbox\"]')\n+ input.setChecked()\n+\n+ expect(input.element.checked).to.equal(true)\n+ })\n+\n+ it('sets element checked equal to param passed', () => {\n+ const wrapper = mountingMethod(ComponentWithInput)\n+ const input = wrapper.find('input[type=\"checkbox\"]')\n+\n+ input.setChecked(true)\n+ expect(input.element.checked).to.equal(true)\n+\n+ input.setChecked(false)\n+ expect(input.element.checked).to.equal(false)\n+ })\n+\n+ it('updates dom with checkbox v-model', () => {\n+ const wrapper = mountingMethod(ComponentWithInput)\n+ const input = wrapper.find('input[type=\"checkbox\"]')\n+\n+ input.setChecked()\n+ expect(wrapper.text()).to.contain('checkbox checked')\n+\n+ input.setChecked(false)\n+ expect(wrapper.text()).to.not.contain('checkbox checked')\n+ })\n+\n+ it('changes state the right amount of times with checkbox v-model', () => {\n+ const wrapper = mountingMethod(ComponentWithInput)\n+ const input = wrapper.find('input[type=\"checkbox\"]')\n+\n+ input.setChecked()\n+ input.setChecked(false)\n+ input.setChecked(false)\n+ input.setChecked(true)\n+ input.setChecked(false)\n+ input.setChecked(false)\n+\n+ expect(wrapper.find('.counter').text()).to.equal('4')\n+ })\n+\n+ it('updates dom with radio v-model', () => {\n+ const wrapper = mountingMethod(ComponentWithInput)\n+\n+ wrapper.find('#radioBar').setChecked()\n+ expect(wrapper.text()).to.contain('radioBarResult')\n+\n+ wrapper.find('#radioFoo').setChecked()\n+ expect(wrapper.text()).to.contain('radioFooResult')\n+ })\n+\n+ it('changes state the right amount of times with checkbox v-model', () => {\n+ const wrapper = mountingMethod(ComponentWithInput)\n+ const radioBar = wrapper.find('#radioBar')\n+ const radioFoo = wrapper.find('#radioFoo')\n+\n+ radioBar.setChecked()\n+ radioBar.setChecked()\n+ radioFoo.setChecked()\n+ radioBar.setChecked()\n+ radioBar.setChecked()\n+ radioFoo.setChecked()\n+ radioFoo.setChecked()\n+\n+ expect(wrapper.find('.counter').text()).to.equal('4')\n+ })\n+\n+ it('throws error if checked param is not boolean', () => {\n+ const message = 'wrapper.setChecked() must be passed a boolean'\n+ shouldThrowErrorOnElement('input[type=\"checkbox\"]', message, 'asd')\n+ })\n+\n+ it('throws error if checked param is false on radio element', () => {\n+ const message = 'wrapper.setChecked() cannot be called with parameter false on a <input type=\"radio\" /> element.'\n+ shouldThrowErrorOnElement('#radioFoo', message, false)\n+ })\n+\n+ it('throws error if wrapper does not contain element', () => {\n+ const wrapper = mountingMethod({ render: (h) => h('div') })\n+ const div = wrapper.find('div')\n+ div.element = null\n+\n+ const fn = () => div.setChecked()\n+ const message = '[vue-test-utils]: cannot call wrapper.setChecked() on a wrapper without an element'\n+ expect(fn).to.throw().with.property('message', message)\n+ })\n+\n+ it('throws error if element is select', () => {\n+ const message = 'wrapper.setChecked() cannot be called on a <select> element. Use wrapper.setSelected() instead'\n+ shouldThrowErrorOnElement('select', message)\n+ })\n+\n+ it('throws error if element is text like', () => {\n+ const message = 'wrapper.setChecked() cannot be called on \"text\" inputs. Use wrapper.setValue() instead'\n+ shouldThrowErrorOnElement('input[type=\"text\"]', message)\n+ })\n+\n+ it('throws error if element is not valid', () => {\n+ const message = 'wrapper.setChecked() cannot be called on this element'\n+ shouldThrowErrorOnElement('#label-el', message)\n+ })\n+\n+ function shouldThrowErrorOnElement (selector, message, value) {\n+ const wrapper = mountingMethod(ComponentWithInput)\n+ const input = wrapper.find(selector)\n+\n+ const fn = () => input.setChecked(value)\n+ expect(fn).to.throw().with.property('message', '[vue-test-utils]: ' + message)\n+ }\n+})\n",
"new_path": "test/specs/wrapper/setChecked.spec.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import ComponentWithInput from '~resources/components/component-with-input.vue'\n+import { describeWithShallowAndMount } from '~resources/utils'\n+\n+describeWithShallowAndMount('setSelected', (mountingMethod) => {\n+ it('sets element selected true', () => {\n+ const wrapper = mountingMethod(ComponentWithInput)\n+ const options = wrapper.find('select').findAll('option')\n+\n+ options.at(1).setSelected()\n+\n+ expect(options.at(1).element.selected).to.equal(true)\n+ })\n+\n+ it('updates dom with select v-model', () => {\n+ const wrapper = mountingMethod(ComponentWithInput)\n+ const options = wrapper.find('select').findAll('option')\n+\n+ options.at(1).setSelected()\n+ expect(wrapper.text()).to.contain('selectB')\n+\n+ options.at(0).setSelected()\n+ expect(wrapper.text()).to.contain('selectA')\n+ })\n+\n+ it('throws error if wrapper does not contain element', () => {\n+ const wrapper = mountingMethod({ render: (h) => h('div') })\n+ const div = wrapper.find('div')\n+ div.element = null\n+\n+ const fn = () => div.setSelected()\n+ const message = '[vue-test-utils]: cannot call wrapper.setSelected() on a wrapper without an element'\n+ expect(fn).to.throw().with.property('message', message)\n+ })\n+\n+ it('throws error if element is radio', () => {\n+ const message = 'wrapper.setSelected() cannot be called on a <input type=\"radio\" /> element. Use wrapper.setChecked() instead'\n+ shouldThrowErrorOnElement('input[type=\"radio\"]', message)\n+ })\n+\n+ it('throws error if element is radio', () => {\n+ const message = 'wrapper.setSelected() cannot be called on a <input type=\"checkbox\" /> element. Use wrapper.setChecked() instead'\n+ shouldThrowErrorOnElement('input[type=\"checkbox\"]', message)\n+ })\n+\n+ it('throws error if element is text like', () => {\n+ const message = 'wrapper.setSelected() cannot be called on \"text\" inputs. Use wrapper.setValue() instead'\n+ shouldThrowErrorOnElement('input[type=\"text\"]', message)\n+ })\n+\n+ it('throws error if element is not valid', () => {\n+ const message = 'wrapper.setSelected() cannot be called on this element'\n+ shouldThrowErrorOnElement('#label-el', message)\n+ })\n+\n+ function shouldThrowErrorOnElement (selector, message, value) {\n+ const wrapper = mountingMethod(ComponentWithInput)\n+ const input = wrapper.find(selector)\n+\n+ const fn = () => input.setSelected(value)\n+ expect(fn).to.throw().with.property('message', '[vue-test-utils]: ' + message)\n+ }\n+})\n",
"new_path": "test/specs/wrapper/setSelected.spec.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import ComponentWithInput from '~resources/components/component-with-input.vue'\n+import { describeWithShallowAndMount } from '~resources/utils'\n+\n+describeWithShallowAndMount('setValue', (mountingMethod) => {\n+ it('sets element value', () => {\n+ const wrapper = mountingMethod(ComponentWithInput)\n+ const input = wrapper.find('input[type=\"text\"]')\n+ input.setValue('foo')\n+\n+ expect(input.element.value).to.equal('foo')\n+ })\n+\n+ it('updates dom with v-model', () => {\n+ const wrapper = mountingMethod(ComponentWithInput)\n+ const input = wrapper.find('input[type=\"text\"]')\n+\n+ input.setValue('input text awesome binding')\n+\n+ expect(wrapper.text()).to.contain('input text awesome binding')\n+ })\n+\n+ it('throws error if wrapper does not contain element', () => {\n+ const wrapper = mountingMethod({ render: (h) => h('div') })\n+ const div = wrapper.find('div')\n+ div.element = null\n+ const fn = () => div.setValue('')\n+ const message = '[vue-test-utils]: cannot call wrapper.setValue() on a wrapper without an element'\n+ expect(fn).to.throw().with.property('message', message)\n+ })\n+\n+ it('throws error if element is select', () => {\n+ const message = 'wrapper.setValue() cannot be called on a <select> element. Use wrapper.setSelected() instead'\n+ shouldThrowErrorOnElement('select', message)\n+ })\n+\n+ it('throws error if element is radio', () => {\n+ const message = 'wrapper.setValue() cannot be called on a <input type=\"radio\" /> element. Use wrapper.setChecked() instead'\n+ shouldThrowErrorOnElement('input[type=\"radio\"]', message)\n+ })\n+\n+ it('throws error if element is checkbox', () => {\n+ const message = 'wrapper.setValue() cannot be called on a <input type=\"checkbox\" /> element. Use wrapper.setChecked() instead'\n+ shouldThrowErrorOnElement('input[type=\"checkbox\"]', message)\n+ })\n+\n+ it('throws error if element is not valid', () => {\n+ const message = 'wrapper.setValue() cannot be called on this element'\n+ shouldThrowErrorOnElement('#label-el', message)\n+ })\n+\n+ function shouldThrowErrorOnElement (selector, message) {\n+ const wrapper = mountingMethod(ComponentWithInput)\n+ const input = wrapper.find(selector)\n+\n+ const fn = () => input.setValue('')\n+ expect(fn).to.throw().with.property('message', '[vue-test-utils]: ' + message)\n+ }\n+})\n",
"new_path": "test/specs/wrapper/setValue.spec.js",
"old_path": null
}
] | JavaScript | MIT License | vuejs/vue-test-utils | feat: Add setValue method (#557) | 1 | feat | null |
724,000 | 09.06.2018 08:21:24 | -3,600 | 3446ec22c597eb1121def417eb83bf1bf4ded86f | test: skip setValue tests | [
{
"change_type": "MODIFY",
"diff": "@@ -2,7 +2,7 @@ import ComponentWithInput from '~resources/components/component-with-input.vue'\nimport { describeWithShallowAndMount } from '~resources/utils'\ndescribeWithShallowAndMount('setChecked', (mountingMethod) => {\n- it('sets element checked true with no option passed', () => {\n+ it.skip('sets element checked true with no option passed', () => {\nconst wrapper = mountingMethod(ComponentWithInput)\nconst input = wrapper.find('input[type=\"checkbox\"]')\ninput.setChecked()\n@@ -10,7 +10,7 @@ describeWithShallowAndMount('setChecked', (mountingMethod) => {\nexpect(input.element.checked).to.equal(true)\n})\n- it('sets element checked equal to param passed', () => {\n+ it.skip('sets element checked equal to param passed', () => {\nconst wrapper = mountingMethod(ComponentWithInput)\nconst input = wrapper.find('input[type=\"checkbox\"]')\n@@ -21,7 +21,7 @@ describeWithShallowAndMount('setChecked', (mountingMethod) => {\nexpect(input.element.checked).to.equal(false)\n})\n- it('updates dom with checkbox v-model', () => {\n+ it.skip('updates dom with checkbox v-model', () => {\nconst wrapper = mountingMethod(ComponentWithInput)\nconst input = wrapper.find('input[type=\"checkbox\"]')\n@@ -32,7 +32,7 @@ describeWithShallowAndMount('setChecked', (mountingMethod) => {\nexpect(wrapper.text()).to.not.contain('checkbox checked')\n})\n- it('changes state the right amount of times with checkbox v-model', () => {\n+ it.skip('changes state the right amount of times with checkbox v-model', () => {\nconst wrapper = mountingMethod(ComponentWithInput)\nconst input = wrapper.find('input[type=\"checkbox\"]')\n",
"new_path": "test/specs/wrapper/setChecked.spec.js",
"old_path": "test/specs/wrapper/setChecked.spec.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -2,7 +2,7 @@ import ComponentWithInput from '~resources/components/component-with-input.vue'\nimport { describeWithShallowAndMount } from '~resources/utils'\ndescribeWithShallowAndMount('setValue', (mountingMethod) => {\n- it('sets element value', () => {\n+ it.skip('sets element value', () => {\nconst wrapper = mountingMethod(ComponentWithInput)\nconst input = wrapper.find('input[type=\"text\"]')\ninput.setValue('foo')\n@@ -10,7 +10,7 @@ describeWithShallowAndMount('setValue', (mountingMethod) => {\nexpect(input.element.value).to.equal('foo')\n})\n- it('updates dom with v-model', () => {\n+ it.skip('updates dom with v-model', () => {\nconst wrapper = mountingMethod(ComponentWithInput)\nconst input = wrapper.find('input[type=\"text\"]')\n",
"new_path": "test/specs/wrapper/setValue.spec.js",
"old_path": "test/specs/wrapper/setValue.spec.js"
}
] | JavaScript | MIT License | vuejs/vue-test-utils | test: skip setValue tests | 1 | test | null |
724,000 | 09.06.2018 09:17:40 | -3,600 | 583d81961fc6da571a62b28abe46f8ebf651bce8 | chore: remove version from root package.json | [
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"vue-test-utils\",\n\"private\": true,\n- \"version\": \"1.0.0-beta.16\",\n\"workspaces\": [\n\"packages/*\"\n],\n\"lint\": \"eslint --ext js,vue . --ignore-path .gitignore\",\n\"lint:docs\": \"eslint --ext js,vue,md docs --ignore-path .gitignore\",\n\"lint:fix\": \"npm run lint -- --fix\",\n- \"prepublishOnly\": \"npm run build && npm run test:unit:only\",\n- \"publish\": \"lerna publish --conventional-commits -m \\\"chore(release): publish %s\\\" --cd-version prerelease\",\n+ \"release\": \"npm run build && npm run test:unit:only && lerna publish --conventional-commits -m \\\"chore(release): publish %s\\\" --cd-version prerelease\",\n\"test\": \"npm run lint && npm run lint:docs && npm run flow && npm run test:types && npm run test:unit && npm run test:unit:karma && npm run test:unit:node\",\n\"test:compat\": \"scripts/test-compat.sh\",\n\"test:unit\": \"npm run build:test && npm run test:unit:only\",\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "\"typescript\": \"^2.6.2\"\n},\n\"peerDependencies\": {\n- \"@vue/test-utils\": \"1.0.0-beta.16\",\n+ \"@vue/test-utils\": \"1.x\",\n\"vue\": \"2.x\",\n\"vue-server-renderer\": \"2.x\",\n\"vue-template-compiler\": \"^2.x\"\n",
"new_path": "packages/server-test-utils/package.json",
"old_path": "packages/server-test-utils/package.json"
}
] | JavaScript | MIT License | vuejs/vue-test-utils | chore: remove version from root package.json | 1 | chore | null |
724,174 | 09.06.2018 14:59:50 | -32,400 | 55e52e277fea5e728f3ef0b434a1fa764fb58724 | docs: `setValue`, `setChecked`, `setSelected` | [
{
"change_type": "MODIFY",
"diff": "@@ -42,8 +42,11 @@ A `Wrapper` is an object that contains a mounted component or vnode and methods\n!!!include(docs/api/wrapper/isVueInstance.md)!!!\n!!!include(docs/api/wrapper/name.md)!!!\n!!!include(docs/api/wrapper/props.md)!!!\n+!!!include(docs/api/wrapper/setChecked.md)!!!\n!!!include(docs/api/wrapper/setData.md)!!!\n!!!include(docs/api/wrapper/setMethods.md)!!!\n!!!include(docs/api/wrapper/setProps.md)!!!\n+!!!include(docs/api/wrapper/setSelected.md)!!!\n+!!!include(docs/api/wrapper/setValue.md)!!!\n!!!include(docs/api/wrapper/text.md)!!!\n!!!include(docs/api/wrapper/trigger.md)!!!\n",
"new_path": "docs/api/wrapper/README.md",
"old_path": "docs/api/wrapper/README.md"
},
{
"change_type": "ADD",
"diff": "+## setChecked(value)\n+\n+Sets the value of a radio or checkbox `<input`>.\n+\n+- **Arguments:**\n+ - `{Boolean} selected`\n+\n+- **Example:**\n+\n+```js\n+import { mount } from '@vue/test-utils'\n+import Foo from './Foo.vue'\n+\n+const wrapper = mount(Foo)\n+const option = wrapper.find('input[type=\"radio\"]')\n+option.setChecked()\n+```\n+\n",
"new_path": "docs/api/wrapper/setChecked.md",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+## setSelected(value)\n+\n+Sets a specified `<option>` as selected in a `<select>`.\n+\n+- **Arguments:**\n+ - `{Boolean} selected`\n+\n+- **Example:**\n+\n+```js\n+import { mount } from '@vue/test-utils'\n+import Foo from './Foo.vue'\n+\n+const wrapper = shallowMount(Foo)\n+const options = wrapper.find('select').findAll('option')\n+\n+options.at(1).setSelected()\n+expect(wrapper.text()).to.contain('option1')\n+```\n",
"new_path": "docs/api/wrapper/setSelected.md",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+## setValue(value)\n+\n+Sets the value of a text `<input>`.\n+\n+- **Arguments:**\n+ - `{String} value`\n+\n+- **Example:**\n+\n+```js\n+import { mount } from '@vue/test-utils'\n+import Foo from './Foo.vue'\n+\n+const wrapper = mount(Foo)\n+const input = wrapper.find('input[type=\"text\"]')\n+input.setValue('some value')\n+```\n",
"new_path": "docs/api/wrapper/setValue.md",
"old_path": null
}
] | JavaScript | MIT License | vuejs/vue-test-utils | docs: `setValue`, `setChecked`, `setSelected` (#694) | 1 | docs | null |
217,922 | 09.06.2018 20:24:50 | -7,200 | b3a690069239c9e2423e782dced24dc8bd192f2a | fix(desktop): alarms overlay no longer shows muted groups | [
{
"change_type": "MODIFY",
"diff": "*ngIf=\"alarm.slot\">({{alarm.slot}})</span></span>\n<i matLine>{{alarm.zoneId | placeName | i18n}} </i>\n<span class=\"coords\" matLine\n- *ngIf=\"compact || overlay\">X: {{alarm.coords[0]}} - Y: {{alarm.coords[1]}}</span>\n- <app-map-position *ngIf=\"!overlay\"\n- [zoneId]=\"alarm.zoneId\"\n+ *ngIf=\"compact\">X: {{alarm.coords[0]}} - Y: {{alarm.coords[1]}}</span>\n+ <app-map-position [zoneId]=\"alarm.zoneId\"\nclass=\"map-marker\"\n[marker]=\"{x:alarm.coords[0], y:alarm.coords[1]}\"></app-map-position>\n<div>\n<span matLine>{{alarm.itemId | itemName | i18n}} <span\n*ngIf=\"alarm.slot\">({{alarm.slot}})</span></span>\n<i matLine>{{alarm.zoneId | placeName | i18n}} </i>\n- <span class=\"coords\" matLine\n- *ngIf=\"compact || overlay\">X: {{alarm.coords[0]}} - Y: {{alarm.coords[1]}}</span>\n- <app-map-position *ngIf=\"!overlay\"\n- [zoneId]=\"alarm.zoneId\"\n- class=\"map-marker\"\n- [marker]=\"{x:alarm.coords[0], y:alarm.coords[1]}\"></app-map-position>\n+ <span class=\"coords\" matLine>X: {{alarm.coords[0]}} - Y: {{alarm.coords[1]}}</span>\n<div>\n<span matLine\n*ngIf=\"alarm.aetheryte$\">{{(alarm.aetheryte$ | async)?.nameid | placeName | i18n}}</span>\n",
"new_path": "src/app/pages/alarms/alarms/alarms.component.html",
"old_path": "src/app/pages/alarms/alarms/alarms.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -35,7 +35,7 @@ export class AlarmsComponent {\noverlay = false;\n- alarmGroups$: Observable<{ groupName: string, alarms: Alarm[] }[]>;\n+ alarmGroups$: Observable<{ groupName: string, enabled: boolean, alarms: Alarm[] }[]>;\noverlayAlarms$: Observable<Alarm[]>;\n@@ -54,30 +54,6 @@ export class AlarmsComponent {\nconst user$ = this.userService.getUserData();\n- this.overlayAlarms$ = this.reloader.pipe(\n- switchMap(() => this.etime.getEorzeanTime()),\n- tap(time => this.time = time),\n- map(time => {\n- const alarms: Alarm[] = [];\n- this.alarmService.alarms.forEach(alarm => {\n- if (alarms.find(a => a.itemId === alarm.itemId) !== undefined) {\n- return;\n- }\n- const itemAlarms = this.alarmService.alarms.filter(a => a.itemId === alarm.itemId);\n- alarms.push(this.alarmService.closestAlarm(itemAlarms, time));\n- });\n- return alarms.sort((a, b) => {\n- if (this.alarmService.isAlarmSpawned(a, time)) {\n- return -1;\n- }\n- if (this.alarmService.isAlarmSpawned(b, time)) {\n- return 1;\n- }\n- return this.alarmService.getMinutesBefore(time, a.spawn) < this.alarmService.getMinutesBefore(time, b.spawn) ? -1 : 1;\n- });\n- })\n- );\n-\nthis.alarmGroups$ = combineLatest(timer$, user$)\n.pipe(\nmap(data => {\n@@ -117,7 +93,18 @@ export class AlarmsComponent {\n});\nreturn result;\n})\n- )\n+ );\n+\n+ this.overlayAlarms$ = this.alarmGroups$.pipe(\n+ map(groups => {\n+ return groups.reduce((overlayAlarms, currentGroup) => {\n+ if (currentGroup.enabled) {\n+ overlayAlarms.push(...currentGroup.alarms);\n+ }\n+ return overlayAlarms;\n+ }, []);\n+ })\n+ );\n}\nsetGroupIndex(groupData: any, index: number): void {\n",
"new_path": "src/app/pages/alarms/alarms/alarms.component.ts",
"old_path": "src/app/pages/alarms/alarms/alarms.component.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | fix(desktop): alarms overlay no longer shows muted groups | 1 | fix | desktop |
217,922 | 09.06.2018 20:27:15 | -7,200 | 5ffbea6b68aed12905cbc4db02247bcde480d055 | chore(release): 4.1.8 | [
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"4.1.8\"></a>\n+## [4.1.8](https://github.com/Supamiu/ffxiv-teamcraft/compare/v4.1.7...v4.1.8) (2018-06-09)\n+\n+\n+### Bug Fixes\n+\n+* **desktop:** alarms overlay no longer shows muted groups ([b3a6900](https://github.com/Supamiu/ffxiv-teamcraft/commit/b3a6900))\n+\n+\n+### Features\n+\n+* new /desktop page that redirects to github latest release ([581f278](https://github.com/Supamiu/ffxiv-teamcraft/commit/581f278))\n+\n+\n+\n<a name=\"4.1.7\"></a>\n## [4.1.7](https://github.com/Supamiu/ffxiv-teamcraft/compare/v4.1.6...v4.1.7) (2018-06-08)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"FFXIV-Teamcraft\",\n- \"version\": \"4.1.7\",\n+ \"version\": \"4.1.8\",\n\"lockfileVersion\": 1,\n\"requires\": true,\n\"dependencies\": {\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
},
{
"change_type": "MODIFY",
"diff": "\"name\": \"FFXIV-Teamcraft\",\n\"description\": \"Collaborative crafting made easy\",\n\"author\": \"Flavien Normand <contact@flavien-normand.fr>\",\n- \"version\": \"4.1.7\",\n+ \"version\": \"4.1.8\",\n\"license\": \"MIT\",\n\"main\": \"main.js\",\n\"build\": {\n",
"new_path": "package.json",
"old_path": "package.json"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | chore(release): 4.1.8 | 1 | chore | release |
217,922 | 09.06.2018 22:29:21 | -7,200 | 35b6e610508db6f7f07642035b38f74a7a4c1146 | fix(desktop): auto update popup won't open duplicates anymore | [
{
"change_type": "MODIFY",
"diff": "@@ -116,6 +116,7 @@ app.on('activate', function () {\n});\nautoUpdater.on('update-downloaded', () => {\n+ clearInterval(updateInterval);\ndialog.showMessageBox({\ntype: 'info',\ntitle: 'Update available',\n@@ -124,8 +125,6 @@ autoUpdater.on('update-downloaded', () => {\n}, (buttonIndex) => {\nif (buttonIndex === 0) {\nautoUpdater.quitAndInstall();\n- } else {\n- clearInterval(updateInterval);\n}\n});\n});\n",
"new_path": "main.js",
"old_path": "main.js"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | fix(desktop): auto update popup won't open duplicates anymore | 1 | fix | desktop |
217,922 | 10.06.2018 09:04:00 | -7,200 | 20ad62f0bddb23801498c8b940bb16039172167a | chore(desktop): added FFXIV Teamcraft mention insite update dialog box | [
{
"change_type": "MODIFY",
"diff": "@@ -119,7 +119,7 @@ autoUpdater.on('update-downloaded', () => {\nclearInterval(updateInterval);\ndialog.showMessageBox({\ntype: 'info',\n- title: 'Update available',\n+ title: 'FFXIV Teamcraft - Update available',\nmessage: 'An update is available and downloaded, install now?',\nbuttons: ['Yes', 'No']\n}, (buttonIndex) => {\n",
"new_path": "main.js",
"old_path": "main.js"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | chore(desktop): added FFXIV Teamcraft mention insite update dialog box | 1 | chore | desktop |
723,998 | 10.06.2018 11:30:14 | -19,620 | 6dcfc4f5e88acc5aad903f5e2de619aa2bdb5ff0 | docs: update Vuex guide | [
{
"change_type": "MODIFY",
"diff": "@@ -217,7 +217,7 @@ And the test:\nimport { shallowMount, createLocalVue } from '@vue/test-utils'\nimport Vuex from 'vuex'\nimport MyComponent from '../../../src/components/MyComponent'\n-import mymodule from '../../../src/store/mymodule'\n+import myModule from '../../../src/store/myModule'\nconst localVue = createLocalVue()\n@@ -230,10 +230,8 @@ describe('MyComponent.vue', () => {\nbeforeEach(() => {\nstate = {\n- module: {\nclicks: 2\n}\n- }\nactions = {\nmoduleActionClick: jest.fn()\n@@ -241,10 +239,10 @@ describe('MyComponent.vue', () => {\nstore = new Vuex.Store({\nmodules: {\n- mymodule: {\n+ myModule: {\nstate,\nactions,\n- getters: module.getters\n+ getters: myModule.getters\n}\n}\n})\n@@ -257,7 +255,7 @@ describe('MyComponent.vue', () => {\nexpect(actions.moduleActionClick).toHaveBeenCalled()\n})\n- it('Renders \"state.inputValue\" in first p tag', () => {\n+ it('renders \"state.inputValue\" in first p tag', () => {\nconst wrapper = shallowMount(MyComponent, { store, localVue })\nconst p = wrapper.find('p')\nexpect(p.text()).toBe(state.clicks.toString())\n",
"new_path": "docs/guides/using-with-vuex.md",
"old_path": "docs/guides/using-with-vuex.md"
}
] | JavaScript | MIT License | vuejs/vue-test-utils | docs: update Vuex guide (#691) | 1 | docs | null |
573,227 | 10.06.2018 15:44:57 | 25,200 | b69e6ed106cf6784d1b2ed4995d812636ed23598 | docs(index): sync createServer and Server constructor docs | [
{
"change_type": "MODIFY",
"diff": "@@ -64,15 +64,17 @@ routes and handlers for incoming requests.\n- `options.handleUpgrades` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Hook the `upgrade` event\nfrom the node HTTP server, pushing `Connection: Upgrade` requests through the\nregular request handling chain. (optional, default `false`)\n+ - `options.onceNext` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Prevents calling next multiple\n+ times (optional, default `false`)\n+ - `options.strictNext` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Throws error when next() is\n+ called more than once, enabled onceNext option (optional, default `false`)\n- `options.httpsServerOptions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Any options accepted by\n[node-https Server](http://nodejs.org/api/https.html#https_https).\nIf provided the following restify server options will be ignored:\nspdy, ca, certificate, key, passphrase, rejectUnauthorized, requestCert and\nciphers; however these can all be specified on httpsServerOptions.\n- - `options.onceNext` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Prevents calling next multiple\n- times (optional, default `false`)\n- - `options.strictNext` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Throws error when next() is\n- called more than once, enabled onceNext option (optional, default `false`)\n+ - `options.noWriteContinue` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** prevents\n+ `res.writeContinue()` in `server.on('checkContinue')` when proxing (optional, default `false`)\n- `options.ignoreTrailingSlash` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** ignore trailing slash\non paths (optional, default `false`)\n",
"new_path": "docs/_api/server.md",
"old_path": "docs/_api/server.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -311,9 +311,10 @@ function sendV2(req, res, next) {\nreturn next();\n}\n-var PATH = '/hello/:name';\n-server.get({path: PATH, version: '1.1.3'}, sendV1);\n-server.get({path: PATH, version: '2.0.0'}, sendV2);\n+server.get('/hello/:name', restify.plugins.conditionalHandler([\n+ { version: '1.1.3', handler: sendV1 },\n+ { version: '2.0.0', handler: sendV2 }\n+]));\nserver.listen(8080);\n```\n@@ -347,7 +348,9 @@ creation time. Lastly, you can support multiple versions in the API by using\nan array:\n```js\n-server.get({path: PATH, version: ['2.0.0', '2.1.0', '2.2.0']}, sendV2);\n+server.get('/hello/:name' restify.plugins.conditionalHandler([\n+ { version: ['2.0.0', '2.1.0', '2.2.0'], handler: sendV2 }\n+]));\n```\nIn this case you may need to know more information such as what the original\n@@ -355,17 +358,18 @@ requested version string was, and what the matching version from the routes\nsupported version array was. Two methods make this info available:\n```js\n-var PATH = '/version/test';\n-server.get({\n- path: PATH,\n- version: ['2.0.0', '2.1.0', '2.2.0']\n-}, function (req, res, next) {\n+server.get('/version/test', restify.plugins.conditionalHandler([\n+ {\n+ version: ['2.0.0', '2.1.0', '2.2.0'],\n+ handler: function (req, res, next) {\nres.send(200, {\nrequestedVersion: req.version(),\nmatchedVersion: req.matchedVersion()\n});\nreturn next();\n-});\n+ }\n+ }\n+]));\n```\nHitting this route will respond as below:\n",
"new_path": "docs/guides/server.md",
"old_path": "docs/guides/server.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -368,7 +368,6 @@ requested version string was, and what the matching version from the routes\nsupported version array was. Two methods make this info available:\n```js\n-var PATH = '/version/test';\nserver.get('/version/test', restify.plugins.conditionalHandler([\n{\nversion: ['2.0.0', '2.1.0', '2.2.0'],\n",
"new_path": "docs/index.md",
"old_path": "docs/index.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -46,15 +46,17 @@ require('./errorTypes');\n* @param {Boolean} [options.handleUpgrades=false] - Hook the `upgrade` event\n* from the node HTTP server, pushing `Connection: Upgrade` requests through the\n* regular request handling chain.\n+ * @param {Boolean} [options.onceNext=false] - Prevents calling next multiple\n+ * times\n+ * @param {Boolean} [options.strictNext=false] - Throws error when next() is\n+ * called more than once, enabled onceNext option\n* @param {Object} [options.httpsServerOptions] - Any options accepted by\n* [node-https Server](http://nodejs.org/api/https.html#https_https).\n* If provided the following restify server options will be ignored:\n* spdy, ca, certificate, key, passphrase, rejectUnauthorized, requestCert and\n* ciphers; however these can all be specified on httpsServerOptions.\n- * @param {Boolean} [options.onceNext=false] - Prevents calling next multiple\n- * times\n- * @param {Boolean} [options.strictNext=false] - Throws error when next() is\n- * called more than once, enabled onceNext option\n+ * @param {Boolean} [options.noWriteContinue=false] - prevents\n+ * `res.writeContinue()` in `server.on('checkContinue')` when proxing\n* @param {Boolean} [options.ignoreTrailingSlash=false] - ignore trailing slash\n* on paths\n* @example\n",
"new_path": "lib/index.js",
"old_path": "lib/index.js"
}
] | JavaScript | MIT License | restify/node-restify | docs(index): sync createServer and Server constructor docs (#1678) | 1 | docs | index |
821,224 | 10.06.2018 16:20:55 | -10,800 | 693bebc394befe9c0e1a8388e71c0b582c8e2c56 | chore: bump dependency to latest version | [
{
"change_type": "MODIFY",
"diff": "\"bin\": \"./bin/run\",\n\"bugs\": \"https://github.com/oclif/oclif/issues\",\n\"dependencies\": {\n- \"@oclif/command\": \"^1.4.32\",\n+ \"@oclif/command\": \"^1.4.33\",\n\"@oclif/config\": \"^1.6.27\",\n\"@oclif/errors\": \"^1.1.2\",\n\"@oclif/plugin-help\": \"^2.0.4\",\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "debug \"^3.1.0\"\nsemver \"^5.5.0\"\n+\"@oclif/command@^1.4.33\":\n+ version \"1.4.33\"\n+ resolved \"https://registry.yarnpkg.com/@oclif/command/-/command-1.4.33.tgz#40a48e7384d6b4394c2ca20e5c05ff45541087f5\"\n+ dependencies:\n+ \"@oclif/errors\" \"^1.1.2\"\n+ \"@oclif/parser\" \"^3.5.1\"\n+ debug \"^3.1.0\"\n+ semver \"^5.5.0\"\n+\n\"@oclif/config@^1.6.17\":\nversion \"1.6.18\"\nresolved \"https://registry.yarnpkg.com/@oclif/config/-/config-1.6.18.tgz#25693cb4badb81489a8c5f846761630dca8c516c\"\n\"@oclif/linewrap\" \"^1.0.0\"\nchalk \"^2.4.1\"\n+\"@oclif/parser@^3.5.1\":\n+ version \"3.5.1\"\n+ resolved \"https://registry.yarnpkg.com/@oclif/parser/-/parser-3.5.1.tgz#2f60ac9773565786b6e1afff967b36a6399defcc\"\n+ dependencies:\n+ \"@oclif/linewrap\" \"^1.0.0\"\n+ chalk \"^2.4.1\"\n+\n\"@oclif/plugin-help@^2.0.4\":\nversion \"2.0.4\"\nresolved \"https://registry.yarnpkg.com/@oclif/plugin-help/-/plugin-help-2.0.4.tgz#32cf1dc7696f626a6065109a17b0f061adb14243\"\n",
"new_path": "yarn.lock",
"old_path": "yarn.lock"
}
] | TypeScript | MIT License | oclif/oclif | chore: bump @oclif/command dependency to latest version (#127) | 1 | chore | null |
217,922 | 10.06.2018 16:41:24 | -7,200 | 65ec2a08fc16222a85db6a6296ec9c1e21c09b21 | feat: "recipes only" filter is now persistent accross the platform (not account-bound) | [
{
"change_type": "MODIFY",
"diff": "<mat-hint align=\"end\">\n<small>{{'Data_from_gt' | translate}}</small>\n</mat-hint>\n- <mat-checkbox matSuffix [(ngModel)]=\"onlyCraftable\" (ngModelChange)=\"doSearch()\" class=\"only-recipes\">\n+ <mat-checkbox matSuffix [(ngModel)]=\"settings.recipesOnlySearch\" (ngModelChange)=\"doSearch()\" class=\"only-recipes\">\n{{'ITEMS.Only_recipes' | translate}}\n</mat-checkbox>\n</mat-form-field>\n",
"new_path": "src/app/pages/recipes/recipes/recipes.component.html",
"old_path": "src/app/pages/recipes/recipes/recipes.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -27,6 +27,7 @@ import {CraftingRotationService} from 'app/core/database/crafting-rotation.servi\nimport {CraftingRotation} from '../../../model/other/crafting-rotation';\nimport {debounceTime, distinctUntilChanged, filter, first, map, mergeMap, publishReplay, refCount, switchMap} from 'rxjs/operators';\nimport {SearchResult} from '../../../model/list/search-result';\n+import {SettingsService} from '../../settings/settings.service';\ndeclare const ga: Function;\n@@ -42,8 +43,6 @@ export class RecipesComponent extends PageComponent implements OnInit {\n@ViewChild('filter')\nfilterElement: ElementRef;\n- onlyCraftable = false;\n-\nfilters: SearchFilter[] = [\n{\nenabled: false,\n@@ -122,7 +121,8 @@ export class RecipesComponent extends PageComponent implements OnInit {\nprivate htmlTools: HtmlToolsService, private listService: ListService,\nprivate localizedData: LocalizedDataService, private userService: UserService,\nprotected helpService: HelpService, protected media: ObservableMedia,\n- private workshopService: WorkshopService, private rotationsService: CraftingRotationService) {\n+ private workshopService: WorkshopService, private rotationsService: CraftingRotationService,\n+ public settings: SettingsService) {\nsuper(dialog, helpService, media);\n}\n@@ -216,7 +216,7 @@ export class RecipesComponent extends PageComponent implements OnInit {\nthis.loading = false;\nreturn;\n}\n- this.subscriptions.push(this.db.searchItem(this.query, this.filters, this.onlyCraftable).subscribe(results => {\n+ this.subscriptions.push(this.db.searchItem(this.query, this.filters, this.settings.recipesOnlySearch).subscribe(results => {\nthis.results = results;\nthis.loading = false;\n}));\n",
"new_path": "src/app/pages/recipes/recipes/recipes.component.ts",
"old_path": "src/app/pages/recipes/recipes/recipes.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -44,6 +44,14 @@ export class SettingsService {\nthis.setSetting('compact-sidebar', compact.toString());\n}\n+ public get recipesOnlySearch(): boolean {\n+ return this.getSetting('search-only-recipes', 'false') === 'true';\n+ }\n+\n+ public set recipesOnlySearch(compact: boolean) {\n+ this.setSetting('search-only-recipes', compact.toString());\n+ }\n+\npublic get compactAlarms(): boolean {\nreturn this.getSetting('compact-alarms', 'false') === 'true';\n}\n",
"new_path": "src/app/pages/settings/settings.service.ts",
"old_path": "src/app/pages/settings/settings.service.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | feat: "recipes only" filter is now persistent accross the platform (not account-bound) | 1 | feat | null |
791,723 | 11.06.2018 11:38:12 | 25,200 | e71bad1bc7424ef5fd9d223707f04d01f074665b | core: faster saveTrace by streaming 500 events at a time | [
{
"change_type": "MODIFY",
"diff": "@@ -194,12 +194,14 @@ async function prepareAssets(artifacts, audits) {\n}\n/**\n- * Generates a JSON representation of traceData line-by-line to avoid OOM due to\n- * very large traces.\n+ * Generates a JSON representation of traceData line-by-line to avoid OOM due to very large traces.\n+ * COMPAT: As of Node 9, JSON.parse/stringify can handle 256MB+ strings. Once we drop support for\n+ * Node 8, we can 'revert' PR #2593. See https://stackoverflow.com/a/47781288/89484\n* @param {LH.Trace} traceData\n* @return {IterableIterator<string>}\n*/\nfunction* traceJsonGenerator(traceData) {\n+ const EVENTS_PER_ITERATION = 500;\nconst keys = Object.keys(traceData);\nyield '{\\n';\n@@ -211,9 +213,19 @@ function* traceJsonGenerator(traceData) {\n// Emit first item manually to avoid a trailing comma.\nconst firstEvent = eventsIterator.next().value;\nyield ` ${JSON.stringify(firstEvent)}`;\n+\n+ let eventsRemaining = EVENTS_PER_ITERATION;\n+ let eventsJSON = '';\nfor (const event of eventsIterator) {\n- yield `,\\n ${JSON.stringify(event)}`;\n+ eventsJSON += `,\\n ${JSON.stringify(event)}`;\n+ eventsRemaining--;\n+ if (eventsRemaining === 0) {\n+ yield eventsJSON;\n+ eventsRemaining = EVENTS_PER_ITERATION;\n+ eventsJSON = '';\n+ }\n}\n+ yield eventsJSON;\n}\nyield '\\n]';\n",
"new_path": "lighthouse-core/lib/asset-saver.js",
"old_path": "lighthouse-core/lib/asset-saver.js"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core: faster saveTrace by streaming 500 events at a time (#5387) | 1 | core | null |
791,690 | 11.06.2018 11:38:51 | 25,200 | ee0c35a7d9fd3c889d7f5dc31d0630dc7cc3688e | docs: update required chrome version | [
{
"change_type": "MODIFY",
"diff": "@@ -89,7 +89,7 @@ function getFlags(manualArgv) {\n'preset': 'Use a built-in configuration.',\n'chrome-flags':\n`Custom flags to pass to Chrome (space-delimited). For a full list of flags, see http://bit.ly/chrome-flags\n- Additionally, use the CHROME_PATH environment variable to use a specific Chrome binary. Requires Chromium version 54.0 or later. If omitted, any detected Chrome Canary or Chrome stable will be used.`,\n+ Additionally, use the CHROME_PATH environment variable to use a specific Chrome binary. Requires Chromium version 66.0 or later. If omitted, any detected Chrome Canary or Chrome stable will be used.`,\n'hostname': 'The hostname to use for the debugging protocol.',\n'port': 'The port to use for the debugging protocol. Use 0 for a random port',\n'max-wait-for-load':\n",
"new_path": "lighthouse-cli/cli-flags.js",
"old_path": "lighthouse-cli/cli-flags.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -56,7 +56,7 @@ Configuration:\nEnvironment variables:\nCHROME_PATH: Explicit path of intended Chrome binary. If set must point to an executable of a build of\n- Chromium version 54.0 or later. By default, any detected Chrome Canary or Chrome (stable) will be launched.\n+ Chromium version 66.0 or later. By default, any detected Chrome Canary or Chrome (stable) will be launched.\n[default: \"\"]\n--port The port to use for the debugging protocol. Use 0 for a random port [default: 0]\n--preset Use a built-in configuration. [choices: \"full\", \"perf\", \"mixed-content\"]\n",
"new_path": "readme.md",
"old_path": "readme.md"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | docs: update required chrome version (#5425) | 1 | docs | null |
791,690 | 11.06.2018 11:48:28 | 25,200 | edbca2a36f24a6d0dfaf7ccdbbb94abfcd14a5a9 | core(multi-check): expose manifest checks in details | [
{
"change_type": "MODIFY",
"diff": "*/\n'use strict';\n+const pwaDetailsExpectations = {\n+ isParseFailure: false,\n+ hasStartUrl: true,\n+ hasIconsAtLeast192px: true,\n+ hasIconsAtLeast512px: true,\n+ hasPWADisplayValue: true,\n+ hasBackgroundColor: true,\n+ hasThemeColor: true,\n+ hasShortName: true,\n+ hasName: true,\n+};\n+\n/**\n* Expected Lighthouse audit values for various sites with stable(ish) PWA\n* results.\n@@ -36,16 +48,16 @@ module.exports = [\n// Ignore speed test; just verify that it ran.\n},\n'webapp-install-banner': {\n- // TODO(phulce): assert the checks when we put them in details\nscore: 1,\n+ details: {items: [pwaDetailsExpectations]},\n},\n'splash-screen': {\n- // TODO(phulce): assert the checks when we put them in details\nscore: 1,\n+ details: {items: [pwaDetailsExpectations]},\n},\n'themed-omnibox': {\n- // TODO(phulce): assert the checks when we put them in details\nscore: 1,\n+ details: {items: [{...pwaDetailsExpectations, themeColor: '#2196F3'}]},\n},\n'content-width': {\nscore: 1,\n@@ -93,16 +105,16 @@ module.exports = [\n// Ignore speed test; just verify that it ran.\n},\n'webapp-install-banner': {\n- // TODO(phulce): assert the checks when we put them in details\nscore: 1,\n+ details: {items: [pwaDetailsExpectations]},\n},\n'splash-screen': {\n- // TODO(phulce): assert the checks when we put them in details\nscore: 1,\n+ details: {items: [pwaDetailsExpectations]},\n},\n'themed-omnibox': {\n- // TODO(phulce): assert the checks when we put them in details\nscore: 1,\n+ details: {items: [pwaDetailsExpectations]},\n},\n'content-width': {\nscore: 1,\n@@ -124,3 +136,5 @@ module.exports = [\n},\n},\n];\n+\n+module.exports.PWA_DETAILS_EXPECTATIONS = pwaDetailsExpectations;\n",
"new_path": "lighthouse-cli/test/smokehouse/pwa-expectations.js",
"old_path": "lighthouse-cli/test/smokehouse/pwa-expectations.js"
},
{
"change_type": "MODIFY",
"diff": "*/\n'use strict';\n+const pwaDetailsExpectations = require('./pwa-expectations').PWA_DETAILS_EXPECTATIONS;\n+\n+const jakeExpectations = {...pwaDetailsExpectations, hasShortName: false};\n+\n/**\n* Expected Lighthouse audit values for various sites with stable(ish) PWA\n* results.\n@@ -38,16 +42,16 @@ module.exports = [\n// Ignore speed test; just verify that it ran.\n},\n'webapp-install-banner': {\n- // TODO(phulce): assert the checks when we put them in details\nscore: 0,\n+ details: {items: [jakeExpectations]},\n},\n'splash-screen': {\n- // TODO(phulce): assert the checks when we put them in details\nscore: 1,\n+ details: {items: [jakeExpectations]},\n},\n'themed-omnibox': {\n- // TODO(phulce): assert the checks when we put them in details\nscore: 1,\n+ details: {items: [jakeExpectations]},\n},\n'content-width': {\nscore: 1,\n@@ -95,16 +99,16 @@ module.exports = [\n// Ignore speed test; just verify that it ran.\n},\n'webapp-install-banner': {\n- // TODO(phulce): assert the checks when we put them in details\nscore: 1,\n+ details: {items: [pwaDetailsExpectations]},\n},\n'splash-screen': {\n- // TODO(phulce): assert the checks when we put them in details\nscore: 1,\n+ details: {items: [pwaDetailsExpectations]},\n},\n'themed-omnibox': {\n- // TODO(phulce): assert the checks when we put them in details\nscore: 1,\n+ details: {items: [pwaDetailsExpectations]},\n},\n'content-width': {\nscore: 1,\n",
"new_path": "lighthouse-cli/test/smokehouse/pwa2-expectations.js",
"old_path": "lighthouse-cli/test/smokehouse/pwa2-expectations.js"
},
{
"change_type": "MODIFY",
"diff": "*/\n'use strict';\n+const pwaDetailsExpectations = require('./pwa-expectations').PWA_DETAILS_EXPECTATIONS;\n+\n+const pwaRocksExpectations = {...pwaDetailsExpectations, hasIconsAtLeast512px: false};\n+\n/**\n* Expected Lighthouse audit values for various sites with stable(ish) PWA\n* results.\n@@ -36,16 +40,16 @@ module.exports = [\n// Ignore speed test; just verify that it ran .\n},\n'webapp-install-banner': {\n- // TODO(phulce): assert the checks when we put them in details\nscore: 1,\n+ details: {items: [pwaRocksExpectations]},\n},\n'splash-screen': {\n- // TODO(phulce): assert the checks when we put them in details\nscore: 0,\n+ details: {items: [pwaRocksExpectations]},\n},\n'themed-omnibox': {\n- // TODO(phulce): assert the checks when we put them in details\nscore: 0,\n+ details: {items: [pwaRocksExpectations]},\n},\n'content-width': {\nscore: 1,\n",
"new_path": "lighthouse-cli/test/smokehouse/pwa3-expectations.js",
"old_path": "lighthouse-cli/test/smokehouse/pwa3-expectations.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -25,23 +25,36 @@ class MultiCheckAudit extends Audit {\n* @return {LH.Audit.Product}\n*/\nstatic createAuditProduct(result) {\n- const extendedInfo = {\n- value: result,\n+ /** @type {LH.Audit.MultiCheckAuditDetails} */\n+ const detailsItem = {\n+ ...result,\n+ ...result.manifestValues,\n+ manifestValues: undefined,\n+ warnings: undefined,\n+ allChecks: undefined,\n};\n+ if (result.manifestValues && result.manifestValues.allChecks) {\n+ result.manifestValues.allChecks.forEach(check => {\n+ detailsItem[check.id] = check.passing;\n+ });\n+ }\n+\n+ const details = {items: [detailsItem]};\n+\n// If we fail, share the failures\nif (result.failures.length > 0) {\nreturn {\nrawValue: false,\nexplanation: `Failures: ${result.failures.join(',\\n')}.`,\n- extendedInfo,\n+ details,\n};\n}\n// Otherwise, we pass\nreturn {\nrawValue: true,\n- extendedInfo,\n+ details,\nwarnings: result.warnings,\n};\n}\n",
"new_path": "lighthouse-core/audits/multi-check-audit.js",
"old_path": "lighthouse-core/audits/multi-check-audit.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -26,7 +26,7 @@ class ManifestValues extends ComputedArtifact {\n/** @typedef {(val: NonNullable<LH.Artifacts.Manifest['value']>) => boolean} Validator */\n/**\n- * @return {Array<{id: string, failureText: string, validate: Validator}>}\n+ * @return {Array<{id: LH.Artifacts.ManifestValueCheckID, failureText: string, validate: Validator}>}\n*/\nstatic get manifestChecks() {\nreturn [\n",
"new_path": "lighthouse-core/gather/computed/manifest-values.js",
"old_path": "lighthouse-core/gather/computed/manifest-values.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -62,7 +62,7 @@ describe('PWA: splash screen audit', () => {\nreturn SplashScreenAudit.audit(artifacts).then(result => {\nassert.strictEqual(result.rawValue, false);\nassert.ok(result.explanation);\n- assert.strictEqual(result.extendedInfo.value.failures.length, 4);\n+ assert.strictEqual(result.details.items[0].failures.length, 4);\n});\n});\n",
"new_path": "lighthouse-core/test/audits/splash-screen-test.js",
"old_path": "lighthouse-core/test/audits/splash-screen-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -61,7 +61,7 @@ describe('PWA: webapp install banner audit', () => {\nreturn WebappInstallBannerAudit.audit(artifacts).then(result => {\nassert.strictEqual(result.rawValue, false);\nassert.ok(result.explanation);\n- assert.strictEqual(result.extendedInfo.value.failures.length, 4);\n+ assert.strictEqual(result.details.items[0].failures.length, 4);\n});\n});\n@@ -82,7 +82,7 @@ describe('PWA: webapp install banner audit', () => {\nreturn WebappInstallBannerAudit.audit(artifacts).then(result => {\nassert.strictEqual(result.rawValue, false);\nassert.ok(result.explanation.includes('start_url'), result.explanation);\n- const failures = result.extendedInfo.value.failures;\n+ const failures = result.details.items[0].failures;\nassert.strictEqual(failures.length, 1, failures);\n});\n});\n@@ -95,7 +95,7 @@ describe('PWA: webapp install banner audit', () => {\nreturn WebappInstallBannerAudit.audit(artifacts).then(result => {\nassert.strictEqual(result.rawValue, false);\nassert.ok(result.explanation.includes('short_name'), result.explanation);\n- const failures = result.extendedInfo.value.failures;\n+ const failures = result.details.items[0].failures;\nassert.strictEqual(failures.length, 1, failures);\n});\n});\n@@ -107,7 +107,7 @@ describe('PWA: webapp install banner audit', () => {\nreturn WebappInstallBannerAudit.audit(artifacts).then(result => {\nassert.strictEqual(result.rawValue, false);\nassert.ok(result.explanation.includes('name'), result.explanation);\n- const failures = result.extendedInfo.value.failures;\n+ const failures = result.details.items[0].failures;\nassert.strictEqual(failures.length, 1, failures);\n});\n});\n@@ -119,7 +119,7 @@ describe('PWA: webapp install banner audit', () => {\nreturn WebappInstallBannerAudit.audit(artifacts).then(result => {\nassert.strictEqual(result.rawValue, false);\nassert.ok(result.explanation.includes('icons'), result.explanation);\n- const failures = result.extendedInfo.value.failures;\n+ const failures = result.details.items[0].failures;\nassert.strictEqual(failures.length, 1, failures);\n});\n});\n@@ -133,7 +133,7 @@ describe('PWA: webapp install banner audit', () => {\nreturn WebappInstallBannerAudit.audit(artifacts).then(result => {\nassert.strictEqual(result.rawValue, false);\nassert.ok(result.explanation.includes('service worker'), result.explanation);\n- const failures = result.extendedInfo.value.failures;\n+ const failures = result.details.items[0].failures;\nassert.strictEqual(failures.length, 1, failures);\n});\n});\n@@ -145,7 +145,7 @@ describe('PWA: webapp install banner audit', () => {\nreturn WebappInstallBannerAudit.audit(artifacts).then(result => {\nassert.strictEqual(result.rawValue, false);\nassert.ok(result.explanation.includes('start_url'), result.explanation);\n- const failures = result.extendedInfo.value.failures;\n+ const failures = result.details.items[0].failures;\nassert.strictEqual(failures.length, 1, failures);\n});\n});\n",
"new_path": "lighthouse-core/test/audits/webapp-install-banner-test.js",
"old_path": "lighthouse-core/test/audits/webapp-install-banner-test.js"
},
{
"change_type": "MODIFY",
"diff": "\"score\": 0,\n\"scoreDisplayMode\": \"binary\",\n\"rawValue\": false,\n- \"explanation\": \"Failures: No manifest was fetched,\\nSite does not register a service worker.\"\n+ \"explanation\": \"Failures: No manifest was fetched,\\nSite does not register a service worker.\",\n+ \"details\": {\n+ \"items\": [\n+ {\n+ \"failures\": [\n+ \"No manifest was fetched\",\n+ \"Site does not register a service worker\"\n+ ],\n+ \"isParseFailure\": true,\n+ \"parseFailureReason\": \"No manifest was fetched\"\n+ }\n+ ]\n+ }\n},\n\"splash-screen\": {\n\"id\": \"splash-screen\",\n\"score\": 0,\n\"scoreDisplayMode\": \"binary\",\n\"rawValue\": false,\n- \"explanation\": \"Failures: No manifest was fetched.\"\n+ \"explanation\": \"Failures: No manifest was fetched.\",\n+ \"details\": {\n+ \"items\": [\n+ {\n+ \"failures\": [\n+ \"No manifest was fetched\"\n+ ],\n+ \"isParseFailure\": true,\n+ \"parseFailureReason\": \"No manifest was fetched\"\n+ }\n+ ]\n+ }\n},\n\"themed-omnibox\": {\n\"id\": \"themed-omnibox\",\n\"score\": 0,\n\"scoreDisplayMode\": \"binary\",\n\"rawValue\": false,\n- \"explanation\": \"Failures: No manifest was fetched,\\nNo `<meta name=\\\"theme-color\\\">` tag found.\"\n+ \"explanation\": \"Failures: No manifest was fetched,\\nNo `<meta name=\\\"theme-color\\\">` tag found.\",\n+ \"details\": {\n+ \"items\": [\n+ {\n+ \"failures\": [\n+ \"No manifest was fetched\",\n+ \"No `<meta name=\\\"theme-color\\\">` tag found\"\n+ ],\n+ \"themeColor\": null,\n+ \"isParseFailure\": true,\n+ \"parseFailureReason\": \"No manifest was fetched\"\n+ }\n+ ]\n+ }\n},\n\"manifest-short-name-length\": {\n\"id\": \"manifest-short-name-length\",\n",
"new_path": "lighthouse-core/test/results/sample_v2.json",
"old_path": "lighthouse-core/test/results/sample_v2.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -307,11 +307,13 @@ declare global {\nbottomUpGroupBy(grouping: string): DevtoolsTimelineModelNode;\n}\n+ export type ManifestValueCheckID = 'hasStartUrl'|'hasIconsAtLeast192px'|'hasIconsAtLeast512px'|'hasPWADisplayValue'|'hasBackgroundColor'|'hasThemeColor'|'hasShortName'|'hasName'|'shortNameLength';\n+\nexport interface ManifestValues {\nisParseFailure: boolean;\nparseFailureReason: string | undefined;\nallChecks: {\n- id: string;\n+ id: ManifestValueCheckID;\nfailureText: string;\npassing: boolean;\n}[];\n",
"new_path": "typings/artifacts.d.ts",
"old_path": "typings/artifacts.d.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -145,6 +145,17 @@ declare global {\nchildren: SimpleCriticalRequestNode;\n}\n}\n+\n+ type MultiCheckAuditP1 = Partial<Record<Artifacts.ManifestValueCheckID, boolean>>;\n+ type MultiCheckAuditP2 = Partial<Artifacts.ManifestValues>;\n+ interface MultiCheckAuditP3 {\n+ failures: Array<string>;\n+ warnings?: undefined;\n+ manifestValues?: undefined;\n+ allChecks?: undefined;\n+ }\n+\n+ export type MultiCheckAuditDetails = MultiCheckAuditP1 & MultiCheckAuditP2 & MultiCheckAuditP3;\n}\n}\n",
"new_path": "typings/audit.d.ts",
"old_path": "typings/audit.d.ts"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core(multi-check): expose manifest checks in details (#5405) | 1 | core | multi-check |
217,922 | 11.06.2018 13:23:20 | -7,200 | 0c216fbeefc5c9929d3be500a8d944ad89e2aa3a | chore: added more patreon supporters to the about page | [
{
"change_type": "MODIFY",
"diff": "<li>Dr Dead</li>\n<li>Ascobol</li>\n<li>Elias Timm</li>\n+ <li>LiminalityCarb</li>\n+ <li>Kenny</li>\n+ <li>Killagouge</li>\n+ <li>Faranae</li>\n+ <li>Erys Night</li>\n+ <li>Espresso Lalafell</li>\n+ <li>Omegan</li>\n+ <li>Rohatiro</li>\n+ <li>Scion</li>\n+ <li>Alicielle</li>\n+ <li>DaiSuki2U</li>\n+ <li>C'elosia Arcanine</li>\n+ <li>Lexiam</li>\n+ <li>Twisted Treason</li>\n+ <li>Scarlet Umbra</li>\n+ <li>Heldina Lionroar</li>\n</ul>\n<h2>{{'ABOUT.Contributors' | translate}}</h2>\n",
"new_path": "src/app/pages/about/about/about.component.html",
"old_path": "src/app/pages/about/about/about.component.html"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | chore: added more patreon supporters to the about page | 1 | chore | null |
791,690 | 11.06.2018 14:44:57 | 25,200 | 4c47fb0549a27eb72f084c28f5112dfc8015bad1 | core(a11y): add back html/tags/impact | [
{
"change_type": "MODIFY",
"diff": "@@ -33,6 +33,8 @@ class AxeAudit extends Audit {\nconst violations = artifacts.Accessibility.violations || [];\nconst rule = violations.find(result => result.id === this.meta.name);\n+ const impact = rule && rule.impact;\n+ const tags = rule && rule.tags;\n/** @type {Array<{node: LH.Audit.DetailsRendererNodeDetailsJSON}>}>} */\nlet items = [];\n@@ -42,7 +44,8 @@ class AxeAudit extends Audit {\ntype: 'node',\nselector: Array.isArray(node.target) ? node.target.join(' ') : '',\npath: node.path,\n- snippet: node.snippet,\n+ snippet: node.html || node.snippet,\n+ explanation: node.failureSummary,\n}),\n}));\n}\n@@ -56,7 +59,7 @@ class AxeAudit extends Audit {\nextendedInfo: {\nvalue: rule,\n},\n- details: Audit.makeTableDetails(headings, items),\n+ details: {...Audit.makeTableDetails(headings, items), impact, tags},\n};\n}\n}\n",
"new_path": "lighthouse-core/audits/accessibility/axe-audit.js",
"old_path": "lighthouse-core/audits/accessibility/axe-audit.js"
},
{
"change_type": "MODIFY",
"diff": "\"type\": \"node\",\n\"selector\": \"div > h2\",\n\"path\": \"3,HTML,1,BODY,0,DIV,0,H2\",\n- \"snippet\": \"<h2>\"\n+ \"snippet\": \"<h2>Do better web tester page</h2>\",\n+ \"explanation\": \"Fix any of the following:\\n Element has insufficient color contrast of 1.32 (foreground color: #ffc0cb, background color: #eeeeee, font size: 18.0pt, font weight: bold). Expected contrast ratio of 3:1\"\n}\n},\n{\n\"type\": \"node\",\n\"selector\": \"div > span\",\n\"path\": \"3,HTML,1,BODY,0,DIV,1,SPAN\",\n- \"snippet\": \"<span>\"\n+ \"snippet\": \"<span>Hi there!</span>\",\n+ \"explanation\": \"Fix any of the following:\\n Element has insufficient color contrast of 1.32 (foreground color: #ffc0cb, background color: #eeeeee, font size: 12.0pt, font weight: normal). Expected contrast ratio of 4.5:1\"\n}\n}\n+ ],\n+ \"impact\": \"serious\",\n+ \"tags\": [\n+ \"cat.color\",\n+ \"wcag2aa\",\n+ \"wcag143\"\n]\n}\n},\n\"type\": \"node\",\n\"selector\": \"html\",\n\"path\": \"3,HTML\",\n- \"snippet\": \"<html manifest=\\\"clock.appcache\\\">\"\n+ \"snippet\": \"<html manifest=\\\"clock.appcache\\\">\",\n+ \"explanation\": \"Fix any of the following:\\n The <html> element does not have a lang attribute\"\n}\n}\n+ ],\n+ \"impact\": \"serious\",\n+ \"tags\": [\n+ \"cat.language\",\n+ \"wcag2a\",\n+ \"wcag311\"\n]\n}\n},\n\"type\": \"node\",\n\"selector\": \"body > img[src$=\\\"lighthouse-480x318.jpg\\\"]:nth-child(5)\",\n\"path\": \"3,HTML,1,BODY,5,IMG\",\n- \"snippet\": \"<img src=\\\"lighthouse-480x318.jpg\\\" width=\\\"480\\\" height=\\\"57\\\">\"\n+ \"snippet\": \"<img src=\\\"lighthouse-480x318.jpg\\\" width=\\\"480\\\" height=\\\"57\\\">\",\n+ \"explanation\": \"Fix any of the following:\\n Element does not have an alt attribute\\n aria-label attribute does not exist or is empty\\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty or not visible\\n Element has no title attribute or the title attribute is empty\\n Element's default semantics were not overridden with role=\\\"presentation\\\"\\n Element's default semantics were not overridden with role=\\\"none\\\"\"\n}\n},\n{\n\"type\": \"node\",\n\"selector\": \"body > img[src$=\\\"lighthouse-480x318.jpg\\\"]:nth-child(6)\",\n\"path\": \"3,HTML,1,BODY,7,IMG\",\n- \"snippet\": \"<img src=\\\"lighthouse-480x318.jpg\\\" width=\\\"480\\\" height=\\\"318\\\">\"\n+ \"snippet\": \"<img src=\\\"lighthouse-480x318.jpg\\\" width=\\\"480\\\" height=\\\"318\\\">\",\n+ \"explanation\": \"Fix any of the following:\\n Element does not have an alt attribute\\n aria-label attribute does not exist or is empty\\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty or not visible\\n Element has no title attribute or the title attribute is empty\\n Element's default semantics were not overridden with role=\\\"presentation\\\"\\n Element's default semantics were not overridden with role=\\\"none\\\"\"\n}\n},\n{\n\"type\": \"node\",\n\"selector\": \"body > img:nth-child(20)\",\n\"path\": \"3,HTML,1,BODY,36,IMG\",\n- \"snippet\": \"<img src=\\\"blob:http://localhost:10200/ae0eac03-ab9b-4a6a-b299-f5212153e277\\\">\"\n+ \"snippet\": \"<img src=\\\"blob:http://localhost:10200/ae0eac03-ab9b-4a6a-b299-f5212153e277\\\">\",\n+ \"explanation\": \"Fix any of the following:\\n Element does not have an alt attribute\\n aria-label attribute does not exist or is empty\\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty or not visible\\n Element has no title attribute or the title attribute is empty\\n Element's default semantics were not overridden with role=\\\"presentation\\\"\\n Element's default semantics were not overridden with role=\\\"none\\\"\"\n}\n}\n+ ],\n+ \"impact\": \"critical\",\n+ \"tags\": [\n+ \"cat.text-alternatives\",\n+ \"wcag2a\",\n+ \"wcag111\",\n+ \"section508\",\n+ \"section508.22.a\"\n]\n}\n},\n\"type\": \"node\",\n\"selector\": \"body > input[type=\\\"password\\\"]:nth-child(17)\",\n\"path\": \"3,HTML,1,BODY,31,INPUT\",\n- \"snippet\": \"<input type=\\\"password\\\" onpaste=\\\"event.preventDefault();\\\">\"\n+ \"snippet\": \"<input type=\\\"password\\\" onpaste=\\\"event.preventDefault();\\\">\",\n+ \"explanation\": \"Fix any of the following:\\n aria-label attribute does not exist or is empty\\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty or not visible\\n Form element does not have an implicit (wrapped) <label>\\n Form element does not have an explicit <label>\\n Element has no title attribute or the title attribute is empty\"\n}\n},\n{\n\"type\": \"node\",\n\"selector\": \"body > input[type=\\\"password\\\"]:nth-child(18)\",\n\"path\": \"3,HTML,1,BODY,33,INPUT\",\n- \"snippet\": \"<input type=\\\"password\\\">\"\n+ \"snippet\": \"<input type=\\\"password\\\">\",\n+ \"explanation\": \"Fix any of the following:\\n aria-label attribute does not exist or is empty\\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty or not visible\\n Form element does not have an implicit (wrapped) <label>\\n Form element does not have an explicit <label>\\n Element has no title attribute or the title attribute is empty\"\n}\n},\n{\n\"type\": \"node\",\n\"selector\": \"body > input[type=\\\"password\\\"]:nth-child(19)\",\n\"path\": \"3,HTML,1,BODY,35,INPUT\",\n- \"snippet\": \"<input type=\\\"password\\\" onpaste=\\\"return false;\\\">\"\n+ \"snippet\": \"<input type=\\\"password\\\" onpaste=\\\"return false;\\\">\",\n+ \"explanation\": \"Fix any of the following:\\n aria-label attribute does not exist or is empty\\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty or not visible\\n Form element does not have an implicit (wrapped) <label>\\n Form element does not have an explicit <label>\\n Element has no title attribute or the title attribute is empty\"\n}\n}\n+ ],\n+ \"impact\": \"critical\",\n+ \"tags\": [\n+ \"cat.forms\",\n+ \"wcag2a\",\n+ \"wcag332\",\n+ \"wcag131\",\n+ \"section508\",\n+ \"section508.22.n\"\n]\n}\n},\n\"type\": \"node\",\n\"selector\": \"body > a:nth-child(15)\",\n\"path\": \"3,HTML,1,BODY,27,A\",\n- \"snippet\": \"<a href=\\\"javascript:void(0)\\\" target=\\\"_blank\\\">\"\n+ \"snippet\": \"<a href=\\\"javascript:void(0)\\\" target=\\\"_blank\\\"></a>\",\n+ \"explanation\": \"Fix all of the following:\\n Element is in tab order and does not have accessible text\\n\\nFix any of the following:\\n Element does not have text that is visible to screen readers\\n aria-label attribute does not exist or is empty\\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty or not visible\\n Element's default semantics were not overridden with role=\\\"presentation\\\"\\n Element's default semantics were not overridden with role=\\\"none\\\"\"\n}\n},\n{\n\"type\": \"node\",\n\"selector\": \"body > a[href$=\\\"mailto:inbox@email.com\\\"]\",\n\"path\": \"3,HTML,1,BODY,29,A\",\n- \"snippet\": \"<a href=\\\"mailto:inbox@email.com\\\" target=\\\"_blank\\\">\"\n+ \"snippet\": \"<a href=\\\"mailto:inbox@email.com\\\" target=\\\"_blank\\\"></a>\",\n+ \"explanation\": \"Fix all of the following:\\n Element is in tab order and does not have accessible text\\n\\nFix any of the following:\\n Element does not have text that is visible to screen readers\\n aria-label attribute does not exist or is empty\\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty or not visible\\n Element's default semantics were not overridden with role=\\\"presentation\\\"\\n Element's default semantics were not overridden with role=\\\"none\\\"\"\n}\n}\n+ ],\n+ \"impact\": \"serious\",\n+ \"tags\": [\n+ \"cat.name-role-value\",\n+ \"wcag2a\",\n+ \"wcag111\",\n+ \"wcag412\",\n+ \"wcag244\",\n+ \"section508\",\n+ \"section508.22.a\"\n]\n}\n},\n",
"new_path": "lighthouse-core/test/results/sample_v2.json",
"old_path": "lighthouse-core/test/results/sample_v2.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -134,10 +134,14 @@ declare global {\nexport interface Accessibility {\nviolations: {\nid: string;\n+ impact: string;\n+ tags: string[];\nnodes: {\npath: string;\n+ html: string;\nsnippet: string;\ntarget: string[];\n+ failureSummary?: string;\n}[];\n}[];\nnotApplicable: {\n",
"new_path": "typings/artifacts.d.ts",
"old_path": "typings/artifacts.d.ts"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core(a11y): add back html/tags/impact (#5439) | 1 | core | a11y |
730,413 | 11.06.2018 14:46:18 | 14,400 | e34377b8a2d65b0635df364cd6f606159140f364 | feat(widget-space): allow default overrides in activity menu | [
{
"change_type": "MODIFY",
"diff": "@@ -9,6 +9,7 @@ import RaisedButton from 'material-ui/RaisedButton';\nimport AppBar from 'material-ui/AppBar';\nimport {RadioButtonGroup, RadioButton} from 'material-ui/RadioButton';\nimport {Card, CardActions, CardTitle, CardText} from 'material-ui/Card';\n+import Checkbox from 'material-ui/Checkbox';\nimport TokenInput from '../token-input';\n@@ -28,6 +29,12 @@ class DemoWidget extends Component {\nconst mode = cookies.get('destinationMode') || MODE_SPACE;\nconst destinationId = cookies.get('destinationId') || '';\nthis.state = {\n+ activities: {\n+ files: true,\n+ meet: true,\n+ message: true,\n+ people: true\n+ },\naccessToken: cookies.get('accessToken') || '',\naccessTokenType: cookies.get('accessTokenType') || '',\ndestinationId,\n@@ -134,6 +141,13 @@ class DemoWidget extends Component {\nreturn this.setState({mode: value, destinationId: ''});\n}\n+ @autobind\n+ handleActivitiesChange(event, isInputChecked) {\n+ const {activities} = this.state;\n+ activities[event.target.value] = isInputChecked;\n+ return this.setState({activities});\n+ }\n+\n@autobind\nhandleDestinationChange(e) {\nreturn this.setState({destinationId: e.target.value});\n@@ -143,9 +157,11 @@ class DemoWidget extends Component {\nopenSpaceWidget({toPerson, toPersonId, toSpace}) {\nconst widgetEl = document.getElementById(spaceWidgetElementId);\nconst widgetOptions = {\n+ initialActivity: 'message',\nonEvent: (eventName, detail) => {\nwindow.ciscoSparkEvents.push({eventName, detail});\n- }\n+ },\n+ spaceActivities: this.state.activities\n};\nif (this.state.accessTokenType === 'JWT') {\nwidgetOptions.guestToken = this.state.accessToken;\n@@ -219,6 +235,7 @@ class DemoWidget extends Component {\ntitle=\"Cisco Spark Space Widget\"\n/>\n<CardText expandable>\n+ <h3> Widget Destination Type </h3>\n<div className={classNames(styles.select)}>\n<RadioButtonGroup\naria-label=\"Widget 'To' Type\"\n@@ -243,6 +260,35 @@ class DemoWidget extends Component {\n/>\n</RadioButtonGroup>\n</div>\n+\n+ <div>\n+ <h3> Widget Activities </h3>\n+ <Checkbox\n+ checked={this.state.activities.files}\n+ label=\"Files\"\n+ onCheck={this.handleActivitiesChange}\n+ value=\"files\"\n+ />\n+ <Checkbox\n+ checked={this.state.activities.meet}\n+ label=\"Meet\"\n+ onCheck={this.handleActivitiesChange}\n+ value=\"meet\"\n+ />\n+ <Checkbox\n+ checked={this.state.activities.message}\n+ label=\"Message\"\n+ onCheck={this.handleActivitiesChange}\n+ value=\"message\"\n+ />\n+ <Checkbox\n+ checked={this.state.activities.people}\n+ label=\"People\"\n+ onCheck={this.handleActivitiesChange}\n+ value=\"people\"\n+ />\n+ </div>\n+\n<div>\n<input\naria-label={ariaLabel}\n",
"new_path": "packages/node_modules/@ciscospark/widget-demo/src/components/demo-widget/index.js",
"old_path": "packages/node_modules/@ciscospark/widget-demo/src/components/demo-widget/index.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -121,6 +121,7 @@ When loading the widgets there are some configuration options you can provide:\n| `initialActivity` | `data-initial-activity` | (default: `message`) Activity view to open with the widget. Available options: <ul><li>`message`: Message view</li><li>`meet`: Meet view </li></ul>|\n| `startCall` | `data-start-call` | (default: `false`) When present, widget will start in Meet view and initiate a call with the toPerson immediately. |\n| `logLevel` | `data-log-level` | (default: `silent`) When present, widget will log debug information to console. This can be set to: `error`, `warn`, `debug`, `info`, `trace`, or `silent` |\n+| `spaceActivities` | N/A: global only feature | (default: `spaceActivities: {files: true, meet: true, message: true, people: true}`). When present and a property is set to false, that activity will be disabled in the activities menu. Disabling the initial activity will result in an error.\n### HTML\n",
"new_path": "packages/node_modules/@ciscospark/widget-space/README.md",
"old_path": "packages/node_modules/@ciscospark/widget-space/README.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -38,6 +38,12 @@ const injectedPropTypes = {\nexport const ownPropTypes = {\ncustomActivityTypes: PropTypes.object,\nmuteNotifications: PropTypes.bool,\n+ spaceActivities: PropTypes.shape({\n+ files: PropTypes.bool,\n+ meet: PropTypes.bool,\n+ message: PropTypes.bool,\n+ people: PropTypes.bool\n+ }),\nspaceId: PropTypes.string,\nstartCall: PropTypes.oneOfType([\nPropTypes.string,\n@@ -52,6 +58,12 @@ export const ownPropTypes = {\nconst defaultProps = {\ncustomActivityTypes: undefined,\nmuteNotifications: false,\n+ spaceActivities: {\n+ files: true,\n+ meet: true,\n+ message: true,\n+ people: true\n+ },\nspaceId: '',\nstartCall: false,\ntoPersonEmail: '',\n@@ -78,7 +90,6 @@ export class SpaceWidget extends Component {\nwidgetSpace,\nwidgetStatus\n} = props;\n-\nconst {formatMessage} = props.intl;\nlet errorElement;\nif (errors.get('hasError') || conversation.getIn(['status', 'error'])) {\n",
"new_path": "packages/node_modules/@ciscospark/widget-space/src/container.js",
"old_path": "packages/node_modules/@ciscospark/widget-space/src/container.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -36,7 +36,9 @@ function checkForMercuryErrors(props) {\nfunction checkForErrors(props) {\nconst {\n+ activityTypes,\nerrors,\n+ initialActivity,\nspaceId,\nsparkState,\nspark,\n@@ -90,6 +92,19 @@ function checkForErrors(props) {\n});\n}\n}\n+\n+ const invalidActivityId = 'ciscospark.container.space.error.invalidActivity';\n+ const validActivity = initialActivity ? activityTypes.some((activity) => activity.name === initialActivity) : true;\n+ if (!validActivity && !errors.get('errors').has(invalidActivityId)) {\n+ props.addError({\n+ id: invalidActivityId,\n+ displayTitle: formatMessage(messages.disabledInitialActivity),\n+ temporary: false\n+ });\n+ }\n+ if (validActivity && errors.get('errors').has(invalidActivityId)) {\n+ props.removeError(invalidActivityId);\n+ }\n}\nexport default compose(\n",
"new_path": "packages/node_modules/@ciscospark/widget-space/src/enhancers/errors.js",
"old_path": "packages/node_modules/@ciscospark/widget-space/src/enhancers/errors.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -30,6 +30,10 @@ export default defineMessages({\nid: 'ciscospark.container.space.error.badid',\ndefaultMessage: 'Error: Invalid Space ID'\n},\n+ disabledInitialActivity: {\n+ id: 'ciscospark.container.space.error.invalidActivity',\n+ defaultMessage: 'Error: The selected initial activity is invalid'\n+ },\nunableToLoad: {\nid: 'ciscospark.container.space.error.unabletoload',\ndefaultMessage: 'Unable to Load Space'\n",
"new_path": "packages/node_modules/@ciscospark/widget-space/src/messages.js",
"old_path": "packages/node_modules/@ciscospark/widget-space/src/messages.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -50,11 +50,15 @@ export const getSpaceDetails = createSelector(\n);\nexport const getActivityTypes = createSelector(\n- [getWidget, getFeatures],\n- (widget, features) => {\n+ [getWidget, getFeatures, getOwnProps],\n+ (widget, features, ownProps) => {\n+ const {spaceActivities} = ownProps;\nconst spaceType = widget.getIn(['spaceDetails', 'type']);\n- const activityTypes = widget.get('activityTypes').toJS();\nconst filteredActivityTypes = [];\n+ let activityTypes = widget.get('activityTypes').toJS();\n+ if (spaceActivities) {\n+ activityTypes = activityTypes.filter((a) => spaceActivities[a.name] !== false);\n+ }\nactivityTypes.forEach((activityType) => {\nlet isValid = true;\n// Filter activity Type based on spaceType\n",
"new_path": "packages/node_modules/@ciscospark/widget-space/src/selector.js",
"old_path": "packages/node_modules/@ciscospark/widget-space/src/selector.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -10,7 +10,8 @@ export const elements = {\ncloseButton: 'button[aria-label=\"Close\"]',\nexitButton: '.ciscospark-activity-menu-exit button',\nmessageWidget: '.ciscospark-message-wrapper',\n- meetWidget: '.ciscospark-meet-wrapper'\n+ meetWidget: '.ciscospark-meet-wrapper',\n+ errorMessage: '.ciscospark-error-title'\n};\n/**\n",
"new_path": "test/journeys/lib/test-helpers/space-widget/main.js",
"old_path": "test/journeys/lib/test-helpers/space-widget/main.js"
},
{
"change_type": "ADD",
"diff": "+import {assert} from 'chai';\n+\n+import testUsers from '@ciscospark/test-helper-test-users';\n+import '@ciscospark/internal-plugin-conversation';\n+\n+import {updateJobStatus} from '../../../lib/test-helpers';\n+import {elements} from '../../../lib/test-helpers/space-widget/main';\n+import {elements as rosterElements} from '../../../lib/test-helpers/space-widget/roster';\n+\n+describe('Widget Space: One on One: Startup Settings', () => {\n+ const browserLocal = browser.select('browserLocal');\n+ const browserRemote = browser.select('browserRemote');\n+ const jobName = 'react-widget-oneOnOne-global';\n+ let mccoy, spock;\n+ let allPassed = true;\n+\n+ before('load browsers', () => {\n+ browser.url('/space.html?message');\n+ });\n+\n+ before('create spock', () => testUsers.create({count: 1, config: {displayName: 'Mr Spock'}})\n+ .then((users) => {\n+ [spock] = users;\n+ }));\n+\n+ before('create mccoy', () => testUsers.create({count: 1, config: {displayName: 'Bones Mccoy'}})\n+ .then((users) => {\n+ [mccoy] = users;\n+ }));\n+\n+ before('pause to let test users establish', () => browser.pause(5000));\n+\n+ before('inject token', () => {\n+ browserLocal.execute((localAccessToken, localToUserEmail) => {\n+ const options = {\n+ accessToken: localAccessToken,\n+ onEvent: (eventName, detail) => {\n+ window.ciscoSparkEvents.push({eventName, detail});\n+ },\n+ toPersonEmail: localToUserEmail,\n+ initialActivity: 'message'\n+ };\n+ window.openSpaceWidget(options);\n+ }, spock.token.access_token, mccoy.email);\n+ });\n+\n+ describe('message widget', () => {\n+ before('open remote widget', () => {\n+ browserRemote.execute((localAccessToken, localToUserEmail) => {\n+ const options = {\n+ accessToken: localAccessToken,\n+ onEvent: (eventName, detail) => {\n+ window.ciscoSparkEvents.push({eventName, detail});\n+ },\n+ toPersonEmail: localToUserEmail,\n+ initialActivity: 'message',\n+ spaceActivities: {\n+ files: false,\n+ meet: false,\n+ message: false,\n+ people: true\n+ }\n+ };\n+ window.openSpaceWidget(options);\n+ }, mccoy.token.access_token, spock.email);\n+ });\n+\n+ it('displays error message for disabled initial activity', () => {\n+ browserRemote.waitForVisible(elements.errorMessage);\n+ assert.equal(browserRemote.getText(elements.errorMessage), 'Error: The selected initial activity is invalid', 'does not display error message for invalid activity');\n+ browserRemote.refresh();\n+ });\n+ });\n+\n+ describe('message widget', () => {\n+ before('open remote widget', () => {\n+ browserRemote.execute((localAccessToken, localToUserEmail) => {\n+ const options = {\n+ accessToken: localAccessToken,\n+ onEvent: (eventName, detail) => {\n+ window.ciscoSparkEvents.push({eventName, detail});\n+ },\n+ toPersonEmail: localToUserEmail,\n+ initialActivity: 'message',\n+ spaceActivities: {\n+ files: false,\n+ meet: false,\n+ message: true,\n+ people: true\n+ }\n+ };\n+ window.openSpaceWidget(options);\n+ }, mccoy.token.access_token, spock.email);\n+ });\n+\n+ it('disables the files and meet activities', () => {\n+ browserRemote.waitForVisible(elements.menuButton);\n+ browserRemote.click(elements.menuButton);\n+ browserRemote.waitForVisible(elements.activityMenu);\n+ browserRemote.waitForVisible(elements.messageButton);\n+ browserRemote.waitForVisible(rosterElements.peopleButton);\n+ assert.isFalse(browserRemote.isExisting(elements.meetButton), 'meet button exists in activity menu when it should be disabled');\n+ assert.isFalse(browserRemote.isExisting(elements.filesButton), 'files button exists in activity menu when it should be disabled');\n+ });\n+ });\n+\n+ /* eslint-disable-next-line func-names */\n+ afterEach(function () {\n+ allPassed = allPassed && (this.currentTest.state === 'passed');\n+ });\n+\n+ after(() => {\n+ updateJobStatus(jobName, allPassed);\n+ });\n+});\n",
"new_path": "test/journeys/specs/oneOnOne/global/startup-settings.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import '@ciscospark/plugin-logger';\n+import CiscoSpark from '@ciscospark/spark-core';\n+import testUsers from '@ciscospark/test-helper-test-users';\n+import '@ciscospark/internal-plugin-conversation';\n+\n+import {assert} from 'chai';\n+\n+import {updateJobStatus} from '../../../lib/test-helpers';\n+import {elements} from '../../../lib/test-helpers/space-widget/main';\n+import {elements as rosterElements} from '../../../lib/test-helpers/space-widget/roster';\n+\n+describe('Widget Space: Startup Settings', () => {\n+ const browserLocal = browser.select('browserLocal');\n+ const browserRemote = browser.select('browserRemote');\n+ const jobName = 'react-widget-space-global';\n+\n+ let allPassed = true;\n+ let docbrown, lorraine, marty;\n+ let conversation;\n+\n+ before('load browsers', () => {\n+ browser.url('/space.html');\n+ });\n+\n+ before('create marty', () => testUsers.create({count: 1, config: {displayName: 'Marty McFly'}})\n+ .then((users) => {\n+ [marty] = users;\n+ marty.spark = new CiscoSpark({\n+ credentials: {\n+ authorization: marty.token\n+ },\n+ config: {\n+ logger: {\n+ level: 'error'\n+ }\n+ }\n+ });\n+ return marty.spark.internal.mercury.connect();\n+ }));\n+\n+ before('create docbrown', () => testUsers.create({count: 1, config: {displayName: 'Emmett Brown'}})\n+ .then((users) => {\n+ [docbrown] = users;\n+ docbrown.spark = new CiscoSpark({\n+ credentials: {\n+ authorization: docbrown.token\n+ },\n+ config: {\n+ logger: {\n+ level: 'error'\n+ }\n+ }\n+ });\n+ }));\n+\n+ before('create lorraine', () => testUsers.create({count: 1, config: {displayName: 'Lorraine Baines'}})\n+ .then((users) => {\n+ [lorraine] = users;\n+ lorraine.spark = new CiscoSpark({\n+ credentials: {\n+ authorization: lorraine.token\n+ },\n+ config: {\n+ logger: {\n+ level: 'error'\n+ }\n+ }\n+ });\n+ return lorraine.spark.internal.mercury.connect();\n+ }));\n+\n+ before('pause to let test users establish', () => browser.pause(5000));\n+\n+ before('create space', () => marty.spark.internal.conversation.create({\n+ displayName: 'Test Widget Space',\n+ participants: [marty, docbrown, lorraine]\n+ }).then((c) => {\n+ conversation = c;\n+ return conversation;\n+ }));\n+\n+\n+ before('inject token', () => {\n+ browserLocal.execute((localAccessToken, localToUserEmail) => {\n+ const options = {\n+ accessToken: localAccessToken,\n+ onEvent: (eventName, detail) => {\n+ window.ciscoSparkEvents.push({eventName, detail});\n+ },\n+ toPersonEmail: localToUserEmail,\n+ initialActivity: 'message'\n+ };\n+ window.openSpaceWidget(options);\n+ }, marty.token.access_token, docbrown.email);\n+ });\n+\n+ describe('message widget', () => {\n+ before('open remote widget', () => {\n+ browserRemote.execute((localAccessToken, localToUserEmail) => {\n+ const options = {\n+ accessToken: localAccessToken,\n+ onEvent: (eventName, detail) => {\n+ window.ciscoSparkEvents.push({eventName, detail});\n+ },\n+ toPersonEmail: localToUserEmail,\n+ initialActivity: 'message',\n+ spaceActivities: {\n+ files: false,\n+ meet: false,\n+ message: false,\n+ people: true\n+ }\n+ };\n+ window.openSpaceWidget(options);\n+ }, docbrown.token.access_token, marty.email);\n+ });\n+\n+ it('displays error message for disabled initial activity', () => {\n+ browserRemote.waitForVisible(elements.errorMessage);\n+ assert.equal(browserRemote.getText(elements.errorMessage), 'Error: The selected initial activity is invalid', 'does not display error message for invalid activity');\n+ browserRemote.refresh();\n+ });\n+ });\n+\n+ describe('message widget', () => {\n+ before('open remote widget', () => {\n+ browserRemote.execute((localAccessToken, localToUserEmail) => {\n+ const options = {\n+ accessToken: localAccessToken,\n+ onEvent: (eventName, detail) => {\n+ window.ciscoSparkEvents.push({eventName, detail});\n+ },\n+ toPersonEmail: localToUserEmail,\n+ initialActivity: 'message',\n+ spaceActivities: {\n+ files: false,\n+ meet: false,\n+ message: true,\n+ people: true\n+ }\n+ };\n+ window.openSpaceWidget(options);\n+ }, docbrown.token.access_token, marty.email);\n+ });\n+\n+ it('disables the files and meet activities', () => {\n+ browserRemote.waitForVisible(elements.menuButton);\n+ browserRemote.click(elements.menuButton);\n+ browserRemote.waitForVisible(elements.activityMenu);\n+ browserRemote.waitForVisible(elements.messageButton);\n+ browserRemote.waitForVisible(rosterElements.peopleButton);\n+ assert.isFalse(browserRemote.isExisting(elements.meetButton), 'meet button exists in activity menu when it should be disabled');\n+ assert.isFalse(browserRemote.isExisting(elements.filesButton), 'files button exists in activity menu when it should be disabled');\n+ });\n+ });\n+\n+ /* eslint-disable-next-line func-names */\n+ afterEach(function () {\n+ allPassed = allPassed && (this.currentTest.state === 'passed');\n+ });\n+\n+ after(() => {\n+ updateJobStatus(jobName, allPassed);\n+ });\n+});\n",
"new_path": "test/journeys/specs/space/global/startup-settings.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -92,6 +92,9 @@ The \"oneOnOne\" test suite opens a space widget between two individuals. The test\n- during call experience\n- can hangup in call\n- can decline an incoming call\n+ - Startup Settings\n+ - Error message is displayed when the initial activity is disabled\n+ - Properly disables activities in the activities menu\n- Data API\n- \"Basic Tests\" (Test Users Created)\n@@ -238,6 +241,9 @@ The \"space\" test suite opens a space widget to a group space and creates three t\n- sends message with link\n- sends message with inline code\n- sends message with codeblock\n+ - Startup Settings\n+ - Error message is displayed when the initial activity is disabled\n+ - Properly disables activities in the activities menu\n- Data API\n- \"Basic Tests\" (Test Users & Space Created)\n",
"new_path": "test/journeys/testplan.md",
"old_path": "test/journeys/testplan.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -117,7 +117,8 @@ exports.config = {\n'./test/journeys/specs/oneOnOne/dataApi/startup-settings.js',\n'./test/journeys/specs/oneOnOne/global/basic.js',\n'./test/journeys/specs/oneOnOne/global/meet.js',\n- './test/journeys/specs/oneOnOne/global/messaging.js'\n+ './test/journeys/specs/oneOnOne/global/messaging.js',\n+ './test/journeys/specs/oneOnOne/global/startup-settings.js'\n],\nspace: [\n'./test/journeys/specs/space/dataApi/basic.js',\n@@ -126,7 +127,9 @@ exports.config = {\n'./test/journeys/specs/space/dataApi/startup-settings.js',\n'./test/journeys/specs/space/global/basic.js',\n'./test/journeys/specs/space/global/meet.js',\n- './test/journeys/specs/space/global/messaging.js'\n+ './test/journeys/specs/space/global/messaging.js',\n+ './test/journeys/specs/space/global/startup-settings.js',\n+ './test/journeys/specs/space/featureFlags.js'\n],\nrecents: [\n'./test/journeys/specs/recents/dataApi/basic.js',\n@@ -146,6 +149,7 @@ exports.config = {\n'./test/journeys/specs/oneOnOne/global/guest.js',\n'./test/journeys/specs/oneOnOne/global/meet.js',\n'./test/journeys/specs/oneOnOne/global/messaging.js',\n+ './test/journeys/specs/oneOnOne/global/startup-settings.js',\n'./test/journeys/specs/recents/dataApi/basic.js',\n'./test/journeys/specs/recents/global/basic.js',\n'./test/journeys/specs/space/dataApi/basic.js',\n@@ -154,7 +158,9 @@ exports.config = {\n'./test/journeys/specs/space/dataApi/startup-settings.js',\n'./test/journeys/specs/space/global/basic.js',\n'./test/journeys/specs/space/global/meet.js',\n- './test/journeys/specs/space/global/messaging.js'\n+ './test/journeys/specs/space/global/messaging.js',\n+ './test/journeys/specs/space/global/startup-settings.js',\n+ './test/journeys/specs/space/featureFlags.js'\n],\nguest: [\n'./test/journeys/specs/oneOnOne/dataApi/guest.js',\n",
"new_path": "wdio.conf.js",
"old_path": "wdio.conf.js"
}
] | JavaScript | MIT License | webex/react-widgets | feat(widget-space): allow default overrides in activity menu | 1 | feat | widget-space |
791,690 | 11.06.2018 15:04:39 | 25,200 | 9cc37d4c07ca68c5b5463715877df4f95416daed | core(user-timings): add back startTime | [
{
"change_type": "MODIFY",
"diff": "@@ -115,16 +115,16 @@ class UserTimings extends Audit {\nreturn artifacts.requestTraceOfTab(trace).then(tabTrace => {\nconst userTimings = this.filterTrace(tabTrace).filter(UserTimings.excludeBlacklisted);\nconst tableRows = userTimings.map(item => {\n- const time = item.isMark ? item.startTime : item.duration;\nreturn {\nname: item.name,\n+ startTime: item.startTime,\n+ duration: item.isMark ? undefined : item.duration,\ntimingType: item.isMark ? 'Mark' : 'Measure',\n- time,\n};\n}).sort((itemA, itemB) => {\nif (itemA.timingType === itemB.timingType) {\n// If both items are the same type, sort in ascending order by time\n- return itemA.time - itemB.time;\n+ return itemA.startTime - itemB.startTime;\n} else if (itemA.timingType === 'Measure') {\n// Put measures before marks\nreturn -1;\n@@ -136,16 +136,26 @@ class UserTimings extends Audit {\nconst headings = [\n{key: 'name', itemType: 'text', text: 'Name'},\n{key: 'timingType', itemType: 'text', text: 'Type'},\n- {key: 'time', itemType: 'ms', granularity: 0.01, text: 'Time'},\n+ {key: 'startTime', itemType: 'ms', granularity: 0.01, text: 'Start Time'},\n+ {key: 'duration', itemType: 'ms', granularity: 0.01, text: 'Duration'},\n];\nconst details = Audit.makeTableDetails(headings, tableRows);\n+ /** @type {LH.Audit.Product['displayValue']} */\n+ let displayValue;\n+ if (userTimings.length) {\n+ displayValue = [\n+ userTimings.length === 1 ? '%d user timing' : '%d user timings',\n+ userTimings.length,\n+ ];\n+ }\n+\nreturn {\n// mark the audit as notApplicable if there were no user timings\nrawValue: userTimings.length === 0,\nnotApplicable: userTimings.length === 0,\n- displayValue: userTimings.length ? `${userTimings.length}` : '',\n+ displayValue,\nextendedInfo: {\nvalue: userTimings,\n},\n",
"new_path": "lighthouse-core/audits/user-timings.js",
"old_path": "lighthouse-core/audits/user-timings.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -30,21 +30,17 @@ describe('Performance: user-timings audit', () => {\nassert.equal(blackListedUTs.length, 0, 'Blacklisted usertimings included in results');\nassert.equal(auditResult.rawValue, false);\n- assert.equal(auditResult.displayValue, 2);\n-\n- assert.equal(auditResult.extendedInfo.value[0].isMark, true);\n- assert.equal(Math.floor(auditResult.extendedInfo.value[0].startTime), 1000);\n- assert.equal(typeof auditResult.extendedInfo.value[0].endTime, 'undefined');\n- assert.equal(typeof auditResult.extendedInfo.value[0].duration, 'undefined');\n-\n- assert.equal(auditResult.extendedInfo.value[1].isMark, false);\n- assert.equal(Math.floor(auditResult.extendedInfo.value[1].startTime), 0);\n- assert.equal(Math.floor(auditResult.extendedInfo.value[1].endTime), 1000);\n- assert.equal(Math.floor(auditResult.extendedInfo.value[1].duration), 1000);\n+ assert.deepStrictEqual(auditResult.displayValue, ['%d user timings', 2]);\nassert.equal(auditResult.details.items[0].name, 'measure_test');\nassert.equal(auditResult.details.items[0].timingType, 'Measure');\n- assert.equal(auditResult.details.items[0].time, 1000.965);\n+ assert.equal(auditResult.details.items[0].startTime, 0.002);\n+ assert.equal(auditResult.details.items[0].duration, 1000.965);\n+\n+ assert.equal(auditResult.details.items[1].name, 'mark_test');\n+ assert.equal(auditResult.details.items[1].timingType, 'Mark');\n+ assert.equal(auditResult.details.items[1].startTime, 1000.954);\n+ assert.equal(auditResult.details.items[1].duration, undefined);\n});\n});\n",
"new_path": "lighthouse-core/test/audits/user-timing-test.js",
"old_path": "lighthouse-core/test/audits/user-timing-test.js"
},
{
"change_type": "MODIFY",
"diff": "\"score\": null,\n\"scoreDisplayMode\": \"not-applicable\",\n\"rawValue\": true,\n- \"displayValue\": \"\",\n\"details\": {\n\"type\": \"table\",\n\"headings\": [],\n",
"new_path": "lighthouse-core/test/results/sample_v2.json",
"old_path": "lighthouse-core/test/results/sample_v2.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -200,7 +200,7 @@ describe('Runner', () => {\nreturn Runner.run({}, {url, config}).then(results => {\nconst audits = results.lhr.audits;\n- assert.equal(audits['user-timings'].displayValue, 2);\n+ assert.equal(audits['user-timings'].displayValue[1], 2);\nassert.equal(audits['user-timings'].rawValue, false);\n});\n});\n",
"new_path": "lighthouse-core/test/runner-test.js",
"old_path": "lighthouse-core/test/runner-test.js"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core(user-timings): add back startTime (#5442) | 1 | core | user-timings |
730,412 | 11.06.2018 15:46:15 | 0 | 57d4b1910248c82727de14f5917d8801a5d63b74 | chore(release): 0.1.306 | [
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.1.306\"></a>\n+## [0.1.306](https://github.com/webex/react-ciscospark/compare/v0.1.305...v0.1.306) (2018-06-11)\n+\n+\n+\n<a name=\"0.1.305\"></a>\n## [0.1.305](https://github.com/webex/react-ciscospark/compare/v0.1.304...v0.1.305) (2018-06-05)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@ciscospark/react-ciscospark\",\n- \"version\": \"0.1.305\",\n+ \"version\": \"0.1.306\",\n\"description\": \"The Cisco Spark for React library allows developers to easily incorporate Spark functionality into an application.\",\n\"scripts\": {\n\"build\": \"./scripts/build/index.js\",\n",
"new_path": "package.json",
"old_path": "package.json"
}
] | JavaScript | MIT License | webex/react-widgets | chore(release): 0.1.306 | 1 | chore | release |
724,111 | 11.06.2018 16:01:20 | -28,800 | 87936e96be3e5be4cd05e487588fd9c80db2fd98 | docs: keep update | [
{
"change_type": "MODIFY",
"diff": "## setChecked(value)\n-Sets the value of a radio or checkbox `<input`>.\n+Sets the value of a radio or checkbox `<input>`.\n- **Arguments:**\n- `{Boolean} selected`\n",
"new_path": "docs/api/wrapper/setChecked.md",
"old_path": "docs/api/wrapper/setChecked.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -217,7 +217,7 @@ export default{\nimport { shallowMount, createLocalVue } from '@vue/test-utils'\nimport Vuex from 'vuex'\nimport MyComponent from '../../../src/components/MyComponent'\n-import mymodule from '../../../src/store/mymodule'\n+import myModule from '../../../src/store/myModule'\nconst localVue = createLocalVue()\n@@ -230,10 +230,8 @@ describe('MyComponent.vue', () => {\nbeforeEach(() => {\nstate = {\n- module: {\nclicks: 2\n}\n- }\nactions = {\nmoduleActionClick: jest.fn()\n@@ -241,10 +239,10 @@ describe('MyComponent.vue', () => {\nstore = new Vuex.Store({\nmodules: {\n- mymodule: {\n+ myModule: {\nstate,\nactions,\n- getters: module.getters\n+ getters: myModule.getters\n}\n}\n})\n",
"new_path": "docs/zh/guides/using-with-vuex.md",
"old_path": "docs/zh/guides/using-with-vuex.md"
}
] | JavaScript | MIT License | vuejs/vue-test-utils | docs: keep update (#702) | 1 | docs | null |
791,690 | 11.06.2018 17:36:44 | 25,200 | 5237ce749750a4ce45a6f9e5e5f212cf3829dd8d | core(simulator): convert node timings to trace | [
{
"change_type": "MODIFY",
"diff": "@@ -73,6 +73,7 @@ class LanternMetricArtifact extends ComputedArtifact {\n*/\nasync computeMetricWithGraphs(data, artifacts, extras) {\nconst {trace, devtoolsLog, settings} = data;\n+ const metricName = this.name.replace('Lantern', '');\nconst graph = await artifacts.requestPageDependencyGraph({trace, devtoolsLog});\nconst traceOfTab = await artifacts.requestTraceOfTab(trace);\n/** @type {Simulator} */\n@@ -82,9 +83,14 @@ class LanternMetricArtifact extends ComputedArtifact {\nconst optimisticGraph = this.getOptimisticGraph(graph, traceOfTab);\nconst pessimisticGraph = this.getPessimisticGraph(graph, traceOfTab);\n- const optimisticSimulation = simulator.simulate(optimisticGraph);\n- const optimisticFlexSimulation = simulator.simulate(optimisticGraph, {flexibleOrdering: true});\n- const pessimisticSimulation = simulator.simulate(pessimisticGraph);\n+ let simulateOptions = {label: `optimistic${metricName}`};\n+ const optimisticSimulation = simulator.simulate(optimisticGraph, simulateOptions);\n+\n+ simulateOptions = {label: `optimisticFlex${metricName}`, flexibleOrdering: true};\n+ const optimisticFlexSimulation = simulator.simulate(optimisticGraph, simulateOptions);\n+\n+ simulateOptions = {label: `pessimistic${metricName}`};\n+ const pessimisticSimulation = simulator.simulate(pessimisticGraph, simulateOptions);\nconst optimisticEstimate = this.getEstimateFromSimulation(\noptimisticSimulation.timeInMs < optimisticFlexSimulation.timeInMs ?\n",
"new_path": "lighthouse-core/gather/computed/metrics/lantern-metric.js",
"old_path": "lighthouse-core/gather/computed/metrics/lantern-metric.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -9,6 +9,8 @@ const fs = require('fs');\nconst path = require('path');\nconst log = require('lighthouse-logger');\nconst stream = require('stream');\n+const Simulator = require('./dependency-graph/simulator/simulator');\n+const lanternTraceSaver = require('./lantern-trace-saver');\nconst Metrics = require('./traces/pwmetrics-events');\nconst TraceParser = require('./traces/trace-parser');\nconst rimraf = require('rimraf');\n@@ -267,6 +269,22 @@ function saveTrace(traceData, traceFilename) {\n});\n}\n+/**\n+ * @param {string} pathWithBasename\n+ * @return {Promise<void>}\n+ */\n+async function saveLanternDebugTraces(pathWithBasename) {\n+ if (!process.env.LANTERN_DEBUG) return;\n+\n+ for (const [label, nodeTimings] of Simulator.ALL_NODE_TIMINGS) {\n+ if (lanternTraceSaver.simulationNamesToIgnore.includes(label)) continue;\n+\n+ const traceFilename = `${pathWithBasename}-${label}${traceSuffix}`;\n+ await saveTrace(lanternTraceSaver.convertNodeTimingsToTrace(nodeTimings), traceFilename);\n+ log.log('saveAssets', `${label} lantern trace file streamed to disk: ${traceFilename}`);\n+ }\n+}\n+\n/**\n* Writes trace(s) and associated asset(s) to disk.\n* @param {LH.Artifacts} artifacts\n@@ -296,6 +314,7 @@ async function saveAssets(artifacts, audits, pathWithBasename) {\n});\nawait Promise.all(saveAll);\n+ await saveLanternDebugTraces(pathWithBasename);\n}\n/**\n",
"new_path": "lighthouse-core/lib/asset-saver.js",
"old_path": "lighthouse-core/lib/asset-saver.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -26,6 +26,9 @@ const NodeState = {\nComplete: 3,\n};\n+/** @type {Map<string, LH.Gatherer.Simulation.Result['nodeTimings']>} */\n+const ALL_SIMULATION_NODE_TIMINGS = new Map();\n+\nclass Simulator {\n/**\n* @param {LH.Gatherer.Simulation.Options} [options]\n@@ -369,7 +372,7 @@ class Simulator {\n* connection).\n*\n* @param {Node} graph\n- * @param {{flexibleOrdering?: boolean}=} options\n+ * @param {{flexibleOrdering?: boolean, label?: string}=} options\n* @return {LH.Gatherer.Simulation.Result}\n*/\nsimulate(graph, options) {\n@@ -377,7 +380,11 @@ class Simulator {\nthrow new Error('Cannot simulate graph with cycle');\n}\n- options = Object.assign({flexibleOrdering: false}, options);\n+ options = Object.assign({\n+ label: undefined,\n+ flexibleOrdering: false,\n+ }, options);\n+\n// initialize the necessary data containers\nthis._flexibleOrdering = !!options.flexibleOrdering;\nthis._initializeConnectionPool(graph);\n@@ -429,11 +436,19 @@ class Simulator {\n}\n}\n+ const nodeTimings = this._computeFinalNodeTimings();\n+ ALL_SIMULATION_NODE_TIMINGS.set(options.label || 'unlabeled', nodeTimings);\n+\nreturn {\ntimeInMs: totalElapsedTime,\n- nodeTimings: this._computeFinalNodeTimings(),\n+ nodeTimings,\n};\n}\n+\n+ /** @return {Map<string, LH.Gatherer.Simulation.Result['nodeTimings']>} */\n+ static get ALL_NODE_TIMINGS() {\n+ return ALL_SIMULATION_NODE_TIMINGS;\n+ }\n}\nmodule.exports = Simulator;\n",
"new_path": "lighthouse-core/lib/dependency-graph/simulator/simulator.js",
"old_path": "lighthouse-core/lib/dependency-graph/simulator/simulator.js"
},
{
"change_type": "ADD",
"diff": "+/**\n+ * @license Copyright 2018 Google Inc. All Rights Reserved.\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n+ */\n+'use strict';\n+\n+/**\n+ * @param {LH.Gatherer.Simulation.Result['nodeTimings']} nodeTimings\n+ * @return {LH.Trace}\n+ */\n+function convertNodeTimingsToTrace(nodeTimings) {\n+ /** @type {LH.TraceEvent[]} */\n+ const traceEvents = [];\n+ const baseTs = 1e9;\n+ const baseEvent = {pid: 1, tid: 1, cat: 'devtools.timeline'};\n+ const frame = 'A00001';\n+ /** @param {number} ms */\n+ const toMicroseconds = ms => baseTs + ms * 1000;\n+\n+ traceEvents.push(createFakeTracingStartedEvent());\n+ traceEvents.push({...createFakeTracingStartedEvent(), name: 'TracingStartedInBrowser'});\n+\n+ // Create a fake requestId counter\n+ let requestId = 1;\n+ let lastEventEndTime = 0;\n+ for (const [node, timing] of nodeTimings.entries()) {\n+ lastEventEndTime = Math.max(lastEventEndTime, timing.endTime);\n+ if (node.type === 'cpu') {\n+ // Represent all CPU work that was bundled in a task as an EvaluateScript event\n+ const cpuNode = /** @type {LH.Gatherer.Simulation.GraphCPUNode} */ (node);\n+ traceEvents.push(...createFakeTaskEvents(cpuNode, timing));\n+ } else {\n+ const networkNode = /** @type {LH.Gatherer.Simulation.GraphNetworkNode} */ (node);\n+ // Ignore data URIs as they don't really add much value\n+ if (/^data/.test(networkNode.record.url)) continue;\n+ traceEvents.push(...createFakeNetworkEvents(networkNode.record, timing));\n+ }\n+ }\n+\n+ // Create a fake task event ~1s after the trace ends for a sane default bounds in DT\n+ traceEvents.push(\n+ ...createFakeTaskEvents(\n+ // @ts-ignore\n+ {childEvents: [], event: {}},\n+ {\n+ startTime: lastEventEndTime + 1000,\n+ endTime: lastEventEndTime + 1001,\n+ }\n+ )\n+ );\n+\n+ return {traceEvents};\n+\n+ /**\n+ * @return {LH.TraceEvent}\n+ */\n+ function createFakeTracingStartedEvent() {\n+ const argsData = {\n+ frameTreeNodeId: 1,\n+ sessionId: '1.1',\n+ page: frame,\n+ persistentIds: true,\n+ frames: [{frame, url: 'about:blank', name: '', processId: 1}],\n+ };\n+\n+ return {\n+ ...baseEvent,\n+ ts: baseTs - 1e5,\n+ ph: 'I',\n+ s: 't',\n+ cat: 'disabled-by-default-devtools.timeline',\n+ name: 'TracingStartedInPage',\n+ args: {data: argsData},\n+ dur: 0,\n+ };\n+ }\n+\n+ /**\n+ * @param {LH.Gatherer.Simulation.GraphCPUNode} cpuNode\n+ * @param {{startTime: number, endTime: number}} timing\n+ * @return {LH.TraceEvent[]}\n+ */\n+ function createFakeTaskEvents(cpuNode, timing) {\n+ const argsData = {\n+ url: '',\n+ frame,\n+ lineNumber: 0,\n+ columnNumber: 0,\n+ };\n+\n+ const eventTs = toMicroseconds(timing.startTime);\n+\n+ /** @type {LH.TraceEvent[]} */\n+ const events = [\n+ {\n+ ...baseEvent,\n+ ph: 'X',\n+ name: 'Task',\n+ ts: eventTs,\n+ dur: (timing.endTime - timing.startTime) * 1000,\n+ args: {data: argsData},\n+ },\n+ ];\n+\n+ const nestedBaseTs = cpuNode.event.ts || 0;\n+ const multiplier = (timing.endTime - timing.startTime) * 1000 / cpuNode.event.dur;\n+ // https://github.com/ChromeDevTools/devtools-frontend/blob/5429ac8a61ad4fa/front_end/timeline_model/TimelineModel.js#L1129-L1130\n+ const netReqEvents = new Set(['ResourceSendRequest', 'ResourceFinish',\n+ 'ResourceReceiveResponse', 'ResourceReceivedData']);\n+ for (const event of cpuNode.childEvents) {\n+ if (netReqEvents.has(event.name)) continue;\n+ const ts = eventTs + (event.ts - nestedBaseTs) * multiplier;\n+ const newEvent = {...event, ...{pid: baseEvent.pid, tid: baseEvent.tid}, ts};\n+ if (event.dur) newEvent.dur = event.dur * multiplier;\n+ events.push(newEvent);\n+ }\n+\n+ return events;\n+ }\n+\n+ /**\n+ * @param {LH.WebInspector.NetworkRequest} record\n+ * @param {LH.Gatherer.Simulation.NodeTiming} timing\n+ * @return {LH.TraceEvent[]}\n+ */\n+ function createFakeNetworkEvents(record, timing) {\n+ requestId++;\n+\n+ // 0ms requests get super-messed up rendering\n+ // Use 0.3ms instead so they're still hoverable, https://github.com/GoogleChrome/lighthouse/pull/5350#discussion_r194563201\n+ let {startTime, endTime} = timing; // eslint-disable-line prefer-const\n+ if (startTime === endTime) endTime += 0.3;\n+\n+ const requestData = {requestId: requestId.toString(), frame};\n+ /** @type {Omit<LH.TraceEvent, 'name'|'ts'|'args'>} */\n+ const baseRequestEvent = {...baseEvent, ph: 'I', s: 't', dur: 0};\n+\n+ const sendRequestData = {\n+ ...requestData,\n+ requestMethod: record.requestMethod,\n+ url: record.url,\n+ priority: record.priority(),\n+ };\n+\n+ const receiveResponseData = {\n+ ...requestData,\n+ statusCode: record.statusCode,\n+ mimeType: record._mimeType,\n+ encodedDataLength: record._transferSize,\n+ fromCache: record._fromDiskCache,\n+ fromServiceWorker: record._fetchedViaServiceWorker,\n+ };\n+\n+ const resourceFinishData = {\n+ ...requestData,\n+ decodedBodyLength: record._resourceSize,\n+ didFail: !!record.failed,\n+ finishTime: endTime,\n+ };\n+\n+ /** @type {LH.TraceEvent[]} */\n+ const events = [\n+ {\n+ ...baseRequestEvent,\n+ name: 'ResourceSendRequest',\n+ ts: toMicroseconds(startTime),\n+ args: {data: sendRequestData},\n+ },\n+ {\n+ ...baseRequestEvent,\n+ name: 'ResourceFinish',\n+ ts: toMicroseconds(endTime),\n+ args: {data: resourceFinishData},\n+ },\n+ ];\n+\n+ if (!record.failed) {\n+ events.push({\n+ ...baseRequestEvent,\n+ name: 'ResourceReceiveResponse',\n+ ts: toMicroseconds((startTime + endTime) / 2),\n+ args: {data: receiveResponseData},\n+ });\n+ }\n+\n+ return events;\n+ }\n+}\n+\n+module.exports = {\n+ simulationNamesToIgnore: [\n+ 'unlabeled',\n+ // These node timings should be nearly identical to the ones produced for Interactive\n+ 'optimisticFirstCPUIdle',\n+ 'optimisticFlexFirstCPUIdle',\n+ 'pessimisticFirstCPUIdle',\n+ 'optimisticSpeedIndex',\n+ 'optimisticFlexSpeedIndex',\n+ 'pessimisticSpeedIndex',\n+ 'optimisticEstimatedInputLatency',\n+ 'optimisticFlexEstimatedInputLatency',\n+ 'pessimisticEstimatedInputLatency',\n+ ],\n+ convertNodeTimingsToTrace,\n+};\n",
"new_path": "lighthouse-core/lib/lantern-trace-saver.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -160,6 +160,7 @@ declare global {\nts: number;\ndur: number;\nph: 'B'|'b'|'D'|'E'|'e'|'F'|'I'|'M'|'N'|'n'|'O'|'R'|'S'|'T'|'X';\n+ s?: 't';\n}\nexport interface DevToolsJsonTarget {\n",
"new_path": "typings/externs.d.ts",
"old_path": "typings/externs.d.ts"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core(simulator): convert node timings to trace (#5350) | 1 | core | simulator |
730,412 | 11.06.2018 19:12:10 | 0 | 68b7d5278369f069c4a9e0850614464ba3145abf | chore(release): 0.1.307 | [
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.1.307\"></a>\n+## [0.1.307](https://github.com/webex/react-ciscospark/compare/v0.1.306...v0.1.307) (2018-06-11)\n+\n+\n+### Bug Fixes\n+\n+* **icon:** add missing download icon ([3f11f7f](https://github.com/webex/react-ciscospark/commit/3f11f7f))\n+\n+\n+### Features\n+\n+* **samples:** add download icon ([2d49de7](https://github.com/webex/react-ciscospark/commit/2d49de7))\n+\n+\n+\n<a name=\"0.1.306\"></a>\n## [0.1.306](https://github.com/webex/react-ciscospark/compare/v0.1.305...v0.1.306) (2018-06-11)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@ciscospark/react-ciscospark\",\n- \"version\": \"0.1.306\",\n+ \"version\": \"0.1.307\",\n\"description\": \"The Cisco Spark for React library allows developers to easily incorporate Spark functionality into an application.\",\n\"scripts\": {\n\"build\": \"./scripts/build/index.js\",\n",
"new_path": "package.json",
"old_path": "package.json"
}
] | JavaScript | MIT License | webex/react-widgets | chore(release): 0.1.307 | 1 | chore | release |
821,193 | 12.06.2018 09:17:41 | 25,200 | 764ade1dfcf99e3de74a9a93dc85cc24e3d927a0 | fix: Add rimraf to devDependencies for single and multi projects and use it in npm scripts | [
{
"change_type": "MODIFY",
"diff": "\"bugs\": \"https://github.com/oclif/oclif/issues\",\n\"dependencies\": {\n\"@oclif/command\": \"^1.4.33\",\n- \"@oclif/config\": \"^1.6.27\",\n+ \"@oclif/config\": \"^1.6.28\",\n\"@oclif/errors\": \"^1.1.2\",\n\"@oclif/plugin-help\": \"^2.0.5\",\n\"@oclif/plugin-not-found\": \"^1.0.9\",\n\"yosay\": \"^2.0.2\"\n},\n\"devDependencies\": {\n- \"@oclif/dev-cli\": \"^1.13.30\",\n+ \"@oclif/dev-cli\": \"^1.13.31\",\n\"@oclif/tslint\": \"^1.1.2\",\n\"@types/lodash\": \"^4.14.109\",\n\"@types/read-pkg\": \"^3.0.0\",\n\"nps\": \"^5.9.0\",\n\"shelljs\": \"^0.8.2\",\n\"tmp\": \"^0.0.33\",\n- \"ts-node\": \"^6.1.0\",\n+ \"ts-node\": \"^6.1.1\",\n\"tslint\": \"^5.10.0\",\n\"typescript\": \"^2.9.1\"\n},\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -14,6 +14,10 @@ const fixpack = require('fixpack')\nconst debug = require('debug')('generator-oclif')\nconst {version} = require('../../package.json')\n+const isWindows = process.platform === 'win32'\n+const rmrf = isWindows ? 'rimraf' : 'rm -rf'\n+const rmf = isWindows ? 'rimraf' : 'rm -f'\n+\nlet hasYarn = false\ntry {\nexecSync('yarn -v')\n@@ -262,12 +266,11 @@ class App extends Generator {\nthis.pjson.scripts.test = 'echo NO TESTS'\n}\nif (this.ts) {\n- this.pjson.scripts.prepare = 'rm -rf lib && tsc'\n- this.pjson.scripts.prepack = 'rm -rf lib && tsc'\n+ this.pjson.scripts.prepack = this.pjson.scripts.prepare = `${rmrf} lib && tsc`\n}\nif (['plugin', 'multi'].includes(this.type)) {\nthis.pjson.scripts.prepack = nps.series(this.pjson.scripts.prepack, 'oclif-dev manifest', 'oclif-dev readme')\n- this.pjson.scripts.postpack = nps.series(this.pjson.scripts.postpack, 'rm -f oclif.manifest.json')\n+ this.pjson.scripts.postpack = nps.series(this.pjson.scripts.postpack, `${rmf} oclif.manifest.json`)\nthis.pjson.scripts.version = nps.series('oclif-dev readme', 'git add README.md')\nthis.pjson.files.push('/oclif.manifest.json')\n}\n@@ -449,6 +452,7 @@ class App extends Generator {\n'eslint-config-oclif@^1',\n)\n}\n+ if (isWindows) devDependencies.push('rimraf')\nlet yarnOpts = {} as any\nif (process.env.YARN_MUTEX) yarnOpts.mutex = process.env.YARN_MUTEX\nconst install = (deps: string[], opts: object) => this.yarn ? this.yarnInstall(deps, opts) : this.npmInstall(deps, opts)\n",
"new_path": "src/generators/app.ts",
"old_path": "src/generators/app.ts"
},
{
"change_type": "MODIFY",
"diff": "debug \"^3.1.0\"\nsemver \"^5.5.0\"\n-\"@oclif/command@^1.4.32\":\n- version \"1.4.32\"\n- resolved \"https://registry.yarnpkg.com/@oclif/command/-/command-1.4.32.tgz#1cb2eb9637340a1ac69da35e407316688f736647\"\n- dependencies:\n- \"@oclif/errors\" \"^1.1.2\"\n- \"@oclif/parser\" \"^3.4.1\"\n- debug \"^3.1.0\"\n- semver \"^5.5.0\"\n-\n\"@oclif/command@^1.4.33\":\nversion \"1.4.33\"\nresolved \"https://registry.yarnpkg.com/@oclif/command/-/command-1.4.33.tgz#40a48e7384d6b4394c2ca20e5c05ff45541087f5\"\ndebug \"^3.1.0\"\ntslib \"^1.9.2\"\n-\"@oclif/dev-cli@^1.13.30\":\n- version \"1.13.30\"\n- resolved \"https://registry.yarnpkg.com/@oclif/dev-cli/-/dev-cli-1.13.30.tgz#bcda36f634b82d4591447f229cc5f735b477a598\"\n+\"@oclif/config@^1.6.28\":\n+ version \"1.6.28\"\n+ resolved \"https://registry.yarnpkg.com/@oclif/config/-/config-1.6.28.tgz#bfda0718ba5dfbdeb364350990ed79540f9c3d0b\"\n+ dependencies:\n+ debug \"^3.1.0\"\n+ tslib \"^1.9.2\"\n+\n+\"@oclif/dev-cli@^1.13.31\":\n+ version \"1.13.31\"\n+ resolved \"https://registry.yarnpkg.com/@oclif/dev-cli/-/dev-cli-1.13.31.tgz#ddcca19e1346de3656b63210305c87acdc98fd44\"\ndependencies:\n- \"@oclif/command\" \"^1.4.32\"\n+ \"@oclif/command\" \"^1.4.33\"\n\"@oclif/config\" \"^1.6.27\"\n\"@oclif/errors\" \"^1.1.2\"\n- \"@oclif/plugin-help\" \"^2.0.4\"\n- cli-ux \"^4.6.0\"\n+ \"@oclif/plugin-help\" \"^2.0.5\"\n+ cli-ux \"^4.6.2\"\ndebug \"^3.1.0\"\nfs-extra \"^6.0.1\"\nlodash \"^4.17.10\"\n\"@oclif/linewrap\" \"^1.0.0\"\nchalk \"^2.4.1\"\n-\"@oclif/parser@^3.4.1\":\n- version \"3.4.1\"\n- resolved \"https://registry.yarnpkg.com/@oclif/parser/-/parser-3.4.1.tgz#83942276f3cf9406a1a3dcf3eb917183d6333e1d\"\n- dependencies:\n- \"@oclif/linewrap\" \"^1.0.0\"\n- chalk \"^2.4.1\"\n-\n\"@oclif/parser@^3.5.1\":\nversion \"3.5.1\"\nresolved \"https://registry.yarnpkg.com/@oclif/parser/-/parser-3.5.1.tgz#2f60ac9773565786b6e1afff967b36a6399defcc\"\n\"@oclif/linewrap\" \"^1.0.0\"\nchalk \"^2.4.1\"\n-\"@oclif/plugin-help@^2.0.4\":\n- version \"2.0.4\"\n- resolved \"https://registry.yarnpkg.com/@oclif/plugin-help/-/plugin-help-2.0.4.tgz#32cf1dc7696f626a6065109a17b0f061adb14243\"\n- dependencies:\n- \"@oclif/command\" \"^1.4.30\"\n- chalk \"^2.4.1\"\n- indent-string \"^3.2.0\"\n- lodash.template \"^4.4.0\"\n- string-width \"^2.1.1\"\n- widest-line \"^2.0.0\"\n- wrap-ansi \"^3.0.1\"\n-\n\"@oclif/plugin-help@^2.0.5\":\nversion \"2.0.5\"\nresolved \"https://registry.yarnpkg.com/@oclif/plugin-help/-/plugin-help-2.0.5.tgz#98084286099b44c8c6ed6214e3589f32525f4827\"\n@@ -740,9 +719,9 @@ cli-table@^0.3.1:\ndependencies:\ncolors \"1.0.3\"\n-cli-ux@^4.6.0:\n- version \"4.6.1\"\n- resolved \"https://registry.yarnpkg.com/cli-ux/-/cli-ux-4.6.1.tgz#2cc7feb4d48932a95bffe712426eaa36ec861004\"\n+cli-ux@^4.6.2:\n+ version \"4.6.2\"\n+ resolved \"https://registry.yarnpkg.com/cli-ux/-/cli-ux-4.6.2.tgz#77a4eeb93ffb40c697e4f1d60975804134ba7a5a\"\ndependencies:\n\"@oclif/linewrap\" \"^1.0.0\"\n\"@oclif/screen\" \"^1.0.2\"\n@@ -3415,9 +3394,9 @@ trim-newlines@^1.0.0:\nversion \"1.0.0\"\nresolved \"https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613\"\n-ts-node@^6.1.0:\n- version \"6.1.0\"\n- resolved \"https://registry.yarnpkg.com/ts-node/-/ts-node-6.1.0.tgz#a2c37a11fdb58e60eca887a1269b025cf4d2f8b8\"\n+ts-node@^6.1.1:\n+ version \"6.1.1\"\n+ resolved \"https://registry.yarnpkg.com/ts-node/-/ts-node-6.1.1.tgz#19607140acb06150441fcdb61be11f73f7b6657e\"\ndependencies:\narrify \"^1.0.0\"\ndiff \"^3.1.0\"\n",
"new_path": "yarn.lock",
"old_path": "yarn.lock"
}
] | TypeScript | MIT License | oclif/oclif | fix: Add rimraf to devDependencies for single and multi projects and use it in npm scripts (#123) | 1 | fix | null |
730,429 | 12.06.2018 10:21:43 | 14,400 | 67a4a0b094951c1f0dd6fbb1fefc10ef65e654ce | feat(widget-space): add destination prop | [
{
"change_type": "ADD",
"diff": "+# Space Widget Setup Flow\n+\n+The Space Widget allows you to open a space to a given space id, user id, or email.\n+\n+The widget goes through different workflows depending on which type of space you are opening.\n+\n+## Destinations\n+\n+The Space Widget requires two identifiers for the space: destination id and destination type.\n+\n+### Destination Type\n+\n+Destination type determines what kind of space you are trying to open. It can be one of three values:\n+\n+* \"email\"\n+* \"userId\"\n+* \"spaceId\"\n+\n+### Destination Id\n+\n+If destination type is \"email\", then simply pass a string containing the email of the user you would like to open the space with.\n+\n+If the destination type is either \"userId\" or \"spaceId\", you can pass the UUID or the Hydra ID (the ID provided by the developer portal).\n+\n+## Legacy Properties\n+\n+Previously, the space widget accepted different properties for different destination types, but in an attempt to consolidate, those properties are now deprecated and need to be migrated to the following:\n+\n+* \"spaceId\" should now be `destinationType: \"spaceId\"` and `destinationId: {spaceId}`\n+* \"toPersonId\" should now be `destinationType: \"userId\"` and `destinationId: {toPersonId}`\n+* \"email\" should now be `destinationType: \"email\"` and `destinationId: {email}`\n+\n+## Processing\n+\n+When the widget initializes, it processes the destination to understand which \"conversation\" to load from the API.\n+\n+### Space ID\n+\n+The \"spaceId\" destination type is the most straightforward space for processing.\n+The \"destinationId\" is converted from a hydra ID to a UUID (if necessary), then the conversation details are fetched from the `/rooms` endpoint with the UUID.\n+\n+### Email/User ID\n+\n+The \"email\" destination type allows a user to open a direct space to the account with the given email address. The space widget uses the conversation service to get space details for direct spaces. This is due to the fact that the `/rooms` endpoint doesn't currently have a way to look up space details without a room id.\n\\ No newline at end of file\n",
"new_path": "packages/node_modules/@ciscospark/widget-space/SETUP.md",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -3,7 +3,9 @@ import {addError} from '@ciscospark/redux-module-errors';\nimport messages from './messages';\n-export const STORE_TO_PERSON = 'widget-space/STORE_TO_PERSON';\n+import {destinationTypes} from './';\n+\n+export const STORE_DESTINATION = 'widget-space/STORE_DESTINATION';\nexport const FETCHING_SPACE_DETAILS = 'widget-space/FETCHING_SPACE_DETAILS';\nexport const STORE_ACTIVITY_TYPES = 'widget-space/STORE_ACTIVITY_TYPES';\nexport const STORE_SPACE_DETAILS = 'widget-space/STORE_SPACE_DETAILS';\n@@ -31,11 +33,19 @@ export function updateSecondaryActivityType(type) {\n};\n}\n-export function storeToPerson(toPerson) {\n+/**\n+ * Stores the space widget's destination\n+ *\n+ * @export\n+ * @param {Object} {id, location}\n+ * @returns {Object}\n+ */\n+export function storeDestination({id, type}) {\nreturn {\n- type: STORE_TO_PERSON,\n+ type: STORE_DESTINATION,\npayload: {\n- toPerson\n+ id,\n+ type\n}\n};\n}\n@@ -91,15 +101,24 @@ function fetchingSpaceDetails() {\n/**\n* Gets details about the space\n- * @param {Object} sparkInstance\n- * @param {String} spaceId\n- * @param {Object} intl\n+ * @param {Object} options.sparkInstance\n+ * @param {String} options.destinationId\n+ * @param {String} options.destinationType\n+ * @param {Object} options.intl\n* @returns {Thunk}\n*/\n-export function getSpaceDetails(sparkInstance, spaceId, intl) {\n+export function getSpaceDetails({\n+ sparkInstance, destinationId, destinationType, intl\n+}) {\nreturn (dispatch) => {\n+ // We cannot fetch space details for 1:1's here, it will be handled in conversation store\n+ if (destinationType === destinationTypes.EMAIL || destinationType === destinationTypes.USERID) {\n+ return dispatch(storeSpaceDetails({\n+ type: 'direct'\n+ }));\n+ }\nconst {formatMessage} = intl;\n- const spaceIdUUID = validateAndDecodeId(spaceId);\n+ const spaceIdUUID = validateAndDecodeId(destinationId);\nif (!spaceIdUUID) {\nconst displayTitle = formatMessage(messages.unableToLoad);\nconst displaySubtitle = formatMessage(messages.badSpaceId);\n",
"new_path": "packages/node_modules/@ciscospark/widget-space/src/actions.js",
"old_path": "packages/node_modules/@ciscospark/widget-space/src/actions.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -15,7 +15,7 @@ import {ICONS} from '@ciscospark/react-component-icon';\nimport ActivityMenu from './components/activity-menu';\n-import {storeToPerson} from './actions';\n+import {storeDestination} from './actions';\nimport messages from './messages';\nimport styles from './styles.css';\n@@ -31,12 +31,13 @@ const injectedPropTypes = {\nerrors: PropTypes.object.isRequired,\nmedia: PropTypes.object.isRequired,\nsparkInstance: PropTypes.object,\n- user: PropTypes.object.isRequired,\nwidgetSpace: PropTypes.object.isRequired\n};\nexport const ownPropTypes = {\ncustomActivityTypes: PropTypes.object,\n+ destinationId: PropTypes.string,\n+ destinationType: PropTypes.oneOf(['email', 'userId', 'spaceId']),\nmuteNotifications: PropTypes.bool,\nspaceActivities: PropTypes.shape({\nfiles: PropTypes.bool,\n@@ -57,6 +58,8 @@ export const ownPropTypes = {\nconst defaultProps = {\ncustomActivityTypes: undefined,\n+ destinationId: null,\n+ destinationType: null,\nmuteNotifications: false,\nspaceActivities: {\nfiles: true,\n@@ -71,13 +74,6 @@ const defaultProps = {\n};\nexport class SpaceWidget extends Component {\n- constructor(props) {\n- super(props);\n- if (props.toPersonEmail || props.toPersonId) {\n- props.storeToPerson(props.toPersonEmail || props.toPersonId);\n- }\n- }\n-\nrender() {\nconst {props} = this;\nconst {\n@@ -175,7 +171,7 @@ export default compose(\nconnect(\nnull,\n(dispatch) => bindActionCreators({\n- storeToPerson\n+ storeDestination\n}, dispatch)\n),\n...enhancers\n",
"new_path": "packages/node_modules/@ciscospark/widget-space/src/container.js",
"old_path": "packages/node_modules/@ciscospark/widget-space/src/container.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -2,9 +2,12 @@ import {connect} from 'react-redux';\nimport {compose, lifecycle} from 'recompose';\nimport {bindActionCreators} from 'redux';\nimport {addError, removeError} from '@ciscospark/redux-module-errors';\n+import {validateAndDecodeId} from '@ciscospark/react-component-utils';\nimport messages from '../messages';\n+import {destinationTypes} from '../';\n+\nfunction checkForMercuryErrors(props) {\nconst {\n@@ -37,19 +40,20 @@ function checkForMercuryErrors(props) {\nfunction checkForErrors(props) {\nconst {\nactivityTypes,\n+ currentUser,\n+ destination,\n+ destinationId,\n+ destinationType,\nerrors,\ninitialActivity,\nspaceId,\nsparkState,\nspark,\ntoPersonEmail,\n- toPersonId,\n- users,\n- widgetSpace\n+ toPersonId\n} = props;\nconst {formatMessage} = props.intl;\nconst registerErrorId = 'spark.register';\n- const toPerson = widgetSpace.get('toPerson');\nif (sparkState.get('registerError') && (!errors.get('hasError') || !errors.get('errors').has(registerErrorId))) {\nconst error = spark.get('error');\nlet displaySubtitle = formatMessage(messages.unknownError);\n@@ -67,7 +71,7 @@ function checkForErrors(props) {\nconst missingDestinationErrorId = 'space.error.missingDestination';\nif (\n- !toPersonEmail && !toPersonId && !spaceId &&\n+ !destinationId && !destinationType && !toPersonEmail && !toPersonId && !spaceId &&\n(!errors.get('hasError') || !errors.get('errors').has(missingDestinationErrorId))\n) {\n// No destination found\n@@ -80,10 +84,16 @@ function checkForErrors(props) {\n}\nconst toSelfErrorId = 'space.error.toSelf';\n- const currentUser = users.getIn(['byId', users.get('currentUserId')]);\n- if (toPerson && currentUser && (!errors.get('hasError') || !errors.get('errors').has(toSelfErrorId))) {\n+ if (\n+ destination &&\n+ currentUser && currentUser.id && currentUser.email &&\n+ (!errors.get('hasError') || !errors.get('errors').has(toSelfErrorId))\n+ ) {\n// Check for to user being self\n- if ([currentUser.id, currentUser.email].includes(toPerson)) {\n+ if (\n+ destination.type === destinationTypes.EMAIL && currentUser.email === destination.id\n+ || destination.type === destinationTypes.USERID && validateAndDecodeId(destination.id) === currentUser.id\n+ ) {\nprops.addError({\nid: toSelfErrorId,\ndisplayTitle: formatMessage(messages.unableToLoad),\n",
"new_path": "packages/node_modules/@ciscospark/widget-space/src/enhancers/errors.js",
"old_path": "packages/node_modules/@ciscospark/widget-space/src/enhancers/errors.js"
},
{
"change_type": "MODIFY",
"diff": "import {compose, lifecycle} from 'recompose';\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\n+\nimport {events as metricEvents} from '@ciscospark/react-redux-spark-metrics';\nimport {fetchAvatar} from '@ciscospark/redux-module-avatar';\n+import {constructHydraId, hydraTypes, isUuid} from '@ciscospark/react-component-utils';\nimport {\ngetSpaceDetails,\n+ storeDestination,\nstoreSpaceDetails\n} from '../actions';\nimport {getSpaceWidgetProps} from '../selector';\n+import {destinationTypes} from '../';\n+\n+/**\n+ * Normalizes destination id to either email or hydra id\n+ *\n+ * @param {string} destination.id\n+ * @param {string} destination.type\n+ * @returns {string}\n+ */\n+function normalizeDestinationId({id, type}) {\n+ if (type === destinationTypes.USERID) {\n+ let destinationId = id;\n+ if (isUuid(id)) {\n+ destinationId = constructHydraId(hydraTypes.PEOPLE, id);\n+ }\n+ return destinationId;\n+ }\n+ if (type === destinationTypes.SPACEID) {\n+ let destinationId = id;\n+ if (isUuid(id)) {\n+ destinationId = constructHydraId(hydraTypes.ROOM, id);\n+ }\n+ return destinationId;\n+ }\n+ return id;\n+}\n+\n+/**\n+ * Converts props into a destination object\n+ *\n+ * @param {*} props\n+ * @returns {Object} destination\n+ * @returns {string} destination.id\n+ * @returns {string} destination.type\n+ * @returns {string} destination.warning\n+ */\n+function getDestinationFromProps(props) {\n+ const {\n+ destinationId,\n+ destinationType,\n+ spaceId,\n+ sparkInstance,\n+ toPersonEmail,\n+ toPersonId\n+ } = props;\n+\n+ if (destinationType && destinationId) {\n+ return {type: destinationType, id: normalizeDestinationId({type: destinationType, id: destinationId})};\n+ }\n+ if (spaceId) {\n+ sparkInstance.logger.warn();\n+ return {\n+ type: destinationTypes.SPACEID,\n+ id: normalizeDestinationId({type: destinationTypes.SPACEID, id: spaceId}),\n+ warning: 'The Space ID property is deprecated. Please use Destination ID and Type instead.'\n+ };\n+ }\n+ if (toPersonEmail) {\n+ return {\n+ type: destinationTypes.EMAIL,\n+ id: toPersonEmail,\n+ warning: 'The To Person Email property is deprecated. Please use Destination ID and Type instead.'\n+ };\n+ }\n+ if (toPersonId) {\n+ sparkInstance.logger.warn('The To Person ID property is deprecated. Please use Destination ID and Type instead.');\n+ return {\n+ type: destinationTypes.USERID,\n+ id: normalizeDestinationId({type: destinationTypes.USERID, id: toPersonId}),\n+ warning: 'The To Person ID property is deprecated. Please use Destination ID and Type instead.'\n+ };\n+ }\n+ return null;\n+}\n+\nfunction setup(props) {\nconst {\nconversation,\n+ destination,\nerrors,\n- spaceId,\nsparkInstance,\nsparkState,\n- toPersonEmail,\n- toPersonId,\nmetrics,\nspaceDetails,\nwidgetStatus\n@@ -28,17 +104,28 @@ function setup(props) {\nif (sparkInstance\n&& sparkState.get('authenticated')\n&& sparkState.get('registered')\n- && !sparkState.get('hasError')) {\n+ && !sparkState.get('hasError')\n+ ) {\n+ // Get space details for given destination\nif (!widgetStatus.isFetchingSpaceDetails && !errors.get('hasError') && !spaceDetails) {\n- if (spaceId) {\n- props.getSpaceDetails(sparkInstance, spaceId, props.intl);\n- }\n- // Hack until we find a way to get a one-on-one space's details before loading conversation\n- else if (toPersonEmail || toPersonId) {\n- props.storeSpaceDetails({\n- type: 'direct'\n+ // If the selector isn't returning a destination object and we have props for them, store\n+ if (destination) {\n+ // Use destination object from store to fetch space details\n+ // Instead of using props because of legacy prop support\n+ props.getSpaceDetails({\n+ sparkInstance,\n+ destinationId: destination.id,\n+ destinationType: destination.type,\n+ intl: props.intl\n});\n}\n+ else {\n+ const calculatedDestination = getDestinationFromProps(props);\n+ if (calculatedDestination.warning) {\n+ sparkInstance.logger.warn(calculatedDestination.warning);\n+ }\n+ props.storeDestination(calculatedDestination);\n+ }\n}\nif (conversation.get('id')) {\n@@ -53,6 +140,7 @@ export default compose(\ngetSpaceWidgetProps,\n(dispatch) => bindActionCreators({\ngetSpaceDetails,\n+ storeDestination,\nstoreSpaceDetails,\nfetchAvatar\n}, dispatch)\n",
"new_path": "packages/node_modules/@ciscospark/widget-space/src/enhancers/setup.js",
"old_path": "packages/node_modules/@ciscospark/widget-space/src/enhancers/setup.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -8,6 +8,12 @@ import messages from './translations/en';\nexport {reducers};\n+export const destinationTypes = {\n+ EMAIL: 'email',\n+ USERID: 'userId',\n+ SPACEID: 'spaceId'\n+};\n+\nexport default compose(\nconstructSparkEnhancer({\nname: 'space',\n",
"new_path": "packages/node_modules/@ciscospark/widget-space/src/index.js",
"old_path": "packages/node_modules/@ciscospark/widget-space/src/index.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -10,9 +10,9 @@ import users from '@ciscospark/redux-module-users';\nimport {\nFETCHING_SPACE_DETAILS,\n+ STORE_DESTINATION,\nSTORE_SPACE_DETAILS,\nSTORE_ACTIVITY_TYPES,\n- STORE_TO_PERSON,\nTOGGLE_ACTIVITY_MENU_VISIBLE,\nUPDATE_ACTIVITY_MENU_VISIBLE,\nUPDATE_ACTIVITY_TYPE,\n@@ -28,8 +28,14 @@ const Status = Record({\nisFetchingSpaceDetails: false\n});\n+const Destination = Record({\n+ id: null,\n+ type: null\n+});\n+\nexport const initialState = fromJS({\nactivityTypes: [],\n+ destination: null,\nerror: null,\nprimaryActivityType: null,\nsecondaryActivityType: null,\n@@ -65,8 +71,8 @@ export function reducer(state = initialState, action) {\nreturn state.set('activityTypes', fromJS(action.payload.activityTypes));\n}\n- case STORE_TO_PERSON: {\n- return state.set('toPerson', action.payload.toPerson);\n+ case STORE_DESTINATION: {\n+ return state.set('destination', new Destination(action.payload));\n}\ncase UPDATE_WIDGET_STATUS: {\n",
"new_path": "packages/node_modules/@ciscospark/widget-space/src/reducer.js",
"old_path": "packages/node_modules/@ciscospark/widget-space/src/reducer.js"
},
{
"change_type": "MODIFY",
"diff": "import {createSelector} from 'reselect';\n-import {isUuid, constructHydraId, deconstructHydraId, hydraTypes} from '@ciscospark/react-component-utils';\n+\n+import {validateAndDecodeId} from '@ciscospark/react-component-utils';\n+\n+import {destinationTypes} from './';\nconst getWidget = (state) => state.widgetSpace;\nconst getSpark = (state) => state.spark;\nconst getMedia = (state) => state.media;\nconst getConversation = (state) => state.conversation;\n-const getCurrentUser = (state, ownProps) => ownProps.currentUser;\nconst getFeatures = (state) => state.features;\n+const getUsers = (state) => state.users;\nconst getOwnProps = (state, ownProps) => ownProps;\n+\n+// Injected by WithCurrentUser enhancer on widget base\n+const getCurrentUser = (state, ownProps) => ownProps.currentUser;\n+\n/**\n* Get the other user in a 1:1 conversation.\n* @param {conversation} conversation\n@@ -16,11 +23,23 @@ const getOwnProps = (state, ownProps) => ownProps;\n* @returns {reselect.Selector}\n*/\nexport const getToUser = createSelector(\n- [getConversation, getCurrentUser],\n- (conversation, currentUser) =>\n- conversation\n- .get('participants')\n- .find((participant) => participant.get('id') !== currentUser.id)\n+ [getWidget, getUsers],\n+ (widget, users) => {\n+ const destination = widget.get('destination');\n+ if (destination) {\n+ let toUserId = null;\n+ if (destination.type === destinationTypes.EMAIL) {\n+ toUserId = users.getIn(['byEmail', destination.id]);\n+ }\n+ if (destination.type === destinationTypes.USERID) {\n+ toUserId = validateAndDecodeId(destination.id);\n+ }\n+ if (toUserId && toUserId !== 'PENDING') {\n+ return users.getIn(['byId', toUserId]);\n+ }\n+ }\n+ return null;\n+ }\n);\nexport const getSpaceDetails = createSelector(\n@@ -37,12 +56,9 @@ export const getSpaceDetails = createSelector(\navatarId = toUser.get('id');\n}\n}\n- const toPerson = toUser ? toUser.get('id') : widget.get('toPerson');\n-\nreturn widget.get('spaceDetails').merge({\navatarId,\n- title,\n- toPerson\n+ title\n});\n}\nreturn spaceDetails;\n@@ -92,60 +108,16 @@ const getCall = createSelector(\n}\n);\n-const getTo = createSelector(\n- [getSpaceDetails, getOwnProps],\n- (spaceDetails, ownProps) => {\n- const {\n- spaceId,\n- toPersonId,\n- toPersonEmail\n- } = ownProps;\n- let to;\n-\n- if (spaceDetails && spaceDetails.has('id')) {\n- return spaceDetails.get('id');\n- }\n- if (spaceId) {\n- if (isUuid(spaceId)) {\n- to = constructHydraId(hydraTypes.ROOM, spaceId);\n- }\n- else {\n- const {type} = deconstructHydraId(spaceId);\n- if (type === hydraTypes.ROOM) {\n- to = spaceId;\n- }\n- }\n- }\n- else if (toPersonId) {\n- if (isUuid(toPersonId)) {\n- to = constructHydraId(hydraTypes.PEOPLE, toPersonId);\n- }\n- else {\n- const {type} = deconstructHydraId(toPersonId);\n- if (type === hydraTypes.PEOPLE) {\n- to = toPersonId;\n- }\n- }\n- }\n- else {\n- to = toPersonEmail;\n- }\n-\n- // `to` should be an email or hydra id\n- return to;\n- }\n-);\n-\nexport const getSpaceWidgetProps = createSelector(\n- [getWidget, getSpark, getMedia, getSpaceDetails, getActivityTypes, getCall, getTo],\n- (widget, spark, media, spaceDetails, activityTypes, call, to) => ({\n+ [getWidget, getSpark, getMedia, getSpaceDetails, getActivityTypes, getCall],\n+ (widget, spark, media, spaceDetails, activityTypes, call) => ({\nactivityTypes,\n+ destination: widget.get('destination'),\nmedia,\nsparkInstance: spark.get('spark'),\nsparkState: spark.get('status'),\nspaceDetails,\nwidgetStatus: widget.get('status'),\n- call,\n- to\n+ call\n})\n);\n",
"new_path": "packages/node_modules/@ciscospark/widget-space/src/selector.js",
"old_path": "packages/node_modules/@ciscospark/widget-space/src/selector.js"
},
{
"change_type": "DELETE",
"diff": "-import {fromJS} from 'immutable';\n-\n-import {getToUser} from './selector';\n-\n-describe('widget-space selectors', () => {\n- const otherUser = {\n- entryEmail: 'fakebot@sparkbot.io',\n- displayName: 'Personal Assistant Bot',\n- entryUUID: 'c04b6751-bbed-4ac8-aa63-9654b757e171',\n- emailAddress: 'fakebot@sparkbot.io',\n- objectType: 'person',\n- type: 'ROBOT',\n- id: 'c04b6751-bbed-4ac8-aa63-9654b757e171',\n- orgId: 'ac9c7b0d-77e3-4ab9-b8f6-b092c57e5999'\n- };\n- it('gets the \"to user\"', () => {\n- const currentUser = {\n- entryEmail: 'qtcrabfq6f@4c45deca-dc35-4c44-9941-b0c7ba8f7b13',\n- displayName: 'User-qTCRABFq6f',\n- entryUUID: '1c8ce4a0-df7b-4e62-8020-a1a430581e51',\n- emailAddress: 'qtcrabfq6f@4c45deca-dc35-4c44-9941-b0c7ba8f7b13',\n- objectType: 'person',\n- type: 'APPUSER',\n- id: '1c8ce4a0-df7b-4e62-8020-a1a430581e51',\n- orgId: '4c45deca-dc35-4c44-9941-b0c7ba8f7b13'\n- };\n-\n- const mockedConversation = fromJS({\n- participants: [currentUser, otherUser]\n- });\n-\n- const toUser = getToUser.resultFunc(mockedConversation, currentUser);\n- expect(toUser.get('displayName')).toBe(otherUser.displayName);\n- });\n- it('gets the \"to user\" with capitalized email', () => {\n- const currentUser = {\n- entryEmail: 'qTCRABFq6f@4c45deca-dc35-4c44-9941-b0c7ba8f7b13',\n- displayName: 'User-qTCRABFq6f',\n- entryUUID: '1c8ce4a0-df7b-4e62-8020-a1a430581e51',\n- emailAddress: 'qTCRABFq6f@4c45deca-dc35-4c44-9941-b0c7ba8f7b13',\n- objectType: 'person',\n- type: 'APPUSER',\n- id: '1c8ce4a0-df7b-4e62-8020-a1a430581e51',\n- orgId: '4c45deca-dc35-4c44-9941-b0c7ba8f7b13'\n- };\n-\n- const mockedConversation = fromJS({\n- participants: [currentUser, otherUser]\n- });\n-\n- const toUser = getToUser.resultFunc(mockedConversation, currentUser);\n- expect(toUser.get('displayName')).toBe(otherUser.displayName);\n- });\n-});\n",
"new_path": null,
"old_path": "packages/node_modules/@ciscospark/widget-space/src/selector.test.js"
}
] | JavaScript | MIT License | webex/react-widgets | feat(widget-space): add destination prop | 1 | feat | widget-space |
730,413 | 12.06.2018 16:50:52 | 14,400 | caed5eb63a4f0680255b70282cda823ec2d2d02c | fix(r-c-activity-item-base): delete message button not displayed for long messages | [
{
"change_type": "MODIFY",
"diff": "display: flex;\nflex: 1 1 auto;\nflex-direction: column;\n- width: calc(100% - 40px);\n+ width: calc(100% - 100px);\nborder-radius: 1px;\n}\n",
"new_path": "packages/node_modules/@ciscospark/react-component-activity-item-base/src/styles.css",
"old_path": "packages/node_modules/@ciscospark/react-component-activity-item-base/src/styles.css"
}
] | JavaScript | MIT License | webex/react-widgets | fix(r-c-activity-item-base): delete message button not displayed for long messages | 1 | fix | r-c-activity-item-base |
730,429 | 12.06.2018 16:58:38 | 14,400 | aa572158554148e8d43d5164192b68602d0809c9 | test(tap): fix tap recents selectors | [
{
"change_type": "MODIFY",
"diff": "@@ -9,6 +9,12 @@ import CiscoSpark from '@ciscospark/spark-core';\nimport waitForPromise from '../../../lib/wait-for-promise';\nimport {clearEventLog, getEventLog} from '../../../lib/events';\nimport {loginAndOpenWidget} from '../../../lib/test-helpers/tap/recents';\n+import {\n+ createSpaceAndPost,\n+ displayAndReadIncomingMessage,\n+ displayIncomingMessage,\n+ elements\n+} from '../../../lib/test-helpers/recents-widget';\ndescribe('Widget Recents', () => {\nconst browserLocal = browser.select('browserLocal');\n@@ -103,32 +109,12 @@ describe('Widget Recents', () => {\ndescribe('group space', () => {\nit('displays a new incoming message', () => {\nconst lorraineText = 'Marty, will we ever see you again?';\n- waitForPromise(lorraine.spark.internal.conversation.post(conversation, {\n- displayName: lorraineText\n- }));\n- browserLocal.waitForExist('.space-item:first-child .space-title', 10000);\n- browserLocal.waitUntil(() => browserLocal.getText('.space-item:first-child .space-title') === conversation.displayName);\n- assert.isTrue(browserLocal.isVisible('.space-item:first-child .space-unread-indicator'));\n- assert.include(browserLocal.getText('.space-item:first-child .space-last-activity'), lorraineText);\n+ displayIncomingMessage(browserLocal, lorraine, conversation, lorraineText);\n});\nit('removes unread indicator when read', () => {\n- let activity;\nconst lorraineText = 'You\\'re safe and sound now!';\n- waitForPromise(lorraine.spark.internal.conversation.post(conversation, {\n- displayName: lorraineText\n- }).then((a) => {\n- activity = a;\n- }));\n- browserLocal.waitForExist('.space-item:first-child .space-last-activity', 10000);\n- browserLocal.waitUntil(() =>\n- browserLocal.getText('.space-item:first-child .space-last-activity').includes(lorraineText),\n- 10000,\n- 'expected remote text to display in list');\n- assert.isTrue(browserLocal.isVisible('.space-item:first-child .space-unread-indicator'));\n- // Acknowledge the activity to mark it read\n- waitForPromise(marty.spark.internal.conversation.acknowledge(conversation, activity));\n- browserLocal.waitForVisible('.space-item:first-child .space-unread-indicator', 1500, true);\n+ displayAndReadIncomingMessage(browserLocal, lorraine, marty, conversation, lorraineText);\n});\ndescribe('events', () => {\n@@ -136,81 +122,53 @@ describe('Widget Recents', () => {\nit('messages:created', () => {\nclearEventLog(browserLocal);\nconst lorraineText = 'Don\\'t be such a square';\n- waitForPromise(lorraine.spark.internal.conversation.post(conversation, {\n- displayName: lorraineText\n- }));\n- browserLocal.waitUntil(() =>\n- browserLocal.getText('.space-item:first-child .space-last-activity').includes(lorraineText));\n+ displayIncomingMessage(browserLocal, lorraine, conversation, lorraineText);\nassert.isTrue(getEventLog(browserLocal).some((event) => event.eventName === 'messages:created'), 'event was not seen');\n});\nit('rooms:unread', () => {\nclearEventLog(browserLocal);\nconst lorraineText = 'Your Uncle Joey didn\\'t make parole again.';\n- waitForPromise(lorraine.spark.internal.conversation.post(conversation, {\n- displayName: lorraineText\n- }));\n- browserLocal.waitUntil(() =>\n- browserLocal.getText('.space-item:first-child .space-last-activity').includes(lorraineText));\n+ displayIncomingMessage(browserLocal, lorraine, conversation, lorraineText);\nassert.isTrue(getEventLog(browserLocal).some((event) => event.eventName === 'rooms:unread'), 'event was not seen');\n});\nit('rooms:read', () => {\n- let activity;\nclearEventLog(browserLocal);\nconst lorraineText = 'Your Uncle Joey didn\\'t make parole again.';\n- waitForPromise(lorraine.spark.internal.conversation.post(conversation, {\n- displayName: lorraineText\n- }).then((a) => {\n- activity = a;\n- }));\n- browserLocal.waitUntil(() =>\n- browserLocal.getText('.space-item:first-child .space-last-activity').includes(lorraineText));\n- waitForPromise(marty.spark.internal.conversation.acknowledge(conversation, activity));\n- browserLocal.waitForVisible('.space-item:first-child .space-unread-indicator', 1500, true);\n+ displayAndReadIncomingMessage(browserLocal, lorraine, marty, conversation, lorraineText);\nassert.isTrue(getEventLog(browserLocal).some((event) => event.eventName === 'rooms:read'), 'event was not seen');\n});\nit('rooms:selected', () => {\nclearEventLog(browserLocal);\n- browserLocal.click('.space-item:first-child');\n+ browserLocal.click(elements.firstSpace);\nassert.isTrue(getEventLog(browserLocal).some((event) => event.eventName === 'rooms:selected'), 'event was not seen');\n});\nit('memberships:created', () => {\nconst roomTitle = 'Test Group Space 2';\n+ const firstPost = 'Everybody who\\'s anybody drinks.';\nclearEventLog(browserLocal);\n- waitForPromise(lorraine.spark.internal.conversation.create({\n- displayName: roomTitle,\n- participants: [marty, docbrown, lorraine]\n- }).then((c) => lorraine.spark.internal.conversation.post(c, {\n- displayName: 'Everybody who\\'s anybody drinks.'\n- })));\n- browserLocal.waitUntil(() =>\n- browserLocal.getText('.space-item:first-child .space-title').includes(roomTitle));\n+ createSpaceAndPost(browserLocal, lorraine, [marty, docbrown, lorraine], roomTitle, firstPost);\nassert.isTrue(getEventLog(browserLocal).some((event) => event.eventName === 'memberships:created'), 'event was not seen');\n});\nit('memberships:deleted', () => {\n// Create Room\n- let kickedConversation;\nconst roomTitle = 'Kick Marty Out';\n- waitForPromise(lorraine.spark.internal.conversation.create({\n- displayName: roomTitle,\n- participants: [marty, docbrown, lorraine]\n- }).then((c) => {\n- kickedConversation = c;\n- return lorraine.spark.internal.conversation.post(c, {\n- displayName: 'Goodbye Marty.'\n- });\n- }));\n- browserLocal.waitUntil(() =>\n- browserLocal.getText('.space-item:first-child .space-title') === roomTitle);\n+ const firstPost = 'Goodbye Marty.';\n+ const kickedConversation = createSpaceAndPost(\n+ browserLocal,\n+ lorraine,\n+ [marty, docbrown, lorraine],\n+ roomTitle,\n+ firstPost\n+ );\n// Remove user from room\nclearEventLog(browserLocal);\nwaitForPromise(lorraine.spark.internal.conversation.leave(kickedConversation, marty));\n- browserLocal.waitUntil(() =>\n- browserLocal.getText('.space-item:first-child .space-title') !== roomTitle);\n+ browserLocal.waitUntil(() => browserLocal.getText(`${elements.firstSpace} ${elements.title}`) !== roomTitle);\nassert.isTrue(getEventLog(browserLocal).some((event) => event.eventName === 'memberships:deleted'), 'event was not seen');\n});\n});\n@@ -219,39 +177,17 @@ describe('Widget Recents', () => {\ndescribe('one on one space', () => {\nit('displays a new incoming message', () => {\nconst lorraineText = 'Marty? Why are you so nervous?';\n- waitForPromise(lorraine.spark.internal.conversation.post(oneOnOneConversation, {\n- displayName: lorraineText\n- }));\n- browserLocal.waitUntil(() => browserLocal.getText('.space-item:first-child .space-title') === lorraine.displayName);\n- assert.include(browserLocal.getText('.space-item:first-child .space-last-activity'), lorraineText);\n+ displayIncomingMessage(browserLocal, lorraine, oneOnOneConversation, lorraineText, true);\n});\nit('removes unread indicator when read', () => {\n- let activity;\nconst lorraineText = 'You\\'re safe and sound now!';\n- waitForPromise(lorraine.spark.internal.conversation.post(oneOnOneConversation, {\n- displayName: lorraineText\n- }).then((a) => {\n- activity = a;\n- }));\n- browserLocal.waitUntil(() =>\n- browserLocal.getText('.space-item:first-child .space-last-activity').includes(lorraineText));\n-\n- assert.isTrue(browserLocal.isVisible('.space-item:first-child .space-unread-indicator'));\n- // Acknowledge the activity to mark it read\n- waitForPromise(marty.spark.internal.conversation.acknowledge(oneOnOneConversation, activity));\n- browserLocal.waitForVisible('.space-item:first-child .space-unread-indicator', 1500, true);\n+ displayAndReadIncomingMessage(browserLocal, lorraine, marty, oneOnOneConversation, lorraineText);\n});\nit('displays a new one on one', () => {\nconst docText = 'Marty! We have to talk!';\n- waitForPromise(docbrown.spark.internal.conversation.create({\n- participants: [marty, docbrown]\n- }).then((c) => docbrown.spark.internal.conversation.post(c, {\n- displayName: docText\n- })));\n- browserLocal.waitUntil(() => browserLocal.getText('.space-item:first-child .space-last-activity').includes(docText));\n- assert.isTrue(browserLocal.isVisible('.space-item:first-child .space-unread-indicator'));\n+ createSpaceAndPost(browserLocal, docbrown, [marty, docbrown], undefined, docText, true);\n});\n});\n});\n",
"new_path": "test/journeys/specs/tap/widget-recents/index.js",
"old_path": "test/journeys/specs/tap/widget-recents/index.js"
}
] | JavaScript | MIT License | webex/react-widgets | test(tap): fix tap recents selectors | 1 | test | tap |
217,922 | 12.06.2018 17:22:44 | -7,200 | afefe331ec792637140c4cd90651336845967c8e | chore: [WIP] first implementation for rotation folders system
TODO: UI, reorder folders by dnd. | [
{
"change_type": "MODIFY",
"diff": "@@ -38,4 +38,6 @@ export class AppUser extends DataModel {\ncontacts: string[] = [];\n// Alarm groups for the user\nalarmGroups: AlarmGroup[] = [{name: 'Default group', enabled: true}];\n+ // Rotation folders\n+ rotationFolders: string[] = [];\n}\n",
"new_path": "src/app/model/list/app-user.ts",
"old_path": "src/app/model/list/app-user.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -19,6 +19,8 @@ export class CraftingRotation extends DataModel {\npublic defaultRecipeId?: number;\n+ public folder?: string;\n+\n@DeserializeAs(SavedConsumables)\npublic consumables: SavedConsumables = new SavedConsumables();\n",
"new_path": "src/app/model/other/crafting-rotation.ts",
"old_path": "src/app/model/other/crafting-rotation.ts"
},
{
"change_type": "ADD",
"diff": "+<h2 mat-dialog-title>{{'SIMLUATOR.New_rotation_folder' | translate}}</h2>\n+<div mat-dialog-content>\n+ <form (submit)=\"submit()\">\n+ <mat-form-field>\n+ <input matInput type=\"text\" [formControl]=\"form\" required>\n+ <mat-error *ngIf=\"form.hasError('required')\">\n+ {{'Please_enter_a_name' | translate}}\n+ </mat-error>\n+ </mat-form-field>\n+ <button mat-raised-button type=\"submit\" color=\"accent\">{{'Confirm' | translate}}</button>\n+ </form>\n+</div>\n",
"new_path": "src/app/pages/simulator/components/new-folder-popup/new-folder-popup.component.html",
"old_path": null
},
{
"change_type": "ADD",
"diff": "",
"new_path": "src/app/pages/simulator/components/new-folder-popup/new-folder-popup.component.scss",
"old_path": "src/app/pages/simulator/components/new-folder-popup/new-folder-popup.component.scss"
},
{
"change_type": "ADD",
"diff": "+import {Component, Inject} from '@angular/core';\n+import {FormControl, Validators} from '@angular/forms';\n+import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material';\n+\n+@Component({\n+ selector: 'app-new-folder-popup',\n+ templateUrl: './new-folder-popup.component.html',\n+ styleUrls: ['./new-folder-popup.component.scss']\n+})\n+export class NewFolderPopupComponent {\n+\n+ public form: FormControl;\n+\n+ constructor(private ref: MatDialogRef<NewFolderPopupComponent>, @Inject(MAT_DIALOG_DATA) private name: string) {\n+ this.form = new FormControl(name || '', Validators.required);\n+ }\n+\n+ submit() {\n+ if (this.form.valid) {\n+ this.ref.close(this.form.value);\n+ }\n+ }\n+\n+}\n",
"new_path": "src/app/pages/simulator/components/new-folder-popup/new-folder-popup.component.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import {CraftingRotation} from '../../../../model/other/crafting-rotation';\n+\n+export interface CraftingRotationFolder {\n+ name: string;\n+ rotations: CraftingRotation[];\n+}\n",
"new_path": "src/app/pages/simulator/components/rotations-page/crafting-rotation-folder.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -10,9 +10,11 @@ import {TranslateService} from '@ngx-translate/core';\nimport {ConfirmationPopupComponent} from '../../../../modules/common-components/confirmation-popup/confirmation-popup.component';\nimport {CustomLink} from '../../../../core/database/custom-links/custom-link';\nimport {CustomLinkPopupComponent} from '../../../custom-links/custom-link-popup/custom-link-popup.component';\n-import {filter, map, mergeMap, tap} from 'rxjs/operators';\n+import {filter, first, map, mergeMap, tap} from 'rxjs/operators';\nimport {LinkToolsService} from '../../../../core/tools/link-tools.service';\nimport {RotationNamePopupComponent} from '../rotation-name-popup/rotation-name-popup.component';\n+import {NewFolderPopupComponent} from '../new-folder-popup/new-folder-popup.component';\n+import {CraftingRotationFolder} from './crafting-rotation-folder';\n@Component({\nselector: 'app-rotations-page',\n@@ -22,7 +24,7 @@ import {RotationNamePopupComponent} from '../rotation-name-popup/rotation-name-p\n})\nexport class RotationsPageComponent {\n- rotations$: Observable<CraftingRotation[]>;\n+ rotations$: Observable<{ nofolder: CraftingRotation[], folders: CraftingRotationFolder[] }>;\nlinkButton = false;\n@@ -34,6 +36,22 @@ export class RotationsPageComponent {\ntap(user => this.linkButton = user.admin || user.patron),\nmergeMap(user => {\nreturn this.rotationsService.getUserRotations(user.$key);\n+ }),\n+ map(rotations => {\n+ // Order rotations per folder\n+ return rotations.reduce((result, rotation) => {\n+ if (rotation.folder === undefined) {\n+ result.nofolder.push(rotation);\n+ } else {\n+ let folder = result.folders.find(f => f.name === rotation.folder);\n+ if (folder === undefined) {\n+ result.folders.push({name: rotation.folder, rotations: []});\n+ folder = result.folders[result.folders.length];\n+ }\n+ folder.rotations.push(rotation);\n+ }\n+ return result;\n+ }, {nofolder: [], folders: []});\n})\n);\n}\n@@ -91,6 +109,34 @@ export class RotationsPageComponent {\nreturn `${link}/${rotation.$key}`;\n}\n+ nelder(): void {\n+ this.dialog.open(NewFolderPopupComponent)\n+ .afterClosed()\n+ .pipe(\n+ filter(name => name !== '' && name !== undefined && name !== null),\n+ mergeMap(folderName => {\n+ return this.userService.getUserData()\n+ .pipe(\n+ first(),\n+ map(user => {\n+ if (user.rotationFolders.find(folder => folder === folderName) === undefined) {\n+ user.rotationFolders.push(folderName);\n+ }\n+ return user;\n+ }),\n+ mergeMap(user => {\n+ return this.userService.set(user.$key, user);\n+ })\n+ )\n+ })\n+ ).subscribe();\n+ }\n+\n+ setFolder(rotation: CraftingRotation, folder: string): void {\n+ rotation.folder = folder;\n+ this.rotationsService.set(rotation.$key, rotation).subscribe();\n+ }\n+\npublic showCopiedNotification(): void {\nthis.snack.open(\nthis.translator.instant('SIMULATOR.Share_link_copied'),\n",
"new_path": "src/app/pages/simulator/components/rotations-page/rotations-page.component.ts",
"old_path": "src/app/pages/simulator/components/rotations-page/rotations-page.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -43,6 +43,7 @@ import {ConsumablesService} from './model/consumables.service';\nimport {RotationNamePopupComponent} from './components/rotation-name-popup/rotation-name-popup.component';\nimport {StepByStepReportPopupComponent} from './components/step-by-step-report-popup/step-by-step-report-popup.component';\nimport {RecipeChoicePopupComponent} from './components/recipe-choice-popup/recipe-choice-popup.component';\n+import {NewFolderPopupComponent} from './components/new-folder-popup/new-folder-popup.component';\nconst routes: Routes = [\n{\n@@ -124,7 +125,8 @@ const routes: Routes = [\nSimulationMinStatsPopupComponent,\nRotationNamePopupComponent,\nStepByStepReportPopupComponent,\n- RecipeChoicePopupComponent\n+ RecipeChoicePopupComponent,\n+ NewFolderPopupComponent\n],\nentryComponents: [\nImportRotationPopupComponent,\n@@ -133,7 +135,8 @@ const routes: Routes = [\nSimulationMinStatsPopupComponent,\nRotationNamePopupComponent,\nStepByStepReportPopupComponent,\n- RecipeChoicePopupComponent\n+ RecipeChoicePopupComponent,\n+ NewFolderPopupComponent\n],\nproviders: [\nCraftingActionsRegistry,\n",
"new_path": "src/app/pages/simulator/simulator.module.ts",
"old_path": "src/app/pages/simulator/simulator.module.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | chore: [WIP] first implementation for rotation folders system
TODO: UI, reorder folders by dnd. | 1 | chore | null |
791,834 | 12.06.2018 18:54:39 | 21,600 | 48519f185eb5bfa19a22a091ecc08985b0fe510a | core(tsc): add initial trivial type info to config.js | [
{
"change_type": "MODIFY",
"diff": "@@ -17,10 +17,18 @@ const path = require('path');\nconst Audit = require('../audits/audit');\nconst Runner = require('../runner');\n+/** @typedef {typeof import('../gather/gatherers/gatherer.js')} GathererConstructor */\n+/** @typedef {InstanceType<GathererConstructor>} Gatherer */\n+\n+/**\n+ * @param {LH.Config['passes']} passes\n+ * @param {LH.Config['audits']} audits\n+ */\nfunction validatePasses(passes, audits) {\nif (!Array.isArray(passes)) {\nreturn;\n}\n+\nconst requiredGatherers = Config.getGatherersNeededByAudits(audits);\n// Log if we are running gathers that are not needed by the audits listed in the config\n@@ -28,7 +36,7 @@ function validatePasses(passes, audits) {\npass.gatherers.forEach(gathererDefn => {\nconst gatherer = gathererDefn.instance || gathererDefn.implementation;\nconst isGatherRequiredByAudits = requiredGatherers.has(gatherer.name);\n- if (isGatherRequiredByAudits === false) {\n+ if (!isGatherRequiredByAudits) {\nconst msg = `${gatherer.name} gatherer requested, however no audit requires it.`;\nlog.warn('config', msg);\n}\n@@ -46,6 +54,11 @@ function validatePasses(passes, audits) {\n});\n}\n+/**\n+ * @param {LH.Config['categories']} categories\n+ * @param {LH.Config['audits']} audits\n+ * @param {LH.Config['groups']} groups\n+ */\nfunction validateCategories(categories, audits, groups) {\nif (!categories) {\nreturn;\n@@ -57,7 +70,7 @@ function validateCategories(categories, audits, groups) {\nthrow new Error(`missing an audit id at ${categoryId}[${index}]`);\n}\n- const audit = audits.find(a => a.implementation.meta.name === auditRef.id);\n+ const audit = audits && audits.find(a => a.implementation.meta.name === auditRef.id);\nif (!audit) {\nthrow new Error(`could not find ${auditRef.id} audit for category ${categoryId}`);\n}\n@@ -72,13 +85,17 @@ function validateCategories(categories, audits, groups) {\nthrow new Error(`${auditRef.id} is manual but has a positive weight`);\n}\n- if (auditRef.group && !groups[auditRef.group]) {\n+ if (auditRef.group && (!groups || !groups[auditRef.group])) {\nthrow new Error(`${auditRef.id} references unknown group ${auditRef.group}`);\n}\n});\n});\n}\n+/**\n+ * @param {typeof Audit} auditDefinition\n+ * @param {string=} auditPath\n+ */\nfunction assertValidAudit(auditDefinition, auditPath) {\nconst auditName = auditPath ||\n(auditDefinition && auditDefinition.meta && auditDefinition.meta.name);\n@@ -120,6 +137,10 @@ function assertValidAudit(auditDefinition, auditPath) {\n}\n}\n+/**\n+ * @param {Gatherer} gathererInstance\n+ * @param {string=} gathererName\n+ */\nfunction assertValidGatherer(gathererInstance, gathererName) {\ngathererName = gathererName || gathererInstance.name || 'gatherer';\n@@ -139,8 +160,8 @@ function assertValidGatherer(gathererInstance, gathererName) {\n/**\n* Creates a settings object from potential flags object by dropping all the properties\n* that don't exist on Config.Settings.\n- *\n- * @param {LH.Flags=} flags\n+ * TODO(bckenny): fix Flags type\n+ * @param {Partial<LH.Flags>=} flags\n* @return {Partial<LH.Config.Settings>}\n*/\nfunction cleanFlagsForSettings(flags = {}) {\n@@ -155,7 +176,13 @@ function cleanFlagsForSettings(flags = {}) {\n}\n// TODO(phulce): disentangle this merge function\n-function merge(base, extension, overwriteArrays = false) {\n+/**\n+ * More widely typed than exposed merge() function, below.\n+ * @param {Object<string, any>|Array<any>|undefined|null} base\n+ * @param {Object<string, any>|Array<any>} extension\n+ * @param {boolean=} overwriteArrays\n+ */\n+function _merge(base, extension, overwriteArrays = false) {\n// If the default value doesn't exist or is explicitly null, defer to the extending value\nif (typeof base === 'undefined' || base === null) {\nreturn extension;\n@@ -172,10 +199,11 @@ function merge(base, extension, overwriteArrays = false) {\nreturn merged;\n} else if (typeof extension === 'object') {\nif (typeof base !== 'object') throw new TypeError(`Expected object but got ${typeof base}`);\n+ if (Array.isArray(base)) throw new TypeError('Expected object but got Array');\nObject.keys(extension).forEach(key => {\nconst localOverwriteArrays = overwriteArrays ||\n(key === 'settings' && typeof base[key] === 'object');\n- base[key] = merge(base[key], extension[key], localOverwriteArrays);\n+ base[key] = _merge(base[key], extension[key], localOverwriteArrays);\n});\nreturn base;\n}\n@@ -183,21 +211,61 @@ function merge(base, extension, overwriteArrays = false) {\nreturn extension;\n}\n+/**\n+ * Until support of jsdoc templates with constraints, type in config.d.ts.\n+ * See https://github.com/Microsoft/TypeScript/issues/24283\n+ * @type {LH.Config.Merge}\n+ */\n+const merge = _merge;\n+\n+/**\n+ * @template T\n+ * @param {Array<T>} array\n+ * @return {Array<T>}\n+ */\nfunction cloneArrayWithPluginSafety(array) {\nreturn array.map(item => {\n- return typeof item === 'object' ? Object.assign({}, item) : item;\n+ if (typeof item === 'object') {\n+ // Return copy of instance and prototype chain (in case item is instantiated class).\n+ return Object.assign(\n+ Object.create(\n+ Object.getPrototypeOf(item)\n+ ),\n+ item\n+ );\n+ }\n+\n+ return item;\n});\n}\n+/**\n+ * // TODO(bckenny): could adopt \"jsonified\" type to ensure T will survive JSON\n+ * round trip: https://github.com/Microsoft/TypeScript/issues/21838\n+ * @template T\n+ * @param {T} json\n+ * @return {T}\n+ */\nfunction deepClone(json) {\n- const cloned = JSON.parse(JSON.stringify(json));\n+ return JSON.parse(JSON.stringify(json));\n+}\n+\n+/**\n+ * Deep clone a ConfigJson, copying over any \"live\" gatherer or audit that\n+ * wouldn't make the JSON round trip.\n+ * @param {LH.Config.Json} json\n+ * @return {LH.Config.Json}\n+ */\n+function deepCloneConfigJson(json) {\n+ const cloned = deepClone(json);\n// Copy arrays that could contain plugins to allow for programmatic\n// injection of plugins.\n- if (Array.isArray(json.passes)) {\n- cloned.passes.forEach((pass, i) => {\n+ if (Array.isArray(cloned.passes) && Array.isArray(json.passes)) {\n+ for (let i = 0; i < cloned.passes.length; i++) {\n+ const pass = cloned.passes[i];\npass.gatherers = cloneArrayWithPluginSafety(json.passes[i].gatherers || []);\n- });\n+ }\n}\nif (Array.isArray(json.audits)) {\n@@ -207,10 +275,32 @@ function deepClone(json) {\nreturn cloned;\n}\n+/**\n+ * Until support of jsdoc templates with constraints, type in config.d.ts.\n+ * See https://github.com/Microsoft/TypeScript/issues/24283\n+ * @type {LH.Config.MergeOptionsOfItems}\n+ */\n+const mergeOptionsOfItems = (function(items) {\n+ /** @type {Array<{path?: string, options?: Object<string, any>}>} */\n+ const mergedItems = [];\n+\n+ for (const item of items) {\n+ const existingItem = item.path && mergedItems.find(candidate => candidate.path === item.path);\n+ if (!existingItem) {\n+ mergedItems.push(item);\n+ continue;\n+ }\n+\n+ existingItem.options = Object.assign({}, existingItem.options, item.options);\n+ }\n+\n+ return mergedItems;\n+});\n+\nclass Config {\n/**\n* @constructor\n- * @param {!LighthouseConfig} configJSON\n+ * @param {LH.Config.Json=} configJSON\n* @param {LH.Flags=} flags\n*/\nconstructor(configJSON, flags) {\n@@ -226,15 +316,15 @@ class Config {\n}\n// We don't want to mutate the original config object\n- configJSON = deepClone(configJSON);\n+ configJSON = deepCloneConfigJson(configJSON);\n// Extend the default or full config if specified\nif (configJSON.extends === 'lighthouse:full') {\n- const explodedFullConfig = Config.extendConfigJSON(deepClone(defaultConfig),\n- deepClone(fullConfig));\n+ const explodedFullConfig = Config.extendConfigJSON(deepCloneConfigJson(defaultConfig),\n+ deepCloneConfigJson(fullConfig));\nconfigJSON = Config.extendConfigJSON(explodedFullConfig, configJSON);\n} else if (configJSON.extends) {\n- configJSON = Config.extendConfigJSON(deepClone(defaultConfig), configJSON);\n+ configJSON = Config.extendConfigJSON(deepCloneConfigJson(defaultConfig), configJSON);\n}\n// Augment config with necessary defaults\n@@ -263,11 +353,16 @@ class Config {\n// Store the directory of the config path, if one was provided.\nthis._configDir = configPath ? path.dirname(configPath) : undefined;\n+ /** @type {LH.Config['settings']} */\n+ this._settings = configJSON.settings || {};\n+ /** @type {LH.Config['passes']} */\nthis._passes = Config.requireGatherers(configJSON.passes, this._configDir);\n+ /** @type {LH.Config['audits']} */\nthis._audits = Config.requireAudits(configJSON.audits, this._configDir);\n+ /** @type {LH.Config['categories']} */\nthis._categories = configJSON.categories;\n+ /** @type {LH.Config['groups']} */\nthis._groups = configJSON.groups;\n- this._settings = configJSON.settings || {};\n// validatePasses must follow after audits are required\nvalidatePasses(configJSON.passes, this._audits);\n@@ -275,13 +370,13 @@ class Config {\n}\n/**\n- * @param {!Object} baseJSON The JSON of the configuration to extend\n- * @param {!Object} extendJSON The JSON of the extensions\n- * @return {!Object}\n+ * @param {LH.Config.Json} baseJSON The JSON of the configuration to extend\n+ * @param {LH.Config.Json} extendJSON The JSON of the extensions\n+ * @return {LH.Config.Json}\n*/\nstatic extendConfigJSON(baseJSON, extendJSON) {\n- if (extendJSON.passes) {\n- extendJSON.passes.forEach(pass => {\n+ if (extendJSON.passes && baseJSON.passes) {\n+ for (const pass of extendJSON.passes) {\n// use the default pass name if one is not specified\nconst passName = pass.passName || constants.defaultPassConfig.passName;\nconst basePass = baseJSON.passes.find(candidate => candidate.passName === passName);\n@@ -291,7 +386,7 @@ class Config {\n} else {\nmerge(basePass, pass);\n}\n- });\n+ }\ndelete extendJSON.passes;\n}\n@@ -314,14 +409,13 @@ class Config {\n}\n/**\n- * Expands the audits from user-specified to the internal audit definition format.\n- *\n- * @param {?Array<string|!Audit>} audits\n- * @return {?Array<Config.AuditWithOptions>}\n+ * Expands the audits from user-specified JSON to an internal audit definition format.\n+ * @param {LH.Config.Json['audits']} audits\n+ * @return {?Array<{path: string, options?: {}} | {implementation: typeof Audit, path?: string, options?: {}}>}\n*/\nstatic expandAuditShorthandAndMergeOptions(audits) {\nif (!audits) {\n- return audits;\n+ return null;\n}\nconst newAudits = audits.map(audit => {\n@@ -334,19 +428,19 @@ class Config {\n}\n});\n- return Config._mergeOptionsOfItems(newAudits);\n+ return mergeOptionsOfItems(newAudits);\n}\n/**\n- * Expands the gatherers from user-specified to the internal gatherer definition format.\n+ * Expands the gatherers from user-specified to an internal gatherer definition format.\n*\n* Input Examples:\n* - 'my-gatherer'\n* - class MyGatherer extends Gatherer { }\n* - {instance: myGathererInstance}\n*\n- * @param {?Array<!Pass>} passes\n- * @return {?Array<!Pass>} passes\n+ * @param {Array<{gatherers: Array<LH.Config.GathererJson>}>} passes\n+ * @return {Array<{gatherers: Array<{instance?: Gatherer, implementation?: GathererConstructor, path?: string, options?: {}}>}>} passes\n*/\nstatic expandGathererShorthandAndMergeOptions(passes) {\nif (!passes) {\n@@ -366,32 +460,12 @@ class Config {\n}\n});\n- pass.gatherers = Config._mergeOptionsOfItems(pass.gatherers);\n+ pass.gatherers = mergeOptionsOfItems(pass.gatherers);\n});\nreturn passes;\n}\n- /**\n- * @param {!Array<{path: string=, options: object=}>} items\n- * @return {!Array<{path: string=, options: object}>}\n- */\n- static _mergeOptionsOfItems(items) {\n- const mergedItems = [];\n-\n- for (const item of items) {\n- const existingItem = item.path && mergedItems.find(candidate => candidate.path === item.path);\n- if (!existingItem) {\n- mergedItems.push(item);\n- continue;\n- }\n-\n- existingItem.options = Object.assign({}, existingItem.options, item.options);\n- }\n-\n- return mergedItems;\n- }\n-\n/**\n* Observed throttling methods (devtools/provided) require at least 5s of quiet for the metrics to\n* be computed. This method adjusts the quiet thresholds to the required minimums if necessary.\n@@ -418,15 +492,15 @@ class Config {\n/**\n* Filter out any unrequested items from the config, based on requested top-level categories.\n- * @param {!Object} oldConfig Lighthouse config object\n+ * @param {LH.Config.Json} oldConfig Lighthouse config object\n* @param {!Array<string>=} categoryIds ID values of categories to include\n* @param {!Array<string>=} auditIds ID values of categories to include\n* @param {!Array<string>=} skipAuditIds ID values of categories to exclude\n- * @return {!Object} A new config\n+ * @return {LH.Config.Json} A new config\n*/\nstatic generateNewFilteredConfig(oldConfig, categoryIds, auditIds, skipAuditIds) {\n// 0. Clone config to avoid mutating it\n- const config = deepClone(oldConfig);\n+ const config = deepCloneConfigJson(oldConfig);\nconfig.audits = Config.expandAuditShorthandAndMergeOptions(config.audits);\nconfig.passes = Config.expandGathererShorthandAndMergeOptions(config.passes);\nconfig.passes = Config.requireGatherers(config.passes);\n@@ -460,13 +534,17 @@ class Config {\n/**\n* Filter out any unrequested categories or audits from the categories object.\n- * @param {!Object<string, {auditRefs: !Array<{id: string}>}>} categories\n- * @param {!Array<string>=} categoryIds\n- * @param {!Array<string>=} auditIds\n- * @param {!Array<string>=} skipAuditIds\n- * @return {{categories: Object<string, {audits: !Array<{id: string}>}>, audits: Set<string>}}\n+ * @param {LH.Config['categories']} oldCategories\n+ * @param {Array<string>=} categoryIds\n+ * @param {Array<string>=} auditIds\n+ * @param {Array<string>=} skipAuditIds\n+ * @return {{categories: LH.Config['categories'], requestedAuditNames: Set<string>}}\n*/\nstatic filterCategoriesAndAudits(oldCategories, categoryIds, auditIds, skipAuditIds) {\n+ if (!oldCategories) {\n+ return {categories: null, requestedAuditNames: new Set()};\n+ }\n+\nif (auditIds && skipAuditIds) {\nthrow new Error('Cannot set both skipAudits and onlyAudits');\n}\n@@ -537,23 +615,32 @@ class Config {\n}\n/**\n- * @param {{categories: !Object<string, {title: string}>}} config\n- * @return {!Array<{id: string, title: string}>}\n+ * @param {LH.Config.Json} config\n+ * @return {Array<{id: string, title: string}>}\n*/\nstatic getCategories(config) {\n- return Object.keys(config.categories).map(id => {\n- const title = config.categories[id].title;\n+ const categories = config.categories;\n+ if (!categories) {\n+ return [];\n+ }\n+\n+ return Object.keys(categories).map(id => {\n+ const title = categories[id].title;\nreturn {id, title};\n});\n}\n/**\n* Creates mapping from audit path (used in config.audits) to audit.name (used in categories)\n- * @param {!Object} config Lighthouse config object.\n+ * @param {LH.Config.Json} config Lighthouse config object.\n* @return {Map<string, string>}\n*/\nstatic getMapOfAuditPathToName(config) {\nconst auditObjectsAll = Config.requireAudits(config.audits);\n+ if (!auditObjectsAll) {\n+ return new Map();\n+ }\n+\nconst auditPathToName = new Map(auditObjectsAll.map((auditDefn, index) => {\nconst AuditClass = auditDefn.implementation;\nconst auditPath = config.audits[index];\n@@ -565,8 +652,8 @@ class Config {\n/**\n* From some requested audits, return names of all required artifacts\n- * @param {!Array<!Config.AuditWithOptions>} audits\n- * @return {!Set<string>}\n+ * @param {LH.Config['audits']} audits\n+ * @return {Set<string>}\n*/\nstatic getGatherersNeededByAudits(audits) {\n// It's possible we weren't given any audits (but existing audit results), in which case\n@@ -582,12 +669,16 @@ class Config {\n}\n/**\n- * Filters to only required passes and gatherers, returning a new passes object\n- * @param {!Array} passes\n- * @param {!Set<string>} requiredGatherers\n- * @return {!Array} fresh passes object\n+ * Filters to only required passes and gatherers, returning a new passes array.\n+ * @param {LH.Config['passes']} passes\n+ * @param {Set<string>} requiredGatherers\n+ * @return {LH.Config['passes']}\n*/\nstatic generatePassesNeededByGatherers(passes, requiredGatherers) {\n+ if (!passes) {\n+ return null;\n+ }\n+\nconst auditsNeedTrace = requiredGatherers.has('traces');\nconst filteredPasses = passes.map(pass => {\n// remove any unncessary gatherers from within the passes\n@@ -617,10 +708,10 @@ class Config {\n/**\n* Take an array of audits and audit paths and require any paths (possibly\n* relative to the optional `configPath`) using `Runner.resolvePlugin`,\n- * leaving only an array of Audits.\n- * @param {?Array<!Config.AuditWithOptions>} audits\n+ * leaving only an array of AuditDefns.\n+ * @param {LH.Config.Json['audits']} audits\n* @param {string=} configPath\n- * @return {?Array<!Config.AuditWithOptions>}\n+ * @return {LH.Config['audits']}\n*/\nstatic requireAudits(audits, configPath) {\nif (!audits) {\n@@ -648,10 +739,12 @@ class Config {\n}\n/**\n- *\n- * @param {?Array<{gatherers: !Array}>} passes\n+ * Takes an array of passes with every property now initialized except the\n+ * gatherers and requires them, (relative to the optional `configPath` if\n+ * provided) using `Runner.resolvePlugin`, returning an array of full Passes.\n+ * @param {?Array<Required<LH.Config.PassJson>>} passes\n* @param {string=} configPath\n- * @return {?Array<{gatherers: !Array}>}\n+ * @return {LH.Config['passes']}\n*/\nstatic requireGatherers(passes, configPath) {\nif (!passes) {\n@@ -693,45 +786,30 @@ class Config {\nreturn this._configDir;\n}\n- /** @type {Array<!Pass>} */\n+ /** @type {LH.Config['passes']} */\nget passes() {\nreturn this._passes;\n}\n- /** @type {Array<!Config.AuditWithOptions>} */\n+ /** @type {LH.Config['audits']} */\nget audits() {\nreturn this._audits;\n}\n- /** @type {Object<{audits: !Array<{id: string, weight: number}>}>} */\n+ /** @type {LH.Config['categories']} */\nget categories() {\nreturn this._categories;\n}\n- /** @type {Object<string, {title: string, description: string}>|undefined} */\n+ /** @type {LH.Config['groups']} */\nget groups() {\nreturn this._groups;\n}\n- /** @type {LH.ConfigSettings} */\n+ /** @type {LH.Config['settings']} */\nget settings() {\nreturn this._settings;\n}\n}\n-/**\n- * @typedef {Object} Config.AuditWithOptions\n- * @property {string=} path\n- * @property {!Audit=} implementation\n- * @property {Object=} options\n- */\n-\n-/**\n- * @typedef {Object} Config.GathererWithOptions\n- * @property {string=} path\n- * @property {!Gatherer=} instance\n- * @property {!GathererConstructor=} implementation\n- * @property {Object=} options\n- */\n-\nmodule.exports = Config;\n",
"new_path": "lighthouse-core/config/config.js",
"old_path": "lighthouse-core/config/config.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -47,6 +47,7 @@ const defaultSettings = {\nskipAudits: null,\n};\n+/** @type {LH.Config.Pass} */\nconst defaultPassConfig = {\npassName: 'defaultPass',\nrecordTrace: false,\n",
"new_path": "lighthouse-core/config/constants.js",
"old_path": "lighthouse-core/config/constants.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -40,8 +40,7 @@ async function lighthouse(url, flags, configJSON) {\nlog.setLevel(flags.logLevel);\n// Use ConfigParser to generate a valid config file\n- // @ts-ignore - TODO(bckenny): type checking for Config\n- const config = /** @type {LH.Config} */ (new Config(configJSON, flags));\n+ const config = new Config(configJSON, flags);\nconst connection = new ChromeProtocol(flags.port, flags.hostname);\n// kick off a lighthouse run\n",
"new_path": "lighthouse-core/index.js",
"old_path": "lighthouse-core/index.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -131,7 +131,7 @@ class Runner {\naudits: resultsById,\nconfigSettings: settings,\ncategories,\n- categoryGroups: opts.config.groups,\n+ categoryGroups: opts.config.groups || undefined,\ntiming: {total: Date.now() - startTime},\n};\n",
"new_path": "lighthouse-core/runner.js",
"old_path": "lighthouse-core/runner.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -57,6 +57,31 @@ describe('Config', () => {\nassert.equal(MyAudit, newConfig.audits[0].implementation);\n});\n+ it('doesn\\'t change directly injected plugin instances', () => {\n+ class MyGatherer extends Gatherer {\n+ constructor(secretVal) {\n+ super();\n+ this.secret = secretVal;\n+ }\n+ }\n+ const myGatherer1 = new MyGatherer(1729);\n+ const myGatherer2 = new MyGatherer(6);\n+ const config = {\n+ passes: [{\n+ gatherers: [\n+ myGatherer1,\n+ {instance: myGatherer2},\n+ ],\n+ }],\n+ };\n+ const newConfig = new Config(config);\n+ const configGatherers = newConfig.passes[0].gatherers;\n+ assert(configGatherers[0].instance instanceof MyGatherer);\n+ assert.equal(configGatherers[0].instance.secret, 1729);\n+ assert(configGatherers[1].instance instanceof MyGatherer);\n+ assert.equal(configGatherers[1].instance.secret, 6);\n+ });\n+\nit('uses the default config when no config is provided', () => {\nconst config = new Config();\nassert.deepStrictEqual(config.categories, origConfig.categories);\n",
"new_path": "lighthouse-core/test/config/config-test.js",
"old_path": "lighthouse-core/test/config/config-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -24,11 +24,10 @@ const log = require('lighthouse-logger');\nfunction runLighthouseForConnection(\nconnection, url, options, categoryIDs,\nupdateBadgeFn = function() { }) {\n- // @ts-ignore - TODO(bckenny): type checking for Config\n- const config = /** @type {LH.Config} */ (new Config({\n+ const config = new Config({\nextends: 'lighthouse:default',\nsettings: {onlyCategories: categoryIDs},\n- }, options.flags));\n+ }, options.flags);\n// Add url and config to fresh options object.\nconst runOptions = Object.assign({}, options, {url, config});\n",
"new_path": "lighthouse-extension/app/src/lighthouse-background.js",
"old_path": "lighthouse-extension/app/src/lighthouse-background.js"
},
{
"change_type": "MODIFY",
"diff": "import Gatherer = require('../lighthouse-core/gather/gatherers/gatherer.js');\nimport Audit = require('../lighthouse-core/audits/audit.js');\n-\ndeclare global {\nmodule LH {\n/**\n* The full, normalized Lighthouse Config.\n*/\n- export interface Config {\n+ export interface Config extends Config.Json {\nsettings: Config.Settings;\n- passes?: Config.Pass[];\n- audits?: Config.AuditDefn[];\n- categories?: Record<string, Config.Category>;\n- groups?: Record<string, Config.Group>;\n+ passes: Config.Pass[] | null;\n+ audits: Config.AuditDefn[] | null;\n+ categories: Record<string, Config.Category> | null;\n+ groups: Record<string, Config.Group> | null;\n}\nmodule Config {\n@@ -26,10 +25,12 @@ declare global {\n* The pre-normalization Lighthouse Config format.\n*/\nexport interface Json {\n+ extends?: 'lighthouse:default' | 'lighthouse:full' | string | boolean;\nsettings?: SettingsJson;\n- passes?: PassJson[];\n- categories?: Record<string, CategoryJson>;\n- groups?: GroupJson[];\n+ passes?: PassJson[] | null;\n+ audits?: Config.AuditJson[] | null;\n+ categories?: Record<string, CategoryJson> | null;\n+ groups?: Record<string, Config.GroupJson> | null;\n}\nexport interface SettingsJson extends SharedFlagsSettings {\n@@ -58,7 +59,7 @@ declare global {\n} | {\ninstance: InstanceType<typeof Gatherer>;\noptions?: {};\n- } | string;\n+ } | Gatherer | typeof Gatherer | string;\nexport interface CategoryJson {\ntitle: string;\n@@ -71,6 +72,14 @@ declare global {\ndescription: string;\n}\n+ export type AuditJson = {\n+ path: string,\n+ options?: {};\n+ } | {\n+ implementation: typeof Audit;\n+ options?: {};\n+ } | typeof Audit | string;\n+\n/**\n* Reference to an audit member of a category and how its score should be\n* weighted and how its results grouped with other members.\n@@ -81,7 +90,6 @@ declare global {\ngroup?: string;\n}\n- // TODO(bckenny): we likely don't want to require all these\nexport interface Settings extends Required<SettingsJson> {\nthrottling: Required<ThrottlingSettings>;\n}\n@@ -91,13 +99,15 @@ declare global {\n}\nexport interface GathererDefn {\n- implementation: typeof Gatherer;\n+ implementation?: typeof Gatherer;\ninstance: InstanceType<typeof Gatherer>;\n+ path?: string;\noptions: {};\n}\nexport interface AuditDefn {\nimplementation: typeof Audit;\n+ path?: string;\noptions: {};\n}\n@@ -107,6 +117,13 @@ declare global {\nauditRefs: AuditRef[];\n}\nexport interface Group extends GroupJson {}\n+\n+ export type MergeOptionsOfItems = <T extends {path?: string, options: Record<string, any>}>(items: T[]) => T[];\n+\n+ export type Merge = {\n+ <T extends Record<string, any>, U extends Record<string, any>>(base: T|null|undefined, extension: U, overwriteArrays?: boolean): T & U;\n+ <T extends Array<any>, U extends Array<any>>(base: T|null|undefined, extension: T, overwriteArrays?: boolean): T & U;\n+ }\n}\n}\n}\n",
"new_path": "typings/config.d.ts",
"old_path": "typings/config.d.ts"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core(tsc): add initial trivial type info to config.js (#5481) | 1 | core | tsc |
730,412 | 12.06.2018 21:08:20 | 0 | 40b97420909a204e645f5b9c7af643176c6714f4 | chore(release): 0.1.308 | [
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.1.308\"></a>\n+## [0.1.308](https://github.com/webex/react-ciscospark/compare/v0.1.307...v0.1.308) (2018-06-12)\n+\n+\n+\n<a name=\"0.1.307\"></a>\n## [0.1.307](https://github.com/webex/react-ciscospark/compare/v0.1.306...v0.1.307) (2018-06-11)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@ciscospark/react-ciscospark\",\n- \"version\": \"0.1.307\",\n+ \"version\": \"0.1.308\",\n\"description\": \"The Cisco Spark for React library allows developers to easily incorporate Spark functionality into an application.\",\n\"scripts\": {\n\"build\": \"./scripts/build/index.js\",\n",
"new_path": "package.json",
"old_path": "package.json"
}
] | JavaScript | MIT License | webex/react-widgets | chore(release): 0.1.308 | 1 | chore | release |
791,690 | 13.06.2018 13:58:37 | 25,200 | b339844d3c7b0f6d49fbe332cc7f78c47fc225c2 | core(offscreen-images): add lantern filter | [
{
"change_type": "MODIFY",
"diff": "@@ -128,13 +128,15 @@ class UnusedBytes extends Audit {\n* @param {Array<LH.Audit.ByteEfficiencyItem>} results The array of byte savings results per resource\n* @param {Node} graph\n* @param {Simulator} simulator\n- * @param {{includeLoad?: boolean}=} options\n+ * @param {{includeLoad?: boolean, label?: string}=} options\n* @return {number}\n*/\nstatic computeWasteWithTTIGraph(results, graph, simulator, options) {\n- options = Object.assign({includeLoad: true}, options);\n+ options = Object.assign({includeLoad: true, label: this.meta.name}, options);\n+ const beforeLabel = `${options.label}-before`;\n+ const afterLabel = `${options.label}-after`;\n- const simulationBeforeChanges = simulator.simulate(graph);\n+ const simulationBeforeChanges = simulator.simulate(graph, {label: beforeLabel});\n/** @type {Map<string, LH.Audit.ByteEfficiencyItem>} */\nconst resultsByUrl = new Map();\nfor (const result of results) {\n@@ -157,7 +159,7 @@ class UnusedBytes extends Audit {\nnetworkNode.record._transferSize = Math.max(original - wastedBytes, 0);\n});\n- const simulationAfterChanges = simulator.simulate(graph);\n+ const simulationAfterChanges = simulator.simulate(graph, {label: afterLabel});\n// Restore the original transfer size after we've done our simulation\ngraph.traverse(node => {\n",
"new_path": "lighthouse-core/audits/byte-efficiency/byte-efficiency-audit.js",
"old_path": "lighthouse-core/audits/byte-efficiency/byte-efficiency-audit.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -18,6 +18,7 @@ const ALLOWABLE_OFFSCREEN_Y = 200;\nconst IGNORE_THRESHOLD_IN_BYTES = 2048;\nconst IGNORE_THRESHOLD_IN_PERCENT = 75;\n+const IGNORE_THRESHOLD_IN_MS = 50;\n/** @typedef {{url: string, requestStartTime: number, totalBytes: number, wastedBytes: number, wastedPercent: number}} WasteResult */\n@@ -86,6 +87,53 @@ class OffscreenImages extends ByteEfficiencyAudit {\n};\n}\n+ /**\n+ * Filters out image requests that were requested after the last long task based on lantern timings.\n+ *\n+ * @param {WasteResult[]} images\n+ * @param {LH.Artifacts.LanternMetric} lanternMetricData\n+ */\n+ static filterLanternResults(images, lanternMetricData) {\n+ const nodeTimings = lanternMetricData.pessimisticEstimate.nodeTimings;\n+\n+ // Find the last long task start time\n+ let lastLongTaskStartTime = 0;\n+ // Find the start time of all requests\n+ /** @type {Map<string, number>} */\n+ const startTimesByURL = new Map();\n+ for (const [node, timing] of nodeTimings) {\n+ if (node.type === 'cpu' && timing.duration >= 50) {\n+ lastLongTaskStartTime = Math.max(lastLongTaskStartTime, timing.startTime);\n+ } else if (node.type === 'network') {\n+ const networkNode = /** @type {LH.Gatherer.Simulation.GraphNetworkNode} */ (node);\n+ startTimesByURL.set(networkNode.record.url, timing.startTime);\n+ }\n+ }\n+\n+ return images.filter(image => {\n+ // Filter out images that had little waste\n+ if (image.wastedBytes < IGNORE_THRESHOLD_IN_BYTES) return false;\n+ if (image.wastedPercent < IGNORE_THRESHOLD_IN_PERCENT) return false;\n+ // Filter out images that started after the last long task\n+ const imageRequestStartTime = startTimesByURL.get(image.url) || 0;\n+ return imageRequestStartTime < lastLongTaskStartTime - IGNORE_THRESHOLD_IN_MS;\n+ });\n+ }\n+\n+ /**\n+ * Filters out image requests that were requested after TTI.\n+ *\n+ * @param {WasteResult[]} images\n+ * @param {number} interactiveTimestamp\n+ */\n+ static filterObservedResults(images, interactiveTimestamp) {\n+ return images.filter(image => {\n+ if (image.wastedBytes < IGNORE_THRESHOLD_IN_BYTES) return false;\n+ if (image.wastedPercent < IGNORE_THRESHOLD_IN_PERCENT) return false;\n+ return image.requestStartTime < interactiveTimestamp / 1e6 - IGNORE_THRESHOLD_IN_MS / 1000;\n+ });\n+ }\n+\n/**\n* The default byte efficiency audit will report max(TTI, load), since lazy-loading offscreen\n* images won't reduce the overall time and the wasted bytes are really only \"wasted\" for TTI,\n@@ -97,7 +145,7 @@ class OffscreenImages extends ByteEfficiencyAudit {\n* @return {number}\n*/\nstatic computeWasteWithTTIGraph(results, graph, simulator) {\n- return ByteEfficiencyAudit.computeWasteWithTTIGraph(results, graph, simulator,\n+ return super.computeWasteWithTTIGraph(results, graph, simulator,\n{includeLoad: false});\n}\n@@ -138,19 +186,14 @@ class OffscreenImages extends ByteEfficiencyAudit {\n}, /** @type {Map<string, WasteResult>} */ (new Map()));\nconst settings = context.settings;\n- return artifacts.requestFirstCPUIdle({trace, devtoolsLog, settings}).then(firstInteractive => {\n- // The filter below is just to be extra safe that we exclude images that were loaded post-TTI.\n- // If we're in the Lantern case and `timestamp` isn't available, we just have to rely on the\n- // graph simulation doing the right thing.\n- const ttiTimestamp = firstInteractive.timestamp ? firstInteractive.timestamp / 1e6 : Infinity;\n-\n- const items = Array.from(resultsMap.values()).filter(item => {\n- const isWasteful =\n- item.wastedBytes > IGNORE_THRESHOLD_IN_BYTES &&\n- item.wastedPercent > IGNORE_THRESHOLD_IN_PERCENT;\n- const loadedEarly = item.requestStartTime < ttiTimestamp;\n- return isWasteful && loadedEarly;\n- });\n+ return artifacts.requestInteractive({trace, devtoolsLog, settings}).then(interactive => {\n+ const unfilteredResults = Array.from(resultsMap.values());\n+ const lanternInteractive = /** @type {LH.Artifacts.LanternMetric} */ (interactive);\n+ // Filter out images that were loaded after all CPU activity\n+ const items = context.settings.throttlingMethod === 'simulate' ?\n+ OffscreenImages.filterLanternResults(unfilteredResults, lanternInteractive) :\n+ // @ts-ignore - .timestamp will exist if throttlingMethod isn't lantern\n+ OffscreenImages.filterObservedResults(unfilteredResults, interactive.timestamp);\n/** @type {LH.Result.Audit.OpportunityDetails['headings']} */\nconst headings = [\n",
"new_path": "lighthouse-core/audits/byte-efficiency/offscreen-images.js",
"old_path": "lighthouse-core/audits/byte-efficiency/offscreen-images.js"
},
{
"change_type": "MODIFY",
"diff": "'use strict';\nconst Runner = require('../../../runner');\n-const ByteEfficiencyAudit = require('../../../audits/byte-efficiency/byte-efficiency-audit');\n+const ByteEfficiencyAudit_ = require('../../../audits/byte-efficiency/byte-efficiency-audit');\nconst NetworkNode = require('../../../lib/dependency-graph/network-node');\nconst CPUNode = require('../../../lib/dependency-graph/cpu-node');\nconst Simulator = require('../../../lib/dependency-graph/simulator/simulator');\n@@ -21,6 +21,12 @@ describe('Byte efficiency base audit', () => {\nlet graph;\nlet simulator;\n+ const ByteEfficiencyAudit = class extends ByteEfficiencyAudit_ {\n+ static get meta() {\n+ return {name: 'test'};\n+ }\n+ };\n+\nbeforeEach(() => {\nconst networkRecord = {\nrequestId: 1,\n",
"new_path": "lighthouse-core/test/audits/byte-efficiency/byte-efficiency-audit-test.js",
"old_path": "lighthouse-core/test/audits/byte-efficiency/byte-efficiency-audit-test.js"
},
{
"change_type": "MODIFY",
"diff": "const UnusedImages =\nrequire('../../../audits/byte-efficiency/offscreen-images.js');\n+const NetworkNode = require('../../../lib/dependency-graph/network-node');\n+const CPUNode = require('../../../lib/dependency-graph/cpu-node');\nconst assert = require('assert');\n/* eslint-env mocha */\n@@ -49,8 +51,13 @@ function generateInteractiveFunc(desiredTimeInSeconds) {\n}\ndescribe('OffscreenImages audit', () => {\n+ let context;\nconst DEFAULT_DIMENSIONS = {innerWidth: 1920, innerHeight: 1080};\n+ beforeEach(() => {\n+ context = {settings: {throttlingMethod: 'devtools'}};\n+ });\n+\nit('handles images without network record', () => {\nreturn UnusedImages.audit_({\nViewportDimensions: DEFAULT_DIMENSIONS,\n@@ -59,8 +66,8 @@ describe('OffscreenImages audit', () => {\n],\ntraces: {},\ndevtoolsLogs: {},\n- requestFirstCPUIdle: generateInteractiveFunc(2),\n- }, [], {}).then(auditResult => {\n+ requestInteractive: generateInteractiveFunc(2),\n+ }, [], context).then(auditResult => {\nassert.equal(auditResult.items.length, 0);\n});\n});\n@@ -77,8 +84,8 @@ describe('OffscreenImages audit', () => {\n],\ntraces: {},\ndevtoolsLogs: {},\n- requestFirstCPUIdle: generateInteractiveFunc(2),\n- }, [], {}).then(auditResult => {\n+ requestInteractive: generateInteractiveFunc(2),\n+ }, [], context).then(auditResult => {\nassert.equal(auditResult.items.length, 0);\n});\n});\n@@ -101,8 +108,8 @@ describe('OffscreenImages audit', () => {\n],\ntraces: {},\ndevtoolsLogs: {},\n- requestFirstCPUIdle: generateInteractiveFunc(2),\n- }, [], {}).then(auditResult => {\n+ requestInteractive: generateInteractiveFunc(2),\n+ }, [], context).then(auditResult => {\nassert.equal(auditResult.items.length, 4);\n});\n});\n@@ -115,9 +122,10 @@ describe('OffscreenImages audit', () => {\n],\ntraces: {},\ndevtoolsLogs: {},\n- requestFirstCPUIdle: generateInteractiveFunc(2),\n- }, [], {}).then(auditResult => {\n+ requestInteractive: generateInteractiveFunc(2),\n+ }, [], context).then(auditResult => {\nassert.equal(auditResult.items.length, 1);\n+ assert.equal(auditResult.items[0].wastedBytes, 100 * 1024);\n});\n});\n@@ -133,8 +141,8 @@ describe('OffscreenImages audit', () => {\n],\ntraces: {},\ndevtoolsLogs: {},\n- requestFirstCPUIdle: generateInteractiveFunc(2),\n- }, [], {}).then(auditResult => {\n+ requestInteractive: generateInteractiveFunc(2),\n+ }, [], context).then(auditResult => {\nassert.equal(auditResult.items.length, 1);\n});\n});\n@@ -148,9 +156,38 @@ describe('OffscreenImages audit', () => {\n],\ntraces: {},\ndevtoolsLogs: {},\n- requestFirstCPUIdle: generateInteractiveFunc(2),\n- }, [], {}, [], {}).then(auditResult => {\n+ requestInteractive: generateInteractiveFunc(2),\n+ }, [], context, [], context).then(auditResult => {\nassert.equal(auditResult.items.length, 0);\n});\n});\n+\n+ it('disregards images loaded after last long task (Lantern)', () => {\n+ context = {settings: {throttlingMethod: 'simulate'}};\n+ const recordA = {url: 'a', resourceSize: 100 * 1024, requestId: 'a'};\n+ const recordB = {url: 'b', resourceSize: 100 * 1024, requestId: 'b'};\n+\n+ const networkA = new NetworkNode(recordA);\n+ const networkB = new NetworkNode(recordB);\n+ const cpu = new CPUNode({}, []);\n+ const timings = new Map([\n+ [networkA, {startTime: 1000}],\n+ [networkB, {startTime: 2000}],\n+ [cpu, {startTime: 1975, endTime: 2025, duration: 50}],\n+ ]);\n+\n+ return UnusedImages.audit_({\n+ ViewportDimensions: DEFAULT_DIMENSIONS,\n+ ImageUsage: [\n+ generateImage(generateSize(0, 0), [0, 0], recordA, recordA.url),\n+ generateImage(generateSize(200, 200), [3000, 0], recordB, recordB.url),\n+ ],\n+ traces: {},\n+ devtoolsLogs: {},\n+ requestInteractive: async () => ({pessimisticEstimate: {nodeTimings: timings}}),\n+ }, [], context, [], context).then(auditResult => {\n+ assert.equal(auditResult.items.length, 1);\n+ assert.equal(auditResult.items[0].url, 'a');\n+ });\n+ });\n});\n",
"new_path": "lighthouse-core/test/audits/byte-efficiency/offscreen-images-test.js",
"old_path": "lighthouse-core/test/audits/byte-efficiency/offscreen-images-test.js"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core(offscreen-images): add lantern filter (#5361) | 1 | core | offscreen-images |
791,690 | 13.06.2018 14:28:49 | 25,200 | deaf6073e6de79504f060f1200292a99946f09f7 | core(audit-mode): do not require a URL | [
{
"change_type": "MODIFY",
"diff": "@@ -136,9 +136,13 @@ function getFlags(manualArgv) {\n.default('port', 0)\n.default('hostname', 'localhost')\n.check(/** @param {!LH.Flags} argv */ (argv) => {\n- // Make sure lighthouse has been passed a url, or at least one of --list-all-audits\n- // or --list-trace-categories. If not, stop the program and ask for a url\n- if (!argv.listAllAudits && !argv.listTraceCategories && argv._.length === 0) {\n+ // Lighthouse doesn't need a URL if...\n+ // - We're in auditMode (and we have artifacts already)\n+ // - We're just listing the available options.\n+ // If one of these don't apply, stop the program and ask for a url.\n+ const isListMode = argv.listAllAudits || argv.listTraceCategories;\n+ const isOnlyAuditMode = !!argv.auditMode && !argv.gatherMode;\n+ if (!isListMode && !isOnlyAuditMode && argv._.length === 0) {\nthrow new Error('Please provide a url');\n}\n",
"new_path": "lighthouse-cli/cli-flags.js",
"old_path": "lighthouse-cli/cli-flags.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -23,7 +23,7 @@ const Connection = require('./gather/connections/connection.js'); // eslint-disa\nclass Runner {\n/**\n* @param {Connection} connection\n- * @param {{config: LH.Config, url: string, driverMock?: Driver}} opts\n+ * @param {{config: LH.Config, url?: string, driverMock?: Driver}} opts\n* @return {Promise<LH.RunnerResult|undefined>}\n*/\nstatic async run(connection, opts) {\n@@ -37,19 +37,6 @@ class Runner {\n*/\nconst lighthouseRunWarnings = [];\n- // save the requestedUrl provided by the user\n- const rawRequestedUrl = opts.url;\n- if (typeof rawRequestedUrl !== 'string' || rawRequestedUrl.length === 0) {\n- throw new Error(`You must provide a url to the runner. '${rawRequestedUrl}' provided.`);\n- }\n-\n- let parsedURL;\n- try {\n- parsedURL = new URL(opts.url);\n- } catch (e) {\n- throw new Error('The url provided should have a proper protocol and hostname.');\n- }\n-\nconst sentryContext = Sentry.getContext();\n// @ts-ignore TODO(bckenny): Sentry type checking\nSentry.captureBreadcrumb({\n@@ -59,15 +46,6 @@ class Runner {\ndata: sentryContext && sentryContext.extra,\n});\n- // If the URL isn't https and is also not localhost complain to the user.\n- if (parsedURL.protocol !== 'https:' && parsedURL.hostname !== 'localhost') {\n- log.warn('Lighthouse', 'The URL provided should be on HTTPS');\n- log.warn('Lighthouse', 'Performance stats will be skewed redirecting from HTTP to HTTPS.');\n- }\n-\n- // canonicalize URL with any trailing slashes neccessary\n- const requestedUrl = parsedURL.href;\n-\n// User can run -G solo, -A solo, or -GA together\n// -G and -A will run partial lighthouse pipelines,\n// and -GA will run everything plus save artifacts to disk\n@@ -75,11 +53,31 @@ class Runner {\n// Gather phase\n// Either load saved artifacts off disk or from the browser\nlet artifacts;\n+ let requestedUrl;\nif (settings.auditMode && !settings.gatherMode) {\n// No browser required, just load the artifacts from disk.\nconst path = Runner._getArtifactsPath(settings);\nartifacts = await assetSaver.loadArtifacts(path);\n+ requestedUrl = artifacts.URL.requestedUrl;\n+\n+ if (!requestedUrl) {\n+ throw new Error('Cannot run audit mode on empty URL');\n+ }\n+ if (opts.url && opts.url !== requestedUrl) {\n+ throw new Error('Cannot run audit mode on different URL');\n+ }\n} else {\n+ if (typeof opts.url !== 'string' || opts.url.length === 0) {\n+ throw new Error(`You must provide a url to the runner. '${opts.url}' provided.`);\n+ }\n+\n+ try {\n+ // Use canonicalized URL (with trailing slashes and such)\n+ requestedUrl = new URL(opts.url).href;\n+ } catch (e) {\n+ throw new Error('The url provided should have a proper protocol and hostname.');\n+ }\n+\nartifacts = await Runner._gatherArtifactsFromBrowser(requestedUrl, opts, connection);\n// -G means save these to ./latest-run, etc.\nif (settings.gatherMode) {\n",
"new_path": "lighthouse-core/runner.js",
"old_path": "lighthouse-core/runner.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -29,7 +29,7 @@ trap teardown EXIT\ncolorText \"Generating a fresh LHR...\" \"$purple\"\nset -x\n# TODO(phulce): add a lantern LHR-differ\n-node \"$lhroot_path/lighthouse-cli\" -A=\"$lhroot_path/lighthouse-core/test/results/artifacts\" --throttling-method=devtools --quiet --output=json --output-path=\"$freshLHRPath\" http://localhost/dobetterweb/dbw_tester.html\n+node \"$lhroot_path/lighthouse-cli\" -A=\"$lhroot_path/lighthouse-core/test/results/artifacts\" --throttling-method=devtools --quiet --output=json --output-path=\"$freshLHRPath\"\nset +x\n# remove timing from both\n",
"new_path": "lighthouse-core/scripts/assert-golden-lhr-unchanged.sh",
"old_path": "lighthouse-core/scripts/assert-golden-lhr-unchanged.sh"
},
{
"change_type": "MODIFY",
"diff": "\"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3358.0 Safari/537.36\",\n\"lighthouseVersion\": \"3.0.0-beta.0\",\n\"fetchTime\": \"2018-03-13T00:55:45.840Z\",\n- \"requestedUrl\": \"http://localhost/dobetterweb/dbw_tester.html\",\n+ \"requestedUrl\": \"http://localhost:10200/dobetterweb/dbw_tester.html\",\n\"finalUrl\": \"http://localhost:10200/dobetterweb/dbw_tester.html\",\n\"runWarnings\": [],\n\"audits\": {\n",
"new_path": "lighthouse-core/test/results/sample_v2.json",
"old_path": "lighthouse-core/test/results/sample_v2.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -72,7 +72,7 @@ describe('Runner', () => {\n// uses the files on disk from the -G test. ;)\nit('-A audits from saved artifacts and doesn\\'t gather', () => {\n- const opts = {url, config: generateConfig({auditMode: artifactsPath}), driverMock};\n+ const opts = {config: generateConfig({auditMode: artifactsPath}), driverMock};\nreturn Runner.run(null, opts).then(_ => {\nassert.equal(loadArtifactsSpy.called, true, 'loadArtifacts was not called');\nassert.equal(gatherRunnerRunSpy.called, false, 'GatherRunner.run was called');\n@@ -83,7 +83,7 @@ describe('Runner', () => {\nit('-A throws if the settings change', async () => {\nconst settings = {auditMode: artifactsPath, disableDeviceEmulation: true};\n- const opts = {url, config: generateConfig(settings), driverMock};\n+ const opts = {config: generateConfig(settings), driverMock};\ntry {\nawait Runner.run(null, opts);\nassert.fail('should have thrown');\n@@ -92,6 +92,17 @@ describe('Runner', () => {\n}\n});\n+ it('-A throws if the URL changes', async () => {\n+ const settings = {auditMode: artifactsPath, disableDeviceEmulation: true};\n+ const opts = {url: 'https://example.com', config: generateConfig(settings), driverMock};\n+ try {\n+ await Runner.run(null, opts);\n+ assert.fail('should have thrown');\n+ } catch (err) {\n+ assert.ok(/different URL/.test(err.message), 'should have prevented run');\n+ }\n+ });\n+\nit('-GA is a normal run but it saves artifacts to disk', () => {\nconst settings = {auditMode: artifactsPath, gatherMode: artifactsPath};\nconst opts = {url, config: generateConfig(settings), driverMock};\n@@ -187,8 +198,6 @@ describe('Runner', () => {\n});\nit('accepts trace artifacts as paths and outputs appropriate data', () => {\n- const url = 'https://example.com/';\n-\nconst config = new Config({\nsettings: {\nauditMode: __dirname + '/fixtures/artifacts/perflog/',\n@@ -198,7 +207,7 @@ describe('Runner', () => {\n],\n});\n- return Runner.run({}, {url, config}).then(results => {\n+ return Runner.run({}, {config}).then(results => {\nconst audits = results.lhr.audits;\nassert.equal(audits['user-timings'].displayValue[1], 2);\nassert.equal(audits['user-timings'].rawValue, false);\n@@ -233,7 +242,6 @@ describe('Runner', () => {\ndescribe('Bad required artifact handling', () => {\nit('outputs an error audit result when trace required but not provided', () => {\n- const url = 'https://example.com';\nconst config = new Config({\nsettings: {\nauditMode: __dirname + '/fixtures/artifacts/empty-artifacts/',\n@@ -244,7 +252,7 @@ describe('Runner', () => {\n],\n});\n- return Runner.run({}, {url, config}).then(results => {\n+ return Runner.run({}, {config}).then(results => {\nconst auditResult = results.lhr.audits['user-timings'];\nassert.strictEqual(auditResult.rawValue, null);\nassert.strictEqual(auditResult.scoreDisplayMode, 'error');\n@@ -253,7 +261,6 @@ describe('Runner', () => {\n});\nit('outputs an error audit result when missing a required artifact', () => {\n- const url = 'https://example.com';\nconst config = new Config({\nsettings: {\nauditMode: __dirname + '/fixtures/artifacts/empty-artifacts/',\n@@ -264,7 +271,7 @@ describe('Runner', () => {\n],\n});\n- return Runner.run({}, {url, config}).then(results => {\n+ return Runner.run({}, {config}).then(results => {\nconst auditResult = results.lhr.audits['content-width'];\nassert.strictEqual(auditResult.rawValue, null);\nassert.strictEqual(auditResult.scoreDisplayMode, 'error');\n@@ -312,7 +319,6 @@ describe('Runner', () => {\nit('produces an error audit result when an audit throws a non-fatal Error', () => {\nconst errorMessage = 'Audit yourself';\n- const url = 'https://example.com';\nconst config = new Config({\nsettings: {\nauditMode: __dirname + '/fixtures/artifacts/empty-artifacts/',\n@@ -329,7 +335,7 @@ describe('Runner', () => {\n],\n});\n- return Runner.run({}, {url, config}).then(results => {\n+ return Runner.run({}, {config}).then(results => {\nconst auditResult = results.lhr.audits['throwy-audit'];\nassert.strictEqual(auditResult.rawValue, null);\nassert.strictEqual(auditResult.scoreDisplayMode, 'error');\n@@ -339,7 +345,6 @@ describe('Runner', () => {\nit('rejects if an audit throws a fatal error', () => {\nconst errorMessage = 'Uh oh';\n- const url = 'https://example.com';\nconst config = new Config({\nsettings: {\nauditMode: __dirname + '/fixtures/artifacts/empty-artifacts/',\n@@ -358,14 +363,13 @@ describe('Runner', () => {\n],\n});\n- return Runner.run({}, {url, config}).then(\n+ return Runner.run({}, {config}).then(\n_ => assert.ok(false),\nerr => assert.strictEqual(err.message, errorMessage));\n});\n});\nit('accepts devtoolsLog in artifacts', () => {\n- const url = 'https://example.com';\nconst config = new Config({\nsettings: {\nauditMode: __dirname + '/fixtures/artifacts/perflog/',\n@@ -375,7 +379,7 @@ describe('Runner', () => {\n],\n});\n- return Runner.run({}, {url, config}).then(results => {\n+ return Runner.run({}, {config}).then(results => {\nconst audits = results.lhr.audits;\nassert.equal(audits['critical-request-chains'].displayValue, '5 chains found');\nassert.equal(audits['critical-request-chains'].rawValue, false);\n@@ -487,7 +491,6 @@ describe('Runner', () => {\n});\nit('results include artifacts when given artifacts and audits', () => {\n- const url = 'https://example.com';\nconst config = new Config({\nsettings: {\nauditMode: __dirname + '/fixtures/artifacts/perflog/',\n@@ -497,7 +500,7 @@ describe('Runner', () => {\n],\n});\n- return Runner.run({}, {url, config}).then(results => {\n+ return Runner.run({}, {config}).then(results => {\nassert.strictEqual(results.artifacts.ViewportDimensions.innerWidth, 412);\nassert.strictEqual(results.artifacts.ViewportDimensions.innerHeight, 732);\n});\n@@ -528,7 +531,6 @@ describe('Runner', () => {\n});\nit('includes any LighthouseRunWarnings from artifacts in output', () => {\n- const url = 'https://example.com';\nconst config = new Config({\nsettings: {\nauditMode: __dirname + '/fixtures/artifacts/perflog/',\n@@ -536,7 +538,7 @@ describe('Runner', () => {\naudits: [],\n});\n- return Runner.run(null, {url, config, driverMock}).then(results => {\n+ return Runner.run(null, {config, driverMock}).then(results => {\nassert.deepStrictEqual(results.lhr.runWarnings, [\n'I\\'m a warning!',\n'Also a warning',\n",
"new_path": "lighthouse-core/test/runner-test.js",
"old_path": "lighthouse-core/test/runner-test.js"
},
{
"change_type": "MODIFY",
"diff": "\"changelog\": \"conventional-changelog --config ./build/changelog-generator/index.js --infile changelog.md --same-file\",\n\"type-check\": \"tsc -p . && cd ./lighthouse-viewer && yarn type-check\",\n\"update:sample-artifacts\": \"node lighthouse-core/scripts/update-report-fixtures.js -G\",\n- \"update:sample-json\": \"node ./lighthouse-cli -A=./lighthouse-core/test/results/artifacts --throttling-method=devtools --output=json --output-path=./lighthouse-core/test/results/sample_v2.json http://localhost/dobetterweb/dbw_tester.html && node lighthouse-core/scripts/cleanup-LHR-for-diff.js ./lighthouse-core/test/results/sample_v2.json --only-remove-timing\",\n+ \"update:sample-json\": \"node ./lighthouse-cli -A=./lighthouse-core/test/results/artifacts --throttling-method=devtools --output=json --output-path=./lighthouse-core/test/results/sample_v2.json && node lighthouse-core/scripts/cleanup-LHR-for-diff.js ./lighthouse-core/test/results/sample_v2.json --only-remove-timing\",\n\"diff:sample-json\": \"bash lighthouse-core/scripts/assert-golden-lhr-unchanged.sh\",\n\"update:crdp-typings\": \"node lighthouse-core/scripts/extract-crdp-mapping.js\",\n\"mixed-content\": \"./lighthouse-cli/index.js --chrome-flags='--headless' --config-path=./lighthouse-core/config/mixed-content.js\",\n",
"new_path": "package.json",
"old_path": "package.json"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core(audit-mode): do not require a URL (#5495) | 1 | core | audit-mode |
730,412 | 13.06.2018 14:31:43 | 0 | 86eb31356deed34d0a32ca800c2fd336732e844a | chore(release): 0.1.309 | [
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.1.309\"></a>\n+## [0.1.309](https://github.com/webex/react-ciscospark/compare/v0.1.308...v0.1.309) (2018-06-13)\n+\n+\n+### Bug Fixes\n+\n+* **r-c-activity-item-base:** delete message button not displayed for long messages ([caed5eb](https://github.com/webex/react-ciscospark/commit/caed5eb))\n+\n+\n+\n<a name=\"0.1.308\"></a>\n## [0.1.308](https://github.com/webex/react-ciscospark/compare/v0.1.307...v0.1.308) (2018-06-12)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@ciscospark/react-ciscospark\",\n- \"version\": \"0.1.308\",\n+ \"version\": \"0.1.309\",\n\"description\": \"The Cisco Spark for React library allows developers to easily incorporate Spark functionality into an application.\",\n\"scripts\": {\n\"build\": \"./scripts/build/index.js\",\n",
"new_path": "package.json",
"old_path": "package.json"
}
] | JavaScript | MIT License | webex/react-widgets | chore(release): 0.1.309 | 1 | chore | release |
217,922 | 13.06.2018 16:04:30 | -7,200 | 76261c51b9f1c81765dd9428dcea35b59ac2ead3 | feat(simulator): it is now possible to create folders to organize rotations
closes | [
{
"change_type": "ADD",
"diff": "+<mat-expansion-panel class=\"rotation-panel\">\n+ <mat-expansion-panel-header>\n+ <mat-panel-title>\n+ {{rotation.getName()}}\n+ <button mat-icon-button (click)=\"$event.stopPropagation(); editNameClick.emit()\">\n+ <mat-icon>mode_edit</mat-icon>\n+ </button>\n+ </mat-panel-title>\n+ <button mat-icon-button *ngIf=\"linkButton\"\n+ matTooltip=\"{{'CUSTOM_LINKS.Add_link' | translate}}\" matTooltipPosition=\"above\"\n+ (click)=\"$event.stopPropagation(); linkClick.emit()\">\n+ <mat-icon>link</mat-icon>\n+ </button>\n+ <button mat-icon-button ngxClipboard [cbContent]=\"getLink(rotation)\"\n+ (click)=\"$event.stopPropagation()\"\n+ matTooltip=\"{{'Share' | translate}}\" matTooltipPosition=\"above\"\n+ (cbOnSuccess)=\"showCopiedNotification()\">\n+ <mat-icon>share</mat-icon>\n+ </button>\n+ <button mat-icon-button\n+ routerLink=\"{{getLocalLink(rotation)}}\"\n+ (click)=\"$event.stopPropagation()\">\n+ <mat-icon>playlist_play</mat-icon>\n+ </button>\n+ <button mat-icon-button (click)=\"deleteClick.emit()\">\n+ <mat-icon>delete</mat-icon>\n+ </button>\n+ </mat-expansion-panel-header>\n+ <div class=\"content\">\n+ <app-action *ngFor=\"let step of getSteps(rotation)\" [action]=\"step\" [hideCost]=\"true\"\n+ [jobId]=\"rotation.recipe.job\"></app-action>\n+ </div>\n+</mat-expansion-panel>\n",
"new_path": "src/app/pages/simulator/components/rotation-panel/rotation-panel.component.html",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+mat-panel-title {\n+ display: flex;\n+ align-items: center;\n+}\n+\n+.content {\n+ display: flex;\n+ flex-wrap: wrap;\n+}\n+\n+.rotation-panel {\n+ margin: 10px 0;\n+}\n",
"new_path": "src/app/pages/simulator/components/rotation-panel/rotation-panel.component.scss",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import {Component, EventEmitter, Input, Output} from '@angular/core';\n+import {CraftingRotation} from '../../../../model/other/crafting-rotation';\n+import {LinkToolsService} from '../../../../core/tools/link-tools.service';\n+import {MatSnackBar} from '@angular/material';\n+import {TranslateService} from '@ngx-translate/core';\n+import {CraftingAction} from '../../model/actions/crafting-action';\n+import {CraftingActionsRegistry} from '../../model/crafting-actions-registry';\n+\n+@Component({\n+ selector: 'app-rotation-panel',\n+ templateUrl: './rotation-panel.component.html',\n+ styleUrls: ['./rotation-panel.component.scss']\n+})\n+export class RotationPanelComponent {\n+\n+ @Input()\n+ rotation: CraftingRotation;\n+\n+ @Output()\n+ editNameClick: EventEmitter<void> = new EventEmitter<void>();\n+\n+ @Output()\n+ linkClick: EventEmitter<void> = new EventEmitter<void>();\n+\n+ @Output()\n+ deleteClick: EventEmitter<void> = new EventEmitter<void>();\n+\n+ constructor(private linkTools: LinkToolsService, private snack: MatSnackBar, private translator: TranslateService,\n+ private craftingActionsRegistry: CraftingActionsRegistry) {\n+ }\n+\n+ public getLink(rotation: CraftingRotation): string {\n+ return this.linkTools.getLink(this.getLocalLink(rotation));\n+ }\n+\n+ private getLocalLink(rotation: CraftingRotation): string {\n+ let link = '/simulator';\n+ if (rotation.defaultItemId) {\n+ link += `/${rotation.defaultItemId}`;\n+ if (rotation.defaultRecipeId) {\n+ link += `/${rotation.defaultRecipeId}`;\n+ }\n+ } else {\n+ link += `/custom`;\n+ }\n+ return `${link}/${rotation.$key}`;\n+ }\n+\n+ public getSteps(rotation: CraftingRotation): CraftingAction[] {\n+ return this.craftingActionsRegistry.deserializeRotation(rotation.rotation);\n+ }\n+\n+ public showCopiedNotification(): void {\n+ this.snack.open(\n+ this.translator.instant('SIMULATOR.Share_link_copied'),\n+ '', {\n+ duration: 10000,\n+ panelClass: ['snack']\n+ });\n+ }\n+\n+}\n",
"new_path": "src/app/pages/simulator/components/rotation-panel/rotation-panel.component.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "+<div class=\"topbar\">\n<h1>{{'SIMULATOR.Rotations' | translate}}</h1>\n+ <div class=\"spacer\"></div>\n+ <div class=\"buttons\">\n+ <button mat-mini-fab (click)=\"newFolder()\" matTooltip=\"{{'SIMULATOR.New_rotation_folder' | translate}}\">\n+ <mat-icon>create_new_folder</mat-icon>\n+ </button>\n+ </div>\n+</div>\n<div *ngIf=\"rotations$ | async as rotations\">\n- <div *ngIf=\"rotations.length > 0; else noRotations\">\n- <mat-expansion-panel *ngFor=\"let rotation of rotations; trackBy: trackByRotation\" class=\"rotation-panel\">\n+ <div *ngIf=\"rotations.nofolder.length > 0 || rotations.folders.length > 0; else noRotations\">\n+ <div class=\"drop-zone\" droppable (onDrop)=\"removeFolder($event.dragData)\" [dropScope]=\"'rotation'\">\n+ <div class=\"drop-overlay accent-background\">\n+ <mat-icon>save_alt</mat-icon>\n+ </div>\n+ <div *ngFor=\"let rotation of rotations.nofolder; trackBy: trackByRotation\"\n+ draggable\n+ [dragScope]=\"'rotation'\"\n+ [dragData]=\"rotation\">\n+ <app-rotation-panel [rotation]=\"rotation\"\n+ (editNameClick)=\"editRotationName(rotation)\"\n+ (deleteClick)=\"deleteRotation(rotation.$key)\"\n+ (linkClick)=\"openLinkPopup(rotation)\"></app-rotation-panel>\n+ </div>\n+ </div>\n+\n+ <mat-divider></mat-divider>\n+ <div *ngFor=\"let folder of rotations.folders; trackBy: trackByFolder; let i = index\">\n+ <div class=\"drop-zone folder-zone\" droppable (onDrop)=\"setFolderIndex($event.dragData, i)\"\n+ [dropScope]=\"'folder'\">\n+ <div class=\"drop-overlay accent-background\">\n+ <mat-icon>save_alt</mat-icon>\n+ </div>\n+ </div>\n+ <mat-expansion-panel class=\"folder\" draggable [dragData]=\"folder.name\" [dragScope]=\"'folder'\">\n<mat-expansion-panel-header>\n<mat-panel-title>\n- {{rotation.getName()}}\n- <button mat-icon-button (click)=\"$event.preventDefault();editRotationName(rotation)\">\n+ <mat-icon class=\"folder-icon\">folder</mat-icon>\n+ {{folder.name}}\n+ <button mat-icon-button\n+ (click)=\"$event.stopPropagation();renameFolder(folder.name, folder.rotations)\">\n<mat-icon>mode_edit</mat-icon>\n</button>\n</mat-panel-title>\n- <button mat-icon-button *ngIf=\"linkButton\"\n- matTooltip=\"{{'CUSTOM_LINKS.Add_link' | translate}}\" matTooltipPosition=\"above\"\n- (click)=\"$event.stopPropagation(); openLinkPopup(rotation)\">\n- <mat-icon>link</mat-icon>\n- </button>\n- <button mat-icon-button ngxClipboard [cbContent]=\"getLink(rotation)\"\n- (click)=\"$event.stopPropagation()\"\n- matTooltip=\"{{'Share' | translate}}\" matTooltipPosition=\"above\"\n- (cbOnSuccess)=\"showCopiedNotification()\">\n- <mat-icon>share</mat-icon>\n- </button>\n<button mat-icon-button\n- routerLink=\"{{getLocalLink(rotation)}}\"\n- (click)=\"$event.stopPropagation()\">\n- <mat-icon>playlist_play</mat-icon>\n- </button>\n- <button mat-icon-button (click)=\"deleteRotation(rotation.$key)\">\n+ (click)=\"$event.stopPropagation();deleteFolder(folder.name, folder.rotations)\">\n<mat-icon>delete</mat-icon>\n</button>\n</mat-expansion-panel-header>\n- <div class=\"content\">\n- <app-action *ngFor=\"let step of getSteps(rotation)\" [action]=\"step\" [hideCost]=\"true\"\n- [jobId]=\"rotation.recipe.job\"></app-action>\n+ <div class=\"drop-zone\" droppable (onDrop)=\"onFolderDrop(folder.name, $event.dragData)\"\n+ [dropScope]=\"'rotation'\">\n+ <div class=\"drop-overlay accent-background\">\n+ <mat-icon>save_alt</mat-icon>\n+ </div>\n+ <div *ngFor=\"let rotation of folder.rotations; trackBy: trackByRotation\"\n+ draggable\n+ [dragScope]=\"'rotation'\"\n+ [dragData]=\"rotation\">\n+ <app-rotation-panel\n+ [rotation]=\"rotation\"\n+ (editNameClick)=\"editRotationName(rotation)\"\n+ (deleteClick)=\"deleteRotation(rotation.$key)\"\n+ (linkClick)=\"openLinkPopup(rotation)\"></app-rotation-panel>\n+ </div>\n</div>\n</mat-expansion-panel>\n</div>\n+ <div class=\"drop-zone folder-zone\" droppable\n+ (onDrop)=\"setFolderIndex($event.dragData, rotations.folders.length - 1)\"\n+ [dropScope]=\"'folder'\">\n+ <div class=\"drop-overlay accent-background\">\n+ <mat-icon>save_alt</mat-icon>\n+ </div>\n+ </div>\n+ </div>\n<ng-template #noRotations>\n<span class=\"no-rotations\">{{'SIMULATOR.No_rotations' | translate}}</span>\n</ng-template>\n",
"new_path": "src/app/pages/simulator/components/rotations-page/rotations-page.component.html",
"old_path": "src/app/pages/simulator/components/rotations-page/rotations-page.component.html"
},
{
"change_type": "MODIFY",
"diff": "-\n-mat-panel-title {\n+.topbar {\n+ width: 100%;\ndisplay: flex;\nalign-items: center;\n}\n-.content {\n- display: flex;\n- flex-wrap: wrap;\n-}\n-\n.no-rotations {\nwidth: 100%;\nfont-size: 2rem;\n@@ -21,6 +16,51 @@ mat-panel-title {\nwidth: 100%;\n}\n-.rotation-panel {\n- margin: 10px 0;\n+mat-panel-title {\n+ display: flex;\n+ align-items: center;\n+}\n+\n+.folder {\n+ .folder-icon {\n+ margin-right: 10px;\n+ }\n+}\n+\n+.drag-hint-border {\n+ border: 2px dashed;\n+}\n+\n+.drop-zone {\n+ min-height: 50px;\n+ position: relative;\n+ .drop-overlay {\n+ position: absolute;\n+ top: 0;\n+ left: 0;\n+ width: 100%;\n+ height: 100%;\n+ display: flex;\n+ align-items: center;\n+ justify-content: center;\n+ visibility: hidden;\n+ opacity: .6;\n+ .mat-icon {\n+ font-size: 45px;\n+ height: 45px;\n+ width: 45px;\n+ }\n+ }\n+ &.drag-over-border {\n+ .drop-overlay {\n+ visibility: visible;\n+ }\n+ }\n+}\n+\n+.folder-zone {\n+ min-height: 20px;\n+ .mat-icon {\n+ font-size: 20px;\n+ }\n}\n",
"new_path": "src/app/pages/simulator/components/rotations-page/rotations-page.component.scss",
"old_path": "src/app/pages/simulator/components/rotations-page/rotations-page.component.scss"
},
{
"change_type": "MODIFY",
"diff": "import {ChangeDetectionStrategy, Component} from '@angular/core';\nimport {CraftingRotationService} from '../../../../core/database/crafting-rotation.service';\nimport {CraftingRotation} from '../../../../model/other/crafting-rotation';\n-import {Observable} from 'rxjs';\n+import {combineLatest, Observable} from 'rxjs';\nimport {UserService} from '../../../../core/database/user.service';\n-import {CraftingAction} from '../../model/actions/crafting-action';\nimport {CraftingActionsRegistry} from '../../model/crafting-actions-registry';\nimport {MatDialog, MatSnackBar} from '@angular/material';\nimport {TranslateService} from '@ngx-translate/core';\n@@ -11,7 +10,6 @@ import {ConfirmationPopupComponent} from '../../../../modules/common-components/\nimport {CustomLink} from '../../../../core/database/custom-links/custom-link';\nimport {CustomLinkPopupComponent} from '../../../custom-links/custom-link-popup/custom-link-popup.component';\nimport {filter, first, map, mergeMap, tap} from 'rxjs/operators';\n-import {LinkToolsService} from '../../../../core/tools/link-tools.service';\nimport {RotationNamePopupComponent} from '../rotation-name-popup/rotation-name-popup.component';\nimport {NewFolderPopupComponent} from '../new-folder-popup/new-folder-popup.component';\nimport {CraftingRotationFolder} from './crafting-rotation-folder';\n@@ -30,32 +28,124 @@ export class RotationsPageComponent {\nconstructor(private rotationsService: CraftingRotationService, private userService: UserService,\nprivate craftingActionsRegistry: CraftingActionsRegistry, private snack: MatSnackBar,\n- private translator: TranslateService, private dialog: MatDialog, private linkTools: LinkToolsService) {\n+ private translator: TranslateService, private dialog: MatDialog) {\nthis.rotations$ = this.userService.getUserData()\n.pipe(\ntap(user => this.linkButton = user.admin || user.patron),\nmergeMap(user => {\n- return this.rotationsService.getUserRotations(user.$key);\n+ return this.rotationsService.getUserRotations(user.$key)\n+ .pipe(\n+ map(rotations => ({rotations: rotations, user: user}))\n+ );\n}),\n- map(rotations => {\n+ map(data => {\n+ const result = {nofolder: [], folders: []};\n+ let rotations = data.rotations;\n// Order rotations per folder\n- return rotations.reduce((result, rotation) => {\n- if (rotation.folder === undefined) {\n- result.nofolder.push(rotation);\n+ data.user.rotationFolders.forEach((folder) => {\n+ const matchingRotations = [];\n+ const otherRotations = [];\n+ rotations.forEach(rotation => {\n+ if (rotation.folder === folder) {\n+ matchingRotations.push(rotation);\n} else {\n- let folder = result.folders.find(f => f.name === rotation.folder);\n- if (folder === undefined) {\n- result.folders.push({name: rotation.folder, rotations: []});\n- folder = result.folders[result.folders.length];\n+ otherRotations.push(rotation);\n}\n- folder.rotations.push(rotation);\n+ });\n+ let match = result.folders.find(f => f.name === folder);\n+ if (match === undefined) {\n+ result.folders.push({name: folder, rotations: []});\n+ match = result.folders[result.folders.length - 1];\n}\n+ match.rotations.push(...matchingRotations);\n+ rotations = otherRotations;\n+ });\n+ // Once we moved everybody to its folder, populate the nofolder array with the remaining ones.\n+ result.nofolder.push(...rotations);\nreturn result;\n- }, {nofolder: [], folders: []});\n})\n);\n}\n+ deleteFolder(folderName: string, rotations: CraftingRotation[]): void {\n+ this.dialog.open(ConfirmationPopupComponent)\n+ .afterClosed()\n+ .pipe(\n+ filter(res => res),\n+ mergeMap(() => {\n+ return this.userService.getUserData()\n+ .pipe(\n+ first(),\n+ mergeMap(user => {\n+ user.rotationFolders = user.rotationFolders.filter(folder => folder !== folderName);\n+ return this.userService.set(user.$key, user);\n+ }),\n+ mergeMap(() => {\n+ rotations.forEach(r => delete r.folder);\n+ return combineLatest(rotations.map(rotation => this.rotationsService.set(rotation.$key, rotation)));\n+ })\n+ )\n+ }),\n+ ).subscribe();\n+ }\n+\n+ trackByFolder(index: number, folder: { name: string, rotations: CraftingRotation[] }): string {\n+ return folder.name;\n+ }\n+\n+ onFolderDrop(folderName: string, rotation: CraftingRotation): void {\n+ rotation.folder = folderName;\n+ this.rotationsService.set(rotation.$key, rotation).subscribe();\n+ }\n+\n+ removeFolder(rotation: CraftingRotation): void {\n+ delete rotation.folder;\n+ this.rotationsService.set(rotation.$key, rotation).subscribe();\n+ }\n+\n+ renameFolder(folderName: string, rotations: CraftingRotation[]): void {\n+ this.dialog.open(NewFolderPopupComponent, {data: folderName})\n+ .afterClosed()\n+ .pipe(\n+ filter(name => name !== '' && name !== undefined && name !== null),\n+ mergeMap(newName => {\n+ return this.userService.getUserData()\n+ .pipe(\n+ first(),\n+ map(user => {\n+ user.rotationFolders = user.rotationFolders.filter(folder => folder !== folderName);\n+ user.rotationFolders.push(newName);\n+ return user;\n+ }),\n+ mergeMap(user => {\n+ return this.userService.set(user.$key, user);\n+ }),\n+ mergeMap(() => {\n+ return combineLatest(rotations.map(rotation => {\n+ rotation.folder = newName;\n+ return this.rotationsService.set(rotation.$key, rotation);\n+ }));\n+ })\n+ )\n+ })\n+ ).subscribe();\n+ }\n+\n+ setFolderIndex(folderName: string, index: number): void {\n+ this.userService.getUserData()\n+ .pipe(\n+ first(),\n+ map(user => {\n+ user.rotationFolders = user.rotationFolders.filter(folder => folder !== folderName);\n+ user.rotationFolders.splice(index, 0, folderName);\n+ return user;\n+ }),\n+ mergeMap(user => {\n+ return this.userService.set(user.$key, user);\n+ })\n+ ).subscribe()\n+ }\n+\neditRotationName(rotation: CraftingRotation): void {\nthis.dialog.open(RotationNamePopupComponent, {data: rotation})\n.afterClosed()\n@@ -69,10 +159,6 @@ export class RotationsPageComponent {\n).subscribe();\n}\n- public getSteps(rotation: CraftingRotation): CraftingAction[] {\n- return this.craftingActionsRegistry.deserializeRotation(rotation.rotation);\n- }\n-\ntrackByRotation(index: number, rotation: CraftingRotation): string {\nreturn rotation.$key;\n}\n@@ -92,24 +178,7 @@ export class RotationsPageComponent {\nthis.dialog.open(CustomLinkPopupComponent, {data: link});\n}\n- public getLink(rotation: CraftingRotation): string {\n- return this.linkTools.getLink(this.getLocalLink(rotation));\n- }\n-\n- private getLocalLink(rotation: CraftingRotation): string {\n- let link = '/simulator';\n- if (rotation.defaultItemId) {\n- link += `/${rotation.defaultItemId}`;\n- if (rotation.defaultRecipeId) {\n- link += `/${rotation.defaultRecipeId}`;\n- }\n- } else {\n- link += `/custom`;\n- }\n- return `${link}/${rotation.$key}`;\n- }\n-\n- nelder(): void {\n+ newFolder(): void {\nthis.dialog.open(NewFolderPopupComponent)\n.afterClosed()\n.pipe(\n@@ -132,17 +201,21 @@ export class RotationsPageComponent {\n).subscribe();\n}\n+ private getLocalLink(rotation: CraftingRotation): string {\n+ let link = '/simulator';\n+ if (rotation.defaultItemId) {\n+ link += `/${rotation.defaultItemId}`;\n+ if (rotation.defaultRecipeId) {\n+ link += `/${rotation.defaultRecipeId}`;\n+ }\n+ } else {\n+ link += `/custom`;\n+ }\n+ return `${link}/${rotation.$key}`;\n+ }\n+\nsetFolder(rotation: CraftingRotation, folder: string): void {\nrotation.folder = folder;\nthis.rotationsService.set(rotation.$key, rotation).subscribe();\n}\n-\n- public showCopiedNotification(): void {\n- this.snack.open(\n- this.translator.instant('SIMULATOR.Share_link_copied'),\n- '', {\n- duration: 10000,\n- panelClass: ['snack']\n- });\n- }\n}\n",
"new_path": "src/app/pages/simulator/components/rotations-page/rotations-page.component.ts",
"old_path": "src/app/pages/simulator/components/rotations-page/rotations-page.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -44,6 +44,7 @@ import {RotationNamePopupComponent} from './components/rotation-name-popup/rotat\nimport {StepByStepReportPopupComponent} from './components/step-by-step-report-popup/step-by-step-report-popup.component';\nimport {RecipeChoicePopupComponent} from './components/recipe-choice-popup/recipe-choice-popup.component';\nimport {NewFolderPopupComponent} from './components/new-folder-popup/new-folder-popup.component';\n+import {RotationPanelComponent} from './components/rotation-panel/rotation-panel.component';\nconst routes: Routes = [\n{\n@@ -126,7 +127,8 @@ const routes: Routes = [\nRotationNamePopupComponent,\nStepByStepReportPopupComponent,\nRecipeChoicePopupComponent,\n- NewFolderPopupComponent\n+ NewFolderPopupComponent,\n+ RotationPanelComponent\n],\nentryComponents: [\nImportRotationPopupComponent,\n",
"new_path": "src/app/pages/simulator/simulator.module.ts",
"old_path": "src/app/pages/simulator/simulator.module.ts"
},
{
"change_type": "MODIFY",
"diff": "\"Save_as_new\": \"Save as new (navigates to the newly created rotation)\",\n\"Save_as_new_done\": \"You're now on a copy of your rotation\",\n\"Change_rotation\": \"Change rotation\",\n+ \"New_rotation_folder\": \"New folder\",\n\"CUSTOM\": {\n\"Recipe_configuration\": \"Recipe configuration\",\n\"Recipe_level\": \"Recipe level\",\n",
"new_path": "src/assets/i18n/en.json",
"old_path": "src/assets/i18n/en.json"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | feat(simulator): it is now possible to create folders to organize rotations
closes #404 | 1 | feat | simulator |
730,429 | 13.06.2018 16:59:34 | 14,400 | 5d44ac33d810b053ea5959be344b86bf6bf3045d | feat(widget-message): add destination prop support | [
{
"change_type": "MODIFY",
"diff": "@@ -72,6 +72,59 @@ import {eventNames as defaultEventNames} from './events';\nimport {handleConversationActivityEvent} from './helpers';\n+import {destinationTypes} from './';\n+\n+\n+const injectedPropTypes = {\n+ avatar: PropTypes.object.isRequired,\n+ activity: PropTypes.object.isRequired,\n+ conversation: PropTypes.object.isRequired,\n+ flags: PropTypes.object.isRequired,\n+ sparkInstance: PropTypes.object,\n+ user: PropTypes.object.isRequired,\n+ widgetMessage: PropTypes.object.isRequired,\n+ acknowledgeActivityOnServer: PropTypes.func.isRequired,\n+ addFiles: PropTypes.func.isRequired,\n+ confirmDeleteActivity: PropTypes.func.isRequired,\n+ createConversation: PropTypes.func.isRequired,\n+ createNotification: PropTypes.func.isRequired,\n+ deleteActivityAndDismiss: PropTypes.func.isRequired,\n+ fetchAvatarsForUsers: PropTypes.func.isRequired,\n+ fetchFlags: PropTypes.func.isRequired,\n+ flagActivity: PropTypes.func.isRequired,\n+ getConversation: PropTypes.func.isRequired,\n+ hideDeleteModal: PropTypes.func.isRequired,\n+ loadMissingActivities: PropTypes.func.isRequired,\n+ loadPreviousMessages: PropTypes.func.isRequired,\n+ removeFlagFromServer: PropTypes.func.isRequired,\n+ retryFailedActivity: PropTypes.func.isRequired,\n+ removeInflightActivity: PropTypes.func.isRequired,\n+ setScrollPosition: PropTypes.func.isRequired,\n+ setScrolledUp: PropTypes.func.isRequired,\n+ setTyping: PropTypes.func.isRequired,\n+ showScrollToBottomButton: PropTypes.func.isRequired,\n+ updateHasNewMessage: PropTypes.func.isRequired,\n+ updateWidgetState: PropTypes.func.isRequired,\n+ space: PropTypes.object.isRequired,\n+ features: PropTypes.object.isRequired,\n+ getFeature: PropTypes.func.isRequired,\n+ participants: PropTypes.array.isRequired,\n+ activities: PropTypes.object.isRequired,\n+ conversationId: PropTypes.string\n+};\n+\n+export const ownPropTypes = {\n+ destination: PropTypes.shape({\n+ // Email or Hydra ID\n+ id: PropTypes.string.isRequired,\n+ type: PropTypes.oneOf(['email', 'spaceId', 'userId'])\n+ }).isRequired,\n+ hasAcknowledgementsDisabled: PropTypes.bool,\n+ muteNotifications: PropTypes.bool,\n+ onEvent: PropTypes.func,\n+ eventNames: PropTypes.object\n+};\n+\n/**\n* MessageWidget Container\n* @extends Component\n@@ -302,9 +355,7 @@ export class MessageWidget extends Component {\n*/\nestablishConversation(props) {\nconst {\n- toPersonEmail,\n- toPersonId,\n- spaceId,\n+ destination,\nsparkInstance,\nsparkState,\nconversation,\n@@ -320,11 +371,11 @@ export class MessageWidget extends Component {\nif (sparkInstance && authenticated) {\n// Check if conversation has been retrieved\nif (registered && !conversationId && !conversation.getIn(['status', 'isFetching'])) {\n- if (toPersonId || toPersonEmail) {\n- props.createConversation([toPersonId || toPersonEmail], sparkInstance);\n+ if (destination.type === destinationTypes.SPACEID) {\n+ props.getConversation(destination.id, sparkInstance);\n}\n- else if (spaceId) {\n- props.getConversation(spaceId, sparkInstance);\n+ if (destination.type === destinationTypes.EMAIL || destination.type === destinationTypes.USERID) {\n+ props.createConversation([destination.id], sparkInstance);\n}\n}\n}\n@@ -706,53 +757,6 @@ export class MessageWidget extends Component {\n}\n}\n-const injectedPropTypes = {\n- avatar: PropTypes.object.isRequired,\n- activity: PropTypes.object.isRequired,\n- conversation: PropTypes.object.isRequired,\n- flags: PropTypes.object.isRequired,\n- sparkInstance: PropTypes.object,\n- user: PropTypes.object.isRequired,\n- widgetMessage: PropTypes.object.isRequired,\n- acknowledgeActivityOnServer: PropTypes.func.isRequired,\n- addFiles: PropTypes.func.isRequired,\n- confirmDeleteActivity: PropTypes.func.isRequired,\n- createConversation: PropTypes.func.isRequired,\n- createNotification: PropTypes.func.isRequired,\n- deleteActivityAndDismiss: PropTypes.func.isRequired,\n- fetchAvatarsForUsers: PropTypes.func.isRequired,\n- fetchFlags: PropTypes.func.isRequired,\n- flagActivity: PropTypes.func.isRequired,\n- getConversation: PropTypes.func.isRequired,\n- hideDeleteModal: PropTypes.func.isRequired,\n- loadMissingActivities: PropTypes.func.isRequired,\n- loadPreviousMessages: PropTypes.func.isRequired,\n- removeFlagFromServer: PropTypes.func.isRequired,\n- retryFailedActivity: PropTypes.func.isRequired,\n- removeInflightActivity: PropTypes.func.isRequired,\n- setScrollPosition: PropTypes.func.isRequired,\n- setScrolledUp: PropTypes.func.isRequired,\n- setTyping: PropTypes.func.isRequired,\n- showScrollToBottomButton: PropTypes.func.isRequired,\n- updateHasNewMessage: PropTypes.func.isRequired,\n- updateWidgetState: PropTypes.func.isRequired,\n- space: PropTypes.object.isRequired,\n- features: PropTypes.object.isRequired,\n- participants: PropTypes.array.isRequired,\n- activities: PropTypes.object.isRequired,\n- conversationId: PropTypes.string\n-};\n-\n-export const ownPropTypes = {\n- hasAcknowledgementsDisabled: PropTypes.bool,\n- muteNotifications: PropTypes.bool,\n- onEvent: PropTypes.func,\n- spaceId: PropTypes.string,\n- toPersonEmail: PropTypes.string,\n- toPersonId: PropTypes.string,\n- eventNames: PropTypes.object\n-};\n-\nMessageWidget.propTypes = {\n...ownPropTypes,\n...injectedPropTypes\n",
"new_path": "packages/node_modules/@ciscospark/widget-message/src/container.js",
"old_path": "packages/node_modules/@ciscospark/widget-message/src/container.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -8,6 +8,12 @@ import messages from './translations/en';\nexport {reducers};\n+export const destinationTypes = {\n+ EMAIL: 'email',\n+ USERID: 'userId',\n+ SPACEID: 'spaceId'\n+};\n+\nexport default compose(\nconstructSparkEnhancer({\nname: 'message',\n",
"new_path": "packages/node_modules/@ciscospark/widget-message/src/index.js",
"old_path": "packages/node_modules/@ciscospark/widget-message/src/index.js"
}
] | JavaScript | MIT License | webex/react-widgets | feat(widget-message): add destination prop support | 1 | feat | widget-message |
730,429 | 13.06.2018 17:00:05 | 14,400 | b0f3ffe188e4fc0ca152497bc7638fa808bf4b2f | feat(widget-meet): add destination support | [
{
"change_type": "MODIFY",
"diff": "@@ -28,8 +28,12 @@ const injectedPropTypes = {\n};\nexport const ownPropTypes = {\n- to: PropTypes.string,\ncall: PropTypes.object,\n+ destination: PropTypes.shape({\n+ // Email or Hydra ID\n+ id: PropTypes.string.isRequired,\n+ type: PropTypes.oneOf(['email', 'spaceId', 'userId'])\n+ }).isRequired,\neventNames: PropTypes.object,\nmuteNotifications: PropTypes.bool,\nonEvent: PropTypes.func,\n",
"new_path": "packages/node_modules/@ciscospark/widget-meet/src/container.js",
"old_path": "packages/node_modules/@ciscospark/widget-meet/src/container.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -3,14 +3,14 @@ import withErrors from './withErrors';\nimport withWebRtcSupport from './withWebRtcSupport';\nimport withEventHandler from './withEventHandler';\nimport withCallHandlers from './withCallHandlers';\n-import withToType from './withToType';\n+import withDestinationType from './withDestinationType';\nimport withMeetDetails from './withMeetDetails';\nimport withExternalCall from './withExternalCall';\nexport default [\nwithEventHandler,\nwithExternalCall,\n- withToType,\n+ withDestinationType,\nwithMeetDetails,\nwithCallMemberships,\nwithCallHandlers,\n",
"new_path": "packages/node_modules/@ciscospark/widget-meet/src/enhancers/index.js",
"old_path": "packages/node_modules/@ciscospark/widget-meet/src/enhancers/index.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -20,7 +20,7 @@ import {\nstoreMeetDetails\n} from '../actions';\n-import {toTypes} from './withToType';\n+import {destinationTypes} from '../';\nfunction catchCallError(props) {\n@@ -83,18 +83,16 @@ function handleCall(props) {\n} = props;\nconst {\ntoType,\n- toValue,\n- spaceId,\n- userId\n+ toValue\n} = widgetMeet;\nlet destination = toValue;\n- if (toType === toTypes.USERID) {\n- destination = constructHydraId(hydraTypes.PEOPLE, userId);\n+ if (toType === destinationTypes.USERID) {\n+ destination = constructHydraId(hydraTypes.PEOPLE, toValue);\n}\n- else if (toType === toTypes.SPACEID) {\n- destination = constructHydraId(hydraTypes.ROOM, spaceId);\n+ else if (toType === destinationTypes.SPACEID) {\n+ destination = constructHydraId(hydraTypes.ROOM, toValue);\n}\nprops.placeCall(sparkInstance, {destination})\n",
"new_path": "packages/node_modules/@ciscospark/widget-meet/src/enhancers/withCallHandlers.js",
"old_path": "packages/node_modules/@ciscospark/widget-meet/src/enhancers/withCallHandlers.js"
},
{
"change_type": "ADD",
"diff": "+import {compose, lifecycle} from 'recompose';\n+import {bindActionCreators} from 'redux';\n+import {connect} from 'react-redux';\n+import {deconstructHydraId} from '@ciscospark/react-component-utils';\n+\n+import {storeMeetDetails} from '../actions';\n+\n+import {destinationTypes} from '../';\n+\n+function storeDestinationType(props) {\n+ const {\n+ destination,\n+ call\n+ } = props;\n+ const details = {};\n+\n+ if (destination && !call) {\n+ let toValue = destination.id;\n+\n+ // Normalize To values and store\n+ switch (destination.type) {\n+ case destinationTypes.SIP:\n+ toValue = toValue.replace('sip:', '');\n+ break;\n+ case destinationTypes.USERID:\n+ case destinationTypes.SPACEID:\n+ {\n+ const hydraObject = deconstructHydraId(toValue);\n+ toValue = hydraObject.id;\n+ }\n+ break;\n+ default:\n+ break;\n+ }\n+\n+ details.toType = destination.type;\n+ details.toValue = toValue;\n+\n+ props.storeMeetDetails(details);\n+ }\n+}\n+\n+export default compose(\n+ connect(\n+ null,\n+ (dispatch) => bindActionCreators({\n+ storeMeetDetails\n+ }, dispatch)\n+ ),\n+ lifecycle({\n+ componentWillMount() {\n+ storeDestinationType(this.props);\n+ }\n+ })\n+);\n",
"new_path": "packages/node_modules/@ciscospark/widget-meet/src/enhancers/withDestinationType.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -18,11 +18,11 @@ export default compose(\ncomponentWillMount() {\nconst {\ncall,\n- to,\n+ destination,\nintl\n} = this.props;\n- if (!call && !to) {\n+ if (!call && (!destination || destination && !destination.id || !destination.type)) {\nconst {formatMessage} = intl;\nthis.props.addError({\nid: 'widgetMeet.to',\n",
"new_path": "packages/node_modules/@ciscospark/widget-meet/src/enhancers/withErrors.js",
"old_path": "packages/node_modules/@ciscospark/widget-meet/src/enhancers/withErrors.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,6 +5,8 @@ import {storeExternalCall} from '@ciscospark/redux-module-media';\nimport {storeMeetDetails} from '../actions';\n+import {destinationTypes} from '../';\n+\nexport default compose(\nconnect(\n(state) => state,\n@@ -29,11 +31,13 @@ export default compose(\nprops.storeExternalCall(call);\n}\nif (call.locus && call.locus.conversationUrl) {\n- details.spaceId = call.locus.conversationUrl.split('/').pop();\n+ details.toValue = call.locus.conversationUrl.split('/').pop();\n+ details.toType = destinationTypes.SPACEID;\nconst {locusTags} = call.locus.info;\nif (locusTags && locusTags.includes('ONE_ON_ONE')) {\nconst otherUser = call.memberships.filter((u) => call.me.personUuid !== u.personUuid)[0];\n- details.userId = otherUser.personUuid;\n+ details.toValue = otherUser.personUuid;\n+ details.toType = destinationTypes.USERID;\n}\n}\nprops.storeMeetDetails(details);\n",
"new_path": "packages/node_modules/@ciscospark/widget-meet/src/enhancers/withExternalCall.js",
"old_path": "packages/node_modules/@ciscospark/widget-meet/src/enhancers/withExternalCall.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -7,47 +7,43 @@ import {fetchAvatar} from '@ciscospark/redux-module-avatar';\nimport {storeMeetDetails} from '../actions';\n-import {toTypes} from './withToType';\n+import {destinationTypes} from '../';\nfunction getCallDetails(props) {\nconst {\n- widgetMeet,\nsparkInstance,\navatar,\nspaces,\nusers,\n- currentUser\n+ currentUser,\n+ widgetMeet\n} = props;\n- const {\n- spaceId,\n- userId,\n- toType,\n- toValue\n- } = widgetMeet;\n+ const {toType, toValue} = widgetMeet;\nswitch (toType) {\n- case toTypes.EMAIL:\n- case toTypes.USERID:\n- if (userId && !users.getIn(['byId', userId])) {\n- props.getUser({id: userId}, sparkInstance);\n- }\n- else if (toValue && !users.getIn(['byEmail', toValue])) {\n+ case destinationTypes.EMAIL:\n+ if (!users.getIn(['byEmail', toValue])) {\nprops.getUser({email: toValue}, sparkInstance);\n}\nbreak;\n- case toTypes.SPACEID:\n- if (spaceId) {\n- const space = spaces.getIn(['byId', spaceId]);\n+ case destinationTypes.USERID:\n+ if (!users.getIn(['byId', toValue])) {\n+ props.getUser({id: toValue}, sparkInstance);\n+ }\n+ break;\n+ case destinationTypes.SPACEID:\n+ {\n+ const space = spaces.getIn(['byId', toValue]);\nif (!space) {\n- props.fetchSpace(sparkInstance, spaceId)\n+ props.fetchSpace(sparkInstance, toValue)\n.then((s) => {\nif (s && s.locusUrl) {\nprops.storeMeetDetails({callId: s.locusUrl});\n}\n});\n}\n- else if (space && !space.isFetching && !avatar.hasIn(['items', spaceId])) {\n+ else if (space && !space.isFetching && !avatar.hasIn(['items', toValue])) {\nconst otherUser = space.participants.find((p) => p !== currentUser.id);\nprops.fetchAvatar({space, userId: otherUser}, sparkInstance);\n}\n",
"new_path": "packages/node_modules/@ciscospark/widget-meet/src/enhancers/withMeetDetails.js",
"old_path": "packages/node_modules/@ciscospark/widget-meet/src/enhancers/withMeetDetails.js"
},
{
"change_type": "DELETE",
"diff": "-import {compose, lifecycle} from 'recompose';\n-import {bindActionCreators} from 'redux';\n-import {connect} from 'react-redux';\n-import {\n- deconstructHydraId,\n- hydraTypes,\n- validateSipUri,\n- validateEmail\n-} from '@ciscospark/react-component-utils';\n-\n-import {storeMeetDetails} from '../actions';\n-\n-\n-export const toTypes = {\n- SIP: 'sipUri',\n- EMAIL: 'email',\n- USERID: 'userId',\n- SPACEID: 'spaceId',\n- PSTN: 'pstn' // currently ignoring PSTN\n-};\n-\n-const toTypeNames = Object.values(toTypes);\n-\n-function storeToType(props) {\n- const {\n- to,\n- call,\n- type\n- } = props;\n- const details = {};\n-\n- if (to && !call) {\n- let toType = type;\n- let toValue = to;\n-\n- if (!toType || !toTypeNames.includes(toType)) {\n- const hydraObject = deconstructHydraId(to);\n- if (validateSipUri(to)) {\n- toType = toTypes.SIP;\n- toValue = to.replace('sip:', '');\n- }\n- else if (hydraObject.id && hydraObject.type) {\n- if (hydraObject.type === hydraTypes.PEOPLE) {\n- toType = toTypes.USERID;\n- toValue = hydraObject.id;\n- details.userId = toValue;\n- }\n- else if (hydraObject.type === hydraTypes.ROOM) {\n- toType = toTypes.SPACEID;\n- toValue = hydraObject.id;\n- details.spaceId = toValue;\n- }\n- }\n- else if (validateEmail(to)) {\n- toType = toTypes.EMAIL;\n- }\n-\n- details.toType = toType;\n- details.toValue = toValue;\n-\n- props.storeMeetDetails(details);\n- }\n- }\n-}\n-\n-export default compose(\n- connect(\n- null,\n- (dispatch) => bindActionCreators({\n- storeMeetDetails\n- }, dispatch)\n- ),\n- lifecycle({\n- componentWillMount() {\n- storeToType(this.props);\n- }\n- })\n-);\n",
"new_path": null,
"old_path": "packages/node_modules/@ciscospark/widget-meet/src/enhancers/withToType.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -10,6 +10,14 @@ import messages from './translations/en';\nexport {reducers};\n+export const destinationTypes = {\n+ SIP: 'sipUri',\n+ EMAIL: 'email',\n+ USERID: 'userId',\n+ SPACEID: 'spaceId',\n+ PSTN: 'pstn' // currently ignoring PSTN\n+};\n+\nexport default compose(\nconstructSparkEnhancer({\nname: 'meet',\n",
"new_path": "packages/node_modules/@ciscospark/widget-meet/src/index.js",
"old_path": "packages/node_modules/@ciscospark/widget-meet/src/index.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -31,7 +31,7 @@ const VideoPosition = Record({\nconst InitialState = Record({\ntoType: '', // valid types: userId, spaceId, email, sip, phoneNumber\n- toValue: '',\n+ toValue: '', // sip address, uuid or email\ncallId: '', // id of call object in media store.\ncall: null,\nspaceId: '',\n",
"new_path": "packages/node_modules/@ciscospark/widget-meet/src/reducer.js",
"old_path": "packages/node_modules/@ciscospark/widget-meet/src/reducer.js"
},
{
"change_type": "MODIFY",
"diff": "import {createSelector} from 'reselect';\n-import {toTypes} from './enhancers/withToType';\n+import {destinationTypes} from '.';\nconst getWidget = (state) => state.widgetMeet;\nconst getCalls = (state) => state.media.byId;\n@@ -32,10 +32,10 @@ const getAvatarImage = createSelector(\nlet avatarId;\n- if (toType === toTypes.EMAIL) {\n+ if (toType === destinationTypes.EMAIL) {\navatarId = users.getIn(['byEmail', toValue]);\n}\n- else if ([toTypes.EMAIL, toTypes.USERID, toTypes.SPACEID].includes(toType)) {\n+ else if ([destinationTypes.EMAIL, destinationTypes.USERID, destinationTypes.SPACEID].includes(toType)) {\navatarId = toValue;\n}\n@@ -52,15 +52,15 @@ const getDisplayName = createSelector(\n} = widget;\nswitch (toType) {\n- case toTypes.SIP:\n+ case destinationTypes.SIP:\nreturn toValue;\n- case toTypes.EMAIL: {\n+ case destinationTypes.EMAIL: {\nconst userId = users.getIn(['byEmail', toValue]);\nreturn users.getIn(['byId', userId, 'displayName']);\n}\n- case toTypes.USERID:\n+ case destinationTypes.USERID:\nreturn users.getIn(['byId', toValue, 'displayName']);\n- case toTypes.SPACEID:\n+ case destinationTypes.SPACEID:\nreturn spaces.getIn(['byId', toValue, 'displayName']);\ndefault:\nreturn '';\n",
"new_path": "packages/node_modules/@ciscospark/widget-meet/src/selector.js",
"old_path": "packages/node_modules/@ciscospark/widget-meet/src/selector.js"
}
] | JavaScript | MIT License | webex/react-widgets | feat(widget-meet): add destination support | 1 | feat | widget-meet |
217,922 | 13.06.2018 20:38:24 | -7,200 | 68804bbd821b572a1be52e89f84d60f94de4d409 | fix: fixed an issue with recipe amounts reduction not being applied to ingredients | [
{
"change_type": "MODIFY",
"diff": "@@ -305,8 +305,8 @@ export class List extends DataWithPermissions {\nconst previousUsed = item.used;\n// Update used amount\nitem.used += amount;\n- // Set amount to the amount of items to add to the total, nothing can be removed so min is 0.\n- amount = Math.max(0, amount - (item.done - previousUsed));\n+ // Set amount to the amount of items to add to the total.\n+ amount = amount - (item.done - previousUsed);\nif (item.used > item.amount) {\nitem.used = item.amount;\n}\n@@ -322,7 +322,7 @@ export class List extends DataWithPermissions {\nitem.done = 0;\n}\namount = MathTools.absoluteCeil(amount / pitem.yield);\n- if (item.requires !== undefined && MathTools.absoluteCeil(item.done / item.yield) > previousDone) {\n+ if (item.requires !== undefined && MathTools.absoluteCeil(item.done / item.yield) !== previousDone) {\nfor (const requirement of item.requires) {\nconst requirementItem = this.getItemById(requirement.id, excludeRecipes);\nif (requirementItem !== undefined) {\n",
"new_path": "src/app/model/list/list.ts",
"old_path": "src/app/model/list/list.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | fix: fixed an issue with recipe amounts reduction not being applied to ingredients
#407 | 1 | fix | null |
217,922 | 13.06.2018 23:02:28 | -7,200 | b2a8425acbfd2221a411824f4458e848361dc521 | fix: show list completion dialog only for author only | [
{
"change_type": "MODIFY",
"diff": "@@ -373,7 +373,7 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\n}\nprivate onCompletion(list: List): void {\n- if (!this.completionDialogOpen) {\n+ if (!this.completionDialogOpen && this.userData.$key === this.listData.authorId) {\nthis.completionDialogOpen = true;\nthis.dialog.open(ListFinishedPopupComponent)\n.afterClosed()\n",
"new_path": "src/app/pages/list/list-details/list-details.component.ts",
"old_path": "src/app/pages/list/list-details/list-details.component.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | fix: show list completion dialog only for author only | 1 | fix | null |
821,196 | 14.06.2018 08:59:00 | 25,200 | 819e9716f0d9f7be987d14b9919fdaeb68e293dc | fix: add shrinkwrap file | [
{
"change_type": "MODIFY",
"diff": "@@ -266,13 +266,14 @@ class App extends Generator {\nthis.pjson.scripts.test = 'echo NO TESTS'\n}\nif (this.ts) {\n- this.pjson.scripts.prepack = this.pjson.scripts.prepare = `${rmrf} lib && tsc`\n+ this.pjson.scripts.prepack = this.pjson.scripts.prepare = nps.series(`${rmrf} lib`, 'tsc')\n}\nif (['plugin', 'multi'].includes(this.type)) {\n- this.pjson.scripts.prepack = nps.series(this.pjson.scripts.prepack, 'oclif-dev manifest', 'oclif-dev readme')\n- this.pjson.scripts.postpack = nps.series(this.pjson.scripts.postpack, `${rmf} oclif.manifest.json`)\n+ this.pjson.scripts.prepack = nps.series(`${rmrf} lib`, 'tsc', 'oclif-dev manifest', 'oclif-dev readme', 'npm shrinkwrap')\n+ this.pjson.scripts.postpack = `${rmf} oclif.manifest.json`\nthis.pjson.scripts.version = nps.series('oclif-dev readme', 'git add README.md')\nthis.pjson.files.push('/oclif.manifest.json')\n+ this.pjson.files.push('/npm-shrinkwrap.json')\n}\nif (this.type === 'plugin' && hasYarn) {\n// for plugins, add yarn.lock file to package so we can lock plugin dependencies\n",
"new_path": "src/generators/app.ts",
"old_path": "src/generators/app.ts"
}
] | TypeScript | MIT License | oclif/oclif | fix: add shrinkwrap file | 1 | fix | null |
821,196 | 14.06.2018 09:24:39 | 25,200 | ab161e5b60a5d350eb71683e94e0377e23c71b87 | fix: js setups | [
{
"change_type": "MODIFY",
"diff": "@@ -269,7 +269,7 @@ class App extends Generator {\nthis.pjson.scripts.prepack = this.pjson.scripts.prepare = nps.series(`${rmrf} lib`, 'tsc')\n}\nif (['plugin', 'multi'].includes(this.type)) {\n- this.pjson.scripts.prepack = nps.series(`${rmrf} lib`, 'tsc', 'oclif-dev manifest', 'oclif-dev readme', 'npm shrinkwrap')\n+ this.pjson.scripts.prepack = nps.series(this.pjson.scripts.prepare, 'oclif-dev manifest', 'oclif-dev readme', 'npm shrinkwrap')\nthis.pjson.scripts.postpack = `${rmf} oclif.manifest.json`\nthis.pjson.scripts.version = nps.series('oclif-dev readme', 'git add README.md')\nthis.pjson.files.push('/oclif.manifest.json')\n",
"new_path": "src/generators/app.ts",
"old_path": "src/generators/app.ts"
}
] | TypeScript | MIT License | oclif/oclif | fix: js setups | 1 | fix | null |
217,922 | 14.06.2018 09:25:52 | -7,200 | fcfaed062b590842755ee132620136cbafcced12 | fix: fixed an issue with gathering-location page not able to create alarm for Rhea | [
{
"change_type": "MODIFY",
"diff": "@@ -193,6 +193,7 @@ export class DataService {\n}\nconst params = new HttpParams()\n.set('gatherable', '1')\n+ .set('type', 'item')\n.set('text', name)\n.set('lang', lang);\nreturn this.getGarlandSearch(params);\n",
"new_path": "src/app/core/api/data.service.ts",
"old_path": "src/app/core/api/data.service.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -41,8 +41,8 @@ export class GatheringLocationComponent implements OnInit {\nmergeMap(name => this.dataService.searchGathering(name)),\nmap(items => {\nreturn items\n- // Only use item results\n- .filter(item => item.type === 'item')\n+ // Only use gatherable results\n+ .filter(item => item.obj.f === undefined)\n// First of all, add node informations\n.map(item => {\nitem.nodes = Object.keys(nodePositions)\n",
"new_path": "src/app/pages/gathering-location/gathering-location/gathering-location.component.ts",
"old_path": "src/app/pages/gathering-location/gathering-location/gathering-location.component.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | fix: fixed an issue with gathering-location page not able to create alarm for Rhea | 1 | fix | null |
217,922 | 14.06.2018 11:35:28 | -7,200 | 5df0290d718bcf5929e49293f3c4898298419348 | feat(desktop): you can now set an opacity on overlay | [
{
"change_type": "DELETE",
"diff": "-owner: Supamiu\n-repo: ffxiv-teamcraft\n-provider: github\n",
"new_path": null,
"old_path": "dev-app-update.yml"
},
{
"change_type": "MODIFY",
"diff": "@@ -3,7 +3,6 @@ const {autoUpdater} = require('electron-updater');\nconst path = require('path');\nconst Config = require('electron-config');\nconst config = new Config();\n-const isDev = require('electron-is-dev');\nconst electronOauth2 = require('electron-oauth2');\n@@ -23,10 +22,6 @@ const shouldQuit = app.makeSingleInstance(function (commandLine, workingDirector\n}\n});\n-if (isDev) {\n- autoUpdater.updateConfigPath = path.join(__dirname, 'dev-app-update.yml');\n-}\n-\nif (shouldQuit) {\napp.quit();\nreturn;\n@@ -40,6 +35,7 @@ function createWindow() {\nicon: `file://${__dirname}/dist/assets/logo.png`\n};\nObject.assign(opts, config.get('win:bounds'));\n+ opts.fullscreen = config.get('win:fullscreen') || false;\nwin = new BrowserWindow(opts);\nwin.loadURL(`file://${__dirname}/dist/index.html`);\n@@ -63,6 +59,7 @@ function createWindow() {\n// save window size and position\nwin.on('close', () => {\nconfig.set('win:bounds', win.getBounds());\n+ config.set('win:fullscreen', win.isFullScreen());\n});\nconst iconPath = path.join(__dirname, 'dist', 'assets', 'logo.png');\n@@ -192,19 +189,20 @@ ipcMain.on('overlay', (event, url) => {\nresizable: true,\nframe: false,\nalwaysOnTop: true,\n- autoHideMenuBar: true,\n- webPreferences: {\n- nodeIntegration: false\n- }\n+ autoHideMenuBar: true\n};\nObject.assign(opts, config.get(`overlay:${url}:bounds`));\n+ opts.opacity = config.get(`overlay:${url}:opacity`) || 1;\nconst overlay = new BrowserWindow(opts);\n- overlay.once('ready-to-show', overlay.show);\n+ overlay.once('ready-to-show', () => {\n+ overlay.show();\n+ });\n// save window size and position\noverlay.on('close', () => {\nconfig.set(`overlay:${url}:bounds`, overlay.getBounds());\n+ config.set(`overlay:${url}:opacity`, overlay.getOpacity());\n});\n@@ -212,6 +210,20 @@ ipcMain.on('overlay', (event, url) => {\nopenedOverlays[url] = overlay;\n});\n+ipcMain.on('overlay:set-opacity', (event, data) => {\n+ const overlayWindow = openedOverlays[data.uri];\n+ if (overlayWindow !== undefined) {\n+ overlayWindow.setOpacity(data.opacity);\n+ }\n+});\n+\n+ipcMain.on('overlay:get-opacity', (event, data) => {\n+ const overlayWindow = openedOverlays[data.uri];\n+ if (overlayWindow !== undefined) {\n+ event.sender.send(`overlay:${data.uri}:opacity`, overlayWindow.getOpacity());\n+ }\n+});\n+\nipcMain.on('overlay-close', (event, url) => {\nif (openedOverlays[url] !== undefined) {\nopenedOverlays[url].close();\n",
"new_path": "main.js",
"old_path": "main.js"
},
{
"change_type": "MODIFY",
"diff": "<app-alarms-sidebar></app-alarms-sidebar>\n</mat-sidenav>\n</mat-sidenav-container>\n+ <div class=\"opacity-slider\" *ngIf=\"overlay\">\n+ <mat-slider [min]=\"0.2\" [max]=\"1\" [step]=\"0.05\" [value]=\"overlayOpacity\"\n+ (change)=\"setOverlayOpacity($event.value)\"></mat-slider>\n+ </div>\n</div>\n",
"new_path": "src/app/app.component.html",
"old_path": "src/app/app.component.html"
},
{
"change_type": "MODIFY",
"diff": "}\n}\n}\n+\n+.opacity-slider {\n+ position: fixed;\n+ bottom: 0;\n+ width: 100%;\n+ z-index: 1;\n+ padding: 0 15px;\n+ mat-slider {\n+ width: 100%;\n+ }\n+}\n",
"new_path": "src/app/app.component.scss",
"old_path": "src/app/app.component.scss"
},
{
"change_type": "MODIFY",
"diff": "@@ -79,6 +79,8 @@ export class AppComponent implements OnInit {\npublic openingUrl = false;\n+ public overlayOpacity = 1;\n+\n@ViewChild('urlBox')\nurlBox: ElementRef;\n@@ -133,6 +135,12 @@ export class AppComponent implements OnInit {\n})\n).subscribe((event: any) => {\nthis.overlay = event.url.indexOf('?overlay') > -1;\n+ if (this.overlay) {\n+ this.ipc.on(`overlay:${this.ipc.overlayUri}:opacity`, (value) => {\n+ this.overlayOpacity = value;\n+ });\n+ this.ipc.send('overlay:get-opacity', {uri: this.ipc.overlayUri});\n+ }\nga('set', 'page', event.url);\nga('send', 'pageview');\n});\n@@ -336,4 +344,8 @@ export class AppComponent implements OnInit {\nthis.ipc.send('minimize');\n}\n+ setOverlayOpacity(opacity: number): void {\n+ this.ipc.send('overlay:set-opacity', {uri: this.ipc.overlayUri, opacity: opacity});\n+ }\n+\n}\n",
"new_path": "src/app/app.component.ts",
"old_path": "src/app/app.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -6,12 +6,15 @@ import {BrowserAnimationsModule} from '@angular/platform-browser/animations';\nimport {\nMatButtonModule,\nMatCardModule,\n- MatExpansionModule, MatFormFieldModule,\n+ MatExpansionModule,\n+ MatFormFieldModule,\nMatGridListModule,\n- MatIconModule, MatInputModule,\n+ MatIconModule,\n+ MatInputModule,\nMatListModule,\nMatMenuModule,\nMatSidenavModule,\n+ MatSliderModule,\nMatSlideToggleModule,\nMatSnackBarModule,\nMatToolbarModule,\n@@ -112,6 +115,7 @@ export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {\nMatCardModule,\nMatFormFieldModule,\nMatInputModule,\n+ MatSliderModule,\nBrowserModule,\nFormsModule,\n",
"new_path": "src/app/app.module.ts",
"old_path": "src/app/app.module.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -9,6 +9,16 @@ export class IpcService {\nprivate readonly _ipc: IpcRenderer | undefined = undefined;\n+ private _overlayUri: string;\n+\n+ public get overlayUri(): string {\n+ return this._overlayUri;\n+ }\n+\n+ public set overlayUri(uri: string) {\n+ this._overlayUri = uri;\n+ }\n+\nconstructor(private platformService: PlatformService, private router: Router) {\n// Only load ipc if we're running inside electron\nif (platformService.isDesktop()) {\n",
"new_path": "src/app/core/electron/ipc.service.ts",
"old_path": "src/app/core/electron/ipc.service.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -45,6 +45,9 @@ export class AlarmsComponent {\nthis.desktop = platformService.isDesktop();\nroute.queryParams.subscribe(params => {\nthis.overlay = params.overlay === 'true';\n+ if (this.overlay) {\n+ this.ipc.overlayUri = '/alarms';\n+ }\n});\nconst timer$ = this.reloader.pipe(\n",
"new_path": "src/app/pages/alarms/alarms/alarms.component.ts",
"old_path": "src/app/pages/alarms/alarms/alarms.component.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | feat(desktop): you can now set an opacity on overlay
#407 | 1 | feat | desktop |
730,429 | 14.06.2018 12:18:57 | 14,400 | 5585a2a71ac8d320ac09b35b958de7ac9d11eb91 | refactor(widget-message): remove user module dependency | [
{
"change_type": "MODIFY",
"diff": "@@ -81,7 +81,6 @@ const injectedPropTypes = {\nconversation: PropTypes.object.isRequired,\nflags: PropTypes.object.isRequired,\nsparkInstance: PropTypes.object,\n- user: PropTypes.object.isRequired,\nwidgetMessage: PropTypes.object.isRequired,\nacknowledgeActivityOnServer: PropTypes.func.isRequired,\naddFiles: PropTypes.func.isRequired,\n@@ -264,24 +263,6 @@ export class MessageWidget extends Component {\nprops.fetchAvatarsForUsers(participants, sparkInstance);\n}\n-\n- /**\n- * Gets the non-current user of a conversation\n- *\n- * @param {object} conversation\n- * @returns {object}\n- */\n- @autobind\n- getToUserFromConversation(conversation) {\n- const {props} = this;\n- if (!conversation.get('participants') || !props.currentUser) {\n- return null;\n- }\n- return conversation.get('participants').find((user) =>\n- user.get('id') !== props.currentUser.id);\n- }\n-\n-\n/**\n* Store activity list from child component\n*\n@@ -682,8 +663,7 @@ export class MessageWidget extends Component {\nif (conversation && conversationId) {\nconst isLoadingHistoryUp = conversation.getIn(['status', 'isLoadingHistoryUp']);\n- const toUser = this.getToUserFromConversation(conversation);\n- const displayName = conversation.get('displayName') || toUser && toUser.get('displayName');\n+ const displayName = conversation.get('displayName');\nreturn (\n<Dropzone\n",
"new_path": "packages/node_modules/@ciscospark/widget-message/src/container.js",
"old_path": "packages/node_modules/@ciscospark/widget-message/src/container.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -9,7 +9,6 @@ import {reducer as notifications} from '@ciscospark/react-container-notification\nimport {reducer as messageComposer} from '@ciscospark/react-container-message-composer';\nimport presence from '@ciscospark/redux-module-presence';\nimport share from '@ciscospark/redux-module-share';\n-import user from '@ciscospark/redux-module-user';\nimport spark from '@ciscospark/react-redux-spark';\nimport features from '@ciscospark/redux-module-features';\n@@ -50,7 +49,6 @@ export const reducers = {\nindicators,\nnotifications,\nshare,\n- user,\nspark,\nmessageComposer,\nfeatures,\n",
"new_path": "packages/node_modules/@ciscospark/widget-message/src/reducer.js",
"old_path": "packages/node_modules/@ciscospark/widget-message/src/reducer.js"
}
] | JavaScript | MIT License | webex/react-widgets | refactor(widget-message): remove user module dependency | 1 | refactor | widget-message |
217,922 | 14.06.2018 13:16:00 | -7,200 | 2e45ccbb3ef62c28afa8a3959afa632228ed0687 | chore: changed target url for desktop app download | [
{
"change_type": "MODIFY",
"diff": "class=\"fab fa-discord\"></i></a></div>\n<div class=\"fab-container\" matTooltip=\"{{'Download_desktop_app' | translate}}\"\nmatTooltipPosition=\"above\" *ngIf=\"!mobile && !platformService.isDesktop()\">\n- <a href=\"https://github.com/Supamiu/ffxiv-teamcraft/releases\" mat-mini-fab target=\"_blank\">\n+ <a href=\"https://ffxivteamcraft.com/desktop\" mat-mini-fab target=\"_blank\">\n<mat-icon>get_app</mat-icon>\n</a>\n</div>\n",
"new_path": "src/app/app.component.html",
"old_path": "src/app/app.component.html"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | chore: changed target url for desktop app download | 1 | chore | null |
217,922 | 14.06.2018 14:45:22 | -7,200 | 25deaa128dbafd0f622fd046fa46742c9b99cd13 | feat: you can now see the job used for the craft in simulator result panel | [
{
"change_type": "MODIFY",
"diff": "<span *ngIf=\"recipe$ | async as recipeData\">{{recipeData.lvl}} {{getStars(recipeData.stars)}}</span>\n</mat-card-subtitle>\n<div class=\"stats\">\n- {{'SIMULATOR.CONFIGURATION.Craftsmanship' | translate}}: {{simulation.crafterStats.craftsmanship}}\n- {{'SIMULATOR.CONFIGURATION.Control' | translate}}: {{simulation.crafterStats._control}}\n+ <span><b>{{simulation.crafterStats.jobId | jobName | i18n}}</b></span>\n+ <span>{{'SIMULATOR.CONFIGURATION.Craftsmanship' | translate}}: {{simulation.crafterStats.craftsmanship}}\n+ <br>\n+ {{'SIMULATOR.CONFIGURATION.Control' | translate}}: {{simulation.crafterStats._control}}</span>\n</div>\n<div class=\"steps\">\n{{'SIMULATOR.Step_counter' | translate}}\n",
"new_path": "src/app/pages/simulator/components/simulator/simulator.component.html",
"old_path": "src/app/pages/simulator/components/simulator/simulator.component.html"
},
{
"change_type": "MODIFY",
"diff": "}\n}\n+.stats {\n+ display: flex;\n+ align-items: center;\n+ > span {\n+ white-space: nowrap;\n+ margin-right: 10px;\n+ }\n+}\n+\n.steps {\nwhite-space: nowrap;\nfont-size: 1.2rem;\n",
"new_path": "src/app/pages/simulator/components/simulator/simulator.component.scss",
"old_path": "src/app/pages/simulator/components/simulator/simulator.component.scss"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | feat: you can now see the job used for the craft in simulator result panel
#407 | 1 | feat | null |
217,922 | 14.06.2018 15:06:59 | -7,200 | 06635ee321c004d9b2bed882a146707133dce0cc | feat(desktop): added navigation arrows in topbar | [
{
"change_type": "MODIFY",
"diff": "{{locale | uppercase}}\n</div>\n<div class=\"spacer draggable\"></div>\n+ <mat-icon class=\"desktop-bar-button nav-button theme-text-color\" (click)=\"previousPage()\">arrow_back</mat-icon>\n<mat-icon (click)=\"openingUrl = true\" class=\"desktop-bar-button open-url theme-text-color\" *ngIf=\"!overlay\"\nmatTooltip=\"{{'COMMON.Open_url' | translate}}\">\nopen_in_browser\n</mat-icon>\n+ <mat-icon class=\"desktop-bar-button nav-button theme-text-color\" (click)=\"nextPage()\">arrow_forward</mat-icon>\n<div class=\"spacer draggable\"></div>\n<mat-icon class=\"desktop-bar-button theme-text-color\" (click)=\"minimize()\" *ngIf=\"!overlay\">minimize</mat-icon>\n<mat-icon class=\"desktop-bar-button theme-text-color\" (click)=\"toggleFullscreen()\" *ngIf=\"!overlay\">fullscreen\n",
"new_path": "src/app/app.component.html",
"old_path": "src/app/app.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -348,4 +348,12 @@ export class AppComponent implements OnInit {\nthis.ipc.send('overlay:set-opacity', {uri: this.ipc.overlayUri, opacity: opacity});\n}\n+ previousPage(): void {\n+ window.history.back();\n+ }\n+\n+ nextPage(): void {\n+ window.history.forward();\n+ }\n+\n}\n",
"new_path": "src/app/app.component.ts",
"old_path": "src/app/app.component.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | feat(desktop): added navigation arrows in topbar
#407 | 1 | feat | desktop |
730,429 | 14.06.2018 15:30:36 | 14,400 | 3c3e6fa85850b21a3e0691000e261dbfef41b0e0 | docs(widget-space): add destination docs | [
{
"change_type": "MODIFY",
"diff": "@@ -42,11 +42,11 @@ Depending on how comfortable you are with these frameworks, there are are a numb\n### Spark for Developers\n-If you haven't already, go to the Spark for Developers Portal (<https://developer.ciscospark.com>) and sign up for an account. Once you've created an account you can get your developer access token by clicking on your avatar at the top right of the screen.\n+If you haven't already, go to the Webex for Developers Portal (<https://developer.webex.com>) and sign up for an account. Once you've created an account you can get your developer access token by clicking on your avatar at the top right of the screen.\nWhen you want to eventually create an integration and have your own users take advantage of the widget, you'll need to create an integration with the `spark:all` scope.\n-Head over to the Spark for Developers Documentation for more information about how to setup OAuth for your app: <https://developer.ciscospark.com/authentication.html>\n+Head over to the Webex for Developers Documentation for more information about how to setup OAuth for your app: <https://developer.webex.com/authentication.html>\n### CDN\n@@ -103,16 +103,15 @@ When loading the widgets there are some configuration options you can provide:\n| Name | Data API | Description |\n|:--|:-------|---|\n-| `accessToken` | `data-access-token` | Access token for the user account initiating the messaging session. <br>For testing purposes you can use a developer access token from <https://developer.ciscospark.com>. |\n-| `guestToken` | `data-guest-token` | Guest Access token for the user account initiating the messaging session. <br>A guest issuer application is required to generate a guest token. <https://developer.ciscospark.com/guest-issuer.html>.<br>Currently in *restricted access*|\n+| `accessToken` | `data-access-token` | Access token for the user account initiating the messaging session. <br>For testing purposes you can use a developer access token from <https://developer.webex.com>. |\n+| `guestToken` | `data-guest-token` | Guest Access token for the user account initiating the messaging session. <br>A guest issuer application is required to generate a guest token. <https://developer.webex.com/guest-issuer.html>.<br>Currently in *restricted access*|\n**Include only one of the following attributes:**\n| Name | Data API | Description |\n|:--|:-------|---|\n-| `spaceId` | `data-space-id` | ID of the space you want to open. |\n-| `toPersonEmail` | `data-to-person-email` | Email of the message recipient |\n-| `toPersonId` | `data-to-person-id` | User Id of the message recipient |\n+| `destinationId` | `data-destination-id` | space ID/email/user id of the space you want to open. |\n+| `destinationType` | `data-destination-type` | Type of space destination, one of: `email`, `userId`, `spaceId` |\n**Optional configurations:**\n@@ -123,6 +122,14 @@ When loading the widgets there are some configuration options you can provide:\n| `logLevel` | `data-log-level` | (default: `silent`) When present, widget will log debug information to console. This can be set to: `error`, `warn`, `debug`, `info`, `trace`, or `silent` |\n| `spaceActivities` | N/A: global only feature | (default: `spaceActivities: {files: true, meet: true, message: true, people: true}`). When present and a property is set to false, that activity will be disabled in the activities menu. Disabling the initial activity will result in an error.\n+**These properties have been deprecated:**\n+\n+| Name | Data API | Description |\n+|:--|:-------|---|\n+| `spaceId` | `data-space-id` | ID of the space you want to open. |\n+| `toPersonEmail` | `data-to-person-email` | Email of the message recipient |\n+| `toPersonId` | `data-to-person-id` | User Id of the message recipient |\n+\n### HTML\nThe easiest way to get the Spark Space Widget into your web site is to add the built resources and attach data attributes to your a container.\n@@ -154,7 +161,8 @@ If you need additional behaviors or need to do additional work before the widget\n// Init a new widget\nciscospark.widget(widgetEl).spaceWidget({\naccessToken: 'AN_ACCESS_TOKEN',\n- spaceId: 'XXXXXXXXXXXXXXX'\n+ destinationType: 'spaceId',\n+ destinationId: 'XXXXXXXXXXXXXXX'\n});\n</script>\n```\n@@ -207,26 +215,11 @@ Create a container where you would like to embed the widget and use the [configu\nclass=\"ciscospark-widget\"\ndata-toggle=\"ciscospark-space\"\ndata-access-token=\"AN_ACCESS_TOKEN\"\n- data-space-id=\"XXXXXXXXXXXXXXX\"\n+ data-destination-id=\"XXXXXXXXXXXXXXX\"\n+ data-destination-type=\"spaceId\"\n/>\n```\n-### JSX\n-\n-Because our widgets are built using React, you'll be able to directly import the modules and components into your React app.\n-\n-``` js\n-import SpaceWidget from '@ciscospark/widget-space';\n-\n-ReactDOM.render(\n- <SpaceWidget\n- accessToken=\"AN_ACCESS_TOKEN\"\n- spaceId=\"XXXXXXXXXXX\"\n- />,\n- document.getElementById('ELEMENT')\n-);\n-```\n-\n### Events\nThe Space widget exposes a few events for hooking into widget functionality.\n@@ -237,7 +230,8 @@ You can directly add DOM event listener like this:\nclass=\"ciscospark-widget\"\ndata-toggle=\"ciscospark-space\"\ndata-access-token=\"AN_ACCESS_TOKEN\"\n- data-space-id=\"XXXXXXXXXXXXXXX\"\n+ data-destination-id=\"XXXXXXXXXXXXXXX\"\n+ data-destination-type=\"spaceId\"\n/>\n<script>\ndocument.getElementById('ciscospark-widget').addEventListener('EVENT_NAME', function(event) {\n@@ -254,7 +248,8 @@ var widgetEl = document.getElementById('my-ciscospark-widget');\n// Init a new widget\nciscospark.widget(widgetEl).spaceWidget({\naccessToken: 'AN_ACCESS_TOKEN',\n- spaceId: 'XXXXXXXXXXXXXXX',\n+ destinationId: 'XXXXXXXXXXXXXXX',\n+ destinationType: 'spaceId',\nonEvent: callback\n});\n",
"new_path": "packages/node_modules/@ciscospark/widget-space/README.md",
"old_path": "packages/node_modules/@ciscospark/widget-space/README.md"
}
] | JavaScript | MIT License | webex/react-widgets | docs(widget-space): add destination docs | 1 | docs | widget-space |
217,922 | 14.06.2018 15:31:16 | -7,200 | 6998eb494fe95cbf9dfa286aafc55c0e075dcac9 | feat: you can now choose in which group you create your alarms from lists | [
{
"change_type": "MODIFY",
"diff": "@@ -36,9 +36,13 @@ export class AlarmService {\n/**\n* Registers a given item and creates an alarm for it.\n* @param {ListRow} item\n+ * @param groupName\n*/\n- public register(item: ListRow): void {\n+ public register(item: ListRow, groupName?: string): void {\nthis.generateAlarms(item).forEach(alarm => {\n+ if (groupName !== undefined) {\n+ alarm.groupName = groupName;\n+ }\nthis.registerAlarms(alarm);\n});\n}\n",
"new_path": "src/app/core/time/alarm.service.ts",
"old_path": "src/app/core/time/alarm.service.ts"
},
{
"change_type": "MODIFY",
"diff": "<div *ngIf=\"hasTimers\" class=\"timers-container\">\n<div [ngClass]=\"{'timer':true, 'compact': settings.compactLists}\"\n*ngFor=\"let timer of timers | async; trackBy: trackByTimers\">\n+ <mat-menu #addAlarmMenu=\"matMenu\">\n+ <button (click)=\"addAlarm(timer.itemId, timer.type, group.name)\" mat-menu-item\n+ *ngFor=\"let group of user.alarmGroups\">{{group.name}}\n+ </button>\n+ </mat-menu>\n<button mat-raised-button\n+ *ngIf=\"!hasAlarm[timer.itemId]\"\n+ [matMenuTriggerFor]=\"addAlarmMenu\"\n[color]=\"getTimerColor(timer.alarm) | async\"\n- (click)=\"toggleAlarm(timer.itemId, timer.type)\"\nmatTooltip=\"{{timer?.zoneId | placeName | i18n}} - {{timer?.areaId | placeName | i18n}}\"\nmatTooltipPosition=\"above\">\n- <mat-icon *ngIf=\"!hasAlarm[timer.itemId]\">alarm_add</mat-icon>\n- <mat-icon *ngIf=\"hasAlarm[timer.itemId]\">alarm_on</mat-icon>\n+ <mat-icon>alarm_add</mat-icon>\n+ {{timer?.display}} <span *ngIf=\"timer?.slot as slot\">({{slot}})</span>\n+ <img src=\"{{getTimerIcon(timer.type)}}\" alt=\"\" class=\"type-icon\" *ngIf=\"timer.type > -1\">\n+ </button>\n+\n+ <button mat-raised-button\n+ *ngIf=\"hasAlarm[timer.itemId]\"\n+ (click)=\"removeAlarm(timer.itemId)\"\n+ [color]=\"getTimerColor(timer.alarm) | async\"\n+ matTooltip=\"{{timer?.zoneId | placeName | i18n}} - {{timer?.areaId | placeName | i18n}}\"\n+ matTooltipPosition=\"above\">\n+ <mat-icon>alarm_on</mat-icon>\n{{timer?.display}} <span *ngIf=\"timer?.slot as slot\">({{slot}})</span>\n<img src=\"{{getTimerIcon(timer.type)}}\" alt=\"\" class=\"type-icon\" *ngIf=\"timer.type > -1\">\n</button>\n{{'SIMULATOR.Open_in_external' | translate: {name: 'ryan20340'} }}\n</a>\n</mat-menu>\n- <button mat-icon-button class=\"crafter-button\" [matMenuTriggerFor]=\"simulatorMenu\" *ngIf=\"getCraft(item.recipeId) as craft\">\n+ <button mat-icon-button class=\"crafter-button\" [matMenuTriggerFor]=\"simulatorMenu\"\n+ *ngIf=\"getCraft(item.recipeId) as craft\">\n<img [ngClass]=\"{'crafted-by':true, 'compact': settings.compactLists}\"\nsrc=\"{{craft.icon}}\">\n<span class=\"crafter-level\">{{craft.level}} {{craft.stars_tooltip}}</span>\n{{'SIMULATOR.Open_in_external' | translate: {name: 'ryan20340'} }}\n</a>\n</mat-menu>\n- <button mat-icon-button [matMenuTriggerFor]=\"simulatorMenu\" *ngIf=\"getCraft(item.recipeId) as craft\" class=\"crafter-button\">\n+ <button mat-icon-button [matMenuTriggerFor]=\"simulatorMenu\" *ngIf=\"getCraft(item.recipeId) as craft\"\n+ class=\"crafter-button\">\n<img [ngClass]=\"{'crafted-by':true}\" src=\"{{craft.icon}}\">\n<span class=\"crafter-level\">{{craft.level}} {{craft.stars_tooltip}}</span>\n</button>\n",
"new_path": "src/app/modules/item/item/item.component.html",
"old_path": "src/app/modules/item/item/item.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -458,17 +458,30 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\n}\n}\n- toggleAlarm(id: number, type?: number): void {\n+ toggleAlarm(id: number, type: number = 0, groupName?: string): void {\nif (this.alarmService.hasAlarm(id)) {\n- this.alarmService.unregister(id);\n+ this.removeAlarm(id);\n} else {\n+ this.addAlarm(id, type, groupName);\n+ }\n+ }\n+\n+ addAlarm(id: number, type: number = 0, groupName?: string): void {\nif (type > 0) {\n- const alarms = this.alarmService.generateAlarms(this.item).filter(alarm => alarm.type === type);\n+ const alarms = this.alarmService.generateAlarms(this.item).filter(alarm => alarm.type === type).map(alarm => {\n+ if (groupName !== undefined) {\n+ alarm.groupName = groupName;\n+ }\n+ return alarm;\n+ });\nthis.alarmService.registerAlarms(...alarms);\n} else {\n- this.alarmService.register(this.item);\n+ this.alarmService.register(this.item, groupName);\n}\n}\n+\n+ removeAlarm(id: number): void {\n+ this.alarmService.unregister(id);\n}\nupdateHasAlarm(itemId): void {\n",
"new_path": "src/app/modules/item/item/item.component.ts",
"old_path": "src/app/modules/item/item/item.component.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | feat: you can now choose in which group you create your alarms from lists | 1 | feat | null |
217,922 | 14.06.2018 16:19:42 | -7,200 | 13b7eed26e1bf7aaef06b1a46261189e453fb206 | feat: new dialog box to show total cost of a list section (gils and trades) | [
{
"change_type": "MODIFY",
"diff": "@@ -58,7 +58,7 @@ import {first, map, mergeMap, publishReplay, refCount, tap} from 'rxjs/operators\n})\nexport class ItemComponent extends ComponentWithSubscriptions implements OnInit, OnChanges {\n- private static TRADE_SOURCES_PRIORITIES = {\n+ public static TRADE_SOURCES_PRIORITIES = {\n// Just in case\n25: 25, // Wolf Mark\n29: 25, // MGP\n",
"new_path": "src/app/modules/item/item/item.component.ts",
"old_path": "src/app/modules/item/item/item.component.ts"
},
{
"change_type": "MODIFY",
"diff": "<mat-expansion-panel [expanded]=\"expanded\" (opened)=\"opened.emit()\" (closed)=\"closed.emit()\">\n<mat-expansion-panel-header>\n<mat-panel-title>{{title}}</mat-panel-title>\n+ <button mat-icon-button\n+ matTooltip=\"{{'LIST.Total_price' | translate}}\"\n+ matTooltipPosition=\"above\"\n+ *ngIf=\"hasVendors\"\n+ (click)=\"$event.stopPropagation();showTotalPrice()\">\n+ <mat-icon>local_atm</mat-icon>\n+ </button>\n<button mat-icon-button ngxClipboard\n*ngIf=\"data !== null\"\nmatTooltip=\"{{'LIST.Copy_as_text' | translate}}\"\n",
"new_path": "src/app/pages/list/list-details-panel/list-details-panel.component.html",
"old_path": "src/app/pages/list/list-details-panel/list-details-panel.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -13,6 +13,7 @@ import {NavigationObjective} from '../../../modules/map/navigation-objective';\nimport {Vector2} from '../../../core/tools/vector2';\nimport {Permissions} from '../../../core/database/permissions/permissions';\nimport {I18nToolsService} from '../../../core/tools/i18n-tools.service';\n+import {TotalPricePopupComponent} from '../total-price-popup/total-price-popup.component';\n@Component({\nselector: 'app-list-details-panel',\n@@ -67,10 +68,16 @@ export class ListDetailsPanelComponent implements OnChanges, OnInit {\npermissions: Permissions;\n+ hasVendors = false;\n+\nconstructor(public settings: SettingsService, private dataService: LocalizedDataService, private dialog: MatDialog,\nprivate l12n: LocalizedDataService, private i18nTools: I18nToolsService) {\n}\n+ showTotalPrice(): void {\n+ this.dialog.open(TotalPricePopupComponent, {data: this.data});\n+ }\n+\n/**\n* Returns a list of tiers based on dependencies between each list row.\n* each tier is a list of rows.\n@@ -221,6 +228,12 @@ export class ListDetailsPanelComponent implements OnChanges, OnInit {\nif (this.zoneBreakdown) {\nthis.zoneBreakdownData = new ZoneBreakdown(this.data);\n}\n+ if (this.data) {\n+ this.hasVendors = this.data.find(row => {\n+ return (row.tradeSources !== undefined && row.tradeSources !== null && row.tradeSources.length > 0)\n+ || (row.vendors !== undefined && row.vendors !== null && row.vendors.length > 0);\n+ }) !== undefined;\n+ }\n}\nngOnInit(): void {\n",
"new_path": "src/app/pages/list/list-details-panel/list-details-panel.component.ts",
"old_path": "src/app/pages/list/list-details-panel/list-details-panel.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -42,6 +42,7 @@ import {ListComponent} from './list/list.component';\nimport {NavigationMapPopupComponent} from './navigation-map-popup/navigation-map-popup.component';\nimport {MapModule} from '../../modules/map/map.module';\nimport {ListFinishedPopupComponent} from './list-finished-popup/list-finished-popup.component';\n+import {TotalPricePopupComponent} from './total-price-popup/total-price-popup.component';\nconst routes: Routes = [\n{\n@@ -109,6 +110,7 @@ const routes: Routes = [\nListComponent,\nNavigationMapPopupComponent,\nListFinishedPopupComponent,\n+ TotalPricePopupComponent,\n],\nentryComponents: [\nRegenerationPopupComponent,\n@@ -119,6 +121,7 @@ const routes: Routes = [\nImportInputBoxComponent,\nNavigationMapPopupComponent,\nListFinishedPopupComponent,\n+ TotalPricePopupComponent,\n]\n})\nexport class ListModule {\n",
"new_path": "src/app/pages/list/list.module.ts",
"old_path": "src/app/pages/list/list.module.ts"
},
{
"change_type": "ADD",
"diff": "+<h3 mat-dialog-title>{{'LIST.Total_price' | translate}}</h3>\n+<div mat-dialog-content>\n+ <mat-list dense>\n+ <mat-list-item *ngFor=\"let row of totalPrice\">\n+ <img src=\"https://secure.xivdb.com/img/game/065000/065002.png\" alt=\"\" *ngIf=\"row.currencyId === -1\"\n+ mat-list-avatar>\n+ <app-item-icon [item]=\"{icon: row.currencyIcon, id: row.currencyId}\" mat-list-avatar></app-item-icon>\n+ <p matLine>{{row.amount}}</p>\n+ </mat-list-item>\n+ </mat-list>\n+</div>\n",
"new_path": "src/app/pages/list/total-price-popup/total-price-popup.component.html",
"old_path": null
},
{
"change_type": "ADD",
"diff": "",
"new_path": "src/app/pages/list/total-price-popup/total-price-popup.component.scss",
"old_path": "src/app/pages/list/total-price-popup/total-price-popup.component.scss"
},
{
"change_type": "ADD",
"diff": "+import {Component, Inject, OnInit} from '@angular/core';\n+import {ListRow} from '../../../model/list/list-row';\n+import {MAT_DIALOG_DATA} from '@angular/material';\n+import {TradeSource} from '../../../model/list/trade-source';\n+import {ItemComponent} from '../../../modules/item/item/item.component';\n+\n+@Component({\n+ selector: 'app-total-price-popup',\n+ templateUrl: './total-price-popup.component.html',\n+ styleUrls: ['./total-price-popup.component.scss']\n+})\n+export class TotalPricePopupComponent implements OnInit {\n+\n+ totalPrice: { currencyId: number, currencyIcon: number, amount: number }[] = [];\n+\n+ constructor(@Inject(MAT_DIALOG_DATA) private rows: ListRow[]) {\n+ }\n+\n+ getTradeSourceByPriority(tradeSources: TradeSource[]): TradeSource {\n+ return tradeSources.sort((a, b) => {\n+ return ItemComponent.TRADE_SOURCES_PRIORITIES[a.trades[0].currencyId]\n+ > ItemComponent.TRADE_SOURCES_PRIORITIES[b.trades[0].currencyId] ? -1 : 1;\n+ })[0];\n+ }\n+\n+ ngOnInit() {\n+ this.totalPrice = this.rows.reduce((result, row) => {\n+ if (row.vendors !== null && row.vendors.length > 0) {\n+ row.vendors.forEach(vendor => {\n+ // We'll use -1 as currencyId for gil.\n+ const gilsRow = result.find(r => r.currencyId === -1);\n+ if (gilsRow === undefined) {\n+ result.push({currencyId: -1, currencyIcon: -1, amount: vendor.price * (row.amount - row.done)});\n+ } else {\n+ gilsRow.amount += vendor.price * (row.amount - row.done);\n+ }\n+ });\n+ } else if (row.tradeSources !== undefined && row.tradeSources.length > 0) {\n+ const tradeSource = this.getTradeSourceByPriority(row.tradeSources);\n+ const trade = tradeSource.trades.sort((ta, tb) => ta.currencyAmount / ta.itemAmount - tb.currencyAmount / tb.itemAmount)[0];\n+ const tradeRow = result.find(r => r.currencyId === trade.currencyId);\n+ if (tradeRow === undefined) {\n+ result.push({\n+ currencyId: trade.currencyId,\n+ currencyIcon: trade.currencyIcon,\n+ amount: trade.currencyAmount * (row.amount - row.done)\n+ });\n+ } else {\n+ tradeRow.amount += trade.currencyAmount * (row.amount - row.done);\n+ }\n+ }\n+ return result;\n+ }, []);\n+ }\n+\n+}\n",
"new_path": "src/app/pages/list/total-price-popup/total-price-popup.component.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "\"Copied_x_times\": \"Copied {{count}} times\",\n\"Enable_crystals_tracking\": \"Enable crystals tracking\",\n\"Copy_as_text\": \"Copy as text\",\n+ \"Total_price\": \"Total trades (gils and currencies)\",\n\"BUTTONS\": {\n\"Add_link_description\": \"Create a custom link for this list\",\n\"Create_template_description\": \"Create a template link for this list, which will create a copy of the list for whoever opens it\",\n",
"new_path": "src/assets/i18n/en.json",
"old_path": "src/assets/i18n/en.json"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | feat: new dialog box to show total cost of a list section (gils and trades)
#407 | 1 | feat | null |
730,429 | 14.06.2018 16:42:38 | 14,400 | 9912b7167556ac26c72c14a35bb584bc6fe8eced | feat(widget-space-demo): update props to destination | [
{
"change_type": "MODIFY",
"diff": "@@ -20,8 +20,8 @@ import TokenInput from '../token-input';\nimport styles from './styles.css';\n-const MODE_ONE_ON_ONE = 'MODE_ONE_ON_ONE';\n-const MODE_SPACE = 'MODE_SPACE';\n+const MODE_ONE_ON_ONE = 'email';\n+const MODE_SPACE = 'spaceId';\nconst widgetElementId = 'my-ciscospark-widget';\n@@ -69,29 +69,18 @@ class DemoWidgetSpace extends Component {\nelse {\ncookies.set('spaceId', this.state.spaceId);\n}\n- const toPerson = this.state.mode === MODE_ONE_ON_ONE ? this.state.toPersonEmail : '';\n- const toSpace = this.state.mode === MODE_SPACE ? this.state.spaceId : '';\n+ const destinationId = this.state.mode === MODE_ONE_ON_ONE ? this.state.toPersonEmail : this.state.spaceId;\nconst widgetEl = document.getElementById(widgetElementId);\n- if (toPerson) {\nciscospark.widget(widgetEl).spaceWidget({\naccessToken: this.state.accessToken,\nonEvent: (eventName, detail) => {\nwindow.ciscoSparkEvents.push({eventName, detail});\n},\n- spaceActivities: this.state.activities,\n- toPersonEmail: toPerson\n+ destinationId,\n+ destinationType: this.state.mode,\n+ spaceActivities: this.state.activities\n});\n- }\n- if (toSpace) {\n- ciscospark.widget(widgetEl).spaceWidget({\n- accessToken: this.state.accessToken,\n- onEvent: (eventName, detail) => {\n- window.ciscoSparkEvents.push({eventName, detail});\n- },\n- spaceActivities: this.state.activities,\n- spaceId: toSpace\n- });\n- }\n+\nthis.setState({running: true});\n}\n@@ -136,23 +125,29 @@ class DemoWidgetSpace extends Component {\ngenerateExampleCode() {\nconst {\n- accessToken, displayToken, spaceId, toPersonEmail\n+ accessToken, activities, displayToken, spaceId, toPersonEmail\n} = this.state;\nconst displayedAccessToken = displayToken ? accessToken : 'YOUR_ACCESS_TOKEN';\n- let globalToField, inlineToField;\n+ const globalActivityTypesField = `activities: ${JSON.stringify(activities)}`;\n+ let globalDestinationIdField, globalDestinationTypeField, inlineDestinationIdField, inlineDestinationTypeField;\nif (this.state.mode === MODE_ONE_ON_ONE) {\n- inlineToField = `data-to-person-email=\"${toPersonEmail || 'TO_PERSON_EMAIL'}\"`;\n- globalToField = `toPersonEmail: '${toPersonEmail || 'TO_PERSON_EMAIL'}'`;\n+ inlineDestinationIdField = `data-destination-id=\"${toPersonEmail || 'TO_PERSON_EMAIL'}\"`;\n+ inlineDestinationTypeField = 'data-destination-type=\"email\"';\n+ globalDestinationIdField = `destinationId: '${toPersonEmail || 'TO_PERSON_EMAIL'}'`;\n+ globalDestinationTypeField = 'destinationType: \"email\"';\n}\nelse {\n- globalToField = `spaceId: '${spaceId || 'SPACE_ID'}'`;\n- inlineToField = `data-space-id=\"${spaceId || 'SPACE_ID'}\"`;\n+ globalDestinationIdField = `destinationId: '${spaceId || 'SPACE_ID'}'`;\n+ globalDestinationTypeField = 'destinationType: \"spaceId\"';\n+ inlineDestinationIdField = `data-destination-id=\"${spaceId || 'SPACE_ID'}\"`;\n+ inlineDestinationTypeField = 'data-destination-type=\"spaceId\"';\n}\nconst inlineCode = `<div\ndata-toggle=\"ciscospark-space\"\ndata-access-token=\"${displayedAccessToken}\"\n- ${inlineToField}\n+ ${inlineDestinationIdField}\n+ ${inlineDestinationTypeField}\n/>`;\nconst globalCode = `<div id=\"my-ciscospark-widget\" />\n<script>\n@@ -160,7 +155,9 @@ class DemoWidgetSpace extends Component {\n// Init a new widget\nciscospark.widget(widgetEl).spaceWidget({\naccessToken: '${displayedAccessToken}',\n- ${globalToField}\n+ ${globalDestinationIdField},\n+ ${globalDestinationTypeField},\n+ ${globalActivityTypesField}\n});\n</script>`;\nreturn {\n",
"new_path": "packages/node_modules/@ciscospark/widget-space-demo/src/components/demo-widget-space/index.js",
"old_path": "packages/node_modules/@ciscospark/widget-space-demo/src/components/demo-widget-space/index.js"
}
] | JavaScript | MIT License | webex/react-widgets | feat(widget-space-demo): update props to destination | 1 | feat | widget-space-demo |
730,412 | 14.06.2018 16:47:11 | 0 | 45638244335ffb47c72a9e59f6b232575cf9a5db | chore(release): 0.1.310 | [
{
"change_type": "MODIFY",
"diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.1.310\"></a>\n+## [0.1.310](https://github.com/webex/react-ciscospark/compare/v0.1.309...v0.1.310) (2018-06-14)\n+\n+\n+### Features\n+\n+* **all:** remove group calling feature flag ([dc3d285](https://github.com/webex/react-ciscospark/commit/dc3d285))\n+* **all:** remove roster feature flag ([aff906d](https://github.com/webex/react-ciscospark/commit/aff906d))\n+* **widget-message:** remove mentions feature flag ([46a8e81](https://github.com/webex/react-ciscospark/commit/46a8e81))\n+\n+\n+\n<a name=\"0.1.309\"></a>\n## [0.1.309](https://github.com/webex/react-ciscospark/compare/v0.1.308...v0.1.309) (2018-06-13)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@ciscospark/react-ciscospark\",\n- \"version\": \"0.1.309\",\n+ \"version\": \"0.1.310\",\n\"description\": \"The Cisco Spark for React library allows developers to easily incorporate Spark functionality into an application.\",\n\"scripts\": {\n\"build\": \"./scripts/build/index.js\",\n",
"new_path": "package.json",
"old_path": "package.json"
}
] | JavaScript | MIT License | webex/react-widgets | chore(release): 0.1.310 | 1 | chore | release |
217,922 | 14.06.2018 17:11:23 | -7,200 | 9ada75de9f6f09c644d46f2edcd98256ea9a6cf9 | fix: fixed an issue with alarms not showing proper location | [
{
"change_type": "MODIFY",
"diff": "@@ -331,7 +331,7 @@ export class AlarmService {\n} else if (this._isSpawned(b, time)) {\nreturn 1;\n} else {\n- return this.getMinutesBefore(time, a.spawn) > this.getMinutesBefore(time, b.spawn) ? 1 : -1;\n+ return this.getMinutesBefore(time, (a.spawn || 24)) > this.getMinutesBefore(time, (b.spawn || 24)) ? 1 : -1;\n}\n})[0]\n}\n",
"new_path": "src/app/core/time/alarm.service.ts",
"old_path": "src/app/core/time/alarm.service.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -90,8 +90,8 @@ export class AlarmsComponent {\nif (this.alarmService.isAlarmSpawned(b, time)) {\nreturn 1;\n}\n- return this.alarmService.getMinutesBefore(time, a.spawn) < this.alarmService.getMinutesBefore(time, b.spawn)\n- ? -1 : 1;\n+ return this.alarmService.getMinutesBefore(time, (a.spawn || 24)) <\n+ this.alarmService.getMinutesBefore(time, (b.spawn || 24)) ? -1 : 1;\n});\n});\nreturn result;\n",
"new_path": "src/app/pages/alarms/alarms/alarms.component.ts",
"old_path": "src/app/pages/alarms/alarms/alarms.component.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | fix: fixed an issue with alarms not showing proper location
#407 | 1 | fix | null |
217,922 | 14.06.2018 17:31:22 | -7,200 | 8a7d164057d2c65288549cf9775de677e70feb11 | feat: you can now customize echo notification in craft macros
closes | [
{
"change_type": "MODIFY",
"diff": "<h3 mat-dialog-title>{{'SIMULATOR.Generated_macro' | translate}}</h3>\n<div mat-dialog-content class=\"content\">\n+ <div class=\"config\">\n<mat-checkbox [(ngModel)]=\"addEcho\" (ngModelChange)=\"generateMacros()\">\n{{'SIMULATOR.Include_sound_end' | translate}}\n</mat-checkbox>\n+ <mat-checkbox [(ngModel)]=\"fixedEcho\" [disabled]=\"!addEcho\" (ngModelChange)=\"generateMacros()\">\n+ {{'SIMULATOR.Fixed_notification_number' | translate}}\n+ </mat-checkbox>\n+ <mat-form-field>\n+ <input type=\"number\" [(ngModel)]=\"echoSeNumber\" [disabled]=\"!addEcho\" (ngModelChange)=\"generateMacros()\"\n+ placeholder=\"{{'SIMULATOR.Starting_echo_number' | translate}}\" matInput>\n+ </mat-form-field>\n+ </div>\n<div class=\"macro\">\n<pre *ngFor=\"let macroFragment of macro\" class=\"macro-fragment\">\n<button mat-icon-button class=\"copy-macro\" ngxClipboard [cbContent]=\"getText(macroFragment)\">\n",
"new_path": "src/app/pages/simulator/components/macro-popup/macro-popup.component.html",
"old_path": "src/app/pages/simulator/components/macro-popup/macro-popup.component.html"
},
{
"change_type": "MODIFY",
"diff": ".content {\npadding-top: 15px;\n+ .config {\n+ display: flex;\n+ flex-direction: column;\n+ }\n.macro-fragment {\ndisplay: flex;\nflex-direction: column;\n",
"new_path": "src/app/pages/simulator/components/macro-popup/macro-popup.component.scss",
"old_path": "src/app/pages/simulator/components/macro-popup/macro-popup.component.scss"
},
{
"change_type": "MODIFY",
"diff": "@@ -20,6 +20,10 @@ export class MacroPopupComponent implements OnInit {\npublic addEcho = true;\n+ public echoSeNumber = 1;\n+\n+ public fixedEcho = false;\n+\nconstructor(@Inject(MAT_DIALOG_DATA) private data: { rotation: CraftingAction[], job: CraftingJob }, private l12n: LocalizedDataService,\nprivate i18n: I18nToolsService) {\n}\n@@ -45,11 +49,23 @@ export class MacroPopupComponent implements OnInit {\n}\nmacroFragment.push(`/ac ${actionName} <wait.${action.getWaitDuration()}>`);\nif (macroFragment.length === 14 && this.addEcho) {\n- macroFragment.push(`/echo Macro #${this.macro.length} finished <se.${this.macro.length}>`);\n+ let seNumber: number;\n+ if (this.fixedEcho) {\n+ seNumber = this.echoSeNumber;\n+ } else {\n+ seNumber = this.echoSeNumber - 1 + this.macro.length;\n+ }\n+ macroFragment.push(`/echo Macro #${this.macro.length} finished <se.${seNumber}>`);\n}\n});\nif (this.macro[this.macro.length - 1].length < 15 && this.addEcho) {\n- this.macro[this.macro.length - 1].push('/echo Craft finished <se.4>')\n+ let seNumber: number;\n+ if (this.fixedEcho) {\n+ seNumber = this.echoSeNumber;\n+ } else {\n+ seNumber = this.echoSeNumber + this.macro.length;\n+ }\n+ this.macro[this.macro.length - 1].push(`/echo Craft finished <se.${seNumber}>`)\n}\nif (this.aactionsMacro.length > 0) {\nthis.aactionsMacro.push('/echo Cross class setup finished <se.4>');\n",
"new_path": "src/app/pages/simulator/components/macro-popup/macro-popup.component.ts",
"old_path": "src/app/pages/simulator/components/macro-popup/macro-popup.component.ts"
},
{
"change_type": "MODIFY",
"diff": "\"Not_found\": \"Page not found\"\n},\n\"SIMULATOR\": {\n+ \"Fixed_notification_number\": \"Fixed notification\",\n+ \"Starting_echo_number\": \"Notification #\",\n\"Import_macro\": \"Import from ingame macro\",\n\"Ingame_macro\": \"Ingame macro\",\n\"Min_stats\": \"Minimum stats\",\n",
"new_path": "src/assets/i18n/en.json",
"old_path": "src/assets/i18n/en.json"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | feat: you can now customize echo notification in craft macros
closes #407 | 1 | feat | null |
724,040 | 14.06.2018 18:26:54 | -3,600 | dae0b1c2f6458220c6992b28f3b28afebb8089e3 | fix: wrapper.setSelected() to work on select with optgroups | [
{
"change_type": "MODIFY",
"diff": "@@ -641,8 +641,14 @@ export default class Wrapper implements BaseWrapper {\nif (tag === 'OPTION') {\n// $FlowIgnore\nel.selected = true\n+ // $FlowIgnore\n+ if (el.parentElement.tagName === 'OPTGROUP') {\n+ // $FlowIgnore\n+ createWrapper(el.parentElement.parentElement, this.options).trigger(event)\n+ } else {\n// $FlowIgnore\ncreateWrapper(el.parentElement, this.options).trigger(event)\n+ }\n} else if (tag === 'SELECT') {\nthrowError('wrapper.setSelected() cannot be called on select. Call it on one of its options')\n} else if (tag === 'INPUT' && type === 'checkbox') {\n",
"new_path": "packages/test-utils/src/wrapper.js",
"old_path": "packages/test-utils/src/wrapper.js"
},
{
"change_type": "MODIFY",
"diff": "<option value=\"selectB\"></option>\n<option value=\"selectC\"></option>\n</select>\n+ <select v-model=\"selectVal\" class=\"with-optgroups\">\n+ <optgroup label=\"Group1\">\n+ <option value=\"selectA\"></option>\n+ <option value=\"selectB\"></option>\n+ </optgroup>\n+ <optgroup label=\"Group2\">\n+ <option value=\"selectC\"></option>\n+ </optgroup>\n+ </select>\n<label id=\"label-el\"></label>\n<span class=\"checkboxResult\" v-if=\"checkboxVal\">checkbox checked</span>\n",
"new_path": "test/resources/components/component-with-input.vue",
"old_path": "test/resources/components/component-with-input.vue"
},
{
"change_type": "MODIFY",
"diff": "@@ -22,6 +22,17 @@ describeWithShallowAndMount('setSelected', (mountingMethod) => {\nexpect(wrapper.text()).to.contain('selectA')\n})\n+ it('updates dom with select v-model for select with optgroups', () => {\n+ const wrapper = mountingMethod(ComponentWithInput)\n+ const options = wrapper.find('select.with-optgroups').findAll('option')\n+\n+ options.at(1).setSelected()\n+ expect(wrapper.text()).to.contain('selectB')\n+\n+ options.at(0).setSelected()\n+ expect(wrapper.text()).to.contain('selectA')\n+ })\n+\nit('throws error if wrapper does not contain element', () => {\nconst wrapper = mountingMethod({ render: (h) => h('div') })\nconst div = wrapper.find('div')\n",
"new_path": "test/specs/wrapper/setSelected.spec.js",
"old_path": "test/specs/wrapper/setSelected.spec.js"
}
] | JavaScript | MIT License | vuejs/vue-test-utils | fix: wrapper.setSelected() to work on select with optgroups (#715) | 1 | fix | null |
724,077 | 14.06.2018 19:29:25 | -7,200 | 7fa2fb390b7b4c5a4105315876a1f72aaf1684bc | feat: silence warnings when updating prop | [
{
"change_type": "MODIFY",
"diff": "@@ -94,3 +94,17 @@ import VueTestUtils from '@vue/test-utils'\nVueTestUtils.config.logModifiedComponents = false\n```\n+\n+### `silentWarnings`\n+\n+- type: `Boolean`\n+- default: `true`\n+\n+It suppresses warnings triggered by Vue while mutating component's observables (e.g. props). When set to `false`, all warnings are visible in the console. This is a configurable way which relies on `Vue.config.silent`.\n+Example:\n+\n+```js\n+import VueTestUtils from '@vue/test-utils'\n+\n+VueTestUtils.config.silentWarnings = false\n+```\n",
"new_path": "docs/api/config.md",
"old_path": "docs/api/config.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -9,5 +9,6 @@ export default {\nmocks: {},\nmethods: {},\nprovide: {},\n- logModifiedComponents: true\n+ logModifiedComponents: true,\n+ silentWarnings: true\n}\n",
"new_path": "packages/test-utils/src/config.js",
"old_path": "packages/test-utils/src/config.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -9,6 +9,7 @@ import {\nNAME_SELECTOR,\nFUNCTIONAL_OPTIONS\n} from './consts'\n+import config from './config'\nimport {\nvmCtorMatchesName,\nvmCtorMatchesSelector,\n@@ -512,6 +513,8 @@ export default class Wrapper implements BaseWrapper {\n* Sets vm props\n*/\nsetProps (data: Object) {\n+ const originalConfig = Vue.config.silent\n+ Vue.config.silent = config.silentWarnings\nif (this.isFunctionalComponent) {\nthrowError('wrapper.setProps() cannot be called on a functional component')\n}\n@@ -546,6 +549,7 @@ export default class Wrapper implements BaseWrapper {\n// $FlowIgnore : Problem with possibly null this.vm\nthis.vnode = this.vm._vnode\norderWatchers(this.vm || this.vnode.context.$root)\n+ Vue.config.silent = originalConfig\n}\n/**\n",
"new_path": "packages/test-utils/src/wrapper.js",
"old_path": "packages/test-utils/src/wrapper.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -2,6 +2,7 @@ import {\ndescribeWithShallowAndMount,\nvueVersion\n} from '~resources/utils'\n+import ComponentWithProps from '~resources/components/component-with-props.vue'\nimport {\nitDoNotRunIf,\nitSkipIf\n@@ -10,15 +11,17 @@ import { config, TransitionStub, TransitionGroupStub, createLocalVue } from '~vu\nimport Vue from 'vue'\ndescribeWithShallowAndMount('config', (mountingMethod) => {\n- let configStubsSave\n- let consoleError\n- let configLogSave\n+ let configStubsSave,\n+ consoleError,\n+ configLogSave,\n+ configSilentWarningsSave\nbeforeEach(() => {\nTransitionGroupStub.name = 'another-temp-name'\nTransitionStub.name = 'a-temp-name'\nconfigStubsSave = config.stubs\nconfigLogSave = config.logModifiedComponents\n+ configSilentWarningsSave = config.silentWarnings\nconsoleError = sinon.stub(console, 'error')\n})\n@@ -27,6 +30,7 @@ describeWithShallowAndMount('config', (mountingMethod) => {\nTransitionStub.name = 'transition'\nconfig.stubs = configStubsSave\nconfig.logModifiedComponents = configLogSave\n+ config.silentWarnings = configSilentWarningsSave\nconsoleError.restore()\n})\n@@ -137,6 +141,38 @@ describeWithShallowAndMount('config', (mountingMethod) => {\nexpect(wrapper.contains(TransitionStub)).to.equal(false)\n})\n+ it('doesn\\'t throw Vue warning when silentWarnings is set to true', () => {\n+ config.silentWarnings = true\n+ const localVue = createLocalVue()\n+ const wrapper = mountingMethod(ComponentWithProps, {\n+ propsData: {\n+ prop1: 'example'\n+ },\n+ localVue\n+ })\n+ expect(wrapper.vm.prop1).to.equal('example')\n+ wrapper.setProps({\n+ prop1: 'new value'\n+ })\n+ expect(consoleError.called).to.equal(false)\n+ })\n+\n+ it('does throw Vue warning when silentWarnings is set to false', () => {\n+ config.silentWarnings = false\n+ const localVue = createLocalVue()\n+ const wrapper = mountingMethod(ComponentWithProps, {\n+ propsData: {\n+ prop1: 'example'\n+ },\n+ localVue\n+ })\n+ expect(wrapper.vm.prop1).to.equal('example')\n+ wrapper.setProps({\n+ prop1: 'new value'\n+ })\n+ expect(consoleError.called).to.equal(true)\n+ })\n+\nitSkipIf(\nvueVersion < 2.3,\n'does not log when component is extended if logModifiedComponents is false', () => {\n",
"new_path": "test/specs/config.spec.js",
"old_path": "test/specs/config.spec.js"
}
] | JavaScript | MIT License | vuejs/vue-test-utils | feat: silence warnings when updating prop (#688) | 1 | feat | null |
815,745 | 14.06.2018 20:16:15 | -10,800 | 22eb640bad612ba8424e884e2ed63f8fb0e93948 | refactor: rename isOpen to opened | [
{
"change_type": "MODIFY",
"diff": "autocomplete=\"{{dropdownId}}\"\n[id]=\"labelForId\"\n[readOnly]=\"!searchable\"\n- [disabled]=\"isDisabled\"\n+ [disabled]=\"disabled\"\n[value]=\"filterValue\"\n(input)=\"filter(filterInput.value)\"\n(focus)=\"onInputFocus()\"\n(blur)=\"onInputBlur()\"\n(change)=\"$event.stopPropagation()\"\nrole=\"combobox\"\n- [attr.aria-expanded]=\"isOpen\"\n- [attr.aria-owns]=\"isOpen ? dropdownId : null\"\n- [attr.aria-activedescendant]=\"isOpen ? itemsList?.markedItem?.htmlId : null\">\n+ [attr.aria-expanded]=\"opened\"\n+ [attr.aria-owns]=\"opened ? dropdownId : null\"\n+ [attr.aria-activedescendant]=\"opened ? itemsList?.markedItem?.htmlId : null\">\n</div>\n</div>\n</span>\n</div>\n-<ng-dropdown-panel *ngIf=\"isOpen\"\n+<ng-dropdown-panel *ngIf=\"opened\"\nclass=\"ng-dropdown-panel\"\n[virtualScroll]=\"virtualScroll\"\n[bufferAmount]=\"bufferAmount\"\n",
"new_path": "src/ng-select/ng-select.component.html",
"old_path": "src/ng-select/ng-select.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -924,7 +924,7 @@ describe('NgSelectComponent', function () {\nfixture.detectChanges();\nfixture.whenStable().then(() => {\n- expect(fixture.componentInstance.select.isOpen).toBeFalsy();\n+ expect(fixture.componentInstance.select.opened).toBeFalsy();\n})\n}));\n@@ -941,7 +941,7 @@ describe('NgSelectComponent', function () {\nselectOption(fixture, KeyCode.ArrowDown, 0);\ntickAndDetectChanges(fixture);\n- expect(fixture.componentInstance.select.isOpen).toBeTruthy();\n+ expect(fixture.componentInstance.select.opened).toBeTruthy();\n}));\n});\n@@ -965,7 +965,7 @@ describe('NgSelectComponent', function () {\ndescribe('space', () => {\nit('should open dropdown', () => {\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n- expect(select.isOpen).toBe(true);\n+ expect(select.opened).toBe(true);\n});\nit('should open empty dropdown if no items', fakeAsync(() => {\n@@ -1073,9 +1073,9 @@ describe('NgSelectComponent', function () {\ndescribe('esc', () => {\nit('should close opened dropdown', () => {\n- select.isOpen = true;\n+ select.opened = true;\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Esc);\n- expect(select.isOpen).toBe(false);\n+ expect(select.opened).toBe(false);\n});\n});\n@@ -1085,7 +1085,7 @@ describe('NgSelectComponent', function () {\ntick(200);\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Tab);\n- expect(select.isOpen).toBeFalsy()\n+ expect(select.opened).toBeFalsy()\n}));\nit('should close dropdown when [selectOnTab]=\"false\"', fakeAsync(() => {\n@@ -1094,7 +1094,7 @@ describe('NgSelectComponent', function () {\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Tab);\nexpect(select.selectedItems).toEqual([]);\n- expect(select.isOpen).toBeFalsy();\n+ expect(select.opened).toBeFalsy();\n}));\nit('should close dropdown and keep selected value', fakeAsync(() => {\n@@ -1107,7 +1107,7 @@ describe('NgSelectComponent', function () {\nvalue: fixture.componentInstance.cities[0]\n})];\nexpect(select.selectedItems).toEqual(result);\n- expect(select.isOpen).toBeFalsy()\n+ expect(select.opened).toBeFalsy()\n}));\nit('should mark first item on filter when tab', fakeAsync(() => {\n@@ -1208,14 +1208,14 @@ describe('NgSelectComponent', function () {\ndescribe('enter', () => {\nit('should open dropdown when it is closed', () => {\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Enter);\n- expect(select.isOpen).toBe(true);\n+ expect(select.opened).toBe(true);\n});\nit('should select option and close dropdown', () => {\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Enter);\nexpect(select.selectedItems[0].value).toEqual(fixture.componentInstance.cities[0]);\n- expect(select.isOpen).toBe(false);\n+ expect(select.opened).toBe(false);\n});\n});\n});\n@@ -1239,22 +1239,22 @@ describe('NgSelectComponent', function () {\nit('should close dropdown if opened and clicked outside dropdown container', fakeAsync(() => {\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n- expect(fixture.componentInstance.select.isOpen).toBeTruthy();\n+ expect(fixture.componentInstance.select.opened).toBeTruthy();\ndocument.getElementById('outside').click();\nlet event = new MouseEvent('mousedown', { bubbles: true });\ndocument.getElementById('outside').dispatchEvent(event);\ntickAndDetectChanges(fixture);\n- expect(fixture.componentInstance.select.isOpen).toBeFalsy();\n+ expect(fixture.componentInstance.select.opened).toBeFalsy();\n}));\nit('should prevent dropdown close if clicked on select', fakeAsync(() => {\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n- expect(select.isOpen).toBeTruthy();\n+ expect(select.opened).toBeTruthy();\ndocument.getElementById('select').click();\nlet event = new MouseEvent('mousedown', { bubbles: true });\ndocument.getElementById('select').dispatchEvent(event);\ntickAndDetectChanges(fixture);\n- expect(select.isOpen).toBeTruthy();\n+ expect(select.opened).toBeTruthy();\n}));\n});\n@@ -1596,7 +1596,7 @@ describe('NgSelectComponent', function () {\ntickAndDetectChanges(fixture);\nclickArrow();\ntickAndDetectChanges(fixture);\n- expect(fixture.componentInstance.select.isOpen).toBe(false);\n+ expect(fixture.componentInstance.select.opened).toBe(false);\nexpect((<NgOption[]>fixture.componentInstance.select.selectedItems).length).toBe(2);\n}));\n});\n@@ -1614,7 +1614,7 @@ describe('NgSelectComponent', function () {\nselectOption(fixture, KeyCode.ArrowDown, 1);\nexpect(select.selectedItems.length).toBe(3);\nexpect(select.itemsList.filteredItems.length).toBe(0);\n- expect(select.isOpen).toBeFalsy();\n+ expect(select.opened).toBeFalsy();\n}));\nit('should not open dropdown when all items are selected', fakeAsync(() => {\n@@ -1623,7 +1623,7 @@ describe('NgSelectComponent', function () {\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\nexpect(select.selectedItems.length).toBe(3);\nexpect(select.itemsList.filteredItems.length).toBe(0);\n- expect(select.isOpen).toBeFalsy();\n+ expect(select.opened).toBeFalsy();\n}));\nit('should open dropdown when all items are selected and tagging is enabled', fakeAsync(() => {\n@@ -1631,7 +1631,7 @@ describe('NgSelectComponent', function () {\nfixture.componentInstance.cities = [];\ntickAndDetectChanges(fixture);\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n- expect(select.isOpen).toBeTruthy();\n+ expect(select.opened).toBeTruthy();\n}));\nit('should not insert option back to list if it is newly created option', fakeAsync(() => {\n@@ -1919,12 +1919,12 @@ describe('NgSelectComponent', function () {\n// open\nselectInput.triggerEventHandler('mousedown', createEvent({ target: { className: '' } }));\ntickAndDetectChanges(fixture);\n- expect(fixture.componentInstance.select.isOpen).toBe(true);\n+ expect(fixture.componentInstance.select.opened).toBe(true);\n// close\nselectInput.triggerEventHandler('mousedown', createEvent({ target: { className: '' } }));\ntickAndDetectChanges(fixture);\n- expect(fixture.componentInstance.select.isOpen).toBe(false);\n+ expect(fixture.componentInstance.select.opened).toBe(false);\n}));\nit('should not filter when searchable false', fakeAsync(() => {\n@@ -2159,7 +2159,7 @@ describe('NgSelectComponent', function () {\ntickAndDetectChanges(fixture);\nfixture.componentInstance.filter.subscribe();\nfixture.componentInstance.select.open();\n- expect(fixture.componentInstance.select.isOpen).toBeTruthy();\n+ expect(fixture.componentInstance.select.opened).toBeTruthy();\n}));\n});\n@@ -2500,7 +2500,7 @@ describe('NgSelectComponent', function () {\nit('should not open dropdown', fakeAsync(() => {\ntriggerMousedown();\ntickAndDetectChanges(fixture);\n- expect(fixture.componentInstance.select.isOpen).toBe(false);\n+ expect(fixture.componentInstance.select.opened).toBe(false);\n}));\nit('clear button should not appear if select is disabled', fakeAsync(() => {\n@@ -2535,7 +2535,7 @@ describe('NgSelectComponent', function () {\nit('should not open dropdown', fakeAsync(() => {\ntriggerMousedown();\ntickAndDetectChanges(fixture);\n- expect(select.isOpen).toBe(false);\n+ expect(select.opened).toBe(false);\n}));\nit('should focus dropdown', fakeAsync(() => {\n@@ -2567,17 +2567,17 @@ describe('NgSelectComponent', function () {\n// open\ntriggerMousedown();\ntickAndDetectChanges(fixture);\n- expect(fixture.componentInstance.select.isOpen).toBe(true);\n+ expect(fixture.componentInstance.select.opened).toBe(true);\n// close\ntriggerMousedown();\ntickAndDetectChanges(fixture);\n- expect(fixture.componentInstance.select.isOpen).toBe(false);\n+ expect(fixture.componentInstance.select.opened).toBe(false);\n// open\ntriggerMousedown();\ntickAndDetectChanges(fixture);\n- expect(fixture.componentInstance.select.isOpen).toBe(true);\n+ expect(fixture.componentInstance.select.opened).toBe(true);\n}));\n});\n});\n",
"new_path": "src/ng-select/ng-select.component.spec.ts",
"old_path": "src/ng-select/ng-select.component.spec.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -138,8 +138,8 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n@ContentChildren(NgOptionComponent, { descendants: true }) ngOptions: QueryList<NgOptionComponent>;\n@ViewChild('filterInput') filterInput: ElementRef;\n- @HostBinding('class.ng-select-opened') isOpen = false;\n- @HostBinding('class.ng-select-disabled') isDisabled = false;\n+ @HostBinding('class.ng-select-opened') opened = false;\n+ @HostBinding('class.ng-select-disabled') disabled = false;\n@HostBinding('class.ng-select-filtered') get filtered() { return !!this.filterValue && this.searchable };\nitemsList = new ItemsList(this);\n@@ -271,7 +271,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\nhandleArrowClick() {\n- if (this.isOpen) {\n+ if (this.opened) {\nthis.close();\n} else {\nthis.open();\n@@ -313,12 +313,12 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\nsetDisabledState(isDisabled: boolean): void {\n- this.isDisabled = isDisabled;\n+ this.disabled = isDisabled;\nthis._cd.markForCheck();\n}\ntoggle() {\n- if (!this.isOpen) {\n+ if (!this.opened) {\nthis.open();\n} else {\nthis.close();\n@@ -326,14 +326,14 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\nopen() {\n- if (this.isDisabled || this.isOpen || this.itemsList.maxItemsSelected) {\n+ if (this.disabled || this.opened || this.itemsList.maxItemsSelected) {\nreturn;\n}\nif (!this._isTypeahead && !this.addTag && this.itemsList.noItemsToSelect) {\nreturn;\n}\n- this.isOpen = true;\n+ this.opened = true;\nthis.itemsList.markSelectedOrDefault(this.markFirst);\nthis.openEvent.emit();\nif (!this.filterValue) {\n@@ -343,10 +343,10 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\nclose() {\n- if (!this.isOpen) {\n+ if (!this.opened) {\nreturn;\n}\n- this.isOpen = false;\n+ this.opened = false;\nthis._clearSearch();\nthis._onTouched();\nthis.closeEvent.emit();\n@@ -354,7 +354,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\ntoggleItem(item: NgOption) {\n- if (!item || item.disabled || this.isDisabled) {\n+ if (!item || item.disabled || this.disabled) {\nreturn;\n}\n@@ -407,7 +407,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\nshowClear() {\n- return this.clearable && (this.hasValue || this.filterValue) && !this.isDisabled;\n+ return this.clearable && (this.hasValue || this.filterValue) && !this.disabled;\n}\nshowAddTag() {\n@@ -450,7 +450,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nonInputBlur() {\n(<HTMLElement>this.elementRef.nativeElement).classList.remove('ng-select-focused');\nthis.blurEvent.emit(null);\n- if (!this.isOpen && !this.isDisabled) {\n+ if (!this.opened && !this.disabled) {\nthis._onTouched();\n}\nthis._focused = false;\n@@ -483,10 +483,10 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nif (items.length > 0 && this.hasValue) {\nthis.itemsList.mapSelectedItems();\n}\n- if (this.isOpen && isDefined(this.filterValue) && !this._isTypeahead) {\n+ if (this.opened && isDefined(this.filterValue) && !this._isTypeahead) {\nthis.itemsList.filter(this.filterValue);\n}\n- if (this._isTypeahead || this.isOpen) {\n+ if (this._isTypeahead || this.opened) {\nthis.itemsList.markSelectedOrDefault(this.markFirst);\n}\n}\n@@ -598,7 +598,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n.subscribe(term => {\nconst item = this.itemsList.findByLabel(term);\nif (item) {\n- if (this.isOpen) {\n+ if (this.opened) {\nthis.itemsList.markItem(item);\nthis._cd.markForCheck();\n} else {\n@@ -646,21 +646,21 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\nprivate _scrollToMarked() {\n- if (!this.isOpen || !this.dropdownPanel) {\n+ if (!this.opened || !this.dropdownPanel) {\nreturn;\n}\nthis.dropdownPanel.scrollInto(this.itemsList.markedItem);\n}\nprivate _scrollToTag() {\n- if (!this.isOpen || !this.dropdownPanel) {\n+ if (!this.opened || !this.dropdownPanel) {\nreturn;\n}\nthis.dropdownPanel.scrollIntoTag();\n}\nprivate _handleTab($event: KeyboardEvent) {\n- if (!this.isOpen) {\n+ if (!this.opened) {\nreturn;\n}\nif (this.selectOnTab) {\n@@ -679,7 +679,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\nprivate _handleEnter($event: KeyboardEvent) {\n- if (this.isOpen) {\n+ if (this.opened) {\nif (this.itemsList.markedItem) {\nthis.toggleItem(this.itemsList.markedItem);\n} else if (this.addTag) {\n@@ -693,7 +693,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\nprivate _handleSpace($event: KeyboardEvent) {\n- if (this.isOpen) {\n+ if (this.opened) {\nreturn;\n}\nthis.open();\n@@ -713,7 +713,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\nprivate _handleArrowUp($event: KeyboardEvent) {\n- if (!this.isOpen) {\n+ if (!this.opened) {\nreturn;\n}\n",
"new_path": "src/ng-select/ng-select.component.ts",
"old_path": "src/ng-select/ng-select.component.ts"
}
] | TypeScript | MIT License | ng-select/ng-select | refactor: rename isOpen to opened | 1 | refactor | null |
217,922 | 15.06.2018 08:49:54 | -7,200 | 95b8f0d15c4b9ec5dfe471477504d2fa9265de4b | fix(alarms): fixed an issue with nodes despawning the day after the spawn | [
{
"change_type": "MODIFY",
"diff": "@@ -378,7 +378,13 @@ export class AlarmService {\nlet despawn = (spawn + alarm.duration) % 24;\ndespawn = despawn === 0 ? 24 : despawn;\nspawn = spawn === 0 ? 24 : spawn;\n+ // If spawn is greater than despawn, it means that it spawns before midnight and despawns after, which is during the next day.\n+ const despawnsNextDay = spawn > despawn;\n+ if (!despawnsNextDay) {\nreturn time.getUTCHours() >= spawn && time.getUTCHours() < despawn;\n+ } else {\n+ return time.getUTCHours() >= spawn || time.getUTCHours() < despawn;\n+ }\n}\n/**\n",
"new_path": "src/app/core/time/alarm.service.ts",
"old_path": "src/app/core/time/alarm.service.ts"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | fix(alarms): fixed an issue with nodes despawning the day after the spawn | 1 | fix | alarms |
791,834 | 15.06.2018 11:35:27 | 25,200 | 036c4dff2e0affbdaad66d16be796a18547ac743 | core: split out BaseArtifacts, those always provided by LH itself | [
{
"change_type": "MODIFY",
"diff": "*/\n'use strict';\n+/** @typedef {void|LH.GathererArtifacts[keyof LH.GathererArtifacts]} PhaseResult */\n+\n/**\n* Base class for all gatherers; defines pass lifecycle methods. The artifact\n* from the gatherer is the last not-undefined value returned by a lifecycle\n*/\nclass Gatherer {\n/**\n- * @return {string}\n+ * @return {keyof LH.GathererArtifacts}\n*/\nget name() {\n+ // @ts-ignore - assume that class name has been added to LH.GathererArtifacts.\nreturn this.constructor.name;\n}\n@@ -29,7 +32,7 @@ class Gatherer {\n/**\n* Called before navigation to target url.\n* @param {LH.Gatherer.PassContext} passContext\n- * @return {*|!Promise<*>}\n+ * @return {PhaseResult|Promise<PhaseResult>}\n*/\nbeforePass(passContext) { }\n@@ -37,7 +40,7 @@ class Gatherer {\n* Called after target page is loaded. If a trace is enabled for this pass,\n* the trace is still being recorded.\n* @param {LH.Gatherer.PassContext} passContext\n- * @return {*|!Promise<*>}\n+ * @return {PhaseResult|Promise<PhaseResult>}\n*/\npass(passContext) { }\n@@ -47,7 +50,7 @@ class Gatherer {\n* and record of network activity are provided in `loadData`.\n* @param {LH.Gatherer.PassContext} passContext\n* @param {LH.Gatherer.LoadData} loadData\n- * @return {*|!Promise<*>}\n+ * @return {PhaseResult|Promise<PhaseResult>}\n*/\nafterPass(passContext, loadData) { }\n",
"new_path": "lighthouse-core/gather/gatherers/gatherer.js",
"old_path": "lighthouse-core/gather/gatherers/gatherer.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -153,7 +153,7 @@ describe('GatherRunner', function() {\ncreateEmulationCheck('calledCpuEmulation')\n);\n- return GatherRunner.setupDriver(driver, {}, {\n+ return GatherRunner.setupDriver(driver, {\nsettings: {},\n}).then(_ => {\nassert.ok(tests.calledDeviceEmulation, 'did not call device emulation');\n@@ -180,7 +180,7 @@ describe('GatherRunner', function() {\ncreateEmulationCheck('calledCpuEmulation', true)\n);\n- return GatherRunner.setupDriver(driver, {}, {\n+ return GatherRunner.setupDriver(driver, {\nsettings: {\ndisableDeviceEmulation: true,\nthrottlingMethod: 'devtools',\n@@ -209,7 +209,7 @@ describe('GatherRunner', function() {\ncreateEmulationCheck('calledCpuEmulation')\n);\n- return GatherRunner.setupDriver(driver, {}, {\n+ return GatherRunner.setupDriver(driver, {\nsettings: {\nthrottlingMethod: 'provided',\n},\n@@ -238,7 +238,7 @@ describe('GatherRunner', function() {\ncreateEmulationCheck('calledCpuEmulation')\n);\n- return GatherRunner.setupDriver(driver, {}, {\n+ return GatherRunner.setupDriver(driver, {\nsettings: {\nthrottlingMethod: 'devtools',\nthrottling: {\n@@ -279,10 +279,9 @@ describe('GatherRunner', function() {\nclearDataForOrigin: createCheck('calledClearStorage'),\nblockUrlPatterns: asyncFunc,\nsetExtraHTTPHeaders: asyncFunc,\n- getUserAgent: () => Promise.resolve('Fake user agent'),\n};\n- return GatherRunner.setupDriver(driver, {}, {settings: {}}).then(_ => {\n+ return GatherRunner.setupDriver(driver, {settings: {}}).then(_ => {\nassert.equal(tests.calledCleanBrowserCaches, false);\nassert.equal(tests.calledClearStorage, true);\n});\n@@ -338,10 +337,9 @@ describe('GatherRunner', function() {\nclearDataForOrigin: createCheck('calledClearStorage'),\nblockUrlPatterns: asyncFunc,\nsetExtraHTTPHeaders: asyncFunc,\n- getUserAgent: () => Promise.resolve('Fake user agent'),\n};\n- return GatherRunner.setupDriver(driver, {}, {\n+ return GatherRunner.setupDriver(driver, {\nsettings: {disableStorageReset: true},\n}).then(_ => {\nassert.equal(tests.calledCleanBrowserCaches, false);\n@@ -824,8 +822,6 @@ describe('GatherRunner', function() {\nPromise.reject(someOtherError),\nPromise.resolve(1729),\n],\n-\n- LighthouseRunWarnings: [],\n};\nreturn GatherRunner.collectArtifacts(gathererResults, {}).then(artifacts => {\n@@ -843,11 +839,11 @@ describe('GatherRunner', function() {\n'warning2',\n];\n- const gathererResults = {\n+ const baseArtifacts = {\nLighthouseRunWarnings,\n};\n- return GatherRunner.collectArtifacts(gathererResults, {}).then(artifacts => {\n+ return GatherRunner.collectArtifacts({}, baseArtifacts).then(artifacts => {\nassert.deepStrictEqual(artifacts.LighthouseRunWarnings, LighthouseRunWarnings);\n});\n});\n@@ -1023,20 +1019,4 @@ describe('GatherRunner', function() {\n});\n});\n});\n-\n- it('issues a lighthouseRunWarnings if running an old version of Headless', () => {\n- const gathererResults = {\n- LighthouseRunWarnings: [],\n- };\n-\n- const userAgent = 'Mozilla/5.0 AppleWebKit/537.36 HeadlessChrome/63.0.3239.0 Safari/537.36';\n- GatherRunner.warnOnHeadless(userAgent, gathererResults);\n- assert.strictEqual(gathererResults.LighthouseRunWarnings.length, 0);\n-\n- const oldUserAgent = 'Mozilla/5.0 AppleWebKit/537.36 HeadlessChrome/62.0.3239.0 Safari/537.36';\n- GatherRunner.warnOnHeadless(oldUserAgent, gathererResults);\n- assert.strictEqual(gathererResults.LighthouseRunWarnings.length, 1);\n- const warning = gathererResults.LighthouseRunWarnings[0];\n- assert.ok(/Headless Chrome/.test(warning));\n- });\n});\n",
"new_path": "lighthouse-core/test/gather/gather-runner-test.js",
"old_path": "lighthouse-core/test/gather/gather-runner-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -12,18 +12,31 @@ type LanternSimulator = InstanceType<typeof _LanternSimulator>;\ndeclare global {\nmodule LH {\n- export interface Artifacts extends ComputedArtifacts {\n- // Created by by gather-runner\n+ export interface Artifacts extends BaseArtifacts, GathererArtifacts, ComputedArtifacts {}\n+\n+ /** Artifacts always created by GatherRunner. */\n+ export interface BaseArtifacts {\n+ /** The ISO-8601 timestamp of when the test page was fetched and artifacts collected. */\nfetchTime: string;\n+ /** A set of warnings about unexpected things encountered while loading and testing the page. */\nLighthouseRunWarnings: string[];\n+ /** The user agent string of the version of Chrome that was used by Lighthouse. */\nUserAgent: string;\n+ /** A set of page-load traces, keyed by passName. */\ntraces: {[passName: string]: Trace};\n+ /** A set of DevTools debugger protocol records, keyed by passName. */\ndevtoolsLogs: {[passName: string]: DevtoolsLog};\n+ /** An object containing information about the testing configuration used by Lighthouse. */\nsettings: Config.Settings;\n/** The URL initially requested and the post-redirects URL that was actually loaded. */\nURL: {requestedUrl: string, finalUrl: string};\n+ }\n- // Remaining are provided by default gatherers.\n+ /**\n+ * Artifacts provided by the default gatherers. Augment this interface when adding additional\n+ * gatherers.\n+ */\n+ export interface GathererArtifacts {\n/** The results of running the aXe accessibility tests on the page. */\nAccessibility: Artifacts.Accessibility;\n/** Information on all anchors in the page that aren't nofollow or noreferrer. */\n",
"new_path": "typings/artifacts.d.ts",
"old_path": "typings/artifacts.d.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -22,6 +22,11 @@ declare global {\n[P in K]+?: T[P]\n}\n+ /**\n+ * Exclude void from T\n+ */\n+ type NonVoid<T> = T extends void ? never : T;\n+\n/** Remove properties K from T. */\ntype Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;\n",
"new_path": "typings/externs.d.ts",
"old_path": "typings/externs.d.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -19,6 +19,8 @@ declare global {\npassConfig: Config.Pass\nsettings: Config.Settings;\noptions?: object;\n+ /** Push to this array to add top-level warnings to the LHR. */\n+ LighthouseRunWarnings: Array<string>;\n}\nexport interface LoadData {\n",
"new_path": "typings/gatherer.d.ts",
"old_path": "typings/gatherer.d.ts"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core: split out BaseArtifacts, those always provided by LH itself (#5506) | 1 | core | null |
217,922 | 15.06.2018 11:38:48 | -7,200 | 14a9d5fc065a98b457d8a7f762adf20a6a15559a | feat: you can now associate character using lodestoneId, useful for short names
closes | [
{
"change_type": "MODIFY",
"diff": "<h3 mat-dialog-title>{{'Character_informations' | translate}}</h3>\n<div mat-dialog-content>\n+ <mat-checkbox [(ngModel)]=\"customId\">\n+ {{'Use_lodestoneId' | translate}}\n+ </mat-checkbox>\n+ <div class=\"search\" [style.display]=\"customId?'none':'block'\">\n<mat-form-field>\n- <input matInput #name [(ngModel)]=\"characterName\" placeholder=\"{{'Character_name' | translate}}\" type=\"text\" required>\n+ <input matInput #name [(ngModel)]=\"characterName\" placeholder=\"{{'Character_name' | translate}}\" type=\"text\"\n+ required>\n<mat-error>Required</mat-error>\n</mat-form-field>\n<mat-form-field>\n- <input matInput #server [(ngModel)]=\"serverName\" placeholder=\"{{'Server_name' | translate}}\" type=\"text\" required>\n+ <input matInput #server [(ngModel)]=\"serverName\" placeholder=\"{{'Server_name' | translate}}\" type=\"text\"\n+ required>\n<mat-error>Required</mat-error>\n</mat-form-field>\n<div class=\"loader-container\" *ngIf=\"loading\">\n<img mat-list-avatar src=\"{{character.avatar}}\" alt=\"\">\n<h3 matLine>{{character.name}}</h3>\n<span matLine>{{character.server}}</span>\n- <button mat-raised-button color=\"accent\" (click)=\"select(character.id)\">{{'Select' | translate}}</button>\n+ <button mat-raised-button color=\"accent\" (click)=\"select(character.id)\">{{'Select' | translate}}\n+ </button>\n</mat-list-item>\n</mat-list>\n<div *ngIf=\"(search | async)?.length === 0\">\n<mat-error>{{'Character_not_found' | translate}}</mat-error>\n</div>\n</div>\n+ <div class=\"lodestoneId\" [style.display]=\"customId?'block':'none'\">\n+ <mat-form-field>\n+ <input matInput #lodestoneIdInput [(ngModel)]=\"lodestoneId\" placeholder=\"{{'Lodestone ID' | translate}}\"\n+ type=\"text\" required>\n+ <mat-error>Required</mat-error>\n+ </mat-form-field>\n+ <div class=\"loader-container\" *ngIf=\"loading\">\n+ <mat-spinner></mat-spinner>\n+ </div>\n+ <mat-list dense>\n+ <mat-list-item *ngIf=\"characterFromLodestone$ | async as character; else notFound\">\n+ <img mat-list-avatar src=\"{{character.avatar}}\" alt=\"\">\n+ <h3 matLine>{{character.name}}</h3>\n+ <span matLine>{{character.server}}</span>\n+ <button mat-raised-button color=\"accent\" (click)=\"select(character.id)\">{{'Select' | translate}}\n+ </button>\n+ </mat-list-item>\n+ </mat-list>\n+ <ng-template #notFound>\n+ <mat-error>{{'Character_not_found' | translate}}</mat-error>\n+ </ng-template>\n+ </div>\n+</div>\n<mat-dialog-actions>\n- <button color=\"warn\" (click)=\"logOut()\" mat-raised-button *ngIf=\"disconnectButton\">{{'Disconnect' | translate}}</button>\n+ <button color=\"warn\" (click)=\"logOut()\" mat-raised-button *ngIf=\"disconnectButton\">{{'Disconnect' | translate}}\n+ </button>\n</mat-dialog-actions>\n",
"new_path": "src/app/modules/common-components/character-add-popup/character-add-popup.component.html",
"old_path": "src/app/modules/common-components/character-add-popup/character-add-popup.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -17,14 +17,22 @@ export class CharacterAddPopupComponent implements OnInit {\n@ViewChild('server') serverInput: ElementRef;\n+ @ViewChild('lodestoneIdInput') lodestoneIdInput: ElementRef;\n+\nserverName = '';\ncharacterName: string;\n+ lodestoneId: string;\n+\nsearch: Observable<any[]>;\n+ characterFromLodestone$: Observable<any>;\n+\nloading = false;\n+ customId = false;\n+\nconstructor(private data: DataService,\nprivate userService: UserService,\npublic dialogRef: MatDialogRef<CharacterAddPopupComponent>,\n@@ -60,6 +68,18 @@ export class CharacterAddPopupComponent implements OnInit {\ndebounceTime(250),\nmap(() => this.serverName)\n);\n+ this.characterFromLodestone$ = fromEvent(this.lodestoneIdInput.nativeElement, 'keyup')\n+ .pipe(\n+ debounceTime(250),\n+ map(() => this.lodestoneId),\n+ tap(() => this.loading = true),\n+ switchMap(lodestoneId => {\n+ return this.data.getCharacter(+lodestoneId).pipe(\n+ map(res => res.name === 'Lodestone under maintenance' ? null : res)\n+ );\n+ }),\n+ tap(() => this.loading = false)\n+ );\n// Combine them to observe the result.\nthis.search = combineLatest(name$, server$)\n.pipe(\n",
"new_path": "src/app/modules/common-components/character-add-popup/character-add-popup.component.ts",
"old_path": "src/app/modules/common-components/character-add-popup/character-add-popup.component.ts"
},
{
"change_type": "MODIFY",
"diff": "\"Server_name\": \"Server Name\",\n\"Add_all_recipes\": \"Add results to a list\",\n\"Character_not_found\": \"Character not found\",\n+ \"Use_lodestoneId\": \"Use lodestone ID\",\n+ \"LodestoneId\": \"Lodestone ID\",\n\"List_forked\": \"List copied to your account\",\n\"List_fork\": \"Copy this list to your account\",\n\"List_not_found\": \"List not found or you don't have access to it\",\n",
"new_path": "src/assets/i18n/en.json",
"old_path": "src/assets/i18n/en.json"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | feat: you can now associate character using lodestoneId, useful for short names
closes #392 | 1 | feat | null |
815,745 | 15.06.2018 13:51:50 | -10,800 | ab6c388a22638c5f42f12e842cedf6ddb4b1bee2 | feat(isOpen): allow to control whether dropdown should open or close
closes # | [
{
"change_type": "MODIFY",
"diff": "@@ -131,7 +131,8 @@ map: {\n| [loading] | `boolean` | `-` | no | You can set the loading state from the outside (e.g. async items loading) |\n| loadingText | `string` | `Loading...` | no | Set custom text when for loading items |\n| labelForId | `string` | `-` | no | Id to associate control with label. |\n-| [markFirst] | `boolean` | `true` | no | Marks first item as focused when opening/filtering. Default `true`|\n+| [markFirst] | `boolean` | `true` | no | Marks first item as focused when opening/filtering. |\n+| [isOpen] | `boolean` | `-` | no | Allows to control whether dropdown should open or close. `True` - won't close. `False` - won't open. |\n| maxSelectedItems | `number` | none | no | When multiple = true, allows to set a limit number of selection. |\n| [hideSelected] | `boolean` | `false` | no | Allows to hide selected items. |\n| [multiple] | `boolean` | `false` | no | Allows to select multiple items. |\n",
"new_path": "README.md",
"old_path": "README.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -43,6 +43,16 @@ import { Component, ChangeDetectionStrategy } from '@angular/core';\n[(ngModel)]=\"selectedCompanyCustomPromise\">\n</ng-select>\n---\n+\n+ <hr>\n+ <label>Tagging without dropdown. Press enter to add item</label>\n+ ---html,true\n+ <ng-select [items]=\"[]\"\n+ [addTag]=\"true\"\n+ [multiple]=\"true\"\n+ [isOpen]=\"false\">\n+ </ng-select>\n+ ---\n`\n})\nexport class SelectTagsComponent {\n",
"new_path": "demo/app/examples/tags.component.ts",
"old_path": "demo/app/examples/tags.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -926,7 +926,23 @@ describe('NgSelectComponent', function () {\nfixture.whenStable().then(() => {\nexpect(fixture.componentInstance.select.opened).toBeFalsy();\n})\n+ }));\n+\n+ it('should not close when isOpen is true', async(() => {\n+ const fixture = createTestingModule(\n+ NgSelectTestCmp,\n+ `<ng-select [items]=\"cities\"\n+ [isOpen]=\"true\"\n+ bindLabel=\"name\"\n+ [(ngModel)]=\"city\">\n+ </ng-select>`);\n+ selectOption(fixture, KeyCode.ArrowDown, 0);\n+ fixture.detectChanges();\n+\n+ fixture.whenStable().then(() => {\n+ expect(fixture.componentInstance.select.opened).toBeTruthy();\n+ })\n}));\nit('should not close on option select when [closeOnSelect]=\"false\"', fakeAsync(() => {\n@@ -968,6 +984,12 @@ describe('NgSelectComponent', function () {\nexpect(select.opened).toBe(true);\n});\n+ it('should not open dropdown when isOpen is false', () => {\n+ select.isOpen = false;\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n+ expect(select.opened).toBeFalsy();\n+ });\n+\nit('should open empty dropdown if no items', fakeAsync(() => {\nfixture.componentInstance.cities = [];\ntickAndDetectChanges(fixture);\n@@ -1967,6 +1989,22 @@ describe('NgSelectComponent', function () {\nexpect(fixture.componentInstance.select.selectedItems).toEqual([result]);\n}));\n+ it('should not mark first item when isOpen is false', fakeAsync(() => {\n+ const fixture = createTestingModule(\n+ NgSelectTestCmp,\n+ `<ng-select [items]=\"cities\"\n+ bindLabel=\"name\"\n+ [isOpen]=\"false\"\n+ [(ngModel)]=\"selectedCity\">\n+ </ng-select>`);\n+\n+ tick(200);\n+ fixture.componentInstance.select.filter('pab');\n+ tick(200);\n+\n+ expect(fixture.componentInstance.select.itemsList.markedItem).toBeUndefined();\n+ }));\n+\nit('should mark first item on filter when selected is not among filtered items', fakeAsync(() => {\nconst fixture = createTestingModule(\nNgSelectTestCmp,\n",
"new_path": "src/ng-select/ng-select.component.spec.ts",
"old_path": "src/ng-select/ng-select.component.spec.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -87,6 +87,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n@Input() appendTo: string;\n@Input() loading = false;\n@Input() closeOnSelect = true;\n+ @Input() isOpen: boolean;\n@Input() hideSelected = false;\n@Input() selectOnTab = false;\n@Input() maxSelectedItems: number;\n@@ -231,6 +232,8 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nbreak;\ncase KeyCode.Esc:\nthis.close();\n+ $event.preventDefault();\n+ $event.stopPropagation();\nbreak;\ncase KeyCode.Backspace:\nthis._handleBackspace();\n@@ -326,7 +329,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\nopen() {\n- if (this.disabled || this.opened || this.itemsList.maxItemsSelected) {\n+ if (this.disabled || this.opened || this.itemsList.maxItemsSelected || this.isOpen === false) {\nreturn;\n}\n@@ -343,7 +346,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\nclose() {\n- if (!this.opened) {\n+ if (!this.opened || this.isOpen) {\nreturn;\n}\nthis.opened = false;\n@@ -437,9 +440,11 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nthis.typeahead.next(this.filterValue);\n} else {\nthis.itemsList.filter(this.filterValue);\n+ if (this.isOpen !== false) {\nthis.itemsList.markSelectedOrDefault(this.markFirst);\n}\n}\n+ }\nonInputFocus() {\n(<HTMLElement>this.elementRef.nativeElement).classList.add('ng-select-focused');\n@@ -679,10 +684,10 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\nprivate _handleEnter($event: KeyboardEvent) {\n- if (this.opened) {\n+ if (this.opened || this.isOpen === false) {\nif (this.itemsList.markedItem) {\nthis.toggleItem(this.itemsList.markedItem);\n- } else if (this.addTag) {\n+ } else if (this.addTag && this.filterValue) {\nthis.selectTag();\n}\n} else {\n",
"new_path": "src/ng-select/ng-select.component.ts",
"old_path": "src/ng-select/ng-select.component.ts"
}
] | TypeScript | MIT License | ng-select/ng-select | feat(isOpen): allow to control whether dropdown should open or close
closes # | 1 | feat | isOpen |
217,922 | 15.06.2018 14:13:45 | -7,200 | 9aa29abe23ba30d6543948f029a63bea714550d0 | chore: [WIP] list drag&drop reorder | [
{
"change_type": "MODIFY",
"diff": "@@ -39,6 +39,9 @@ export class List extends DataWithPermissions {\ncomments: ResourceComment[];\n+ // For ordering purpose.\n+ index = 0;\n+\nconstructor() {\nsuper();\n}\n",
"new_path": "src/app/model/list/list.ts",
"old_path": "src/app/model/list/list.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -23,33 +23,6 @@ mat-expansion-panel.disabled {\nopacity: .5;\n}\n-.drop-zone {\n- min-height: 50px;\n- position: relative;\n- .drop-overlay {\n- position: absolute;\n- top: 0;\n- left: 0;\n- width: 100%;\n- height: 100%;\n- display: flex;\n- align-items: center;\n- justify-content: center;\n- visibility: hidden;\n- opacity: .6;\n- .mat-icon {\n- font-size: 45px;\n- height: 45px;\n- width: 45px;\n- }\n- }\n- &.drag-over-border {\n- .drop-overlay {\n- visibility: visible;\n- }\n- }\n-}\n-\n.compact-timer {\ntext-align: right;\n}\n",
"new_path": "src/app/pages/alarms/alarms/alarms.component.scss",
"old_path": "src/app/pages/alarms/alarms/alarms.component.scss"
},
{
"change_type": "MODIFY",
"diff": "@@ -13,7 +13,8 @@ import {\nMatInputModule,\nMatListModule,\nMatProgressBarModule,\n- MatProgressSpinnerModule, MatRadioModule,\n+ MatProgressSpinnerModule,\n+ MatRadioModule,\nMatSelectModule,\nMatSnackBarModule,\nMatStepperModule,\n@@ -30,6 +31,7 @@ import {WorkshopDeleteConfirmationPopupComponent} from './workshop-delete-confir\nimport {ExternalListImportPopupComponent} from './external-list-import-popup/external-list-import-popup.component';\nimport {PipesModule} from 'app/pipes/pipes.module';\nimport {TooltipModule} from '../../modules/tooltip/tooltip.module';\n+import {NgDragDropModule} from 'ng-drag-drop';\nconst routes: Routes = [\n{\n@@ -46,6 +48,7 @@ const routes: Routes = [\nFormsModule,\nClipboardModule,\n+ NgDragDropModule,\nRouterModule.forChild(routes),\n",
"new_path": "src/app/pages/lists/lists.module.ts",
"old_path": "src/app/pages/lists/lists.module.ts"
},
{
"change_type": "MODIFY",
"diff": "<div *ngIf=\"lists | async as display\">\n<h2>{{'Lists' | translate}}</h2>\n<mat-divider class=\"divider\"></mat-divider>\n- <div class=\"row\" *ngFor=\"let list of display.basicLists;trackBy: trackByListsFn; let i = index; \">\n+ <div *ngFor=\"let list of display.basicLists;trackBy: trackByListsFn; let i = index;\">\n+ <div class=\"drop-zone\" droppable (onDrop)=\"setListIndex(i, $event.dragData)\" [dropScope]=\"'list'\">\n+ <div class=\"drop-overlay accent-background\">\n+ <mat-icon>save_alt</mat-icon>\n+ </div>\n+ </div>\n+ <div draggable\n+ [dragData]=\"list\"\n+ [dragScope]=\"'list'\"\n+ (onDragStart)=\"dragStart($event)\">\n<app-list-panel\n[list]=\"list\"\n[expanded]=\"expanded.indexOf(list.$key) > -1\"\n[templateButton]=\"userData?.patron || userData?.admin\"\n></app-list-panel>\n</div>\n+ </div>\n+ <div class=\"drop-zone\" droppable (onDrop)=\"setListIndex(display.basicLists.length, $event.dragData)\"\n+ [dropScope]=\"'list'\">\n+ <div class=\"drop-overlay accent-background\">\n+ <mat-icon>save_alt</mat-icon>\n+ </div>\n+ </div>\n<div class=\"category\" *ngIf=\"display.publicLists !== undefined && display.publicLists.length > 0\">\n<h2>{{'Public_lists' | translate}}</h2>\n<mat-divider class=\"divider\"></mat-divider>\n",
"new_path": "src/app/pages/lists/lists/lists.component.html",
"old_path": "src/app/pages/lists/lists/lists.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -32,8 +32,17 @@ mat-slide-toggle {\nbackground-color: rgba(123, 123, 123, .2);\n}\n-.row {\n- margin: 5px 0;\n+.drop-zone {\n+ min-height: 5px;\n+}\n+\n+.drag-hint-border {\n+ min-height: 50px;\n+ border: 2px dashed;\n+}\n+\n+.drag-handle {\n+ border: 1px solid red;\n}\n.shared-lists {\n",
"new_path": "src/app/pages/lists/lists/lists.component.scss",
"old_path": "src/app/pages/lists/lists/lists.component.scss"
},
{
"change_type": "MODIFY",
"diff": "@@ -276,6 +276,14 @@ export class ListsComponent extends ComponentWithSubscriptions implements OnInit\nreturn workshop.$key;\n}\n+ setListIndex(index: number, list: List): void {\n+ console.log(index, list.name);\n+ }\n+\n+ dragStart(event: any): void {\n+ console.log(event);\n+ }\n+\nngOnInit() {\nthis.sharedLists = this.userService.getUserData().pipe(\nmergeMap(user => {\n",
"new_path": "src/app/pages/lists/lists/lists.component.ts",
"old_path": "src/app/pages/lists/lists/lists.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -27,37 +27,6 @@ mat-panel-title {\n}\n}\n-.drag-hint-border {\n- border: 2px dashed;\n-}\n-\n-.drop-zone {\n- min-height: 50px;\n- position: relative;\n- .drop-overlay {\n- position: absolute;\n- top: 0;\n- left: 0;\n- width: 100%;\n- height: 100%;\n- display: flex;\n- align-items: center;\n- justify-content: center;\n- visibility: hidden;\n- opacity: .6;\n- .mat-icon {\n- font-size: 45px;\n- height: 45px;\n- width: 45px;\n- }\n- }\n- &.drag-over-border {\n- .drop-overlay {\n- visibility: visible;\n- }\n- }\n-}\n-\n.folder-zone {\nmin-height: 20px;\n.mat-icon {\n",
"new_path": "src/app/pages/simulator/components/rotations-page/rotations-page.component.scss",
"old_path": "src/app/pages/simulator/components/rotations-page/rotations-page.component.scss"
},
{
"change_type": "MODIFY",
"diff": "@@ -222,3 +222,34 @@ mat-form-field:not(.with-infix) {\n}\n}\n}\n+\n+.drop-zone {\n+ min-height: 50px;\n+ position: relative;\n+ .drop-overlay {\n+ position: absolute;\n+ top: 0;\n+ left: 0;\n+ width: 100%;\n+ height: 100%;\n+ display: flex;\n+ align-items: center;\n+ justify-content: center;\n+ visibility: hidden;\n+ opacity: .6;\n+ .mat-icon {\n+ font-size: 45px;\n+ height: 45px;\n+ width: 45px;\n+ }\n+ }\n+ &.drag-over-border {\n+ .drop-overlay {\n+ visibility: visible;\n+ }\n+ }\n+}\n+\n+.drag-hint-border {\n+ border: 2px dashed;\n+}\n",
"new_path": "src/styles.scss",
"old_path": "src/styles.scss"
}
] | TypeScript | MIT License | ffxiv-teamcraft/ffxiv-teamcraft | chore: [WIP] list drag&drop reorder | 1 | chore | null |
730,429 | 15.06.2018 16:04:54 | 14,400 | cb10fc261bf2ea2525813ea43c8c4442a0b5c4d2 | feat(widget-demo): use react component for space widget | [
{
"change_type": "MODIFY",
"diff": "@@ -11,6 +11,8 @@ import {RadioButtonGroup, RadioButton} from 'material-ui/RadioButton';\nimport {Card, CardActions, CardTitle, CardText} from 'material-ui/Card';\nimport Checkbox from 'material-ui/Checkbox';\n+import SpaceWidget from '@ciscospark/widget-space';\n+\nimport TokenInput from '../token-input';\nimport styles from './styles.css';\n@@ -44,7 +46,8 @@ class DemoWidget extends Component {\ndestinationId,\ndestinationPropMode,\nmode,\n- spaceRunning: false\n+ spaceRunning: false,\n+ spaceWidgetProps: {}\n};\n}\n@@ -174,7 +177,6 @@ class DemoWidget extends Component {\nopenSpaceWidget({\ndestinationId, destinationType, toPerson, toPersonId, toSpace\n}) {\n- const widgetEl = document.getElementById(spaceWidgetElementId);\nconst widgetOptions = {\ninitialActivity: 'message',\nonEvent: (eventName, detail) => {\n@@ -203,12 +205,11 @@ class DemoWidget extends Component {\nwidgetOptions.destinationId = destinationId;\nwidgetOptions.destinationType = destinationType;\n}\n- ciscospark.widget(widgetEl).spaceWidget(widgetOptions);\n- this.setState({spaceRunning: true});\n+ this.setState({spaceRunning: true, spaceWidgetProps: widgetOptions});\n}\nrender() {\n- const loadButtonEnabled = this.state.accessToken && this.state.destinationId && !this.state.spaceRunning;\n+ const loadButtonEnabled = this.state.accessToken && this.state.destinationId;\nconst loadRecentsButtonEnabled = this.state.accessToken && !this.state.recentsRunning;\nconst componentSpaceContainerClassNames = [\nstyles.widgetSpaceComponentContainer\n@@ -347,10 +348,10 @@ class DemoWidget extends Component {\n</CardText>\n<CardActions expandable>\n<RaisedButton\n- aria-label=\"Open Widget\"\n+ aria-label={this.state.spaceRunning ? 'Update Space Widget' : 'Open Space Widget'}\ndisabled={!loadButtonEnabled}\nid=\"openWidgetButton\"\n- label=\"Open Space Widget\"\n+ label={this.state.spaceRunning ? 'Update Space Widget' : 'Open Space Widget'}\nonClick={this.handleOpenSpaceWidget}\nprimary\n/>\n@@ -390,7 +391,11 @@ class DemoWidget extends Component {\n</Card>\n<div className={classNames(runningDemosContainerClassNames)}>\n<div className={classNames(componentSpaceContainerClassNames)}>\n- <div id={spaceWidgetElementId} />\n+ <div id={spaceWidgetElementId}>\n+ { this.state.spaceRunning &&\n+ <SpaceWidget {...this.state.spaceWidgetProps} />\n+ }\n+ </div>\n</div>\n<div className={classNames(componentRecentsContainerClassNames)}>\n<div id={recentsWidgetElementId} />\n",
"new_path": "packages/node_modules/@ciscospark/widget-demo/src/components/demo-widget/index.js",
"old_path": "packages/node_modules/@ciscospark/widget-demo/src/components/demo-widget/index.js"
}
] | JavaScript | MIT License | webex/react-widgets | feat(widget-demo): use react component for space widget | 1 | feat | widget-demo |
791,723 | 15.06.2018 16:21:52 | 25,200 | ed5b38ecb40869dda0e817b0d268ee65bd5ad109 | core(tsc): migrate renderer & viewer off typedefs to .d.ts | [
{
"change_type": "MODIFY",
"diff": "/** @typedef {import('./dom.js')} DOM */\n/** @typedef {import('./report-renderer.js')} ReportRenderer */\n-/** @typedef {import('./report-renderer.js').AuditJSON} AuditJSON */\n-/** @typedef {import('./report-renderer.js').CategoryJSON} CategoryJSON */\n-/** @typedef {import('./report-renderer.js').GroupJSON} GroupJSON */\n/** @typedef {import('./details-renderer.js')} DetailsRenderer */\n/** @typedef {import('./util.js')} Util */\n@@ -32,7 +29,7 @@ class CategoryRenderer {\n}\n/**\n- * @param {AuditJSON} audit\n+ * @param {LH.ReportResult.AuditRef} audit\n* @param {number} index\n* @return {Element}\n*/\n@@ -43,7 +40,7 @@ class CategoryRenderer {\n/**\n* Populate an DOM tree with audit details. Used by renderAudit and renderOpportunity\n- * @param {AuditJSON} audit\n+ * @param {LH.ReportResult.AuditRef} audit\n* @param {number} index\n* @param {DocumentFragment} tmpl\n* @return {Element}\n@@ -126,7 +123,7 @@ class CategoryRenderer {\n}\n/**\n- * @param {CategoryJSON} category\n+ * @param {LH.ReportResult.Category} category\n* @return {Element}\n*/\nrenderCategoryHeader(category) {\n@@ -149,7 +146,7 @@ class CategoryRenderer {\n/**\n* Renders the group container for a group of audits. Individual audit elements can be added\n* directly to the returned element.\n- * @param {GroupJSON} group\n+ * @param {LH.Result.ReportGroup} group\n* @param {{expandable: boolean, itemCount?: number}} opts\n* @return {Element}\n*/\n@@ -235,8 +232,8 @@ class CategoryRenderer {\n}\n/**\n- * @param {Array<AuditJSON>} manualAudits\n- * @param {string} manualDescription\n+ * @param {Array<LH.ReportResult.AuditRef>} manualAudits\n+ * @param {string} [manualDescription]\n* @return {Element}\n*/\n_renderManualAudits(manualAudits, manualDescription) {\n@@ -259,7 +256,7 @@ class CategoryRenderer {\n}\n/**\n- * @param {CategoryJSON} category\n+ * @param {LH.ReportResult.Category} category\n* @return {DocumentFragment}\n*/\nrenderScoreGauge(category) {\n@@ -293,8 +290,8 @@ class CategoryRenderer {\n}\n/**\n- * @param {CategoryJSON} category\n- * @param {Object<string, GroupJSON>} groupDefinitions\n+ * @param {LH.ReportResult.Category} category\n+ * @param {Object<string, LH.Result.ReportGroup>} [groupDefinitions]\n* @return {Element}\n*/\nrender(category, groupDefinitions) {\n@@ -306,7 +303,7 @@ class CategoryRenderer {\nconst manualAudits = auditRefs.filter(audit => audit.result.scoreDisplayMode === 'manual');\nconst nonManualAudits = auditRefs.filter(audit => !manualAudits.includes(audit));\n- /** @type {Object<string, {passed: Array<AuditJSON>, failed: Array<AuditJSON>, notApplicable: Array<AuditJSON>}>} */\n+ /** @type {Object<string, {passed: Array<LH.ReportResult.AuditRef>, failed: Array<LH.ReportResult.AuditRef>, notApplicable: Array<LH.ReportResult.AuditRef>}>} */\nconst auditsGroupedByGroup = {};\nconst auditsUngrouped = {passed: [], failed: [], notApplicable: []};\n@@ -339,14 +336,14 @@ class CategoryRenderer {\nconst passedElements = /** @type {Array<Element>} */ ([]);\nconst notApplicableElements = /** @type {Array<Element>} */ ([]);\n- auditsUngrouped.failed.forEach((/** @type {AuditJSON} */ audit, i) =>\n- failedElements.push(this.renderAudit(audit, i)));\n- auditsUngrouped.passed.forEach((/** @type {AuditJSON} */ audit, i) =>\n- passedElements.push(this.renderAudit(audit, i)));\n- auditsUngrouped.notApplicable.forEach((/** @type {AuditJSON} */ audit, i) =>\n- notApplicableElements.push(this.renderAudit(audit, i)));\n+ auditsUngrouped.failed.forEach((audit, i) => failedElements.push(this.renderAudit(audit, i)));\n+ auditsUngrouped.passed.forEach((audit, i) => passedElements.push(this.renderAudit(audit, i)));\n+ auditsUngrouped.notApplicable.forEach((audit, i) => notApplicableElements.push(\n+ this.renderAudit(audit, i)));\nObject.keys(auditsGroupedByGroup).forEach(groupId => {\n+ if (!groupDefinitions) return; // We never reach here if there aren't groups, but TSC needs convincing\n+\nconst group = groupDefinitions[groupId];\nconst groups = auditsGroupedByGroup[groupId];\n",
"new_path": "lighthouse-core/report/html/renderer/category-renderer.js",
"old_path": "lighthouse-core/report/html/renderer/category-renderer.js"
},
{
"change_type": "MODIFY",
"diff": "/* globals self, Util, CategoryRenderer */\n/** @typedef {import('./dom.js')} DOM */\n-/** @typedef {import('./report-renderer.js').CategoryJSON} CategoryJSON */\n-/** @typedef {import('./report-renderer.js').GroupJSON} GroupJSON */\n-/** @typedef {import('./report-renderer.js').AuditJSON} AuditJSON */\n/** @typedef {import('./details-renderer.js').FilmstripDetails} FilmstripDetails */\n/** @typedef {LH.Result.Audit.OpportunityDetails} OpportunityDetails */\nclass PerformanceCategoryRenderer extends CategoryRenderer {\n/**\n- * @param {AuditJSON} audit\n+ * @param {LH.ReportResult.AuditRef} audit\n* @return {Element}\n*/\n_renderMetric(audit) {\n@@ -46,7 +43,7 @@ class PerformanceCategoryRenderer extends CategoryRenderer {\n}\n/**\n- * @param {AuditJSON} audit\n+ * @param {LH.ReportResult.AuditRef} audit\n* @param {number} index\n* @param {number} scale\n* @return {Element}\n@@ -85,7 +82,7 @@ class PerformanceCategoryRenderer extends CategoryRenderer {\n* Get an audit's wastedMs to sort the opportunity by, and scale the sparkline width\n* Opportunties with an error won't have a details object, so MIN_VALUE is returned to keep any\n* erroring opportunities last in sort order.\n- * @param {AuditJSON} audit\n+ * @param {LH.ReportResult.AuditRef} audit\n* @return {number}\n*/\n_getWastedMs(audit) {\n@@ -102,8 +99,8 @@ class PerformanceCategoryRenderer extends CategoryRenderer {\n}\n/**\n- * @param {CategoryJSON} category\n- * @param {Object<string, GroupJSON>} groups\n+ * @param {LH.ReportResult.Category} category\n+ * @param {Object<string, LH.Result.ReportGroup>} groups\n* @return {Element}\n* @override\n*/\n",
"new_path": "lighthouse-core/report/html/renderer/performance-category-renderer.js",
"old_path": "lighthouse-core/report/html/renderer/performance-category-renderer.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -29,12 +29,12 @@ class ReportRenderer {\n}\n/**\n- * @param {ReportJSON} report\n+ * @param {LH.ReportResult} report\n* @param {Element} container Parent element to render the report into.\n*/\nrenderReport(report, container) {\n// If any mutations happen to the report within the renderers, we want the original object untouched\n- const clone = /** @type {ReportJSON} */ (JSON.parse(JSON.stringify(report)));\n+ const clone = /** @type {LH.ReportResult} */ (JSON.parse(JSON.stringify(report)));\n// TODO(phulce): we all agree this is technical debt we should fix\nif (typeof clone.categories !== 'object') throw new Error('No categories provided.');\n@@ -56,7 +56,7 @@ class ReportRenderer {\n}\n/**\n- * @param {ReportJSON} report\n+ * @param {LH.ReportResult} report\n* @return {DocumentFragment}\n*/\n_renderReportHeader(report) {\n@@ -90,7 +90,7 @@ class ReportRenderer {\n/**\n- * @param {ReportJSON} report\n+ * @param {LH.ReportResult} report\n* @return {DocumentFragment}\n*/\n_renderReportFooter(report) {\n@@ -117,7 +117,7 @@ class ReportRenderer {\n/**\n* Returns a div with a list of top-level warnings, or an empty div if no warnings.\n- * @param {ReportJSON} report\n+ * @param {LH.ReportResult} report\n* @return {Node}\n*/\n_renderReportWarnings(report) {\n@@ -136,7 +136,7 @@ class ReportRenderer {\n}\n/**\n- * @param {ReportJSON} report\n+ * @param {LH.ReportResult} report\n* @return {DocumentFragment}\n*/\n_renderReport(report) {\n@@ -203,7 +203,7 @@ class ReportRenderer {\n/**\n* Place the AuditResult into the auditDfn (which has just weight & group)\n* @param {Object<string, LH.Audit.Result>} audits\n- * @param {Array<CategoryJSON>} reportCategories\n+ * @param {Array<LH.ReportResult.Category>} reportCategories\n*/\nstatic smooshAuditResultsIntoCategories(audits, reportCategories) {\nfor (const category of reportCategories) {\n@@ -220,49 +220,3 @@ if (typeof module !== 'undefined' && module.exports) {\n} else {\nself.ReportRenderer = ReportRenderer;\n}\n-\n-/**\n- * @typedef {{\n- id: string,\n- score: (number|null),\n- weight: number,\n- group?: string,\n- result: LH.Audit.Result\n- }} AuditJSON\n- */\n-\n-/**\n- * @typedef {{\n- title: string,\n- id: string,\n- score: (number|null),\n- description?: string,\n- manualDescription: string,\n- auditRefs: Array<AuditJSON>\n- }} CategoryJSON\n- */\n-\n-/**\n- * @typedef {{\n- title: string,\n- description?: string,\n- }} GroupJSON\n- */\n-\n-/**\n- * @typedef {{\n- lighthouseVersion: string,\n- userAgent: string,\n- fetchTime: string,\n- timing: {total: number},\n- requestedUrl: string,\n- finalUrl: string,\n- runWarnings?: Array<string>,\n- artifacts: {traces: {defaultPass: {traceEvents: Array}}},\n- audits: Object<string, LH.Audit.Result>,\n- categories: Object<string, CategoryJSON>,\n- reportCategories: Array<CategoryJSON>,\n- categoryGroups: Object<string, GroupJSON>,\n- configSettings: LH.Config.Settings,\n- }} ReportJSON\n- */\n",
"new_path": "lighthouse-core/report/html/renderer/report-renderer.js",
"old_path": "lighthouse-core/report/html/renderer/report-renderer.js"
},
{
"change_type": "MODIFY",
"diff": "/* globals self URL Blob CustomEvent getFilenamePrefix window */\n/** @typedef {import('./dom.js')} DOM */\n-/** @typedef {import('./report-renderer.js').ReportJSON} ReportJSON */\nclass ReportUIFeatures {\n/**\n* @param {DOM} dom\n*/\nconstructor(dom) {\n- /** @type {ReportJSON} */\n+ /** @type {LH.ReportResult} */\nthis.json; // eslint-disable-line no-unused-expressions\n/** @type {DOM} */\nthis._dom = dom;\n@@ -68,7 +67,7 @@ class ReportUIFeatures {\n/**\n* Adds export button, print, and other functionality to the report. The method\n* should be called whenever the report needs to be re-rendered.\n- * @param {ReportJSON} report\n+ * @param {LH.ReportResult} report\n*/\ninitFeatures(report) {\nif (this._dom.isDevTools()) return;\n@@ -347,7 +346,7 @@ class ReportUIFeatures {\n/**\n* Opens a new tab to the online viewer and sends the local page's JSON results\n* to the online viewer using postMessage.\n- * @param {ReportJSON} reportJson\n+ * @param {LH.ReportResult} reportJson\n* @param {string} viewerPath\n* @protected\n*/\n",
"new_path": "lighthouse-core/report/html/renderer/report-ui-features.js",
"old_path": "lighthouse-core/report/html/renderer/report-ui-features.js"
},
{
"change_type": "MODIFY",
"diff": "/* global logger, FirebaseAuth, idbKeyval, getFilenamePrefix */\n-/** @typedef {import('../../../lighthouse-core/report/html/renderer/report-renderer.js').ReportJSON} ReportJSON */\n-/** @typedef {{etag: ?string, content: ReportJSON}} CachableGist */\n+/** @typedef {{etag: ?string, content: LH.ReportResult}} CachableGist */\n/**\n* Wrapper around the GitHub API for reading/writing gists.\n@@ -25,7 +24,7 @@ class GithubApi {\n/**\n* Creates a gist under the users account.\n- * @param {ReportJSON} jsonFile The gist file body.\n+ * @param {LH.ReportResult} jsonFile The gist file body.\n* @return {Promise<string>} id of the created gist.\n*/\ncreateGist(jsonFile) {\n@@ -74,7 +73,7 @@ class GithubApi {\n/**\n* Fetches a Lighthouse report from a gist.\n* @param {string} id The id of a gist.\n- * @return {Promise<ReportJSON>}\n+ * @return {Promise<LH.ReportResult>}\n*/\ngetGistFileContentAsJson(id) {\nlogger.log('Fetching report from GitHub...', false);\n@@ -133,7 +132,7 @@ class GithubApi {\n.then(resp => resp.json())\n.then(content => ({etag, content}));\n}\n- const lhr = /** @type {ReportJSON} */ (JSON.parse(f.content));\n+ const lhr = /** @type {LH.ReportResult} */ (JSON.parse(f.content));\nreturn {etag, content: lhr};\n});\n});\n",
"new_path": "lighthouse-viewer/app/src/github-api.js",
"old_path": "lighthouse-viewer/app/src/github-api.js"
},
{
"change_type": "MODIFY",
"diff": "/* global DOM, ViewerUIFeatures, ReportRenderer, DragAndDrop, GithubApi, logger, idbKeyval */\n-/** @typedef {import('../../../lighthouse-core/report/html/renderer/report-renderer.js').ReportJSON} ReportJSON */\n-\n/**\n* Guaranteed context.querySelector. Always returns an element or throws if\n* nothing matches query.\n@@ -109,7 +107,7 @@ class LighthouseReportViewer {\n/**\n* Basic Lighthouse report JSON validation.\n- * @param {ReportJSON} reportJson\n+ * @param {LH.ReportResult} reportJson\n* @private\n*/\n_validateReportJson(reportJson) {\n@@ -135,7 +133,7 @@ class LighthouseReportViewer {\n}\n/**\n- * @param {ReportJSON} json\n+ * @param {LH.ReportResult} json\n* @private\n*/\n_replaceReportHtml(json) {\n@@ -204,7 +202,7 @@ class LighthouseReportViewer {\n/**\n* Stores v2.x report in IDB, then navigates to legacy viewer in current tab\n- * @param {ReportJSON} reportJson\n+ * @param {LH.ReportResult} reportJson\n* @private\n*/\n_loadInLegacyViewerVersion(reportJson) {\n@@ -237,7 +235,7 @@ class LighthouseReportViewer {\n/**\n* Saves the current report by creating a gist on GitHub.\n- * @param {ReportJSON} reportJson\n+ * @param {LH.ReportResult} reportJson\n* @return {Promise<string|void>} id of the created gist.\n* @private\n*/\n",
"new_path": "lighthouse-viewer/app/src/lighthouse-report-viewer.js",
"old_path": "lighthouse-viewer/app/src/lighthouse-report-viewer.js"
},
{
"change_type": "MODIFY",
"diff": "/* global ReportUIFeatures, ReportGenerator */\n-/** @typedef {import('../../../lighthouse-core/report/html/renderer/report-renderer.js').ReportJSON} ReportJSON */\n-\n/**\n* Extends ReportUIFeatures to add an (optional) ability to save to a gist and\n* generates the saved report from a browserified ReportGenerator.\nclass ViewerUIFeatures extends ReportUIFeatures {\n/**\n* @param {DOM} dom\n- * @param {?function(ReportJSON)} saveGistCallback\n+ * @param {?function(LH.ReportResult)} saveGistCallback\n*/\nconstructor(dom, saveGistCallback) {\nsuper(dom);\n@@ -25,7 +23,7 @@ class ViewerUIFeatures extends ReportUIFeatures {\n}\n/**\n- * @param {ReportJSON} report\n+ * @param {LH.ReportResult} report\n* @override\n*/\ninitFeatures(report) {\n@@ -44,7 +42,6 @@ class ViewerUIFeatures extends ReportUIFeatures {\n* @override\n*/\ngetReportHtml() {\n- // @ts-ignore - TODO(bckenny): remove ignore when this.json is an LHR instead of ReportJSON.\nreturn ReportGenerator.generateReportHtml(this.json);\n}\n",
"new_path": "lighthouse-viewer/app/src/viewer-ui-features.js",
"old_path": "lighthouse-viewer/app/src/viewer-ui-features.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -35,6 +35,24 @@ declare global {\nReportUIFeatures: typeof _ReportUIFeatures;\nUtil: typeof _Util;\n}\n+\n+ module LH {\n+ // During report generation, the LHR object is transformed a bit for convenience\n+ // Primarily, the auditResult is added as .result onto the auditRef.\n+ // Also: a reportCategories property is added. We're lazy sometimes. It'll be removed in due time.\n+ export interface ReportResult extends Result {\n+ categories: Record<string, ReportResult.Category>;\n+ reportCategories: Array<ReportResult.Category>;\n+ }\n+ export module ReportResult {\n+ export interface Category extends Result.Category {\n+ auditRefs: Array<AuditRef>\n+ }\n+ export interface AuditRef extends Result.AuditRef {\n+ result: Audit.Result\n+ }\n+ }\n+ }\n}\n// empty export to keep file a module\n",
"new_path": "typings/html-renderer.d.ts",
"old_path": "typings/html-renderer.d.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -67,7 +67,7 @@ declare global {\n/** The title of the display group. */\ntitle: string;\n/** A brief description of the purpose of the display group. */\n- description: string;\n+ description?: string;\n}\n/**\n",
"new_path": "typings/lhr.d.ts",
"old_path": "typings/lhr.d.ts"
}
] | JavaScript | Apache License 2.0 | googlechrome/lighthouse | core(tsc): migrate renderer & viewer off typedefs to .d.ts (#5342) | 1 | core | tsc |
821,196 | 15.06.2018 21:29:44 | 25,200 | 3a1441deab5bd58927c51188831be214c02f24f6 | fix: remove shrinkwrap after publishing | [
{
"change_type": "MODIFY",
"diff": "@@ -270,7 +270,7 @@ class App extends Generator {\n}\nif (['plugin', 'multi'].includes(this.type)) {\nthis.pjson.scripts.prepack = nps.series(this.pjson.scripts.prepare, 'oclif-dev manifest', 'oclif-dev readme', 'npm shrinkwrap')\n- this.pjson.scripts.postpack = `${rmf} oclif.manifest.json`\n+ this.pjson.scripts.postpack = `${rmf} oclif.manifest.json npm-shrinkwrap.json`\nthis.pjson.scripts.version = nps.series('oclif-dev readme', 'git add README.md')\nthis.pjson.files.push('/oclif.manifest.json')\nthis.pjson.files.push('/npm-shrinkwrap.json')\n",
"new_path": "src/generators/app.ts",
"old_path": "src/generators/app.ts"
}
] | TypeScript | MIT License | oclif/oclif | fix: remove shrinkwrap after publishing | 1 | fix | null |
679,913 | 17.06.2018 11:35:19 | -3,600 | dce189f968295d71d5bf221b99060f514706a052 | feat(sax): initial import | [
{
"change_type": "ADD",
"diff": "+build\n+coverage\n+dev\n+doc\n+src*\n+test\n+.nyc_output\n+tsconfig.json\n+*.tgz\n+*.html\n",
"new_path": "packages/sax/.npmignore",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+ Apache License\n+ Version 2.0, January 2004\n+ http://www.apache.org/licenses/\n+\n+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n+\n+ 1. Definitions.\n+\n+ \"License\" shall mean the terms and conditions for use, reproduction,\n+ and distribution as defined by Sections 1 through 9 of this document.\n+\n+ \"Licensor\" shall mean the copyright owner or entity authorized by\n+ the copyright owner that is granting the License.\n+\n+ \"Legal Entity\" shall mean the union of the acting entity and all\n+ other entities that control, are controlled by, or are under common\n+ control with that entity. For the purposes of this definition,\n+ \"control\" means (i) the power, direct or indirect, to cause the\n+ direction or management of such entity, whether by contract or\n+ otherwise, or (ii) ownership of fifty percent (50%) or more of the\n+ outstanding shares, or (iii) beneficial ownership of such entity.\n+\n+ \"You\" (or \"Your\") shall mean an individual or Legal Entity\n+ exercising permissions granted by this License.\n+\n+ \"Source\" form shall mean the preferred form for making modifications,\n+ including but not limited to software source code, documentation\n+ source, and configuration files.\n+\n+ \"Object\" form shall mean any form resulting from mechanical\n+ transformation or translation of a Source form, including but\n+ not limited to compiled object code, generated documentation,\n+ and conversions to other media types.\n+\n+ \"Work\" shall mean the work of authorship, whether in Source or\n+ Object form, made available under the License, as indicated by a\n+ copyright notice that is included in or attached to the work\n+ (an example is provided in the Appendix below).\n+\n+ \"Derivative Works\" shall mean any work, whether in Source or Object\n+ form, that is based on (or derived from) the Work and for which the\n+ editorial revisions, annotations, elaborations, or other modifications\n+ represent, as a whole, an original work of authorship. For the purposes\n+ of this License, Derivative Works shall not include works that remain\n+ separable from, or merely link (or bind by name) to the interfaces of,\n+ the Work and Derivative Works thereof.\n+\n+ \"Contribution\" shall mean any work of authorship, including\n+ the original version of the Work and any modifications or additions\n+ to that Work or Derivative Works thereof, that is intentionally\n+ submitted to Licensor for inclusion in the Work by the copyright owner\n+ or by an individual or Legal Entity authorized to submit on behalf of\n+ the copyright owner. For the purposes of this definition, \"submitted\"\n+ means any form of electronic, verbal, or written communication sent\n+ to the Licensor or its representatives, including but not limited to\n+ communication on electronic mailing lists, source code control systems,\n+ and issue tracking systems that are managed by, or on behalf of, the\n+ Licensor for the purpose of discussing and improving the Work, but\n+ excluding communication that is conspicuously marked or otherwise\n+ designated in writing by the copyright owner as \"Not a Contribution.\"\n+\n+ \"Contributor\" shall mean Licensor and any individual or Legal Entity\n+ on behalf of whom a Contribution has been received by Licensor and\n+ subsequently incorporated within the Work.\n+\n+ 2. Grant of Copyright License. Subject to the terms and conditions of\n+ this License, each Contributor hereby grants to You a perpetual,\n+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n+ copyright license to reproduce, prepare Derivative Works of,\n+ publicly display, publicly perform, sublicense, and distribute the\n+ Work and such Derivative Works in Source or Object form.\n+\n+ 3. Grant of Patent License. Subject to the terms and conditions of\n+ this License, each Contributor hereby grants to You a perpetual,\n+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n+ (except as stated in this section) patent license to make, have made,\n+ use, offer to sell, sell, import, and otherwise transfer the Work,\n+ where such license applies only to those patent claims licensable\n+ by such Contributor that are necessarily infringed by their\n+ Contribution(s) alone or by combination of their Contribution(s)\n+ with the Work to which such Contribution(s) was submitted. If You\n+ institute patent litigation against any entity (including a\n+ cross-claim or counterclaim in a lawsuit) alleging that the Work\n+ or a Contribution incorporated within the Work constitutes direct\n+ or contributory patent infringement, then any patent licenses\n+ granted to You under this License for that Work shall terminate\n+ as of the date such litigation is filed.\n+\n+ 4. Redistribution. You may reproduce and distribute copies of the\n+ Work or Derivative Works thereof in any medium, with or without\n+ modifications, and in Source or Object form, provided that You\n+ meet the following conditions:\n+\n+ (a) You must give any other recipients of the Work or\n+ Derivative Works a copy of this License; and\n+\n+ (b) You must cause any modified files to carry prominent notices\n+ stating that You changed the files; and\n+\n+ (c) You must retain, in the Source form of any Derivative Works\n+ that You distribute, all copyright, patent, trademark, and\n+ attribution notices from the Source form of the Work,\n+ excluding those notices that do not pertain to any part of\n+ the Derivative Works; and\n+\n+ (d) If the Work includes a \"NOTICE\" text file as part of its\n+ distribution, then any Derivative Works that You distribute must\n+ include a readable copy of the attribution notices contained\n+ within such NOTICE file, excluding those notices that do not\n+ pertain to any part of the Derivative Works, in at least one\n+ of the following places: within a NOTICE text file distributed\n+ as part of the Derivative Works; within the Source form or\n+ documentation, if provided along with the Derivative Works; or,\n+ within a display generated by the Derivative Works, if and\n+ wherever such third-party notices normally appear. The contents\n+ of the NOTICE file are for informational purposes only and\n+ do not modify the License. You may add Your own attribution\n+ notices within Derivative Works that You distribute, alongside\n+ or as an addendum to the NOTICE text from the Work, provided\n+ that such additional attribution notices cannot be construed\n+ as modifying the License.\n+\n+ You may add Your own copyright statement to Your modifications and\n+ may provide additional or different license terms and conditions\n+ for use, reproduction, or distribution of Your modifications, or\n+ for any such Derivative Works as a whole, provided Your use,\n+ reproduction, and distribution of the Work otherwise complies with\n+ the conditions stated in this License.\n+\n+ 5. Submission of Contributions. Unless You explicitly state otherwise,\n+ any Contribution intentionally submitted for inclusion in the Work\n+ by You to the Licensor shall be under the terms and conditions of\n+ this License, without any additional terms or conditions.\n+ Notwithstanding the above, nothing herein shall supersede or modify\n+ the terms of any separate license agreement you may have executed\n+ with Licensor regarding such Contributions.\n+\n+ 6. Trademarks. This License does not grant permission to use the trade\n+ names, trademarks, service marks, or product names of the Licensor,\n+ except as required for reasonable and customary use in describing the\n+ origin of the Work and reproducing the content of the NOTICE file.\n+\n+ 7. Disclaimer of Warranty. Unless required by applicable law or\n+ agreed to in writing, Licensor provides the Work (and each\n+ Contributor provides its Contributions) on an \"AS IS\" BASIS,\n+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n+ implied, including, without limitation, any warranties or conditions\n+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n+ PARTICULAR PURPOSE. You are solely responsible for determining the\n+ appropriateness of using or redistributing the Work and assume any\n+ risks associated with Your exercise of permissions under this License.\n+\n+ 8. Limitation of Liability. In no event and under no legal theory,\n+ whether in tort (including negligence), contract, or otherwise,\n+ unless required by applicable law (such as deliberate and grossly\n+ negligent acts) or agreed to in writing, shall any Contributor be\n+ liable to You for damages, including any direct, indirect, special,\n+ incidental, or consequential damages of any character arising as a\n+ result of this License or out of the use or inability to use the\n+ Work (including but not limited to damages for loss of goodwill,\n+ work stoppage, computer failure or malfunction, or any and all\n+ other commercial damages or losses), even if such Contributor\n+ has been advised of the possibility of such damages.\n+\n+ 9. Accepting Warranty or Additional Liability. While redistributing\n+ the Work or Derivative Works thereof, You may choose to offer,\n+ and charge a fee for, acceptance of support, warranty, indemnity,\n+ or other liability obligations and/or rights consistent with this\n+ License. However, in accepting such obligations, You may act only\n+ on Your own behalf and on Your sole responsibility, not on behalf\n+ of any other Contributor, and only if You agree to indemnify,\n+ defend, and hold each Contributor harmless for any liability\n+ incurred by, or claims asserted against, such Contributor by reason\n+ of your accepting any such warranty or additional liability.\n+\n+ END OF TERMS AND CONDITIONS\n+\n+ APPENDIX: How to apply the Apache License to your work.\n+\n+ To apply the Apache License to your work, attach the following\n+ boilerplate notice, with the fields enclosed by brackets \"{}\"\n+ replaced with your own identifying information. (Don't include\n+ the brackets!) The text should be enclosed in the appropriate\n+ comment syntax for the file format. We also recommend that a\n+ file or class name and description of purpose be included on the\n+ same \"printed page\" as the copyright notice for easier\n+ identification within third-party archives.\n+\n+ Copyright {yyyy} {name of copyright owner}\n+\n+ Licensed under the Apache License, Version 2.0 (the \"License\");\n+ you may not use this file except in compliance with the License.\n+ You may obtain a copy of the License at\n+\n+ http://www.apache.org/licenses/LICENSE-2.0\n+\n+ Unless required by applicable law or agreed to in writing, software\n+ distributed under the License is distributed on an \"AS IS\" BASIS,\n+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ See the License for the specific language governing permissions and\n+ limitations under the License.\n",
"new_path": "packages/sax/LICENSE",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"@thi.ng/sax\",\n+ \"version\": \"0.0.1\",\n+ \"description\": \"TODO\",\n+ \"main\": \"./index.js\",\n+ \"typings\": \"./index.d.ts\",\n+ \"repository\": \"https://github.com/thi-ng/umbrella\",\n+ \"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n+ \"license\": \"Apache-2.0\",\n+ \"scripts\": {\n+ \"build\": \"yarn run clean && tsc --declaration\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n+ \"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n+ \"pub\": \"yarn run build && yarn publish --access public\",\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n+ },\n+ \"devDependencies\": {\n+ \"@types/mocha\": \"^5.2.0\",\n+ \"@types/node\": \"^10.0.6\",\n+ \"mocha\": \"^5.1.1\",\n+ \"nyc\": \"^11.7.1\",\n+ \"typedoc\": \"^0.11.1\",\n+ \"typescript\": \"^2.8.3\"\n+ },\n+ \"dependencies\": {\n+ \"@thi.ng/api\": \"^4.0.3\",\n+ \"@thi.ng/transducers\": \"^1.10.2\"\n+ },\n+ \"keywords\": [\n+ \"ES6\",\n+ \"typescript\"\n+ ],\n+ \"publishConfig\": {\n+ \"access\": \"public\"\n+ }\n+}\n\\ No newline at end of file\n",
"new_path": "packages/sax/package.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { Event, IObjectOf } from \"@thi.ng/api\";\n+import { Transducer, Reducer } from \"@thi.ng/transducers/api\";\n+\n+export interface FSMState {\n+ state: PropertyKey;\n+}\n+\n+export type FSMStateMap<T extends FSMState, A, B> = IObjectOf<FSMHandler<T, A, B>>;\n+export type FSMHandler<T extends FSMState, A, B> = (state: T, input: A) => B;\n+\n+export function fsm<T extends FSMState, A, B>(states: FSMStateMap<T, A, B>, initial: () => T): Transducer<A, B> {\n+ return (rfn: Reducer<any, B>) => {\n+ let state = initial();\n+ const r = rfn[2];\n+ return [\n+ rfn[0],\n+ (acc) => rfn[1](acc),\n+ (acc, x) => {\n+ // console.log(state.state, x, state);\n+ const res = states[<any>state.state](state, x);\n+ if (res) {\n+ acc = r(acc, res);\n+ }\n+ return acc;\n+ }];\n+ }\n+}\n+\n+const isWS = (x: string) =>\n+ x == \" \" || x == \"\\t\" || x == \"\\n\" || x == \"\\r\";\n+\n+const isTagChar = (x: string) =>\n+ (x >= \"A\" && x <= \"Z\") ||\n+ (x >= \"a\" && x <= \"z\") ||\n+ (x >= \"0\" && x <= \"9\") ||\n+ x == \"-\" ||\n+ x == \"_\" ||\n+ x == \":\";\n+\n+export interface ParseState extends FSMState {\n+ scope: string[];\n+ tag: string;\n+ body: string;\n+ attribs: any;\n+ phase: number;\n+ name: string;\n+ val: string;\n+}\n+\n+export enum State {\n+ WAIT,\n+ ELEM,\n+ ELEM_BODY,\n+ ATTRIB,\n+}\n+\n+const unexpected = (x) => { throw new Error(`unexpected char: ${x}`); };\n+\n+export const PARSER: FSMStateMap<ParseState, string, Event> = {\n+ [State.WAIT]: (s: ParseState, x: string) => {\n+ if (isWS(x)) {\n+ return null;\n+ } else if (x == \"<\") {\n+ s.state = State.ELEM;\n+ s.phase = 0;\n+ } else {\n+ unexpected(x);\n+ }\n+ },\n+\n+ [State.ELEM]: (s: ParseState, x: string) => {\n+ switch (s.phase) {\n+ case 0:\n+ if (x == \"/\") {\n+ if (s.scope.length == 0) {\n+ unexpected(x);\n+ }\n+ s.tag = \"\";\n+ s.phase = 1;\n+ } else if (isTagChar(x)) {\n+ s.tag = x;\n+ s.attribs = {};\n+ s.phase = 2;\n+ } else {\n+ unexpected(x);\n+ }\n+ break;\n+ // end\n+ case 1:\n+ if (isTagChar(x)) {\n+ s.tag += x;\n+ } else if (x == \">\") {\n+ if (s.tag == s.scope[s.scope.length - 1]) {\n+ const res = { id: \"end\", value: { tag: s.tag } };\n+ s.scope.pop();\n+ s.state = State.WAIT;\n+ return res;\n+ } else {\n+ throw new Error(`unmatched end tag: ${s.tag}`);\n+ }\n+ }\n+ break;\n+ // start\n+ case 2:\n+ if (isTagChar(x)) {\n+ s.tag += x;\n+ } else if (isWS(x)) {\n+ s.state = State.ATTRIB;\n+ s.phase = 0;\n+ } else if (x == \">\") {\n+ const res = { id: \"elem\", value: { tag: s.tag, attribs: s.attribs } };\n+ s.scope.push(s.tag);\n+ s.state = State.ELEM_BODY;\n+ s.body = \"\";\n+ return res;\n+ } else if (x == \"/\") {\n+ s.phase = 3;\n+ } else {\n+ unexpected(x);\n+ }\n+ break;\n+ case 3:\n+ if (x == \">\") {\n+ s.state = State.WAIT;\n+ return { id: \"start\", value: { tag: s.tag, attribs: s.attribs } };\n+ } else {\n+ unexpected(x);\n+ }\n+ break;\n+ }\n+ },\n+\n+\n+ [State.ELEM_BODY]: (s: ParseState, x: string) => {\n+ if (x == \"<\") {\n+ const res = s.body.length > 0 ?\n+ { id: \"body\", value: s.body } :\n+ undefined;\n+ s.state = State.ELEM;\n+ s.tag = \"\";\n+ s.phase = 0;\n+ return res;\n+ } else {\n+ s.body += x;\n+ }\n+ },\n+\n+ [State.ATTRIB]: (s: ParseState, x: string) => {\n+ switch (s.phase) {\n+ // ws\n+ case 0:\n+ if (isTagChar(x)) {\n+ s.name = x;\n+ s.val = \"\";\n+ s.phase = 2;\n+ } else if (x == \">\") {\n+ const res = { id: \"elem\", value: { tag: s.tag, attribs: s.attribs } };\n+ s.scope.push(s.tag);\n+ s.state = State.ELEM_BODY;\n+ s.body = \"\";\n+ return res;\n+ } else if (x == \"/\") {\n+ s.phase = 1;\n+ } else if (!isWS(x)) {\n+ unexpected(x);\n+ }\n+ break;\n+ // self-closing\n+ case 1:\n+ if (x == \">\") {\n+ s.state = State.WAIT;\n+ return { id: \"elem\", value: { tag: s.tag, attribs: s.attribs } };\n+ } else {\n+ unexpected(x);\n+ }\n+ break;\n+ // attrib name\n+ case 2:\n+ if (isTagChar(x)) {\n+ s.name += x;\n+ } else if (x == \"=\") {\n+ s.phase = 3;\n+ } else {\n+ unexpected(x);\n+ }\n+ break;\n+ case 3:\n+ if (x == \"\\\"\") {\n+ s.phase = 4;\n+ } else {\n+ unexpected(x);\n+ }\n+ break;\n+ case 4:\n+ if (x == \"\\\"\") {\n+ s.attribs[s.name] = s.val;\n+ s.phase = 0;\n+ } else {\n+ s.val += x;\n+ }\n+ }\n+ }\n+}\n\\ No newline at end of file\n",
"new_path": "packages/sax/src/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"extends\": \"../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \".\"\n+ },\n+ \"include\": [\n+ \"./src/**/*.ts\"\n+ ]\n+}\n",
"new_path": "packages/sax/tsconfig.json",
"old_path": null
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | feat(sax): initial import | 1 | feat | sax |
679,913 | 17.06.2018 12:02:19 | -3,600 | 74f7d02ef65faef75d1ddcd1f1469772b98e6a18 | refactor(sax): extract parser sub-states | [
{
"change_type": "MODIFY",
"diff": "@@ -6,7 +6,7 @@ export interface FSMState {\n}\nexport type FSMStateMap<T extends FSMState, A, B> = IObjectOf<FSMHandler<T, A, B>>;\n-export type FSMHandler<T extends FSMState, A, B> = (state: T, input: A) => B;\n+export type FSMHandler<T extends FSMState, A, B> = (state: T, input: A) => B | void;\nexport function fsm<T extends FSMState, A, B>(states: FSMStateMap<T, A, B>, initial: () => T): Transducer<A, B> {\nreturn (rfn: Reducer<any, B>) => {\n@@ -37,167 +37,155 @@ const isTagChar = (x: string) =>\nx == \"_\" ||\nx == \":\";\n+const unexpected = (x) => { throw new Error(`unexpected char: ${x}`); };\n+\nexport interface ParseState extends FSMState {\nscope: string[];\ntag: string;\nbody: string;\nattribs: any;\n- phase: number;\nname: string;\nval: string;\n}\n-export enum State {\n+enum State {\nWAIT,\n- ELEM,\n+ MAYBE_ELEM,\n+ ELEM_START,\n+ ELEM_END,\n+ ELEM_SINGLE,\nELEM_BODY,\n- ATTRIB,\n+ MAYBE_ATTRIB,\n+ ATTRIB_NAME,\n+ ATTRIB_VAL_START,\n+ ATTRIB_VALUE\n}\n-const unexpected = (x) => { throw new Error(`unexpected char: ${x}`); };\nexport const PARSER: FSMStateMap<ParseState, string, Event> = {\n[State.WAIT]: (s: ParseState, x: string) => {\n- if (isWS(x)) {\n- return null;\n- } else if (x == \"<\") {\n- s.state = State.ELEM;\n- s.phase = 0;\n+ if (!isWS(x)) {\n+ if (x == \"<\") {\n+ s.state = State.MAYBE_ELEM;\n} else {\nunexpected(x);\n}\n+ }\n},\n- [State.ELEM]: (s: ParseState, x: string) => {\n- switch (s.phase) {\n- case 0:\n+ [State.MAYBE_ELEM]: (s: ParseState, x: string) => {\nif (x == \"/\") {\nif (s.scope.length == 0) {\nunexpected(x);\n}\n+ s.state = State.ELEM_END;\ns.tag = \"\";\n- s.phase = 1;\n} else if (isTagChar(x)) {\n+ s.state = State.ELEM_START;\ns.tag = x;\ns.attribs = {};\n- s.phase = 2;\n} else {\nunexpected(x);\n}\n- break;\n- // end\n- case 1:\n- if (isTagChar(x)) {\n- s.tag += x;\n- } else if (x == \">\") {\n- if (s.tag == s.scope[s.scope.length - 1]) {\n- const res = { id: \"end\", value: { tag: s.tag } };\n- s.scope.pop();\n- s.state = State.WAIT;\n- return res;\n- } else {\n- throw new Error(`unmatched end tag: ${s.tag}`);\n- }\n- }\n- break;\n- // start\n- case 2:\n+ },\n+\n+ [State.ELEM_START]: (s: ParseState, x: string) => {\nif (isTagChar(x)) {\ns.tag += x;\n} else if (isWS(x)) {\n- s.state = State.ATTRIB;\n- s.phase = 0;\n+ s.state = State.MAYBE_ATTRIB;\n} else if (x == \">\") {\nconst res = { id: \"elem\", value: { tag: s.tag, attribs: s.attribs } };\n- s.scope.push(s.tag);\ns.state = State.ELEM_BODY;\n+ s.scope.push(s.tag);\ns.body = \"\";\nreturn res;\n} else if (x == \"/\") {\n- s.phase = 3;\n+ s.state = State.ELEM_SINGLE;\n} else {\nunexpected(x);\n}\n- break;\n- case 3:\n+ },\n+\n+ [State.ELEM_END]: (s: ParseState, x: string) => {\n+ if (isTagChar(x)) {\n+ s.tag += x;\n+ } else if (x == \">\") {\n+ if (s.tag == s.scope[s.scope.length - 1]) {\n+ const res = { id: \"end\", value: { tag: s.tag } };\n+ s.scope.pop();\n+ s.state = State.WAIT;\n+ return res;\n+ } else {\n+ throw new Error(`unmatched end tag: ${s.tag}`);\n+ }\n+ }\n+ },\n+\n+ [State.ELEM_SINGLE]: (s: ParseState, x: string) => {\nif (x == \">\") {\ns.state = State.WAIT;\nreturn { id: \"start\", value: { tag: s.tag, attribs: s.attribs } };\n} else {\nunexpected(x);\n}\n- break;\n- }\n},\n-\n[State.ELEM_BODY]: (s: ParseState, x: string) => {\nif (x == \"<\") {\nconst res = s.body.length > 0 ?\n{ id: \"body\", value: s.body } :\nundefined;\n- s.state = State.ELEM;\n+ s.state = State.MAYBE_ELEM;\ns.tag = \"\";\n- s.phase = 0;\nreturn res;\n} else {\ns.body += x;\n}\n},\n- [State.ATTRIB]: (s: ParseState, x: string) => {\n- switch (s.phase) {\n- // ws\n- case 0:\n+ [State.MAYBE_ATTRIB]: (s: ParseState, x: string) => {\nif (isTagChar(x)) {\n+ s.state = State.ATTRIB_NAME;\ns.name = x;\ns.val = \"\";\n- s.phase = 2;\n} else if (x == \">\") {\nconst res = { id: \"elem\", value: { tag: s.tag, attribs: s.attribs } };\n- s.scope.push(s.tag);\ns.state = State.ELEM_BODY;\n+ s.scope.push(s.tag);\ns.body = \"\";\nreturn res;\n} else if (x == \"/\") {\n- s.phase = 1;\n+ s.state = State.ELEM_SINGLE;\n} else if (!isWS(x)) {\nunexpected(x);\n}\n- break;\n- // self-closing\n- case 1:\n- if (x == \">\") {\n- s.state = State.WAIT;\n- return { id: \"elem\", value: { tag: s.tag, attribs: s.attribs } };\n- } else {\n- unexpected(x);\n- }\n- break;\n- // attrib name\n- case 2:\n+ },\n+\n+ [State.ATTRIB_NAME]: (s: ParseState, x: string) => {\nif (isTagChar(x)) {\ns.name += x;\n} else if (x == \"=\") {\n- s.phase = 3;\n+ s.state = State.ATTRIB_VAL_START;\n} else {\nunexpected(x);\n}\n- break;\n- case 3:\n+ },\n+\n+ [State.ATTRIB_VAL_START]: (s: ParseState, x: string) => {\nif (x == \"\\\"\") {\n- s.phase = 4;\n+ s.state = State.ATTRIB_VALUE;\n} else {\nunexpected(x);\n}\n- break;\n- case 4:\n+ },\n+\n+ [State.ATTRIB_VALUE]: (s: ParseState, x: string) => {\nif (x == \"\\\"\") {\ns.attribs[s.name] = s.val;\n- s.phase = 0;\n+ s.state = State.MAYBE_ATTRIB;\n} else {\ns.val += x;\n}\n- }\n- }\n+ },\n}\n\\ No newline at end of file\n",
"new_path": "packages/sax/src/index.ts",
"old_path": "packages/sax/src/index.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | refactor(sax): extract parser sub-states | 1 | refactor | sax |
679,913 | 17.06.2018 15:54:16 | -3,600 | 3dea95494139931ad75dd29f749f8860b7063807 | feat(sax): emit child elements with `end` results, support comments | [
{
"change_type": "MODIFY",
"diff": "@@ -16,7 +16,7 @@ export function fsm<T extends FSMState, A, B>(states: FSMStateMap<T, A, B>, init\nrfn[0],\n(acc) => rfn[1](acc),\n(acc, x) => {\n- // console.log(state.state, x, state);\n+ // console.log(x, State[state.state], state);\nconst res = states[<any>state.state](state, x);\nif (res) {\nacc = r(acc, res);\n@@ -40,12 +40,13 @@ const isTagChar = (x: string) =>\nconst unexpected = (x) => { throw new Error(`unexpected char: ${x}`); };\nexport interface ParseState extends FSMState {\n- scope: string[];\n+ scope: any[];\ntag: string;\nbody: string;\nattribs: any;\nname: string;\nval: string;\n+ quote: string;\n}\nenum State {\n@@ -58,14 +59,16 @@ enum State {\nMAYBE_ATTRIB,\nATTRIB_NAME,\nATTRIB_VAL_START,\n- ATTRIB_VALUE\n+ ATTRIB_VALUE,\n+ MAYBE_INSTRUCTION,\n+ COMMENT,\n+ COMMENT_BODY,\n}\n-\nexport const PARSER: FSMStateMap<ParseState, string, Event> = {\n[State.WAIT]: (s: ParseState, x: string) => {\nif (!isWS(x)) {\n- if (x == \"<\") {\n+ if (x === \"<\") {\ns.state = State.MAYBE_ELEM;\n} else {\nunexpected(x);\n@@ -74,7 +77,7 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\n},\n[State.MAYBE_ELEM]: (s: ParseState, x: string) => {\n- if (x == \"/\") {\n+ if (x === \"/\") {\nif (s.scope.length == 0) {\nunexpected(x);\n}\n@@ -84,6 +87,8 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\ns.state = State.ELEM_START;\ns.tag = x;\ns.attribs = {};\n+ } else if (x === \"!\") {\n+ s.state = State.MAYBE_INSTRUCTION;\n} else {\nunexpected(x);\n}\n@@ -94,13 +99,13 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\ns.tag += x;\n} else if (isWS(x)) {\ns.state = State.MAYBE_ATTRIB;\n- } else if (x == \">\") {\n+ } else if (x === \">\") {\nconst res = { id: \"elem\", value: { tag: s.tag, attribs: s.attribs } };\ns.state = State.ELEM_BODY;\n- s.scope.push(s.tag);\n+ s.scope.push({ tag: s.tag, attribs: s.attribs, children: [] });\ns.body = \"\";\nreturn res;\n- } else if (x == \"/\") {\n+ } else if (x === \"/\") {\ns.state = State.ELEM_SINGLE;\n} else {\nunexpected(x);\n@@ -110,10 +115,14 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\n[State.ELEM_END]: (s: ParseState, x: string) => {\nif (isTagChar(x)) {\ns.tag += x;\n- } else if (x == \">\") {\n- if (s.tag == s.scope[s.scope.length - 1]) {\n- const res = { id: \"end\", value: { tag: s.tag } };\n+ } else if (x === \">\") {\n+ const n = s.scope.length;\n+ if (n > 0 && s.tag === s.scope[n - 1].tag) {\n+ const res = { id: \"end\", value: s.scope[n - 1] };\ns.scope.pop();\n+ if (n > 1) {\n+ s.scope[n - 2].children.push(res.value);\n+ }\ns.state = State.WAIT;\nreturn res;\n} else {\n@@ -123,16 +132,20 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\n},\n[State.ELEM_SINGLE]: (s: ParseState, x: string) => {\n- if (x == \">\") {\n+ if (x === \">\") {\ns.state = State.WAIT;\n- return { id: \"start\", value: { tag: s.tag, attribs: s.attribs } };\n+ const n = s.scope.length;\n+ if (n > 0) {\n+ s.scope[n - 1].children.push({ tag: s.tag, attribs: s.attribs });\n+ }\n+ return { id: \"elem\", value: { tag: s.tag, attribs: s.attribs } };\n} else {\nunexpected(x);\n}\n},\n[State.ELEM_BODY]: (s: ParseState, x: string) => {\n- if (x == \"<\") {\n+ if (x === \"<\") {\nconst res = s.body.length > 0 ?\n{ id: \"body\", value: s.body } :\nundefined;\n@@ -149,13 +162,13 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\ns.state = State.ATTRIB_NAME;\ns.name = x;\ns.val = \"\";\n- } else if (x == \">\") {\n+ } else if (x === \">\") {\nconst res = { id: \"elem\", value: { tag: s.tag, attribs: s.attribs } };\ns.state = State.ELEM_BODY;\n- s.scope.push(s.tag);\n+ s.scope.push({ tag: s.tag, attribs: s.attribs, children: [] });\ns.body = \"\";\nreturn res;\n- } else if (x == \"/\") {\n+ } else if (x === \"/\") {\ns.state = State.ELEM_SINGLE;\n} else if (!isWS(x)) {\nunexpected(x);\n@@ -165,7 +178,7 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\n[State.ATTRIB_NAME]: (s: ParseState, x: string) => {\nif (isTagChar(x)) {\ns.name += x;\n- } else if (x == \"=\") {\n+ } else if (x === \"=\") {\ns.state = State.ATTRIB_VAL_START;\n} else {\nunexpected(x);\n@@ -173,19 +186,51 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\n},\n[State.ATTRIB_VAL_START]: (s: ParseState, x: string) => {\n- if (x == \"\\\"\") {\n+ if (x === \"\\\"\" || x === \"'\") {\ns.state = State.ATTRIB_VALUE;\n+ s.quote = x;\n} else {\nunexpected(x);\n}\n},\n[State.ATTRIB_VALUE]: (s: ParseState, x: string) => {\n- if (x == \"\\\"\") {\n+ if (x === s.quote) {\ns.attribs[s.name] = s.val;\ns.state = State.MAYBE_ATTRIB;\n} else {\ns.val += x;\n}\n},\n+\n+ [State.MAYBE_INSTRUCTION]: (s: ParseState, x: string) => {\n+ if (x === \"-\") {\n+ s.state = State.COMMENT;\n+ } else {\n+ unexpected(x);\n+ }\n+ },\n+\n+ [State.COMMENT]: (s: ParseState, x: string) => {\n+ if (x === \"-\") {\n+ s.state = State.COMMENT_BODY;\n+ s.body = \"\";\n+ } else {\n+ unexpected(x);\n+ }\n+ },\n+\n+ [State.COMMENT_BODY]: (s: ParseState, x: string) => {\n+ if (x === \">\") {\n+ const n = s.body.length;\n+ if (s.body.substr(n - 2) !== \"--\") {\n+ unexpected(x);\n+ }\n+ s.state = State.WAIT;\n+ return { id: \"comment\", value: s.body.substr(0, n - 2) };\n+ } else {\n+ s.body += x;\n+ }\n+ },\n+\n}\n\\ No newline at end of file\n",
"new_path": "packages/sax/src/index.ts",
"old_path": "packages/sax/src/index.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | feat(sax): emit child elements with `end` results, support comments | 1 | feat | sax |
724,061 | 17.06.2018 20:38:30 | -25,200 | 80118466b9f459abd7a2a65c30471cb8dc302efd | refactor: more readable log modified components warning | [
{
"change_type": "MODIFY",
"diff": "@@ -67,7 +67,7 @@ export default function createInstance (\n) {\nif (options.logModifiedComponents) {\nwarn(\n- `an extended child component ${c} has been modified ` +\n+ `an extended child component <${c}> has been modified ` +\n`to ensure it has the correct instance properties. ` +\n`This means it is not possible to find the component ` +\n`with a component selector. To find the component, ` +\n",
"new_path": "packages/create-instance/create-instance.js",
"old_path": "packages/create-instance/create-instance.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -169,7 +169,7 @@ describeRunIf(process.env.TEST_ENV !== 'node', 'mount', () => {\nit('logs if component is extended', () => {\nconst msg =\n- `[vue-test-utils]: an extended child component ChildComponent ` +\n+ `[vue-test-utils]: an extended child component <ChildComponent> ` +\n`has been modified to ensure it has the correct instance properties. ` +\n`This means it is not possible to find the component with a component ` +\n`selector. To find the component, you must stub it manually using the ` +\n",
"new_path": "test/specs/mount.spec.js",
"old_path": "test/specs/mount.spec.js"
}
] | JavaScript | MIT License | vuejs/vue-test-utils | refactor: more readable log modified components warning (#731) | 1 | refactor | null |
679,913 | 17.06.2018 22:18:55 | -3,600 | a4766a54a1cb965b5fe31f2f2760e7610e8259ea | feat(sax): add support for proc & doctype elements, update `end` results
`end` results now include element body as well | [
{
"change_type": "MODIFY",
"diff": "@@ -47,6 +47,7 @@ export interface ParseState extends FSMState {\nname: string;\nval: string;\nquote: string;\n+ phase: number;\n}\nenum State {\n@@ -63,6 +64,9 @@ enum State {\nMAYBE_INSTRUCTION,\nCOMMENT,\nCOMMENT_BODY,\n+ DOCTYPE,\n+ PROC_DECL,\n+ PROC_END,\n}\nexport const PARSER: FSMStateMap<ParseState, string, Event> = {\n@@ -89,6 +93,10 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\ns.attribs = {};\n} else if (x === \"!\") {\ns.state = State.MAYBE_INSTRUCTION;\n+ } else if (x === \"?\") {\n+ s.state = State.PROC_DECL;\n+ s.phase = 0;\n+ s.body = \"\";\n} else {\nunexpected(x);\n}\n@@ -135,10 +143,11 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\nif (x === \">\") {\ns.state = State.WAIT;\nconst n = s.scope.length;\n+ const res = { tag: s.tag, attribs: s.attribs };\nif (n > 0) {\n- s.scope[n - 1].children.push({ tag: s.tag, attribs: s.attribs });\n+ s.scope[n - 1].children.push(res);\n}\n- return { id: \"elem\", value: { tag: s.tag, attribs: s.attribs } };\n+ return { id: \"elem\", value: res };\n} else {\nunexpected(x);\n}\n@@ -146,9 +155,11 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\n[State.ELEM_BODY]: (s: ParseState, x: string) => {\nif (x === \"<\") {\n- const res = s.body.length > 0 ?\n- { id: \"body\", value: s.body } :\n- undefined;\n+ let res;\n+ if (s.body.length > 0) {\n+ s.scope[s.scope.length - 1].body = s.body;\n+ res = { id: \"body\", value: { tag: s.tag, body: s.body } }\n+ }\ns.state = State.MAYBE_ELEM;\ns.tag = \"\";\nreturn res;\n@@ -170,6 +181,8 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\nreturn res;\n} else if (x === \"/\") {\ns.state = State.ELEM_SINGLE;\n+ } else if (s.tag === \"xml\" && x === \"?\") {\n+ s.state = State.PROC_END;\n} else if (!isWS(x)) {\nunexpected(x);\n}\n@@ -206,6 +219,10 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\n[State.MAYBE_INSTRUCTION]: (s: ParseState, x: string) => {\nif (x === \"-\") {\ns.state = State.COMMENT;\n+ } else if (x === \"D\") {\n+ s.state = State.DOCTYPE;\n+ s.phase = 1;\n+ s.body = \"\";\n} else {\nunexpected(x);\n}\n@@ -233,4 +250,40 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\n}\n},\n+ [State.DOCTYPE]: (s: ParseState, x: string) => {\n+ if (s.phase < 8) {\n+ if (x === \"DOCTYPE \"[s.phase]) {\n+ s.phase++;\n+ } else {\n+ unexpected(x);\n+ }\n+ } else if (x === \">\") {\n+ s.state = State.WAIT;\n+ return { id: \"doctype\", value: s.body.trim() };\n+ } else {\n+ s.body += x;\n+ }\n+ },\n+\n+ [State.PROC_DECL]: (s: ParseState, x: string) => {\n+ if (x === \"xml \"[s.phase]) {\n+ s.phase++;\n+ if (s.phase == 4) {\n+ s.state = State.MAYBE_ATTRIB;\n+ s.tag = \"xml\";\n+ s.attribs = {};\n}\n+ } else {\n+ unexpected(x);\n+ }\n+ },\n+\n+ [State.PROC_END]: (s: ParseState, x: string) => {\n+ if (x === \">\") {\n+ s.state = State.WAIT;\n+ return { id: \"proc\", value: { tag: s.tag, attribs: s.attribs } };\n+ } else {\n+ unexpected(x);\n+ }\n+ },\n+};\n",
"new_path": "packages/sax/src/index.ts",
"old_path": "packages/sax/src/index.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | feat(sax): add support for proc & doctype elements, update `end` results
- `end` results now include element body as well | 1 | feat | sax |
679,913 | 17.06.2018 23:25:12 | -3,600 | 64f237896040dbf490f4c5c47178fca074522944 | feat(sax): update error handling, add parse() wrapper, add FSMOpts
`unexpected()` does NOT throw error anymore,
but triggers new ERROR FSM state
add input `pos` counter to ParserState, use for error messages
add `parse()` transducer wrapper
update `fsm()` transducer to accept new `FSMOpts` | [
{
"change_type": "MODIFY",
"diff": "import { Event, IObjectOf } from \"@thi.ng/api\";\nimport { Transducer, Reducer } from \"@thi.ng/transducers/api\";\n+import { ensureReduced } from \"@thi.ng/transducers/reduced\";\nexport interface FSMState {\nstate: PropertyKey;\n@@ -8,9 +9,16 @@ export interface FSMState {\nexport type FSMStateMap<T extends FSMState, A, B> = IObjectOf<FSMHandler<T, A, B>>;\nexport type FSMHandler<T extends FSMState, A, B> = (state: T, input: A) => B | void;\n-export function fsm<T extends FSMState, A, B>(states: FSMStateMap<T, A, B>, initial: () => T): Transducer<A, B> {\n+export interface FSMOpts<T extends FSMState, A, B> {\n+ states: FSMStateMap<T, A, B>;\n+ terminate: PropertyKey;\n+ init: () => T;\n+}\n+\n+export function fsm<T extends FSMState, A, B>(opts: FSMOpts<T, A, B>): Transducer<A, B> {\nreturn (rfn: Reducer<any, B>) => {\n- let state = initial();\n+ const states = opts.states;\n+ const state = opts.init();\nconst r = rfn[2];\nreturn [\nrfn[0],\n@@ -20,26 +28,17 @@ export function fsm<T extends FSMState, A, B>(states: FSMStateMap<T, A, B>, init\nconst res = states[<any>state.state](state, x);\nif (res) {\nacc = r(acc, res);\n+ if (state.state == opts.terminate) {\n+ return ensureReduced(acc);\n+ }\n}\nreturn acc;\n}];\n}\n}\n-const isWS = (x: string) =>\n- x == \" \" || x == \"\\t\" || x == \"\\n\" || x == \"\\r\";\n-\n-const isTagChar = (x: string) =>\n- (x >= \"A\" && x <= \"Z\") ||\n- (x >= \"a\" && x <= \"z\") ||\n- (x >= \"0\" && x <= \"9\") ||\n- x == \"-\" ||\n- x == \"_\" ||\n- x == \":\";\n-\n-const unexpected = (x) => { throw new Error(`unexpected char: ${x}`); };\n-\nexport interface ParseState extends FSMState {\n+ pos: number;\nscope: any[];\ntag: string;\nbody: string;\n@@ -52,6 +51,7 @@ export interface ParseState extends FSMState {\nenum State {\nWAIT,\n+ ERROR,\nMAYBE_ELEM,\nELEM_START,\nELEM_END,\n@@ -69,21 +69,54 @@ enum State {\nPROC_END,\n}\n+const isWS = (x: string) =>\n+ x == \" \" || x == \"\\t\" || x == \"\\n\" || x == \"\\r\";\n+\n+const isTagChar = (x: string) =>\n+ (x >= \"A\" && x <= \"Z\") ||\n+ (x >= \"a\" && x <= \"z\") ||\n+ (x >= \"0\" && x <= \"9\") ||\n+ x == \"-\" ||\n+ x == \"_\" ||\n+ x == \":\";\n+\n+const unexpected = (s: ParseState, x: string) => {\n+ s.state = State.ERROR;\n+ return { id: \"error\", value: `unexpected char: '${x}' @ pos: ${s.pos}` };\n+};\n+\n+export function parse() {\n+ return fsm({\n+ states: PARSER,\n+ init: () => (<ParseState>{\n+ state: State.WAIT,\n+ scope: [],\n+ pos: 0\n+ }),\n+ terminate: State.ERROR\n+ });\n+}\n+\nexport const PARSER: FSMStateMap<ParseState, string, Event> = {\n+ [State.ERROR]: () => {\n+ },\n+\n[State.WAIT]: (s: ParseState, x: string) => {\n+ s.pos++;\nif (!isWS(x)) {\nif (x === \"<\") {\ns.state = State.MAYBE_ELEM;\n} else {\n- unexpected(x);\n+ return unexpected(s, x);\n}\n}\n},\n[State.MAYBE_ELEM]: (s: ParseState, x: string) => {\n+ s.pos++;\nif (x === \"/\") {\nif (s.scope.length == 0) {\n- unexpected(x);\n+ return unexpected(s, x);\n}\ns.state = State.ELEM_END;\ns.tag = \"\";\n@@ -98,11 +131,12 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\ns.phase = 0;\ns.body = \"\";\n} else {\n- unexpected(x);\n+ return unexpected(s, x);\n}\n},\n[State.ELEM_START]: (s: ParseState, x: string) => {\n+ s.pos++;\nif (isTagChar(x)) {\ns.tag += x;\n} else if (isWS(x)) {\n@@ -116,11 +150,12 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\n} else if (x === \"/\") {\ns.state = State.ELEM_SINGLE;\n} else {\n- unexpected(x);\n+ return unexpected(s, x);\n}\n},\n[State.ELEM_END]: (s: ParseState, x: string) => {\n+ s.pos++;\nif (isTagChar(x)) {\ns.tag += x;\n} else if (x === \">\") {\n@@ -140,6 +175,7 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\n},\n[State.ELEM_SINGLE]: (s: ParseState, x: string) => {\n+ s.pos++;\nif (x === \">\") {\ns.state = State.WAIT;\nconst n = s.scope.length;\n@@ -149,11 +185,12 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\n}\nreturn { id: \"elem\", value: res };\n} else {\n- unexpected(x);\n+ return unexpected(s, x);\n}\n},\n[State.ELEM_BODY]: (s: ParseState, x: string) => {\n+ s.pos++;\nif (x === \"<\") {\nlet res;\nif (s.body.length > 0) {\n@@ -169,6 +206,7 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\n},\n[State.MAYBE_ATTRIB]: (s: ParseState, x: string) => {\n+ s.pos++;\nif (isTagChar(x)) {\ns.state = State.ATTRIB_NAME;\ns.name = x;\n@@ -184,30 +222,33 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\n} else if (s.tag === \"xml\" && x === \"?\") {\ns.state = State.PROC_END;\n} else if (!isWS(x)) {\n- unexpected(x);\n+ return unexpected(s, x);\n}\n},\n[State.ATTRIB_NAME]: (s: ParseState, x: string) => {\n+ s.pos++;\nif (isTagChar(x)) {\ns.name += x;\n} else if (x === \"=\") {\ns.state = State.ATTRIB_VAL_START;\n} else {\n- unexpected(x);\n+ return unexpected(s, x);\n}\n},\n[State.ATTRIB_VAL_START]: (s: ParseState, x: string) => {\n+ s.pos++;\nif (x === \"\\\"\" || x === \"'\") {\ns.state = State.ATTRIB_VALUE;\ns.quote = x;\n} else {\n- unexpected(x);\n+ return unexpected(s, x);\n}\n},\n[State.ATTRIB_VALUE]: (s: ParseState, x: string) => {\n+ s.pos++;\nif (x === s.quote) {\ns.attribs[s.name] = s.val;\ns.state = State.MAYBE_ATTRIB;\n@@ -217,6 +258,7 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\n},\n[State.MAYBE_INSTRUCTION]: (s: ParseState, x: string) => {\n+ s.pos++;\nif (x === \"-\") {\ns.state = State.COMMENT;\n} else if (x === \"D\") {\n@@ -224,24 +266,26 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\ns.phase = 1;\ns.body = \"\";\n} else {\n- unexpected(x);\n+ return unexpected(s, x);\n}\n},\n[State.COMMENT]: (s: ParseState, x: string) => {\n+ s.pos++;\nif (x === \"-\") {\ns.state = State.COMMENT_BODY;\ns.body = \"\";\n} else {\n- unexpected(x);\n+ return unexpected(s, x);\n}\n},\n[State.COMMENT_BODY]: (s: ParseState, x: string) => {\n+ s.pos++;\nif (x === \">\") {\nconst n = s.body.length;\nif (s.body.substr(n - 2) !== \"--\") {\n- unexpected(x);\n+ return unexpected(s, x);\n}\ns.state = State.WAIT;\nreturn { id: \"comment\", value: s.body.substr(0, n - 2) };\n@@ -251,11 +295,12 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\n},\n[State.DOCTYPE]: (s: ParseState, x: string) => {\n+ s.pos++;\nif (s.phase < 8) {\nif (x === \"DOCTYPE \"[s.phase]) {\ns.phase++;\n} else {\n- unexpected(x);\n+ return unexpected(s, x);\n}\n} else if (x === \">\") {\ns.state = State.WAIT;\n@@ -266,6 +311,7 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\n},\n[State.PROC_DECL]: (s: ParseState, x: string) => {\n+ s.pos++;\nif (x === \"xml \"[s.phase]) {\ns.phase++;\nif (s.phase == 4) {\n@@ -274,16 +320,17 @@ export const PARSER: FSMStateMap<ParseState, string, Event> = {\ns.attribs = {};\n}\n} else {\n- unexpected(x);\n+ return unexpected(s, x);\n}\n},\n[State.PROC_END]: (s: ParseState, x: string) => {\n+ s.pos++;\nif (x === \">\") {\ns.state = State.WAIT;\nreturn { id: \"proc\", value: { tag: s.tag, attribs: s.attribs } };\n} else {\n- unexpected(x);\n+ return unexpected(s, x);\n}\n},\n};\n",
"new_path": "packages/sax/src/index.ts",
"old_path": "packages/sax/src/index.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | feat(sax): update error handling, add parse() wrapper, add FSMOpts
- `unexpected()` does NOT throw error anymore,
but triggers new ERROR FSM state
- add input `pos` counter to ParserState, use for error messages
- add `parse()` transducer wrapper
- update `fsm()` transducer to accept new `FSMOpts` | 1 | feat | sax |
679,913 | 17.06.2018 23:41:55 | -3,600 | 7c3c29032afa56af2a1af7dcfcc535ddc37933ff | feat(transducers-fsm): inital import | [
{
"change_type": "ADD",
"diff": "+build\n+coverage\n+dev\n+doc\n+src*\n+test\n+.nyc_output\n+tsconfig.json\n+*.tgz\n+*.html\n",
"new_path": "packages/transducers-fsm/.npmignore",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+ Apache License\n+ Version 2.0, January 2004\n+ http://www.apache.org/licenses/\n+\n+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n+\n+ 1. Definitions.\n+\n+ \"License\" shall mean the terms and conditions for use, reproduction,\n+ and distribution as defined by Sections 1 through 9 of this document.\n+\n+ \"Licensor\" shall mean the copyright owner or entity authorized by\n+ the copyright owner that is granting the License.\n+\n+ \"Legal Entity\" shall mean the union of the acting entity and all\n+ other entities that control, are controlled by, or are under common\n+ control with that entity. For the purposes of this definition,\n+ \"control\" means (i) the power, direct or indirect, to cause the\n+ direction or management of such entity, whether by contract or\n+ otherwise, or (ii) ownership of fifty percent (50%) or more of the\n+ outstanding shares, or (iii) beneficial ownership of such entity.\n+\n+ \"You\" (or \"Your\") shall mean an individual or Legal Entity\n+ exercising permissions granted by this License.\n+\n+ \"Source\" form shall mean the preferred form for making modifications,\n+ including but not limited to software source code, documentation\n+ source, and configuration files.\n+\n+ \"Object\" form shall mean any form resulting from mechanical\n+ transformation or translation of a Source form, including but\n+ not limited to compiled object code, generated documentation,\n+ and conversions to other media types.\n+\n+ \"Work\" shall mean the work of authorship, whether in Source or\n+ Object form, made available under the License, as indicated by a\n+ copyright notice that is included in or attached to the work\n+ (an example is provided in the Appendix below).\n+\n+ \"Derivative Works\" shall mean any work, whether in Source or Object\n+ form, that is based on (or derived from) the Work and for which the\n+ editorial revisions, annotations, elaborations, or other modifications\n+ represent, as a whole, an original work of authorship. For the purposes\n+ of this License, Derivative Works shall not include works that remain\n+ separable from, or merely link (or bind by name) to the interfaces of,\n+ the Work and Derivative Works thereof.\n+\n+ \"Contribution\" shall mean any work of authorship, including\n+ the original version of the Work and any modifications or additions\n+ to that Work or Derivative Works thereof, that is intentionally\n+ submitted to Licensor for inclusion in the Work by the copyright owner\n+ or by an individual or Legal Entity authorized to submit on behalf of\n+ the copyright owner. For the purposes of this definition, \"submitted\"\n+ means any form of electronic, verbal, or written communication sent\n+ to the Licensor or its representatives, including but not limited to\n+ communication on electronic mailing lists, source code control systems,\n+ and issue tracking systems that are managed by, or on behalf of, the\n+ Licensor for the purpose of discussing and improving the Work, but\n+ excluding communication that is conspicuously marked or otherwise\n+ designated in writing by the copyright owner as \"Not a Contribution.\"\n+\n+ \"Contributor\" shall mean Licensor and any individual or Legal Entity\n+ on behalf of whom a Contribution has been received by Licensor and\n+ subsequently incorporated within the Work.\n+\n+ 2. Grant of Copyright License. Subject to the terms and conditions of\n+ this License, each Contributor hereby grants to You a perpetual,\n+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n+ copyright license to reproduce, prepare Derivative Works of,\n+ publicly display, publicly perform, sublicense, and distribute the\n+ Work and such Derivative Works in Source or Object form.\n+\n+ 3. Grant of Patent License. Subject to the terms and conditions of\n+ this License, each Contributor hereby grants to You a perpetual,\n+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n+ (except as stated in this section) patent license to make, have made,\n+ use, offer to sell, sell, import, and otherwise transfer the Work,\n+ where such license applies only to those patent claims licensable\n+ by such Contributor that are necessarily infringed by their\n+ Contribution(s) alone or by combination of their Contribution(s)\n+ with the Work to which such Contribution(s) was submitted. If You\n+ institute patent litigation against any entity (including a\n+ cross-claim or counterclaim in a lawsuit) alleging that the Work\n+ or a Contribution incorporated within the Work constitutes direct\n+ or contributory patent infringement, then any patent licenses\n+ granted to You under this License for that Work shall terminate\n+ as of the date such litigation is filed.\n+\n+ 4. Redistribution. You may reproduce and distribute copies of the\n+ Work or Derivative Works thereof in any medium, with or without\n+ modifications, and in Source or Object form, provided that You\n+ meet the following conditions:\n+\n+ (a) You must give any other recipients of the Work or\n+ Derivative Works a copy of this License; and\n+\n+ (b) You must cause any modified files to carry prominent notices\n+ stating that You changed the files; and\n+\n+ (c) You must retain, in the Source form of any Derivative Works\n+ that You distribute, all copyright, patent, trademark, and\n+ attribution notices from the Source form of the Work,\n+ excluding those notices that do not pertain to any part of\n+ the Derivative Works; and\n+\n+ (d) If the Work includes a \"NOTICE\" text file as part of its\n+ distribution, then any Derivative Works that You distribute must\n+ include a readable copy of the attribution notices contained\n+ within such NOTICE file, excluding those notices that do not\n+ pertain to any part of the Derivative Works, in at least one\n+ of the following places: within a NOTICE text file distributed\n+ as part of the Derivative Works; within the Source form or\n+ documentation, if provided along with the Derivative Works; or,\n+ within a display generated by the Derivative Works, if and\n+ wherever such third-party notices normally appear. The contents\n+ of the NOTICE file are for informational purposes only and\n+ do not modify the License. You may add Your own attribution\n+ notices within Derivative Works that You distribute, alongside\n+ or as an addendum to the NOTICE text from the Work, provided\n+ that such additional attribution notices cannot be construed\n+ as modifying the License.\n+\n+ You may add Your own copyright statement to Your modifications and\n+ may provide additional or different license terms and conditions\n+ for use, reproduction, or distribution of Your modifications, or\n+ for any such Derivative Works as a whole, provided Your use,\n+ reproduction, and distribution of the Work otherwise complies with\n+ the conditions stated in this License.\n+\n+ 5. Submission of Contributions. Unless You explicitly state otherwise,\n+ any Contribution intentionally submitted for inclusion in the Work\n+ by You to the Licensor shall be under the terms and conditions of\n+ this License, without any additional terms or conditions.\n+ Notwithstanding the above, nothing herein shall supersede or modify\n+ the terms of any separate license agreement you may have executed\n+ with Licensor regarding such Contributions.\n+\n+ 6. Trademarks. This License does not grant permission to use the trade\n+ names, trademarks, service marks, or product names of the Licensor,\n+ except as required for reasonable and customary use in describing the\n+ origin of the Work and reproducing the content of the NOTICE file.\n+\n+ 7. Disclaimer of Warranty. Unless required by applicable law or\n+ agreed to in writing, Licensor provides the Work (and each\n+ Contributor provides its Contributions) on an \"AS IS\" BASIS,\n+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n+ implied, including, without limitation, any warranties or conditions\n+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n+ PARTICULAR PURPOSE. You are solely responsible for determining the\n+ appropriateness of using or redistributing the Work and assume any\n+ risks associated with Your exercise of permissions under this License.\n+\n+ 8. Limitation of Liability. In no event and under no legal theory,\n+ whether in tort (including negligence), contract, or otherwise,\n+ unless required by applicable law (such as deliberate and grossly\n+ negligent acts) or agreed to in writing, shall any Contributor be\n+ liable to You for damages, including any direct, indirect, special,\n+ incidental, or consequential damages of any character arising as a\n+ result of this License or out of the use or inability to use the\n+ Work (including but not limited to damages for loss of goodwill,\n+ work stoppage, computer failure or malfunction, or any and all\n+ other commercial damages or losses), even if such Contributor\n+ has been advised of the possibility of such damages.\n+\n+ 9. Accepting Warranty or Additional Liability. While redistributing\n+ the Work or Derivative Works thereof, You may choose to offer,\n+ and charge a fee for, acceptance of support, warranty, indemnity,\n+ or other liability obligations and/or rights consistent with this\n+ License. However, in accepting such obligations, You may act only\n+ on Your own behalf and on Your sole responsibility, not on behalf\n+ of any other Contributor, and only if You agree to indemnify,\n+ defend, and hold each Contributor harmless for any liability\n+ incurred by, or claims asserted against, such Contributor by reason\n+ of your accepting any such warranty or additional liability.\n+\n+ END OF TERMS AND CONDITIONS\n+\n+ APPENDIX: How to apply the Apache License to your work.\n+\n+ To apply the Apache License to your work, attach the following\n+ boilerplate notice, with the fields enclosed by brackets \"{}\"\n+ replaced with your own identifying information. (Don't include\n+ the brackets!) The text should be enclosed in the appropriate\n+ comment syntax for the file format. We also recommend that a\n+ file or class name and description of purpose be included on the\n+ same \"printed page\" as the copyright notice for easier\n+ identification within third-party archives.\n+\n+ Copyright {yyyy} {name of copyright owner}\n+\n+ Licensed under the Apache License, Version 2.0 (the \"License\");\n+ you may not use this file except in compliance with the License.\n+ You may obtain a copy of the License at\n+\n+ http://www.apache.org/licenses/LICENSE-2.0\n+\n+ Unless required by applicable law or agreed to in writing, software\n+ distributed under the License is distributed on an \"AS IS\" BASIS,\n+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ See the License for the specific language governing permissions and\n+ limitations under the License.\n",
"new_path": "packages/transducers-fsm/LICENSE",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+# @thi.ng/transducers-fsm\n+\n+[](https://www.npmjs.com/package/@thi.ng/transducers-fsm)\n+\n+This project is part of the\n+[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.\n+\n+## About\n+\n+TODO...\n+\n+## Installation\n+\n+```\n+yarn add @thi.ng/transducers-fsm\n+```\n+\n+## Usage examples\n+\n+```typescript\n+import * as transducers-fsm from \"@thi.ng/transducers-fsm\";\n+```\n+\n+## Authors\n+\n+- Karsten Schmidt\n+\n+## License\n+\n+© 2018 Karsten Schmidt // Apache Software License 2.0\n",
"new_path": "packages/transducers-fsm/README.md",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"@thi.ng/transducers-fsm\",\n+ \"version\": \"0.0.1\",\n+ \"description\": \"Transducer based Finite State Machine transformer\",\n+ \"main\": \"./index.js\",\n+ \"typings\": \"./index.d.ts\",\n+ \"repository\": \"https://github.com/thi-ng/umbrella\",\n+ \"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n+ \"license\": \"Apache-2.0\",\n+ \"scripts\": {\n+ \"build\": \"yarn run clean && tsc --declaration\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n+ \"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n+ \"pub\": \"yarn run build && yarn publish --access public\",\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n+ },\n+ \"devDependencies\": {\n+ \"@types/mocha\": \"^5.2.0\",\n+ \"@types/node\": \"^10.0.6\",\n+ \"mocha\": \"^5.1.1\",\n+ \"nyc\": \"^11.7.1\",\n+ \"typedoc\": \"^0.11.1\",\n+ \"typescript\": \"^2.8.3\"\n+ },\n+ \"dependencies\": {\n+ \"@thi.ng/api\": \"^4.0.3\",\n+ \"@thi.ng/transducers\": \"^1.10.2\"\n+ },\n+ \"keywords\": [\n+ \"ES6\",\n+ \"typescript\"\n+ ],\n+ \"publishConfig\": {\n+ \"access\": \"public\"\n+ }\n+}\n",
"new_path": "packages/transducers-fsm/package.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { IObjectOf } from \"@thi.ng/api/api\";\n+\n+import { Reducer, Transducer } from \"@thi.ng/transducers/api\";\n+import { compR } from \"@thi.ng/transducers/func/compr\";\n+import { ensureReduced } from \"@thi.ng/transducers/reduced\";\n+\n+export interface FSMState {\n+ state: PropertyKey;\n+}\n+\n+export type FSMStateMap<T extends FSMState, A, B> = IObjectOf<FSMHandler<T, A, B>>;\n+export type FSMHandler<T extends FSMState, A, B> = (state: T, input: A) => B | void;\n+\n+export interface FSMOpts<T extends FSMState, A, B> {\n+ states: FSMStateMap<T, A, B>;\n+ terminate: PropertyKey;\n+ init: () => T;\n+}\n+\n+export function fsm<T extends FSMState, A, B>(opts: FSMOpts<T, A, B>): Transducer<A, B> {\n+ return (rfn: Reducer<any, B>) => {\n+ const states = opts.states;\n+ const state = opts.init();\n+ const r = rfn[2];\n+ return compR(rfn,\n+ (acc, x) => {\n+ // console.log(x, State[state.state], state);\n+ const res = states[<any>state.state](state, x);\n+ if (res) {\n+ acc = r(acc, res);\n+ if (state.state == opts.terminate) {\n+ return ensureReduced(acc);\n+ }\n+ }\n+ return acc;\n+ });\n+ }\n+}\n",
"new_path": "packages/transducers-fsm/src/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+// import * as assert from \"assert\";\n+// import * as transducers-fsm from \"../src/index\";\n+\n+describe(\"transducers-fsm\", () => {\n+ it(\"tests pending\");\n+});\n",
"new_path": "packages/transducers-fsm/test/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"extends\": \"../../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \"../build\"\n+ },\n+ \"include\": [\n+ \"./**/*.ts\",\n+ \"../src/**/*.ts\"\n+ ]\n+}\n",
"new_path": "packages/transducers-fsm/test/tsconfig.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"extends\": \"../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \".\"\n+ },\n+ \"include\": [\n+ \"./src/**/*.ts\"\n+ ]\n+}\n",
"new_path": "packages/transducers-fsm/tsconfig.json",
"old_path": null
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | feat(transducers-fsm): inital import | 1 | feat | transducers-fsm |
679,913 | 17.06.2018 23:44:04 | -3,600 | 56deb4556b4085a7d50ed8c74f094cc02056feb5 | refactor(sax): remove extracted FSM transducer & types, update readme | [
{
"change_type": "ADD",
"diff": "+# @thi.ng/sax\n+\n+[](https://www.npmjs.com/package/@thi.ng/sax)\n+\n+This project is part of the\n+[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.\n+\n+## About\n+\n+[@thi.ng/transducers](https://github.com/thi-ng/umbrella/tree/master/packages/transducers)-based,\n+[SAX](https://en.wikipedia.org/wiki/Simple_API_for_XML)-like,\n+non-validating, speedy & tiny XML parser (1.4KB gzipped).\n+\n+Unlike the classic event-driven approach of SAX, this parser is\n+implemented as a transducer function transforming an XML input into a\n+stream of SAX-event-like objects. Being a transducer, the parser can be\n+used in novel ways as part of a larger processing pipeline and can be\n+composed with other pre or post-processing steps, e.g. to filter or\n+transform element / attribute values.\n+\n+## Installation\n+\n+```\n+yarn add @thi.ng/sax\n+```\n+\n+## Usage examples\n+\n+```ts\n+import * as sax from \"@thi.ng/sax\";\n+import * as tx from \"@thi.ng/transducers\";\n+\n+src=`<?xml version=\"1.0\" encoding=\"utf-8\"?>\n+<!DOCTYPE foo bar>\n+<a>\n+ <b1>\n+ <c x=\"23\" y=\"42\">ccc\n+ <d>dd</d>\n+ </c>\n+ </b1>\n+ <b2 foo=\"bar\" />\n+</a>`\n+\n+doc = [...tx.iterator(sax.parse(), src)]\n+\n+// [ { id: 'proc', value: { tag: 'xml', attribs: { version: '1.0', encoding: 'utf-8' } } },\n+// { id: 'doctype', value: 'foo bar' },\n+// { id: 'elem', value: { tag: 'a', attribs: {} } },\n+// { id: 'body', value: { tag: 'a', body: '\\n ' } },\n+// { id: 'elem', value: { tag: 'b1', attribs: {} } },\n+// { id: 'body', value: { tag: 'b1', body: '\\n ' } },\n+// { id: 'elem', value: { tag: 'c', attribs: { x: '23', y: '42' } } },\n+// { id: 'body', value: { tag: 'c', body: 'ccc\\n ' } },\n+// { id: 'elem', value: { tag: 'd', attribs: {} } },\n+// { id: 'body', value: { tag: 'd', body: 'dd' } },\n+// { id: 'end',\n+// value: { tag: 'd', attribs: {}, children: [], body: 'dd' } },\n+// { id: 'end',\n+// value:\n+// { tag: 'c',\n+// attribs: { x: '23', y: '42' },\n+// children: [ { tag: 'd', attribs: {}, children: [], body: 'dd' } ],\n+// body: 'ccc\\n ' } },\n+// { id: 'end',\n+// value:\n+// { tag: 'b1', attribs: {}, children: [Array], body: '\\n ' } },\n+// { id: 'elem', value: { tag: 'b2', attribs: [Object] } },\n+// { id: 'end',\n+// value: { tag: 'a', attribs: {}, children: [Array], body: '\\n ' } } ]\n+```\n+\n+## Emitted result type IDs\n+\n+| ID | Description |\n+|-----------|-----------------------------------------------|\n+| `body` | Element text body |\n+| `doctype` | Doctype declaration |\n+| `elem` | Element start incl. attributes |\n+| `end` | Element end incl. attributes, body & children |\n+| `proc` | Processing instruction incl. attribs |\n+| `error` | Parse error incl. description |\n+\n+## Authors\n+\n+- Karsten Schmidt\n+\n+## License\n+\n+© 2018 Karsten Schmidt // Apache Software License 2.0\n",
"new_path": "packages/sax/README.md",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@thi.ng/sax\",\n\"version\": \"0.0.1\",\n- \"description\": \"TODO\",\n+ \"description\": \"Transducer-based, SAX-like, non-validating, speedy & tiny XML parser\",\n\"main\": \"./index.js\",\n\"typings\": \"./index.d.ts\",\n\"repository\": \"https://github.com/thi-ng/umbrella\",\n},\n\"dependencies\": {\n\"@thi.ng/api\": \"^4.0.3\",\n- \"@thi.ng/transducers\": \"^1.10.2\"\n+ \"@thi.ng/transducers\": \"^1.10.2\",\n+ \"@thi.ng/transducers-fsm\": \"^0.0.1\"\n},\n\"keywords\": [\n\"ES6\",\n- \"typescript\"\n+ \"FSM\",\n+ \"parser\",\n+ \"SAX\",\n+ \"transducers\",\n+ \"typescript\",\n+ \"XML\"\n],\n\"publishConfig\": {\n\"access\": \"public\"\n",
"new_path": "packages/sax/package.json",
"old_path": "packages/sax/package.json"
},
{
"change_type": "MODIFY",
"diff": "-import { Event, IObjectOf } from \"@thi.ng/api\";\n-import { Transducer, Reducer } from \"@thi.ng/transducers/api\";\n-import { ensureReduced } from \"@thi.ng/transducers/reduced\";\n+import { Event } from \"@thi.ng/api\";\n+import * as fsm from \"@thi.ng/transducers-fsm\";\n+import { Transducer } from \"@thi.ng/transducers/api\";\n-export interface FSMState {\n- state: PropertyKey;\n-}\n-\n-export type FSMStateMap<T extends FSMState, A, B> = IObjectOf<FSMHandler<T, A, B>>;\n-export type FSMHandler<T extends FSMState, A, B> = (state: T, input: A) => B | void;\n-\n-export interface FSMOpts<T extends FSMState, A, B> {\n- states: FSMStateMap<T, A, B>;\n- terminate: PropertyKey;\n- init: () => T;\n-}\n-\n-export function fsm<T extends FSMState, A, B>(opts: FSMOpts<T, A, B>): Transducer<A, B> {\n- return (rfn: Reducer<any, B>) => {\n- const states = opts.states;\n- const state = opts.init();\n- const r = rfn[2];\n- return [\n- rfn[0],\n- (acc) => rfn[1](acc),\n- (acc, x) => {\n- // console.log(x, State[state.state], state);\n- const res = states[<any>state.state](state, x);\n- if (res) {\n- acc = r(acc, res);\n- if (state.state == opts.terminate) {\n- return ensureReduced(acc);\n- }\n- }\n- return acc;\n- }];\n- }\n-}\n-\n-export interface ParseState extends FSMState {\n+export interface ParseState extends fsm.FSMState {\npos: number;\nscope: any[];\ntag: string;\n@@ -69,6 +34,17 @@ enum State {\nPROC_END,\n}\n+export const parse = (): Transducer<string, Event> =>\n+ fsm.fsm({\n+ states: PARSER,\n+ init: () => (<ParseState>{\n+ state: State.WAIT,\n+ scope: [],\n+ pos: 0\n+ }),\n+ terminate: State.ERROR\n+ });\n+\nconst isWS = (x: string) =>\nx == \" \" || x == \"\\t\" || x == \"\\n\" || x == \"\\r\";\n@@ -85,19 +61,7 @@ const unexpected = (s: ParseState, x: string) => {\nreturn { id: \"error\", value: `unexpected char: '${x}' @ pos: ${s.pos}` };\n};\n-export function parse() {\n- return fsm({\n- states: PARSER,\n- init: () => (<ParseState>{\n- state: State.WAIT,\n- scope: [],\n- pos: 0\n- }),\n- terminate: State.ERROR\n- });\n-}\n-\n-export const PARSER: FSMStateMap<ParseState, string, Event> = {\n+const PARSER: fsm.FSMStateMap<ParseState, string, Event> = {\n[State.ERROR]: () => {\n},\n",
"new_path": "packages/sax/src/index.ts",
"old_path": "packages/sax/src/index.ts"
},
{
"change_type": "ADD",
"diff": "+// import * as assert from \"assert\";\n+// import * as sax from \"../src/index\";\n+\n+describe(\"sax\", () => {\n+ it(\"tests pending\");\n+});\n",
"new_path": "packages/sax/test/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"extends\": \"../../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \"../build\"\n+ },\n+ \"include\": [\n+ \"./**/*.ts\",\n+ \"../src/**/*.ts\"\n+ ]\n+}\n",
"new_path": "packages/sax/test/tsconfig.json",
"old_path": null
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | refactor(sax): remove extracted FSM transducer & types, update readme | 1 | refactor | sax |
679,913 | 18.06.2018 01:46:28 | -3,600 | 0f2fcdffa8d8207d0ecebe3d58bdd788536a9ed3 | feat(sax): add entity support, update result format, update states
add ParseOpts, ParseElement, ParseEvent, Type
add XML entity replacement (optional)
update error handling (add `error()` helper)
update PROC_DECL state to support arbitrary instruction tags | [
{
"change_type": "MODIFY",
"diff": "-import { Event } from \"@thi.ng/api\";\n+import { IObjectOf } from \"@thi.ng/api\";\nimport * as fsm from \"@thi.ng/transducers-fsm\";\nimport { Transducer } from \"@thi.ng/transducers/api\";\n-export interface ParseState extends fsm.FSMState {\n- pos: number;\n- scope: any[];\n+export interface ParseOpts {\n+ entities: boolean;\n+}\n+\n+export interface ParseElement {\ntag: string;\n+ attribs: IObjectOf<string>;\nbody: string;\n+ children: ParseElement[];\n+}\n+\n+export interface ParseEvent extends Partial<ParseElement> {\n+ type: Type;\n+}\n+\n+export enum Type {\n+ PROC,\n+ DOCTYPE,\n+ COMMENT,\n+ ELEM_START,\n+ ELEM_END,\n+ ELEM_BODY,\n+ ERROR,\n+}\n+\n+interface ParseState extends fsm.FSMState {\n+ scope: any[];\n+ tag: string;\nattribs: any;\n+ body: string;\nname: string;\nval: string;\n+ pos: number;\nquote: string;\nphase: number;\n+ isProc: boolean;\n+ opts: Partial<ParseOpts>;\n}\nenum State {\n@@ -34,13 +61,24 @@ enum State {\nPROC_END,\n}\n-export const parse = (): Transducer<string, Event> =>\n+const ENTITIES = {\n+ \"&\": \"&\",\n+ \"<\": \"<\",\n+ \">\": \">\",\n+ \""\": '\"',\n+ \"'\": \"'\",\n+};\n+\n+const ENTITY_RE = new RegExp(`(${Object.keys(ENTITIES).join(\"|\")})`, \"g\");\n+\n+export const parse = (opts: Partial<ParseOpts> = {}): Transducer<string, ParseEvent> =>\nfsm.fsm({\nstates: PARSER,\ninit: () => (<ParseState>{\nstate: State.WAIT,\nscope: [],\n- pos: 0\n+ pos: 0,\n+ opts,\n}),\nterminate: State.ERROR\n});\n@@ -56,245 +94,265 @@ const isTagChar = (x: string) =>\nx == \"_\" ||\nx == \":\";\n-const unexpected = (s: ParseState, x: string) => {\n+const error = (s: ParseState, body: string) => {\ns.state = State.ERROR;\n- return { id: \"error\", value: `unexpected char: '${x}' @ pos: ${s.pos}` };\n+ return { type: Type.ERROR, body };\n};\n-const PARSER: fsm.FSMStateMap<ParseState, string, Event> = {\n- [State.ERROR]: () => {\n- },\n+const unexpected = (s: ParseState, x: string) =>\n+ error(s, `unexpected char: '${x}' @ pos ${s.pos}`);\n- [State.WAIT]: (s: ParseState, x: string) => {\n- s.pos++;\n- if (!isWS(x)) {\n- if (x === \"<\") {\n- s.state = State.MAYBE_ELEM;\n+const replaceEntities = (x: string) => x.replace(ENTITY_RE, (y) => ENTITIES[y]);\n+\n+const PARSER: fsm.FSMStateMap<ParseState, string, ParseEvent> = {\n+\n+ [State.ERROR]: () => { },\n+\n+ [State.WAIT]: (state, ch) => {\n+ state.pos++;\n+ if (!isWS(ch)) {\n+ if (ch === \"<\") {\n+ state.state = State.MAYBE_ELEM;\n} else {\n- return unexpected(s, x);\n+ return unexpected(state, ch);\n}\n}\n},\n- [State.MAYBE_ELEM]: (s: ParseState, x: string) => {\n- s.pos++;\n- if (x === \"/\") {\n- if (s.scope.length == 0) {\n- return unexpected(s, x);\n- }\n- s.state = State.ELEM_END;\n- s.tag = \"\";\n- } else if (isTagChar(x)) {\n- s.state = State.ELEM_START;\n- s.tag = x;\n- s.attribs = {};\n- } else if (x === \"!\") {\n- s.state = State.MAYBE_INSTRUCTION;\n- } else if (x === \"?\") {\n- s.state = State.PROC_DECL;\n- s.phase = 0;\n- s.body = \"\";\n+ [State.MAYBE_ELEM]: (state, ch) => {\n+ state.pos++;\n+ if (ch === \"/\") {\n+ if (state.scope.length == 0) {\n+ return unexpected(state, ch);\n+ }\n+ state.state = State.ELEM_END;\n+ state.tag = \"\";\n+ } else if (isTagChar(ch)) {\n+ state.state = State.ELEM_START;\n+ state.tag = ch;\n+ state.attribs = {};\n+ } else if (ch === \"!\") {\n+ state.state = State.MAYBE_INSTRUCTION;\n+ } else if (ch === \"?\") {\n+ state.state = State.PROC_DECL;\n+ state.phase = 0;\n+ state.tag = \"\";\n+ state.body = \"\";\n} else {\n- return unexpected(s, x);\n+ return unexpected(state, ch);\n}\n},\n- [State.ELEM_START]: (s: ParseState, x: string) => {\n- s.pos++;\n- if (isTagChar(x)) {\n- s.tag += x;\n- } else if (isWS(x)) {\n- s.state = State.MAYBE_ATTRIB;\n- } else if (x === \">\") {\n- const res = { id: \"elem\", value: { tag: s.tag, attribs: s.attribs } };\n- s.state = State.ELEM_BODY;\n- s.scope.push({ tag: s.tag, attribs: s.attribs, children: [] });\n- s.body = \"\";\n+ [State.ELEM_START]: (state, ch) => {\n+ state.pos++;\n+ if (isTagChar(ch)) {\n+ state.tag += ch;\n+ } else if (isWS(ch)) {\n+ state.state = State.MAYBE_ATTRIB;\n+ } else if (ch === \">\") {\n+ const res = { type: Type.ELEM_START, tag: state.tag, attribs: state.attribs };\n+ state.state = State.ELEM_BODY;\n+ state.scope.push({ tag: state.tag, attribs: state.attribs, children: [] });\n+ state.body = \"\";\nreturn res;\n- } else if (x === \"/\") {\n- s.state = State.ELEM_SINGLE;\n+ } else if (ch === \"/\") {\n+ state.state = State.ELEM_SINGLE;\n} else {\n- return unexpected(s, x);\n+ return unexpected(state, ch);\n}\n},\n- [State.ELEM_END]: (s: ParseState, x: string) => {\n- s.pos++;\n- if (isTagChar(x)) {\n- s.tag += x;\n- } else if (x === \">\") {\n- const n = s.scope.length;\n- if (n > 0 && s.tag === s.scope[n - 1].tag) {\n- const res = { id: \"end\", value: s.scope[n - 1] };\n- s.scope.pop();\n+ [State.ELEM_END]: (state, ch) => {\n+ state.pos++;\n+ if (isTagChar(ch)) {\n+ state.tag += ch;\n+ } else if (ch === \">\") {\n+ const n = state.scope.length;\n+ if (n > 0 && state.tag === state.scope[n - 1].tag) {\n+ const res = state.scope[n - 1];\n+ state.scope.pop();\nif (n > 1) {\n- s.scope[n - 2].children.push(res.value);\n+ state.scope[n - 2].children.push(res);\n}\n- s.state = State.WAIT;\n- return res;\n+ state.state = State.WAIT;\n+ return { type: Type.ELEM_END, ...res };\n} else {\n- throw new Error(`unmatched end tag: ${s.tag}`);\n+ error(state, state.tag);\n}\n}\n},\n- [State.ELEM_SINGLE]: (s: ParseState, x: string) => {\n- s.pos++;\n- if (x === \">\") {\n- s.state = State.WAIT;\n- const n = s.scope.length;\n- const res = { tag: s.tag, attribs: s.attribs };\n+ [State.ELEM_SINGLE]: (state, ch) => {\n+ state.pos++;\n+ if (ch === \">\") {\n+ state.state = State.WAIT;\n+ const n = state.scope.length;\n+ const res = { tag: state.tag, attribs: state.attribs };\nif (n > 0) {\n- s.scope[n - 1].children.push(res);\n+ state.scope[n - 1].children.push(res);\n}\n- return { id: \"elem\", value: res };\n+ return { type: Type.ELEM_END, ...res };\n} else {\n- return unexpected(s, x);\n+ return unexpected(state, ch);\n}\n},\n- [State.ELEM_BODY]: (s: ParseState, x: string) => {\n- s.pos++;\n- if (x === \"<\") {\n+ [State.ELEM_BODY]: (state, ch) => {\n+ state.pos++;\n+ if (ch === \"<\") {\nlet res;\n- if (s.body.length > 0) {\n- s.scope[s.scope.length - 1].body = s.body;\n- res = { id: \"body\", value: { tag: s.tag, body: s.body } }\n+ if (state.body.length > 0) {\n+ if (state.opts.entities) {\n+ state.body = replaceEntities(state.body);\n+ }\n+ state.scope[state.scope.length - 1].body = state.body;\n+ res = { type: Type.ELEM_BODY, tag: state.tag, body: state.body };\n}\n- s.state = State.MAYBE_ELEM;\n- s.tag = \"\";\n+ state.state = State.MAYBE_ELEM;\n+ state.tag = \"\";\nreturn res;\n} else {\n- s.body += x;\n+ state.body += ch;\n}\n},\n- [State.MAYBE_ATTRIB]: (s: ParseState, x: string) => {\n- s.pos++;\n- if (isTagChar(x)) {\n- s.state = State.ATTRIB_NAME;\n- s.name = x;\n- s.val = \"\";\n- } else if (x === \">\") {\n- const res = { id: \"elem\", value: { tag: s.tag, attribs: s.attribs } };\n- s.state = State.ELEM_BODY;\n- s.scope.push({ tag: s.tag, attribs: s.attribs, children: [] });\n- s.body = \"\";\n+ [State.MAYBE_ATTRIB]: (state, ch) => {\n+ state.pos++;\n+ if (isTagChar(ch)) {\n+ state.state = State.ATTRIB_NAME;\n+ state.name = ch;\n+ state.val = \"\";\n+ } else {\n+ if (state.isProc) {\n+ if (ch === \"?\") {\n+ state.state = State.PROC_END;\n+ } else if (!isWS(ch)) {\n+ return unexpected(state, ch);\n+ }\n+ } else {\n+ if (ch === \">\") {\n+ const res = { type: Type.ELEM_START, tag: state.tag, attribs: state.attribs };\n+ state.state = State.ELEM_BODY;\n+ state.scope.push({ tag: state.tag, attribs: state.attribs, children: [] });\n+ state.body = \"\";\nreturn res;\n- } else if (x === \"/\") {\n- s.state = State.ELEM_SINGLE;\n- } else if (s.tag === \"xml\" && x === \"?\") {\n- s.state = State.PROC_END;\n- } else if (!isWS(x)) {\n- return unexpected(s, x);\n+ } else if (ch === \"/\") {\n+ state.state = State.ELEM_SINGLE;\n+ } else if (!isWS(ch)) {\n+ return unexpected(state, ch);\n+ }\n+ }\n}\n},\n- [State.ATTRIB_NAME]: (s: ParseState, x: string) => {\n- s.pos++;\n- if (isTagChar(x)) {\n- s.name += x;\n- } else if (x === \"=\") {\n- s.state = State.ATTRIB_VAL_START;\n+ [State.ATTRIB_NAME]: (state, ch) => {\n+ state.pos++;\n+ if (isTagChar(ch)) {\n+ state.name += ch;\n+ } else if (ch === \"=\") {\n+ state.state = State.ATTRIB_VAL_START;\n} else {\n- return unexpected(s, x);\n+ return unexpected(state, ch);\n}\n},\n- [State.ATTRIB_VAL_START]: (s: ParseState, x: string) => {\n- s.pos++;\n- if (x === \"\\\"\" || x === \"'\") {\n- s.state = State.ATTRIB_VALUE;\n- s.quote = x;\n+ [State.ATTRIB_VAL_START]: (state, ch) => {\n+ state.pos++;\n+ if (ch === \"\\\"\" || ch === \"'\") {\n+ state.state = State.ATTRIB_VALUE;\n+ state.quote = ch;\n} else {\n- return unexpected(s, x);\n+ return unexpected(state, ch);\n}\n},\n- [State.ATTRIB_VALUE]: (s: ParseState, x: string) => {\n- s.pos++;\n- if (x === s.quote) {\n- s.attribs[s.name] = s.val;\n- s.state = State.MAYBE_ATTRIB;\n+ [State.ATTRIB_VALUE]: (state, ch) => {\n+ state.pos++;\n+ if (ch === state.quote) {\n+ if (state.opts.entities) {\n+ state.val = replaceEntities(state.val);\n+ }\n+ state.attribs[state.name] = state.val;\n+ state.state = State.MAYBE_ATTRIB;\n} else {\n- s.val += x;\n+ state.val += ch;\n}\n},\n- [State.MAYBE_INSTRUCTION]: (s: ParseState, x: string) => {\n- s.pos++;\n- if (x === \"-\") {\n- s.state = State.COMMENT;\n- } else if (x === \"D\") {\n- s.state = State.DOCTYPE;\n- s.phase = 1;\n- s.body = \"\";\n+ [State.MAYBE_INSTRUCTION]: (state, ch) => {\n+ state.pos++;\n+ if (ch === \"-\") {\n+ state.state = State.COMMENT;\n+ } else if (ch === \"D\") {\n+ state.state = State.DOCTYPE;\n+ state.phase = 1;\n+ state.body = \"\";\n} else {\n- return unexpected(s, x);\n+ return unexpected(state, ch);\n}\n},\n- [State.COMMENT]: (s: ParseState, x: string) => {\n- s.pos++;\n- if (x === \"-\") {\n- s.state = State.COMMENT_BODY;\n- s.body = \"\";\n+ [State.COMMENT]: (state, ch) => {\n+ state.pos++;\n+ if (ch === \"-\") {\n+ state.state = State.COMMENT_BODY;\n+ state.body = \"\";\n} else {\n- return unexpected(s, x);\n+ return unexpected(state, ch);\n}\n},\n- [State.COMMENT_BODY]: (s: ParseState, x: string) => {\n- s.pos++;\n- if (x === \">\") {\n- const n = s.body.length;\n- if (s.body.substr(n - 2) !== \"--\") {\n- return unexpected(s, x);\n+ [State.COMMENT_BODY]: (state, ch) => {\n+ state.pos++;\n+ if (ch === \">\") {\n+ const n = state.body.length;\n+ if (state.body.substr(n - 2) !== \"--\") {\n+ return unexpected(state, ch);\n}\n- s.state = State.WAIT;\n- return { id: \"comment\", value: s.body.substr(0, n - 2) };\n+ state.state = State.WAIT;\n+ return { type: Type.COMMENT, body: state.body.substr(0, n - 2) };\n} else {\n- s.body += x;\n+ state.body += ch;\n}\n},\n- [State.DOCTYPE]: (s: ParseState, x: string) => {\n- s.pos++;\n- if (s.phase < 8) {\n- if (x === \"DOCTYPE \"[s.phase]) {\n- s.phase++;\n+ [State.DOCTYPE]: (state, ch) => {\n+ state.pos++;\n+ if (state.phase < 8) {\n+ if (ch === \"DOCTYPE \"[state.phase]) {\n+ state.phase++;\n} else {\n- return unexpected(s, x);\n+ return unexpected(state, ch);\n}\n- } else if (x === \">\") {\n- s.state = State.WAIT;\n- return { id: \"doctype\", value: s.body.trim() };\n+ } else if (ch === \">\") {\n+ state.state = State.WAIT;\n+ return { type: Type.DOCTYPE, body: state.body.trim() };\n} else {\n- s.body += x;\n+ state.body += ch;\n}\n},\n- [State.PROC_DECL]: (s: ParseState, x: string) => {\n- s.pos++;\n- if (x === \"xml \"[s.phase]) {\n- s.phase++;\n- if (s.phase == 4) {\n- s.state = State.MAYBE_ATTRIB;\n- s.tag = \"xml\";\n- s.attribs = {};\n- }\n+ [State.PROC_DECL]: (state, ch) => {\n+ state.pos++;\n+ if (isTagChar(ch)) {\n+ state.tag += ch;\n+ } else if (isWS(ch)) {\n+ state.state = State.MAYBE_ATTRIB;\n+ state.isProc = true;\n+ state.attribs = {};\n} else {\n- return unexpected(s, x);\n+ return unexpected(state, ch);\n}\n},\n- [State.PROC_END]: (s: ParseState, x: string) => {\n- s.pos++;\n- if (x === \">\") {\n- s.state = State.WAIT;\n- return { id: \"proc\", value: { tag: s.tag, attribs: s.attribs } };\n+ [State.PROC_END]: (state, ch) => {\n+ state.pos++;\n+ if (ch === \">\") {\n+ state.state = State.WAIT;\n+ state.isProc = false;\n+ return { type: Type.PROC, tag: state.tag, attribs: state.attribs };\n} else {\n- return unexpected(s, x);\n+ return unexpected(state, ch);\n}\n},\n};\n",
"new_path": "packages/sax/src/index.ts",
"old_path": "packages/sax/src/index.ts"
}
] | TypeScript | Apache License 2.0 | thi-ng/umbrella | feat(sax): add entity support, update result format, update states
- add ParseOpts, ParseElement, ParseEvent, Type
- add XML entity replacement (optional)
- update error handling (add `error()` helper)
- update PROC_DECL state to support arbitrary instruction tags
- | 1 | feat | sax |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.