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
⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
791,723
|
13.04.2018 10:04:29
| 25,200
|
48120d0bfc7072e37949403026e3df8c322efe26
|
tests: exclude audit helpText from 'yarn diff:sample-json' assertion
|
[
{
"change_type": "MODIFY",
"diff": "@@ -24,5 +24,8 @@ writeFileSync(filename, cleanAndFormatLHR(data), 'utf8');\nfunction cleanAndFormatLHR(lhrString) {\nconst lhr = JSON.parse(lhrString);\ndelete lhr.timing;\n+ for (const auditResult of Object.values(lhr.audits)) {\n+ auditResult.helpText = '**Excluded from diff**';\n+ }\nreturn JSON.stringify(lhr, null, 2);\n}\n",
"new_path": "lighthouse-core/scripts/cleanup-LHR-for-diff.js",
"old_path": "lighthouse-core/scripts/cleanup-LHR-for-diff.js"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
tests: exclude audit helpText from 'yarn diff:sample-json' assertion (#4964)
| 1
|
tests
| null |
791,690
|
13.04.2018 10:15:57
| 25,200
|
6d6af51decfc5663c3d497e03c865c478064ca0c
|
core(config): clean flags for config settings
|
[
{
"change_type": "MODIFY",
"diff": "@@ -246,8 +246,27 @@ function expandArtifacts(artifacts) {\nreturn artifacts;\n}\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+ * @return {Partial<LH.Config.Settings>}\n+ */\n+function cleanFlagsForSettings(flags = {}) {\n+ const settings = {};\n+ for (const key of Object.keys(flags)) {\n+ if (typeof constants.defaultSettings[key] !== 'undefined') {\n+ settings[key] = flags[key];\n+ }\n+ }\n+\n+ return settings;\n+}\n+\nfunction merge(base, extension) {\n- if (typeof base === 'undefined') {\n+ // If the default value doesn't exist or is explicitly null, defer to the extending value\n+ if (typeof base === 'undefined' || base === null) {\nreturn extension;\n} else if (Array.isArray(extension)) {\nif (!Array.isArray(base)) throw new TypeError(`Expected array but got ${typeof base}`);\n@@ -330,7 +349,7 @@ class Config {\nconfigJSON.passes = Config.expandGathererShorthandAndMergeOptions(configJSON.passes);\n// Override any applicable settings with CLI flags\n- configJSON.settings = merge(configJSON.settings || {}, flags || {});\n+ configJSON.settings = merge(configJSON.settings || {}, cleanFlagsForSettings(flags));\n// Generate a limited config if specified\nif (Array.isArray(configJSON.settings.onlyCategories) ||\n",
"new_path": "lighthouse-core/config/config.js",
"old_path": "lighthouse-core/config/config.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -26,10 +26,24 @@ const throttling = {\n},\n};\n+/** @type {LH.Config.Settings} */\nconst defaultSettings = {\nmaxWaitForLoad: 45 * 1000,\nthrottlingMethod: 'devtools',\nthrottling: throttling.mobile3G,\n+ auditMode: false,\n+ gatherMode: false,\n+ disableStorageReset: false,\n+ disableDeviceEmulation: false,\n+\n+ // the following settings have no defaults but we still want ensure that `key in settings`\n+ // in config will work in a typechecked way\n+ blockedUrlPatterns: null,\n+ additionalTraceCategories: null,\n+ extraHeaders: null,\n+ onlyAudits: null,\n+ onlyCategories: null,\n+ skipAudits: null,\n};\nconst defaultPassConfig = {\n",
"new_path": "lighthouse-core/config/constants.js",
"old_path": "lighthouse-core/config/constants.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -828,7 +828,7 @@ class Driver {\n}\n/**\n- * @param {{additionalTraceCategories?: string}=} settings\n+ * @param {{additionalTraceCategories?: string|null}=} settings\n* @return {Promise<void>}\n*/\nbeginTrace(settings) {\n@@ -1019,7 +1019,7 @@ class Driver {\n}\n/**\n- * @param {LH.Crdp.Network.Headers=} headers key/value pairs of HTTP Headers.\n+ * @param {LH.Crdp.Network.Headers|null} headers key/value pairs of HTTP Headers.\n* @return {Promise<void>}\n*/\nasync setExtraHTTPHeaders(headers) {\n",
"new_path": "lighthouse-core/gather/driver.js",
"old_path": "lighthouse-core/gather/driver.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -418,6 +418,12 @@ describe('Config', () => {\n});\n});\n+ it('cleans up flags for settings', () => {\n+ const config = new Config({extends: true}, {nonsense: 1, foo: 2, throttlingMethod: 'provided'});\n+ assert.equal(config.settings.throttlingMethod, 'provided');\n+ assert.ok(config.settings.nonsense === undefined, 'did not cleanup settings');\n+ });\n+\nit('extends the full config', () => {\nclass CustomAudit extends Audit {\nstatic get meta() {\n",
"new_path": "lighthouse-core/test/config/config-test.js",
"old_path": "lighthouse-core/test/config/config-test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -26,7 +26,7 @@ declare global {\n}\nexport interface SettingsJson extends SharedFlagsSettings {\n- extraHeaders?: Crdp.Network.Headers;\n+ extraHeaders?: Crdp.Network.Headers | null;\n}\nexport interface PassJson {\n",
"new_path": "typings/config.d.ts",
"old_path": "typings/config.d.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -35,17 +35,17 @@ declare global {\ninterface SharedFlagsSettings {\nmaxWaitForLoad?: number;\n- blockedUrlPatterns?: string[];\n- additionalTraceCategories?: string;\n+ blockedUrlPatterns?: string[] | null;\n+ additionalTraceCategories?: string | null;\nauditMode?: boolean | string;\ngatherMode?: boolean | string;\ndisableStorageReset?: boolean;\ndisableDeviceEmulation?: boolean;\nthrottlingMethod?: 'devtools'|'simulate'|'provided';\nthrottling?: ThrottlingSettings;\n- onlyAudits?: string[];\n- onlyCategories?: string[];\n- skipAudits?: string[];\n+ onlyAudits?: string[] | null;\n+ onlyCategories?: string[] | null;\n+ skipAudits?: string[] | null;\n}\nexport interface Flags extends SharedFlagsSettings {\n",
"new_path": "typings/externs.d.ts",
"old_path": "typings/externs.d.ts"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(config): clean flags for config settings (#4960)
| 1
|
core
|
config
|
815,746
|
13.04.2018 10:51:20
| -10,800
|
a158d7baadde64cf4ee7e82c402719cac02f5c17
|
fix: add ng-option-marked class for custom tags
|
[
{
"change_type": "MODIFY",
"diff": "</ng-template>\n</div>\n- <div class=\"ng-option\" [class.marked]=\"!itemsList.markedItem\" (mouseover)=\"itemsList.unmarkItem()\" role=\"option\" (click)=\"selectTag()\" *ngIf=\"showAddTag()\">\n+ <div class=\"ng-option\" [class.ng-option-marked]=\"!itemsList.markedItem\" (mouseover)=\"itemsList.unmarkItem()\" role=\"option\" (click)=\"selectTag()\" *ngIf=\"showAddTag()\">\n<span><span class=\"ng-tag-label\">{{addTagText}}</span>\"{{filterValue}}\"</span>\n</div>\n</ng-container>\n",
"new_path": "src/ng-select/ng-select.component.html",
"old_path": "src/ng-select/ng-select.component.html"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
fix: add ng-option-marked class for custom tags
| 1
|
fix
| null |
791,877
|
13.04.2018 14:43:35
| 18,000
|
9ea3c17188a6a39a708102ddbefe7367371cbd24
|
report(bootup-time): fix learn more link
|
[
{
"change_type": "MODIFY",
"diff": "@@ -24,7 +24,7 @@ class BootupTime extends Audit {\nscoreDisplayMode: Audit.SCORING_MODES.NUMERIC,\nhelpText: 'Consider reducing the time spent parsing, compiling, and executing JS. ' +\n'You may find delivering smaller JS payloads helps with this. [Learn ' +\n- 'more](https://developers.google.com/web/lighthouse/audits/bootup).',\n+ 'more](https://developers.google.com/web/tools/lighthouse/audits/bootup).',\nrequiredArtifacts: ['traces'],\n};\n}\n",
"new_path": "lighthouse-core/audits/bootup-time.js",
"old_path": "lighthouse-core/audits/bootup-time.js"
},
{
"change_type": "MODIFY",
"diff": "\"scoreDisplayMode\": \"numeric\",\n\"name\": \"bootup-time\",\n\"description\": \"JavaScript boot-up time\",\n- \"helpText\": \"Consider reducing the time spent parsing, compiling, and executing JS. You may find delivering smaller JS payloads helps with this. [Learn more](https://developers.google.com/web/lighthouse/audits/bootup).\",\n+ \"helpText\": \"Consider reducing the time spent parsing, compiling, and executing JS. You may find delivering smaller JS payloads helps with this. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/bootup).\",\n\"details\": {\n\"type\": \"table\",\n\"headings\": [\n}\n},\n\"timing\": {\n- \"total\": 904\n+ \"total\": 877\n}\n}\n\\ No newline at end of file\n",
"new_path": "lighthouse-core/test/results/sample_v2.json",
"old_path": "lighthouse-core/test/results/sample_v2.json"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
report(bootup-time): fix learn more link (#4962)
| 1
|
report
|
bootup-time
|
791,690
|
13.04.2018 16:46:42
| 25,200
|
67947e8a0b47f4bc30a9384bf5411bffa6d52d01
|
core(screenshots): align filmstrip to observed metrics
|
[
{
"change_type": "MODIFY",
"diff": "'use strict';\nconst Audit = require('./audit');\n-const TTFI = require('./first-interactive');\n-const TTCI = require('./consistently-interactive');\n+const LHError = require('../lib/errors');\nconst jpeg = require('jpeg-js');\nconst NUMBER_OF_THUMBNAILS = 10;\n@@ -23,7 +22,7 @@ class ScreenshotThumbnails extends Audit {\ninformative: true,\ndescription: 'Screenshot Thumbnails',\nhelpText: 'This is what the load of your site looked like.',\n- requiredArtifacts: ['traces'],\n+ requiredArtifacts: ['traces', 'devtoolsLogs'],\n};\n}\n@@ -67,23 +66,35 @@ class ScreenshotThumbnails extends Audit {\n* @param {!Artifacts} artifacts\n* @return {!AuditResult}\n*/\n- static audit(artifacts, context) {\n+ static async audit(artifacts, context) {\nconst trace = artifacts.traces[Audit.DEFAULT_PASS];\nconst cachedThumbnails = new Map();\n- return Promise.all([\n- artifacts.requestSpeedline(trace),\n- TTFI.audit(artifacts, context).catch(() => ({rawValue: 0})),\n- TTCI.audit(artifacts, context).catch(() => ({rawValue: 0})),\n- ]).then(([speedline, ttfi, ttci]) => {\n+ const speedline = await artifacts.requestSpeedline(trace);\n+\n+ let minimumTimelineDuration = 0;\n+ // Ensure thumbnails cover the full range of the trace (TTI can be later than visually complete)\n+ if (context.settings.throttlingMethod !== 'simulate') {\n+ const devtoolsLog = artifacts.devtoolsLogs[Audit.DEFAULT_PASS];\n+ const metricComputationData = {trace, devtoolsLog, settings: context.settings};\n+ const ttci = artifacts.requestConsistentlyInteractive(metricComputationData);\n+ try {\n+ minimumTimelineDuration = (await ttci).timing;\n+ } catch (_) {\n+ minimumTimelineDuration = 0;\n+ }\n+ }\n+\nconst thumbnails = [];\nconst analyzedFrames = speedline.frames.filter(frame => !frame.isProgressInterpolated());\nconst maxFrameTime =\nspeedline.complete ||\nMath.max(...speedline.frames.map(frame => frame.getTimeStamp() - speedline.beginning));\n- // Find thumbnails to cover the full range of the trace (max of last visual change and time\n- // to interactive).\n- const timelineEnd = Math.max(maxFrameTime, ttfi.rawValue, ttci.rawValue);\n+ const timelineEnd = Math.max(maxFrameTime, minimumTimelineDuration);\n+\n+ if (!analyzedFrames.length || !Number.isFinite(timelineEnd)) {\n+ throw new LHError(LHError.errors.INVALID_SPEEDLINE);\n+ }\nfor (let i = 1; i <= NUMBER_OF_THUMBNAILS; i++) {\nconst targetTimestamp = speedline.beginning + timelineEnd * i / NUMBER_OF_THUMBNAILS;\n@@ -122,7 +133,6 @@ class ScreenshotThumbnails extends Audit {\nitems: thumbnails,\n},\n};\n- });\n}\n}\n",
"new_path": "lighthouse-core/audits/screenshot-thumbnails.js",
"old_path": "lighthouse-core/audits/screenshot-thumbnails.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -67,6 +67,7 @@ const ERRORS = {\nNO_SPEEDLINE_FRAMES: {message: strings.didntCollectScreenshots},\nSPEEDINDEX_OF_ZERO: {message: strings.didntCollectScreenshots},\nNO_SCREENSHOTS: {message: strings.didntCollectScreenshots},\n+ INVALID_SPEEDLINE: {message: strings.didntCollectScreenshots},\n// Trace parsing errors\nNO_TRACING_STARTED: {message: strings.badTraceRecording},\n",
"new_path": "lighthouse-core/lib/errors.js",
"old_path": "lighthouse-core/lib/errors.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -11,45 +11,26 @@ const assert = require('assert');\nconst Runner = require('../../runner.js');\nconst ScreenshotThumbnailsAudit = require('../../audits/screenshot-thumbnails');\n-const TTFIAudit = require('../../audits/first-interactive');\n-const TTCIAudit = require('../../audits/consistently-interactive');\nconst pwaTrace = require('../fixtures/traces/progressive-app-m60.json');\n+const pwaDevtoolsLog = require('../fixtures/traces/progressive-app-m60.devtools.log.json');\n/* eslint-env mocha */\ndescribe('Screenshot thumbnails', () => {\nlet computedArtifacts;\n- let ttfiOrig;\n- let ttciOrig;\n- let ttfiReturn;\n- let ttciReturn;\nbefore(() => {\ncomputedArtifacts = Runner.instantiateComputedArtifacts();\n-\n- // Monkey patch TTFI to simulate result\n- ttfiOrig = TTFIAudit.audit;\n- ttciOrig = TTCIAudit.audit;\n- TTFIAudit.audit = () => ttfiReturn || Promise.reject(new Error('oops!'));\n- TTCIAudit.audit = () => ttciReturn || Promise.reject(new Error('oops!'));\n- });\n-\n- after(() => {\n- TTFIAudit.audit = ttfiOrig;\n- TTCIAudit.audit = ttciOrig;\n- });\n-\n- beforeEach(() => {\n- ttfiReturn = null;\n- ttciReturn = null;\n});\nit('should extract thumbnails from a trace', () => {\n+ const settings = {throttlingMethod: 'provided'};\nconst artifacts = Object.assign({\ntraces: {defaultPass: pwaTrace},\n+ devtoolsLogs: {}, // empty devtools logs to test just thumbnails without TTI behavior\n}, computedArtifacts);\n- return ScreenshotThumbnailsAudit.audit(artifacts).then(results => {\n+ return ScreenshotThumbnailsAudit.audit(artifacts, {settings}).then(results => {\nresults.details.items.forEach((result, index) => {\nconst framePath = path.join(__dirname,\n`../fixtures/traces/screenshots/progressive-app-frame-${index}.jpg`);\n@@ -65,34 +46,50 @@ describe('Screenshot thumbnails', () => {\n});\n}).timeout(10000);\n- it('should scale the timeline to TTFI', () => {\n+ it('should scale the timeline to TTCI when observed', () => {\n+ const settings = {throttlingMethod: 'devtools'};\nconst artifacts = Object.assign({\ntraces: {defaultPass: pwaTrace},\n+ devtoolsLogs: {defaultPass: pwaDevtoolsLog},\n}, computedArtifacts);\n- ttfiReturn = Promise.resolve({rawValue: 4000});\n- return ScreenshotThumbnailsAudit.audit(artifacts).then(results => {\n- assert.equal(results.details.items[0].timing, 400);\n- assert.equal(results.details.items[9].timing, 4000);\n- const extrapolatedFrames = new Set(results.details.items.slice(3).map(f => f.data));\n+ return ScreenshotThumbnailsAudit.audit(artifacts, {settings}).then(results => {\n+ assert.equal(results.details.items[0].timing, 158);\n+ assert.equal(results.details.items[9].timing, 1582);\n+\n+ // last 5 frames should be equal to the last real frame\n+ const extrapolatedFrames = new Set(results.details.items.slice(5).map(f => f.data));\nassert.ok(results.details.items[9].data.length > 100, 'did not have last frame');\nassert.ok(extrapolatedFrames.size === 1, 'did not extrapolate last frame');\n});\n});\n- it('should scale the timeline to TTCI', () => {\n+ it('should not scale the timeline to TTCI when simulate', () => {\n+ const settings = {throttlingMethod: 'simulate'};\nconst artifacts = Object.assign({\ntraces: {defaultPass: pwaTrace},\n}, computedArtifacts);\n+ computedArtifacts.requestConsistentlyInteractive = () => ({timing: 20000});\n- ttfiReturn = Promise.resolve({rawValue: 8000});\n- ttciReturn = Promise.resolve({rawValue: 20000});\n- return ScreenshotThumbnailsAudit.audit(artifacts).then(results => {\n- assert.equal(results.details.items[0].timing, 2000);\n- assert.equal(results.details.items[9].timing, 20000);\n- const extrapolatedFrames = new Set(results.details.items.map(f => f.data));\n- assert.ok(results.details.items[9].data.length > 100, 'did not have last frame');\n- assert.ok(extrapolatedFrames.size === 1, 'did not extrapolate last frame');\n+ return ScreenshotThumbnailsAudit.audit(artifacts, {settings}).then(results => {\n+ assert.equal(results.details.items[0].timing, 82);\n+ assert.equal(results.details.items[9].timing, 818);\n});\n});\n+\n+ it('should handle nonsense times', async () => {\n+ const settings = {throttlingMethod: 'simulate'};\n+ const artifacts = {\n+ traces: {},\n+ requestSpeedline: () => ({frames: [], complete: false, beginning: -1}),\n+ requestConsistentlyInteractive: () => ({timing: NaN}),\n+ };\n+\n+ try {\n+ await ScreenshotThumbnailsAudit.audit(artifacts, {settings});\n+ assert.fail('should have thrown');\n+ } catch (err) {\n+ assert.equal(err.message, 'INVALID_SPEEDLINE');\n+ }\n+ });\n});\n",
"new_path": "lighthouse-core/test/audits/screenshot-thumbnails-test.js",
"old_path": "lighthouse-core/test/audits/screenshot-thumbnails-test.js"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(screenshots): align filmstrip to observed metrics (#4965)
| 1
|
core
|
screenshots
|
679,913
|
13.04.2018 16:57:33
| -3,600
|
bfabe8025682f5a392d3951f07d5ae5683638a8a
|
feat(associative): add renameKeysMap
|
[
{
"change_type": "MODIFY",
"diff": "import { IObjectOf } from \"@thi.ng/api/api\";\n+import { empty } from \"./utils\";\n+\n+export function renameKeysMap<T>(src: Map<any, T>, km: IObjectOf<T>): Map<any, T> {\n+ const dest = empty(src, Map);\n+ for (let p of src) {\n+ const k = p[0];\n+ const kk = km[k];\n+ dest.set(kk !== undefined ? kk : k, p[1]);\n+ }\n+ return dest;\n+}\n+\nexport function renameKeysObj(src: any, km: IObjectOf<PropertyKey>) {\nconst dest = {};\nfor (let k in src) {\nconst kk = km[k];\n- dest[kk !== undefined ? kk : k] = src[k];\n+ dest[kk != null ? kk : k] = src[k];\n}\nreturn dest;\n}\n",
"new_path": "packages/associative/src/rename-keys.ts",
"old_path": "packages/associative/src/rename-keys.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(associative): add renameKeysMap
| 1
|
feat
|
associative
|
679,913
|
13.04.2018 17:01:03
| -3,600
|
d798cee39ac0f18becb617b99da26777625b714a
|
refactor(dgraph): regression update due to changes
|
[
{
"change_type": "MODIFY",
"diff": "import { ICopy } from \"@thi.ng/api/api\";\nimport { equiv } from \"@thi.ng/api/equiv\";\nimport { illegalArgs } from \"@thi.ng/api/error\";\n-import { ArrayMap } from \"@thi.ng/associative/array-map\";\n-import { ArraySet } from \"@thi.ng/associative/array-set\";\n+import { EquivMap } from \"@thi.ng/associative/equiv-map\";\n+import { LLSet } from \"@thi.ng/associative/ll-set\";\nimport { union } from \"@thi.ng/associative/union\";\nimport { filter } from \"@thi.ng/iterators/filter\";\nimport { reduce } from \"@thi.ng/iterators/reduce\";\n@@ -11,12 +11,12 @@ export class DGraph<T> implements\nIterable<T>,\nICopy<DGraph<T>> {\n- dependencies: ArrayMap<T, ArraySet<T>>;\n- dependents: ArrayMap<T, ArraySet<T>>;\n+ dependencies: EquivMap<T, LLSet<T>>;\n+ dependents: EquivMap<T, LLSet<T>>;\nconstructor() {\n- this.dependencies = new ArrayMap<T, ArraySet<T>>();\n- this.dependents = new ArrayMap<T, ArraySet<T>>();\n+ this.dependencies = new EquivMap<T, LLSet<T>>();\n+ this.dependents = new EquivMap<T, LLSet<T>>();\n}\n*[Symbol.iterator]() {\n@@ -42,10 +42,10 @@ export class DGraph<T> implements\nif (equiv(node, dep) || this.depends(dep, node)) {\nillegalArgs(`Circular dependency between: ${node} & ${dep}`);\n}\n- let d: ArraySet<T> = this.dependencies.get(node);\n- this.dependencies.set(node, d ? d.add(dep) : new ArraySet<T>([dep]));\n+ let d: LLSet<T> = this.dependencies.get(node);\n+ this.dependencies.set(node, d ? d.add(dep) : new LLSet<T>([dep]));\nd = this.dependents.get(dep);\n- this.dependents.set(dep, d ? d.add(node) : new ArraySet<T>([node]));\n+ this.dependents.set(dep, d ? d.add(node) : new LLSet<T>([node]));\nreturn this;\n}\n@@ -75,11 +75,11 @@ export class DGraph<T> implements\n}\nimmediateDependencies(x: T): Set<T> {\n- return this.dependencies.get(x) || new ArraySet<T>();\n+ return this.dependencies.get(x) || new LLSet<T>();\n}\nimmediateDependents(x: T): Set<T> {\n- return this.dependents.get(x) || new ArraySet<T>();\n+ return this.dependents.get(x) || new LLSet<T>();\n}\nisLeaf(x: T) {\n@@ -92,8 +92,8 @@ export class DGraph<T> implements\nnodes(): Set<T> {\nreturn union(\n- new ArraySet<T>(this.dependencies.keys()),\n- new ArraySet<T>(this.dependents.keys()),\n+ new LLSet<T>(this.dependencies.keys()),\n+ new LLSet<T>(this.dependents.keys()),\n);\n}\n@@ -108,14 +108,14 @@ export class DGraph<T> implements\nsort() {\nconst sorted: T[] = [];\nconst g = this.copy();\n- let queue = new ArraySet(filter((node: T) => g.isLeaf(node), g.nodes()));\n+ let queue = new LLSet(filter((node: T) => g.isLeaf(node), g.nodes()));\nwhile (true) {\nif (!queue.size) {\nreturn sorted.reverse();\n}\nconst node = queue.first();\nqueue.delete(node);\n- for (let d of (<ArraySet<T>>g.immediateDependencies(node)).copy()) {\n+ for (let d of (<LLSet<T>>g.immediateDependencies(node)).copy()) {\ng.removeEdge(node, d);\nif (g.isLeaf(d)) {\nqueue.add(d);\n@@ -127,14 +127,14 @@ export class DGraph<T> implements\n}\n}\n-function transitive<T>(nodes: ArrayMap<T, ArraySet<T>>, x: T): ArraySet<T> {\n- const deps: ArraySet<T> = nodes.get(x);\n+function transitive<T>(nodes: EquivMap<T, LLSet<T>>, x: T): LLSet<T> {\n+ const deps: LLSet<T> = nodes.get(x);\nif (deps) {\nreturn reduce(\n- (acc, k: T) => <ArraySet<T>>union(acc, transitive(nodes, k)),\n+ (acc, k: T) => <LLSet<T>>union(acc, transitive(nodes, k)),\ndeps,\ndeps\n);\n}\n- return new ArraySet<T>();\n+ return new LLSet<T>();\n}\n",
"new_path": "packages/dgraph/src/index.ts",
"old_path": "packages/dgraph/src/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(dgraph): regression update due to @thi.ng/associative changes
| 1
|
refactor
|
dgraph
|
679,913
|
13.04.2018 17:05:24
| -3,600
|
07628f67f2a0df3aa44c059402db28b49ef96d9e
|
build: fix package clean tasks
|
[
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn run clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc\",\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",
"new_path": "packages/associative/package.json",
"old_path": "packages/associative/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn run clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc\",\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",
"new_path": "packages/dgraph/package.json",
"old_path": "packages/dgraph/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn run clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc\",\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 && mocha build/test/*.js\"\n",
"new_path": "packages/diff/package.json",
"old_path": "packages/diff/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn run clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts .nyc_output build doc\",\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",
"new_path": "packages/hdom-components/package.json",
"old_path": "packages/hdom-components/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn run clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc\",\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",
"new_path": "packages/hiccup-svg/package.json",
"old_path": "packages/hiccup-svg/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn run clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts .nyc_output build doc\",\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",
"new_path": "packages/interceptors/package.json",
"old_path": "packages/interceptors/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn run clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts .nyc_output build doc\",\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",
"new_path": "packages/paths/package.json",
"old_path": "packages/paths/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn clean && tsc --declaration && yarn peg\",\n- \"clean\": \"rm -rf *.js *.d.ts .nyc_output build doc\",\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\"peg\": \"pegjs -o parser.js src/grammar.pegjs\",\n",
"new_path": "packages/pointfree-lang/package.json",
"old_path": "packages/pointfree-lang/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn run clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts .nyc_output build doc\",\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",
"new_path": "packages/pointfree/package.json",
"old_path": "packages/pointfree/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn run clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc\",\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 && mocha build/test/*.js\"\n",
"new_path": "packages/resolve-map/package.json",
"old_path": "packages/resolve-map/package.json"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn run clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts build doc\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc\",\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 && mocha build/test/*.js\"\n",
"new_path": "packages/router/package.json",
"old_path": "packages/router/package.json"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build: fix package clean tasks
| 1
|
build
| null |
217,922
|
13.04.2018 18:41:12
| -7,200
|
1921fa6fcf1226759e1189abcbb1d7c2a8c066f1
|
feat: added a link to profile page on missing book warning icon
closes
|
[
{
"change_type": "MODIFY",
"diff": "(click)=\"openRequirementsPopup()\">\n<mat-icon color=\"accent\">assignment</mat-icon>\n</button>\n- <mat-icon *ngIf=\"!hasBook\" matTooltip=\"{{'LIST_DETAILS.No_book' | translate}}\" matTooltipPosition=\"above\"\n+ <button mat-icon-button *ngIf=\"!hasBook\" routerLink=\"/profile\">\n+ <mat-icon matTooltip=\"{{'LIST_DETAILS.No_book' | translate}}\" matTooltipPosition=\"above\"\ncolor=\"warn\">\nwarning\n</mat-icon>\n+ </button>\n<div *ngIf=\"item.workingOnIt && getAmount() > (item.done | ceil)\">\n<div *ngIf=\"worksOnIt as character\" class=\"working-on-it\">\n<img src=\"{{character.avatar}}\" alt=\"\"\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": "\"Missing_tags_before_button\": \"This list is shown as community list but has no tags, please add some tags using \",\n\"Missing_tags_after_button\": \" button\",\n\"Add_remove_amount\": \"Add/remove a given amount\",\n- \"No_book\": \"Missing book\",\n+ \"No_book\": \"Missing book, click to navigate to profile\",\n\"No_note\": \"No note\",\n\"Note_placeholder\": \"Note\",\n\"Tags_popup\": \"Tags\",\n",
"new_path": "src/assets/i18n/en.json",
"old_path": "src/assets/i18n/en.json"
},
{
"change_type": "MODIFY",
"diff": "\"Missing_tags_before_button\":\"Your list is shown as community list but has no tags, please add some tags using \",\n\"Missing_tags_after_button\":\" button\",\n\"Add_remove_amount\": \"Add/remove a given amount\",\n- \"No_book\": \"Missing book\",\n+ \"No_book\": \"Missing book, click to navigate to profile\",\n\"No_note\": \"No note\",\n\"Note_placeholder\": \"Note\",\n\"Tags_popup\": \"Tags\",\n",
"new_path": "src/assets/i18n/ja.json",
"old_path": "src/assets/i18n/ja.json"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
feat: added a link to profile page on missing book warning icon
closes #312
| 1
|
feat
| null |
217,922
|
13.04.2018 19:09:38
| -7,200
|
530fe948c518fa0668c083a4003abdff35f3f637
|
feat: you can now order "Items" panel based on level or localized name in your layout
closes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -10,6 +10,7 @@ import {ListLayout} from './list-layout';\nimport {LayoutOrderService} from './layout-order.service';\nimport {Observable} from 'rxjs/Observable';\nimport {UserService} from '../database/user.service';\n+import {ListRow} from '../../model/list/list-row';\n@Injectable()\nexport class LayoutService {\n@@ -61,6 +62,12 @@ export class LayoutService {\n});\n}\n+ public getRecipes(list: List, index: number): Observable<ListRow[]> {\n+ return this.getLayout(index).map(layout => {\n+ return this.layoutOrder.order(list.recipes, layout.recipeOrderBy, layout.recipeOrder);\n+ });\n+ }\n+\npublic getLayoutRows(index: number): Observable<LayoutRow[]> {\nreturn this.getLayout(index).map(layout => {\nif (layout === undefined) {\n",
"new_path": "src/app/core/layout/layout.service.ts",
"old_path": "src/app/core/layout/layout.service.ts"
},
{
"change_type": "MODIFY",
"diff": "import {LayoutRow} from './layout-row';\nimport {DeserializeAs} from '@kaiu/serializer';\n+import {LayoutRowOrder} from './layout-row-order.enum';\nexport class ListLayout {\n@DeserializeAs([LayoutRow])\npublic rows: LayoutRow[];\n+ public recipeOrderBy = 'NONE';\n+\n+ public recipeOrder: LayoutRowOrder = LayoutRowOrder.ASC;\n+\nconstructor(public name: string, rows: LayoutRow[]) {\nthis.rows = rows;\n}\n",
"new_path": "src/app/core/layout/list-layout.ts",
"old_path": "src/app/core/layout/list-layout.ts"
},
{
"change_type": "MODIFY",
"diff": "</div>\n</mat-expansion-panel>\n- <mat-expansion-panel class=\"panel\"\n- [expanded]=\"listData?.isLarge()&&accordionState !== undefined ? accordionState['Crystals']:true\"\n- (opened)=\"accordionState['Crystals'] = true\"\n- (closed)=\"accordionState['Crystals'] = false\">\n+ <mat-expansion-panel class=\"panel\">\n<mat-expansion-panel-header>\n<mat-panel-title>{{'Crystals'| translate}}</mat-panel-title>\n</mat-expansion-panel-header>\n<app-list-details-panel\n[user]=\"userData\"\n*ngIf=\"displayRow.rows.length > 0 || !displayRow.hideIfEmpty\"\n- [expanded]=\"accordionState[displayRow.title] === true || accordionState[displayRow.title] === undefined\"\n[list]=\"listData\"\n(update)=\"update(listData)\"\n(done)=\"setDone(listData, $event)\"\n[data]=\"displayRow.rows\"\n[title]=\"displayRow.title | translate\"\n- (opened)=\"accordionState[displayRow.title] = true\"\n- (closed)=\"accordionState[displayRow.title] = false\"\n[zoneBreakdown]=\"displayRow.zoneBreakdown\"\n[showTier]=\"displayRow.tiers\"></app-list-details-panel>\n</div>\n<app-list-details-panel\n[user]=\"userData\"\n- [expanded]=\"listData?.isLarge()?accordionState['Items']:true\"\n[list]=\"listData\"\n(update)=\"update(listData)\"\n(done)=\"setDone(listData, $event)\"\n- [data]=\"listData?.recipes\"\n+ [data]=\"recipes | async\"\n[recipe]=\"true\"\n- [title]=\"'Items'| translate\"\n- (opened)=\"accordionState['Items'] = true\"\n- (closed)=\"accordionState['Items'] = false\"></app-list-details-panel>\n+ [title]=\"'Items'| translate\"></app-list-details-panel>\n<mat-divider></mat-divider>\n",
"new_path": "src/app/pages/list/list-details/list-details.component.html",
"old_path": "src/app/pages/list/list-details/list-details.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -38,6 +38,7 @@ import {LayoutRowDisplay} from '../../../core/layout/layout-row-display';\nimport {ListLayoutPopupComponent} from '../list-layout-popup/list-layout-popup.component';\nimport {ComponentWithSubscriptions} from '../../../core/component/component-with-subscriptions';\nimport {ReplaySubject} from 'rxjs/ReplaySubject';\n+import {LayoutOrderService} from '../../../core/layout/layout-order.service';\ndeclare const ga: Function;\n@@ -59,6 +60,8 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\nlistDisplay: Observable<LayoutRowDisplay[]>;\n+ recipes: Observable<ListRow[]>;\n+\nuser: UserInfo;\nuserData: AppUser;\n@@ -105,6 +108,11 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\n.mergeMap(data => {\nreturn this.layoutService.getDisplay(data, this.selectedIndex);\n});\n+ this.recipes = this.listData$\n+ .filter(data => data !== null)\n+ .mergeMap(data => {\n+ return this.layoutService.getRecipes(data, this.selectedIndex);\n+ });\n}\ndisplayTrackByFn(index: number, item: LayoutRowDisplay) {\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"
},
{
"change_type": "MODIFY",
"diff": "<mat-icon>add</mat-icon>\n{{\"LIST_DETAILS.LAYOUT_DIALOG.Add_panel\" | translate}}\n</button>\n+ <div class=\"items-panel mat-elevation-z10\">\n+ <mat-input-container>\n+ <input [disabled]=\"true\" type=\"text\" matInput\n+ placeholder=\"{{'LIST_DETAILS.LAYOUT.Panel_name' | translate}}\"\n+ value=\"{{'Items' | translate}}\">\n+ </mat-input-container>\n+ <div class=\"order\">\n+ <mat-form-field>\n+ <mat-select class=\"order-row\" placeholder=\"{{'LIST_DETAILS.LAYOUT.Order_by' | translate}}\"\n+ required\n+ [(value)]=\"availableLayouts[selectedIndex].recipeOrderBy\">\n+ <mat-option value=\"NONE\">NONE</mat-option>\n+ <mat-option value=\"NAME\">NAME</mat-option>\n+ <mat-option value=\"LEVEL\">LEVEL</mat-option>\n+ </mat-select>\n+ </mat-form-field>\n+ <mat-form-field>\n+ <mat-select class=\"order-row\" placeholder=\"{{'LIST_DETAILS.LAYOUT.Order' | translate}}\"\n+ required\n+ [(value)]=\"availableLayouts[selectedIndex].recipeOrder\">\n+ <mat-option [value]=\"0\">ASC</mat-option>\n+ <mat-option [value]=\"1\">DESC</mat-option>\n+ </mat-select>\n+ </mat-form-field>\n+ </div>\n+ </div>\n</div>\n</div>\n</div>\n",
"new_path": "src/app/pages/list/list-layout-popup/list-layout-popup.component.html",
"old_path": "src/app/pages/list/list-layout-popup/list-layout-popup.component.html"
},
{
"change_type": "MODIFY",
"diff": "}\n}\n}\n+ .items-panel {\n+ padding: 20px 10px;\n+ }\n+ .order {\n+ display: inline-flex;\n+ .order-row {\n+ max-width: 120px;\n+ }\n+ }\n}\n",
"new_path": "src/app/pages/list/list-layout-popup/list-layout-popup.component.scss",
"old_path": "src/app/pages/list/list-layout-popup/list-layout-popup.component.scss"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
feat: you can now order "Items" panel based on level or localized name in your layout
closes #296
| 1
|
feat
| null |
791,834
|
13.04.2018 19:30:08
| 25,200
|
9d1064105903db6b0b1ca711bc5f3f2c86b8b87c
|
tests(smoke): add smoke test code coverage
|
[
{
"change_type": "MODIFY",
"diff": "@@ -37,7 +37,7 @@ script:\n- yarn type-check\n- yarn closure\n- yarn diff:sample-json\n- - yarn smoke\n+ - yarn smoke:silentcoverage\n- yarn test-extension\n# _JAVA_OPTIONS is breaking parsing of compiler output. See #3338.\n- unset _JAVA_OPTIONS\n@@ -49,5 +49,6 @@ before_cache:\n- rm -rf ./node_modules/temp-devtoolsprotocol/\nafter_success:\n- yarn coveralls\n+ - yarn codecov\naddons:\nchrome: stable\n",
"new_path": ".travis.yml",
"old_path": ".travis.yml"
},
{
"change_type": "MODIFY",
"diff": "@@ -22,8 +22,8 @@ const libDetectorSource = fs.readFileSync(\n* Obtains a list of detected JS libraries and their versions.\n* @return {!Array<!{name: string, version: string, npmPkgName: string}>}\n*/\n-/* istanbul ignore next */\n/* eslint-disable camelcase */\n+/* istanbul ignore next */\nfunction detectLibraries() {\nconst libraries = [];\n",
"new_path": "lighthouse-core/gather/gatherers/dobetterweb/js-libraries.js",
"old_path": "lighthouse-core/gather/gatherers/dobetterweb/js-libraries.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -23,6 +23,7 @@ const Gatherer = require('../gatherer');\n/* global document,window,HTMLLinkElement */\n+/* istanbul ignore next */\nfunction installMediaListener() {\nwindow.___linkMediaChanges = [];\nObject.defineProperty(HTMLLinkElement.prototype, 'media', {\n",
"new_path": "lighthouse-core/gather/gatherers/dobetterweb/tags-blocking-first-paint.js",
"old_path": "lighthouse-core/gather/gatherers/dobetterweb/tags-blocking-first-paint.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -9,6 +9,7 @@ const Gatherer = require('../gatherer');\n/* global fetch, URL, location */\n+/* istanbul ignore next */\nfunction getRobotsTxtContent() {\nreturn fetch(new URL('/robots.txt', location.href))\n.then(response => {\n",
"new_path": "lighthouse-core/gather/gatherers/seo/robots-txt.js",
"old_path": "lighthouse-core/gather/gatherers/seo/robots-txt.js"
},
{
"change_type": "MODIFY",
"diff": "* Combinators are not supported.\n* @param {!Array<!Element>}\n*/\n+/* istanbul ignore next */\nfunction getElementsInDocument(selector) {\nconst results = [];\n",
"new_path": "lighthouse-core/lib/dom-helpers.js",
"old_path": "lighthouse-core/lib/dom-helpers.js"
},
{
"change_type": "MODIFY",
"diff": "\"viewer-unit\": \"yarn unit-viewer\",\n\"watch\": \"yarn unit-core --watch\",\n- \"unit:silentcoverage\": \"nyc --silent yarn unit\",\n+ \"unit:silentcoverage\": \"nyc --silent yarn unit && nyc report --reporter text-lcov > unit-coverage.lcov\",\n\"coverage\": \"nyc yarn unit && nyc report --reporter html\",\n- \"coveralls\": \"nyc report --reporter lcovonly && cat ./coverage/lcov.info | coveralls && codecov\",\n+ \"smoke:silentcoverage\": \"nyc --silent yarn smoke && nyc report --reporter text-lcov > smoke-coverage.lcov\",\n+ \"coverage:smoke\": \"nyc yarn smoke && nyc report --reporter html\",\n+ \"coveralls\": \"cat unit-coverage.lcov | coveralls\",\n+ \"codecov\": \"codecov -f unit-coverage.lcov -F unit && codecov -f smoke-coverage.lcov -F smoke\",\n\"closure\": \"cd lighthouse-core && node closure/closure-type-checking.js\",\n\"devtools\": \"bash lighthouse-core/scripts/roll-to-devtools.sh\",\n",
"new_path": "package.json",
"old_path": "package.json"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
tests(smoke): add smoke test code coverage (#4967)
| 1
|
tests
|
smoke
|
724,000
|
13.04.2018 19:45:51
| -3,600
|
5a67f4dc0efd9eb55e72f46b05b81056c3bf59b1
|
chore: add release script to server-test-utils
|
[
{
"change_type": "ADD",
"diff": "+set -e\n+\n+if [[ -z $1 ]]; then\n+ echo \"Enter new version: \"\n+ read VERSION\n+else\n+ VERSION=$1\n+fi\n+\n+read -p \"Releasing $VERSION - are you sure? (y/n) \" -n 1 -r\n+echo\n+if [[ $REPLY =~ ^[Yy]$ ]]; then\n+ echo \"Releasing $VERSION ...\"\n+\n+ npm run test\n+\n+ # build\n+ npm run build\n+\n+ # commit\n+ git add -A\n+ git add -f \\\n+ dist/*.js\n+ git commit -m \"build: server-test-utils $VERSION\"\n+ npm version $VERSION --message \"release: server-test-utils $VERSION\"\n+\n+ # publish\n+ git push\n+ npm publish\n+\n+ # generate release note\n+ VERSION=$VERSION npm run release:note\n+fi\n",
"new_path": "packages/server-test-utils/scripts/release.sh",
"old_path": null
}
] |
JavaScript
|
MIT License
|
vuejs/vue-test-utils
|
chore: add release script to server-test-utils
| 1
|
chore
| null |
724,000
|
13.04.2018 19:46:22
| -3,600
|
95c2c84503a0ee00c82bfc8873b7f766f2c0288e
|
chore: update test-utils release script
|
[
{
"change_type": "MODIFY",
"diff": "@@ -21,8 +21,8 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then\ngit add -A\ngit add -f \\\ndist/*.js\n- git commit -m \"build: $VERSION\"\n- npm version $VERSION --message \"release: $VERSION\"\n+ git commit -m \"build: test-utils $VERSION\"\n+ npm version $VERSION --message \"release: test-utils $VERSION\"\n# publish\ngit push origin refs/tags/v$VERSION\n",
"new_path": "packages/test-utils/scripts/release.sh",
"old_path": "packages/test-utils/scripts/release.sh"
}
] |
JavaScript
|
MIT License
|
vuejs/vue-test-utils
|
chore: update test-utils release script
| 1
|
chore
| null |
217,922
|
13.04.2018 19:47:34
| -7,200
|
f6176550d51b51bf3eba7832016228c642557a6b
|
feat: display filters (hide when used/completed) are now saved to your account
closes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -2,6 +2,7 @@ import {DataModel} from '../../core/database/storage/data-model';\nimport {ListLayout} from '../../core/layout/list-layout';\nimport {DeserializeAs} from '@kaiu/serializer';\nimport {Alarm} from '../../core/time/alarm';\n+import {ListDetailsFilters} from '../other/list-details-filters';\nexport class AppUser extends DataModel {\nname?: string;\n@@ -23,4 +24,6 @@ export class AppUser extends DataModel {\nlayouts?: ListLayout[];\n// Alarms are now stored inside firebase\nalarms: Alarm[];\n+ // Default filters (#289)\n+ listDetailsFilters: ListDetailsFilters = ListDetailsFilters.DEFAULT;\n}\n",
"new_path": "src/app/model/list/app-user.ts",
"old_path": "src/app/model/list/app-user.ts"
},
{
"change_type": "ADD",
"diff": "+export class ListDetailsFilters {\n+\n+ public static DEFAULT: ListDetailsFilters = new ListDetailsFilters(false, false);\n+\n+ constructor(public hideCompleted: boolean, public hideUsed: boolean) {\n+ }\n+}\n",
"new_path": "src/app/model/other/list-details-filters.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -38,7 +38,6 @@ import {LayoutRowDisplay} from '../../../core/layout/layout-row-display';\nimport {ListLayoutPopupComponent} from '../list-layout-popup/list-layout-popup.component';\nimport {ComponentWithSubscriptions} from '../../../core/component/component-with-subscriptions';\nimport {ReplaySubject} from 'rxjs/ReplaySubject';\n-import {LayoutOrderService} from '../../../core/layout/layout-order.service';\ndeclare const ga: Function;\n@@ -239,6 +238,9 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\nthis.subscriptions.push(this.userService.getUserData()\n.subscribe(user => {\nthis.userData = user;\n+ this.hideUsed = user.listDetailsFilters.hideUsed;\n+ this.hideCompleted = user.listDetailsFilters.hideCompleted;\n+ this.triggerFilter();\n}));\nthis.listData$.next(this.listData);\n}\n@@ -355,11 +357,15 @@ export class ListDetailsComponent extends ComponentWithSubscriptions implements\npublic toggleHideCompleted(): void {\nthis.hideCompleted = !this.hideCompleted;\n+ this.userData.listDetailsFilters.hideCompleted = this.hideCompleted;\n+ this.userService.set(this.userData.$key, this.userData).first().subscribe();\nthis.triggerFilter();\n}\npublic toggleHideUsed(): void {\nthis.hideUsed = !this.hideUsed;\n+ this.userData.listDetailsFilters.hideUsed = this.hideUsed;\n+ this.userService.set(this.userData.$key, this.userData).first().subscribe();\nthis.triggerFilter();\n}\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
|
feat: display filters (hide when used/completed) are now saved to your account
closes #289
| 1
|
feat
| null |
724,000
|
13.04.2018 20:09:56
| -3,600
|
6fee278d1f8d900996a1cfd3a11a33d4051e57ea
|
chore: remove release notes from script
|
[
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@vue/server-test-utils\",\n- \"version\": \"1.0.0-beta.12\",\n+ \"version\": \"1.0.0-beta.14\",\n\"description\": \"Utilities for testing Vue components.\",\n\"main\": \"dist/vue-server-test-utils.js\",\n\"types\": \"types/index.d.ts\",\n",
"new_path": "packages/server-test-utils/package.json",
"old_path": "packages/server-test-utils/package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -27,7 +27,4 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then\n# publish\ngit push\nnpm publish\n-\n- # generate release note\n- VERSION=$VERSION npm run release:note\nfi\n",
"new_path": "packages/server-test-utils/scripts/release.sh",
"old_path": "packages/server-test-utils/scripts/release.sh"
},
{
"change_type": "MODIFY",
"diff": "@@ -29,6 +29,4 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then\ngit push\nnpm publish\n- # generate release note\n- VERSION=$VERSION npm run release:note\nfi\n",
"new_path": "packages/test-utils/scripts/release.sh",
"old_path": "packages/test-utils/scripts/release.sh"
}
] |
JavaScript
|
MIT License
|
vuejs/vue-test-utils
|
chore: remove release notes from script
| 1
|
chore
| null |
679,913
|
13.04.2018 22:41:27
| -3,600
|
86883e3c734c5bc1154b0230c6d732c588cce677
|
feat(interceptors): add ensureStateRange() & ensureParamRange() iceps
rename existing ensureXXX() interceptors:
- ensureLessThan => ensureStateLessThan
- ensureGreaterThan => ensureStateGreaterThan
|
[
{
"change_type": "MODIFY",
"diff": "@@ -69,33 +69,77 @@ export function ensurePred(pred: InterceptorPredicate, err?: InterceptorFn): Int\n/**\n* Specialization of `ensurePred()` to ensure a state value is less than\n* given max at the time when the event is being processed. The optional\n- * `path` fnis used to extract or produce the path for the state value to\n- * be validated. If omitted, the event's payload item is interpreted as\n- * the value path.\n+ * `path` fn is used to extract or produce the path for the state value\n+ * to be validated. If omitted, the event's payload item is interpreted\n+ * as the value path.\n*\n- * For example, without a provided `path` function and for an event\n- * of this form: `[\"event-id\", \"foo.bar\"]`, the term `\"foo.bar\"` would be\n+ * For example, without a provided `path` function and for an event of\n+ * this form: `[\"event-id\", \"foo.bar\"]`, the term `\"foo.bar\"` would be\n* interpreted as path.\n*\n- * If the event has this shape: `[\"event-id\", [\"foo.bar\", 23]]`, we must provide\n- * `(e) => e[1][0]` as path function to extract `\"foo.bar\"` from the event.\n+ * If the event has this shape: `[\"event-id\", [\"foo.bar\", 23]]`, we must\n+ * provide `(e) => e[1][0]` as path function to extract `\"foo.bar\"` from\n+ * the event.\n*\n+ * @param max\n* @param path path extractor\n+ * @param err error interceptor\n*/\n-export function ensureLessThan(max: number, path?: (e: Event) => Path, err?: InterceptorFn) {\n+export function ensureStateLessThan(max: number, path?: (e: Event) => Path, err?: InterceptorFn) {\nreturn ensurePred((state, e) => getIn(state, path ? path(e) : e[1]) < max, err);\n}\n/**\n- * Specialization of `ensurePred()` to ensure a state value is greater than\n- * given min. See `ensureLessThan()` for further details.\n+ * Specialization of `ensurePred()` to ensure a state value is greater\n+ * than given min. See `ensureStateLessThan()` for further details.\n*\n+ * @param min\n* @param path path extractor\n+ * @param err error interceptor\n*/\n-export function ensureGreaterThan(min: number, path?: (e: Event) => Path, err?: InterceptorFn) {\n+export function ensureStateGreaterThan(min: number, path?: (e: Event) => Path, err?: InterceptorFn) {\nreturn ensurePred((state, e) => getIn(state, path ? path(e) : e[1]) > min, err);\n}\n+/**\n+ * Specialization of `ensurePred()` to ensure a state value is within\n+ * given `min` / `max` closed interval. See `ensureStateLessThan()` for\n+ * further details.\n+ *\n+ * @param min\n+ * @param max\n+ * @param path path extractor\n+ * @param err error interceptor\n+ */\n+export function ensureStateRange(min: number, max: number, path?: (e: Event) => Path, err?: InterceptorFn) {\n+ return ensurePred((state, e) => {\n+ const x = getIn(state, path ? path(e) : e[1]);\n+ return x >= min && x <= max;\n+ }, err);\n+}\n+\n+/**\n+ * Specialization of `ensurePred()` to ensure an event's payload value\n+ * is within given `min` / `max` closed interval. By default, assumes\n+ * event format like: `[event-id, value]`. However if `value` is given,\n+ * the provided function can be used to extract the value to be\n+ * validated from any event. If the value is outside the given interval,\n+ * triggers `FX_CANCEL` side effect and if `err` is given, the error\n+ * interceptor can return any number of other side effects and so be\n+ * used to dispatch alternative events instead.\n+ *\n+ * @param min\n+ * @param max\n+ * @param value event value extractor\n+ * @param err error interceptor\n+ */\n+export function ensureParamRange(min: number, max: number, value?: (e: Event) => number, err?: InterceptorFn) {\n+ return ensurePred((_, e) => {\n+ const x = value ? value(e) : e[1];\n+ return x >= min && x <= max;\n+ }, err);\n+}\n+\n/**\n* Higher-order interceptor. Returns new interceptor to set state value\n* at provided path. This allows for dedicated events to set state\n",
"new_path": "packages/interceptors/src/interceptors.ts",
"old_path": "packages/interceptors/src/interceptors.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(interceptors): add ensureStateRange() & ensureParamRange() iceps
- rename existing ensureXXX() interceptors:
- ensureLessThan => ensureStateLessThan
- ensureGreaterThan => ensureStateGreaterThan
| 1
|
feat
|
interceptors
|
679,913
|
13.04.2018 22:43:17
| -3,600
|
584223cae2be841abac6a543bc90b7e6f6fed039
|
refactor(examples): rename interceptors in interceptor-basics,
|
[
{
"change_type": "MODIFY",
"diff": "@@ -2,7 +2,7 @@ import { IObjectOf } from \"@thi.ng/api/api\";\nimport { EffectDef, EventDef, IDispatch } from \"@thi.ng/interceptors/api\";\nimport { EV_SET_VALUE, EV_UPDATE_VALUE, FX_DISPATCH_NOW } from \"@thi.ng/interceptors/api\";\nimport { EventBus } from \"@thi.ng/interceptors/event-bus\";\n-import { ensureLessThan, ensureGreaterThan, trace } from \"@thi.ng/interceptors/interceptors\";\n+import { ensureStateLessThan, ensureStateGreaterThan, trace } from \"@thi.ng/interceptors/interceptors\";\nimport { start } from \"@thi.ng/hdom/start\";\nimport { Path } from \"@thi.ng/paths\";\n@@ -26,11 +26,11 @@ const events: IObjectOf<EventDef> = {\n// note how we also inject the predicate interceptors here to ensure\n// counter values will be always be in the range between 0 .. 100\n[EV_INC]: [\n- ensureLessThan(100, null, () => console.warn(\"eek, reached max\")),\n+ ensureStateLessThan(100, null, () => console.warn(\"eek, reached max\")),\n(_, [__, path]) => ({ [FX_DISPATCH_NOW]: [EV_ADD_VALUE, [path, 1]] })\n],\n[EV_DEC]: [\n- ensureGreaterThan(0, null, () => console.warn(\"eek, reached min\")),\n+ ensureStateGreaterThan(0, null, () => console.warn(\"eek, reached min\")),\n(_, [__, path]) => ({ [FX_DISPATCH_NOW]: [EV_ADD_VALUE, [path, -1]] })\n],\n",
"new_path": "examples/interceptor-basics/src/index.ts",
"old_path": "examples/interceptor-basics/src/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(examples): rename interceptors in interceptor-basics,
| 1
|
refactor
|
examples
|
679,913
|
13.04.2018 22:44:19
| -3,600
|
1b21710a7d778b51d56a1381288e399f6d7d2f5b
|
feat(examples): add svg-waveform example
|
[
{
"change_type": "ADD",
"diff": "+# svg-waveform\n+## About\n+\n+TODO\n+\n+## Building\n+### Development\n+\n+```\n+git clone https://github.com/[your-gh-username]/rs-icep\n+yarn install\n+yarn start\n+```\n+\n+Installs all dependencies, runs `webpack-dev-server` and opens the app in your browser.\n+\n+### Production\n+\n+```\n+yarn build\n+```\n+\n+Builds a minified version of the app and places it in `/public` directory.\n+\n+## Authors\n+\n+TODO\n+\n+© 2018\n\\ No newline at end of file\n",
"new_path": "examples/svg-waveform/README.md",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"svg-waveform\",\n+ \"version\": \"0.0.1\",\n+ \"description\": \"TODO\",\n+ \"repository\": \"https://github.com/[your-gh-username]/rs-icep\",\n+ \"author\": \"TODO\",\n+ \"license\": \"MIT\",\n+ \"scripts\": {\n+ \"build\": \"webpack --mode production\",\n+ \"start\": \"webpack-dev-server --open --mode development --devtool inline-source-map\"\n+ },\n+ \"dependencies\": {\n+ \"@thi.ng/atom\": \"latest\",\n+ \"@thi.ng/hdom\": \"latest\",\n+ \"@thi.ng/hiccup-svg\": \"latest\",\n+ \"@thi.ng/interceptors\": \"latest\",\n+ \"@thi.ng/iterators\": \"latest\"\n+ },\n+ \"devDependencies\": {\n+ \"@types/node\": \"^9.6.2\",\n+ \"typescript\": \"^2.8.1\",\n+ \"ts-loader\": \"^4.1.0\",\n+ \"webpack\": \"^4.5.0\",\n+ \"webpack-cli\": \"^2.0.14\",\n+ \"webpack-dev-server\": \"^3.1.1\"\n+ }\n+}\n\\ No newline at end of file\n",
"new_path": "examples/svg-waveform/package.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { IObjectOf } from \"@thi.ng/api/api\";\n+import { ViewTransform, IView } from \"@thi.ng/atom/api\";\n+import { EventDef, EffectDef } from \"@thi.ng/interceptors/api\";\n+import { EventBus } from \"@thi.ng/interceptors/event-bus\";\n+\n+/**\n+ * Function signature for main app components.\n+ */\n+export type AppComponent = (ctx: AppContext, ...args: any[]) => any;\n+\n+/**\n+ * Derived view configurations.\n+ */\n+export type ViewSpec = string | [string, ViewTransform<any>];\n+\n+/**\n+ * Structure of the overall application config object.\n+ * See `src/config.ts`.\n+ */\n+export interface AppConfig {\n+ events: IObjectOf<EventDef>;\n+ effects: IObjectOf<EffectDef>;\n+ domRoot: string | Element;\n+ initialState: any;\n+ rootComponent: AppComponent;\n+ ui: UIAttribs;\n+ views: Partial<Record<keyof AppViews, ViewSpec>>;\n+}\n+\n+/**\n+ * Base structure of derived views exposed by the base app.\n+ * Add more declarations here as needed.\n+ */\n+export interface AppViews extends Record<keyof AppViews, IView<any>> {\n+ amp: IView<number>;\n+ freq: IView<number>;\n+ phase: IView<number>;\n+ harmonics: IView<number>;\n+ hstep: IView<number>;\n+}\n+\n+/**\n+ * Helper interface to pre-declare keys of shared UI attributes for\n+ * components and so enable autocomplete & type safety.\n+ *\n+ * See `AppConfig` above and its use in `src/config.ts` and various\n+ * component functions.\n+ */\n+export interface UIAttribs {\n+ link: any;\n+ slider: { root: any, range: any, number: any };\n+ root: any;\n+ sidebar: any;\n+ wave: any;\n+}\n+\n+/**\n+ * Structure of the context object passed to all component functions\n+ */\n+export interface AppContext {\n+ bus: EventBus;\n+ views: AppViews;\n+ ui: UIAttribs;\n+}\n",
"new_path": "examples/svg-waveform/src/api.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { IObjectOf } from \"@thi.ng/api/api\";\n+import { Atom } from \"@thi.ng/atom/atom\";\n+import { isArray } from \"@thi.ng/checks/is-array\";\n+import { start } from \"@thi.ng/hdom\";\n+import { EventBus } from \"@thi.ng/interceptors/event-bus\";\n+\n+import { AppConfig, AppContext, AppViews, ViewSpec } from \"./api\";\n+\n+/**\n+ * Generic base app skeleton. You can use this as basis for your own\n+ * apps.\n+ *\n+ * As is the app does not much more than:\n+ *\n+ * - initialize state and event bus\n+ * - attach derived views\n+ * - define root component wrapper\n+ * - start hdom render & event bus loop\n+ */\n+export class App {\n+\n+ config: AppConfig;\n+ ctx: AppContext;\n+ state: Atom<any>;\n+\n+ constructor(config: AppConfig) {\n+ this.config = config;\n+ this.state = new Atom(config.initialState || {});\n+ this.ctx = {\n+ bus: new EventBus(this.state, config.events, config.effects),\n+ views: <AppViews>{},\n+ ui: config.ui,\n+ };\n+ this.addViews(this.config.views);\n+ }\n+\n+ /**\n+ * Initializes given derived view specs and attaches them to app\n+ * state atom.\n+ *\n+ * @param specs\n+ */\n+ addViews(specs: IObjectOf<ViewSpec>) {\n+ const views = this.ctx.views;\n+ for (let id in specs) {\n+ const spec = specs[id];\n+ if (isArray(spec)) {\n+ views[id] = this.state.addView(spec[0], spec[1]);\n+ } else {\n+ views[id] = this.state.addView(spec);\n+ }\n+ }\n+ }\n+\n+ /**\n+ * Calls `init()` and kicks off hdom render loop, including batched\n+ * event processing and fast fail check if DOM updates are necessary\n+ * (assumes ALL state is held in the app state atom). So if there\n+ * weren't any events causing a state change since last frame,\n+ * re-rendering is skipped without even attempting to diff DOM\n+ * tree).\n+ */\n+ start() {\n+ this.init();\n+ // assume main root component is a higher order function\n+ // call it here to pre-initialize it\n+ const root = this.config.rootComponent(this.ctx);\n+ let firstFrame = true;\n+ start(\n+ this.config.domRoot,\n+ () => {\n+ if (this.ctx.bus.processQueue() || firstFrame) {\n+ firstFrame = false;\n+ return root();\n+ }\n+ },\n+ this.ctx\n+ );\n+ }\n+\n+ /**\n+ * User initialization hook.\n+ * Automatically called from `start()`\n+ */\n+ init() {\n+ // ...add init tasks here\n+ }\n+}\n",
"new_path": "examples/svg-waveform/src/app.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { Event } from \"@thi.ng/interceptors/api\";\n+\n+import { AppContext } from \"../api\";\n+\n+/**\n+ * Customizable hyperlink component emitting given event on event bus\n+ * when clicked.\n+ *\n+ * @param ctx\n+ * @param event event tuple of `[event-id, payload]`\n+ * @param attribs element attribs\n+ * @param body link body\n+ */\n+export function eventLink(ctx: AppContext, attribs: any, event: Event, body: any) {\n+ return [\"a\",\n+ {\n+ ...attribs,\n+ onclick: (e) => {\n+ e.preventDefault();\n+ ctx.bus.dispatch(event);\n+ }\n+ },\n+ body];\n+}\n",
"new_path": "examples/svg-waveform/src/components/event-link.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { AppContext } from \"../api\";\n+import * as ev from \"../events\";\n+\n+import { sidebar } from \"./sidebar\";\n+import { waveform } from \"./waveform\";\n+\n+export function main(ctx: AppContext) {\n+ const bar = sidebar(ctx,\n+ { event: ev.SET_PHASE, view: \"phase\", label: \"phase\", max: 360 },\n+ { event: ev.SET_FREQ, view: \"freq\", label: \"frequency\", max: 10, step: 0.01 },\n+ { event: ev.SET_AMP, view: \"amp\", label: \"amplitude\", max: 4, step: 0.01 },\n+ { event: ev.SET_HARMONICS, view: \"harmonics\", label: \"harmonics\", min: 1, max: 20 },\n+ { event: ev.SET_HSTEP, view: \"hstep\", label: \"h step\", min: 1, max: 3, step: 0.01 },\n+ );\n+ return () => [\n+ \"div\", ctx.ui.root,\n+ bar,\n+ [waveform, {\n+ phase: ctx.views.phase.deref(),\n+ freq: ctx.views.freq.deref(),\n+ amp: ctx.views.amp.deref(),\n+ harmonics: ctx.views.harmonics.deref(),\n+ hstep: ctx.views.hstep.deref(),\n+ res: 500,\n+ }]\n+ ];\n+}\n",
"new_path": "examples/svg-waveform/src/components/main.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { AppContext } from \"../api\";\n+\n+import { slider, SliderOpts } from \"./slider\";\n+\n+export function sidebar(ctx: AppContext, ...specs: SliderOpts[]) {\n+ const sliders = specs.map((s) => slider(ctx, s));\n+ return () => [\"div\", ctx.ui.sidebar, ...sliders];\n+}\n",
"new_path": "examples/svg-waveform/src/components/sidebar.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { AppContext } from \"../api\";\n+\n+export interface SliderOpts {\n+ event: PropertyKey;\n+ view: PropertyKey;\n+ label: string;\n+ min?: number;\n+ max?: number;\n+ step?: number;\n+}\n+\n+export function slider(ctx: AppContext, opts: SliderOpts) {\n+ const listener = (e) => ctx.bus.dispatch([opts.event, parseFloat(e.target.value)]);\n+ opts = Object.assign({\n+ oninput: listener,\n+ min: 0,\n+ max: 100,\n+ step: 1,\n+ }, opts);\n+ return () => [\"section\", ctx.ui.slider.root,\n+ [\"input\",\n+ {\n+ ...ctx.ui.slider.range,\n+ ...opts,\n+ type: \"range\",\n+ value: ctx.views[opts.view].deref(),\n+ }],\n+ [\"div\", opts.label,\n+ [\"input\", {\n+ ...ctx.ui.slider.number,\n+ ...opts,\n+ type: \"number\",\n+ value: ctx.views[opts.view].deref(),\n+ }]]];\n+}\n",
"new_path": "examples/svg-waveform/src/components/slider.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { svgdoc } from \"@thi.ng/hiccup-svg/doc\";\n+import { polyline } from \"@thi.ng/hiccup-svg/polyline\";\n+import { map } from \"@thi.ng/iterators/map\";\n+import { range } from \"@thi.ng/iterators/range\";\n+import { reduce } from \"@thi.ng/iterators/reduce\";\n+\n+import { AppContext } from \"../api\";\n+\n+const TAU = Math.PI * 2;\n+\n+export interface WaveformOpts {\n+ phase: number;\n+ freq: number;\n+ amp: number;\n+ harmonics: number;\n+ hstep: number;\n+ res: number;\n+ osc: number;\n+}\n+\n+export function waveform(ctx: AppContext, opts: WaveformOpts) {\n+ const phase = opts.phase * Math.PI / 180;\n+ const amp = opts.amp * 50;\n+ const fscale = 1 / opts.res * TAU * opts.freq;\n+ return svgdoc(\n+ { class: \"w-100 h-100\", viewBox: `0 -5 ${opts.res} 10` },\n+ polyline(\n+ [\n+ [0, 0],\n+ ...map(\n+ (x) => [x, osc(x, phase, fscale, amp, opts.harmonics, opts.hstep)],\n+ range(opts.res)\n+ ),\n+ [opts.res, 0]\n+ ],\n+ ctx.ui.wave,\n+ )\n+ );\n+}\n+\n+function osc(x: number, phase: number, fscale: number, amp: number, harmonics: number, hstep: number) {\n+ const f = x * fscale;\n+ return reduce(\n+ (sum, i) => {\n+ const k = (1 + i * hstep);\n+ return sum + Math.sin(phase + f * k) * amp / k;\n+ },\n+ 0,\n+ range(0, harmonics + 1)\n+ );\n+}\n",
"new_path": "examples/svg-waveform/src/components/waveform.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { valueSetter, ensureParamRange } from \"@thi.ng/interceptors/interceptors\"\n+import { AppConfig } from \"./api\";\n+import * as ev from \"./events\";\n+// import * as fx from \"./effects\";\n+\n+import { main } from \"./components/main\";\n+\n+// main App configuration\n+export const CONFIG: AppConfig = {\n+\n+ // event handlers events are queued and batch processed in app's RAF\n+ // render loop event handlers can be single functions, interceptor\n+ // objects with `pre`/`post` keys or arrays of either.\n+\n+ // the event handlers' only task is to transform the event into a\n+ // number of side effects. event handlers should be pure functions\n+ // and only side effect functions execute any \"real\" work.\n+\n+ // Docs here:\n+ // https://github.com/thi-ng/umbrella/blob/master/packages/interceptors/src/event-bus.ts#L14\n+ events: {\n+ [ev.SET_AMP]: [ensureParamRange(0, 4), valueSetter(\"amp\")],\n+ [ev.SET_FREQ]: [ensureParamRange(0, 10), valueSetter(\"freq\")],\n+ [ev.SET_PHASE]: [ensureParamRange(0, 360), valueSetter(\"phase\")],\n+ [ev.SET_HARMONICS]: [ensureParamRange(1, 20), valueSetter(\"harmonics\")],\n+ [ev.SET_HSTEP]: [ensureParamRange(1, 3), valueSetter(\"hstep\")],\n+ },\n+\n+ // custom side effects\n+ effects: {\n+\n+ },\n+\n+ // DOM root element (or ID)\n+ domRoot: \"app\",\n+\n+ // root component function used by the app\n+ rootComponent: main,\n+\n+ // initial app state\n+ initialState: {\n+ amp: 2,\n+ freq: 2,\n+ phase: 0,\n+ harmonics: 20,\n+ hstep: 2,\n+ },\n+\n+ // derived view declarations\n+ // each key specifies the name of the view and each value is\n+ // a state path or `[path, transformer]` tuple\n+ // docs here:\n+ // https://github.com/thi-ng/umbrella/tree/master/packages/atom#derived-views\n+ views: {\n+ amp: \"amp\",\n+ freq: \"freq\",\n+ phase: \"phase\",\n+ harmonics: \"harmonics\",\n+ hstep: \"hstep\",\n+ },\n+\n+ // component CSS class config using http://tachyons.io/\n+ // these attribs are being passed to all/most components\n+ ui: {\n+ slider: {\n+ root: { class: \"f7 ttu mb3\" },\n+ range: { class: \"w-100\" },\n+ number: { class: \"fr w3 tr ttu bn bg-transparent\" },\n+ },\n+ link: { class: \"pointer link blue\" },\n+ root: { class: \"vw-100 vh-100 flex\" },\n+ sidebar: { class: \"bg-light-gray pa2 w5\" },\n+ wave: { stroke: \"#f04\", fill: \"#f04\", \"stroke-linejoin\": \"round\" }\n+ }\n+};\n",
"new_path": "examples/svg-waveform/src/config.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+// best practice tip: define event & effect names as consts or enums\n+// and avoid hardcoded strings for more safety and easier refactoring\n+// also see pre-defined event handlers & interceptors in @thi.ng/atom:\n+// https://github.com/thi-ng/umbrella/blob/master/packages/interceptors/src/api.ts#L14\n+\n+/**\n+ * Effect description\n+ */\n+export const FOO = \"foo\";\n",
"new_path": "examples/svg-waveform/src/effects.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+// best practice tip: define event & effect names as consts or enums\n+// and avoid hardcoded strings for more safety and easier refactoring\n+// also see pre-defined event handlers & interceptors in @thi.ng/atom:\n+// https://github.com/thi-ng/umbrella/blob/master/packages/interceptors/src/api.ts#L14\n+\n+/**\n+ * Event description\n+ */\n+export const SET_AMP = \"set-amp\";\n+export const SET_FREQ = \"set-freq\";\n+export const SET_PHASE = \"set-phase\";\n+export const SET_HARMONICS = \"set-harmonics\";\n+export const SET_HSTEP = \"set-hstep\";\n",
"new_path": "examples/svg-waveform/src/events.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { App } from \"./app\";\n+import { CONFIG } from \"./config\";\n+\n+// export app to global var in dev mode\n+// (for interaction via browser dev tools)\n+if (process.env.NODE_ENV == \"development\") {\n+ (window[\"APP\"] = new App(CONFIG)).start();\n+} else {\n+ new App(CONFIG).start();\n+}\n",
"new_path": "examples/svg-waveform/src/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"compilerOptions\": {\n+ \"module\": \"commonjs\",\n+ \"target\": \"ES6\",\n+ \"outDir\": \"build\",\n+ \"experimentalDecorators\": true,\n+ \"noUnusedParameters\": true,\n+ \"noUnusedLocals\": true,\n+ \"sourceMap\": true,\n+ },\n+ \"include\": [\n+ \"./src/**/*.ts\"\n+ ],\n+ \"exclude\": [\n+ \"./**/node_modules\"\n+ ]\n+}\n\\ No newline at end of file\n",
"new_path": "examples/svg-waveform/tsconfig.json",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(examples): add svg-waveform example
| 1
|
feat
|
examples
|
679,913
|
14.04.2018 00:53:48
| -3,600
|
9e98ce12e2c520d901faae92659341b8635a1be1
|
refactor(examples): update svg-waveform demo
|
[
{
"change_type": "MODIFY",
"diff": "# svg-waveform\n## About\n-TODO\n+Interactive, additive waveform synthesis (no audio) and SVG waveform\n+visualization.\n+\n+[Live demo](http://demo.thi.ng/umbrella/svg-waveform/)\n## Building\n+\n+This example is based on the\n+[create-hdom-app](https://github.com/thi-ng/create-hdom-app) project\n+template.\n+\n### Development\n```\n-git clone https://github.com/[your-gh-username]/rs-icep\n+git clone https://github.com/thi-ng/umbrella/\n+cd umbrella/examples/svg-waveform\nyarn install\nyarn start\n```\n-Installs all dependencies, runs `webpack-dev-server` and opens the app in your browser.\n+Installs all dependencies, runs `webpack-dev-server` and opens the app\n+in your browser.\n### Production\n@@ -20,10 +30,11 @@ Installs all dependencies, runs `webpack-dev-server` and opens the app in your b\nyarn build\n```\n-Builds a minified version of the app and places it in `/public` directory.\n+Builds a minified version of the app and places it in `/public`\n+directory.\n## Authors\n-TODO\n+- Karsten Schmidt\n© 2018\n\\ No newline at end of file\n",
"new_path": "examples/svg-waveform/README.md",
"old_path": "examples/svg-waveform/README.md"
},
{
"change_type": "MODIFY",
"diff": "@@ -51,7 +51,7 @@ export interface UIAttribs {\nslider: { root: any, range: any, number: any };\nroot: any;\nsidebar: any;\n- wave: any;\n+ waveform: any;\n}\n/**\n",
"new_path": "examples/svg-waveform/src/api.ts",
"old_path": "examples/svg-waveform/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "import { AppContext } from \"../api\";\n-import * as ev from \"../events\";\n+import { SLIDERS } from \"../sliders\";\nimport { sidebar } from \"./sidebar\";\nimport { waveform } from \"./waveform\";\nexport function main(ctx: AppContext) {\n- const bar = sidebar(ctx,\n- { event: ev.SET_PHASE, view: \"phase\", label: \"phase\", max: 360 },\n- { event: ev.SET_FREQ, view: \"freq\", label: \"frequency\", max: 10, step: 0.01 },\n- { event: ev.SET_AMP, view: \"amp\", label: \"amplitude\", max: 4, step: 0.01 },\n- { event: ev.SET_HARMONICS, view: \"harmonics\", label: \"harmonics\", min: 1, max: 20 },\n- { event: ev.SET_HSTEP, view: \"hstep\", label: \"h step\", min: 1, max: 3, step: 0.01 },\n- );\n+ const bar = sidebar(ctx, ...SLIDERS);\nreturn () => [\n\"div\", ctx.ui.root,\nbar,\n- [waveform, {\n+ waveform(ctx, {\nphase: ctx.views.phase.deref(),\nfreq: ctx.views.freq.deref(),\namp: ctx.views.amp.deref(),\nharmonics: ctx.views.harmonics.deref(),\nhstep: ctx.views.hstep.deref(),\n- res: 500,\n- }]\n+ res: 1000,\n+ stroke: \"#f04\",\n+ fill1: \"#f04\",\n+ fill2: \"#ff0\"\n+ })\n];\n}\n",
"new_path": "examples/svg-waveform/src/components/main.ts",
"old_path": "examples/svg-waveform/src/components/main.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -4,5 +4,10 @@ import { slider, SliderOpts } from \"./slider\";\nexport function sidebar(ctx: AppContext, ...specs: SliderOpts[]) {\nconst sliders = specs.map((s) => slider(ctx, s));\n- return () => [\"div\", ctx.ui.sidebar, ...sliders];\n+ return [\"div\", ctx.ui.sidebar,\n+ ...sliders,\n+ [\"div.absolute.bottom-1\",\n+ \"Made with \",\n+ [\"a\", { ...ctx.ui.link, href: \"https://github.com/thi-ng/umbrella/tree/master/packages/hdom\" }, \"@thi.ng/hdom\"]]\n+ ];\n}\n",
"new_path": "examples/svg-waveform/src/components/sidebar.ts",
"old_path": "examples/svg-waveform/src/components/sidebar.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -9,15 +9,29 @@ export interface SliderOpts {\nstep?: number;\n}\n+/**\n+ * Higher-order slider component using both an HTML5 range and number\n+ * control connected to the same derived view of an app state value.\n+ * Changes as dispatched via event configured via `opts` object.\n+ *\n+ * Because it's an higher order component, it CANNOT be used in an\n+ * inline manner in the parent component and must be initialized\n+ * separately.\n+ *\n+ * See `main.ts` for usage.\n+ *\n+ * @param ctx\n+ * @param opts\n+ */\nexport function slider(ctx: AppContext, opts: SliderOpts) {\n- const listener = (e) => ctx.bus.dispatch([opts.event, parseFloat(e.target.value)]);\nopts = Object.assign({\n- oninput: listener,\n+ oninput: (e) => ctx.bus.dispatch([opts.event, parseFloat(e.target.value)]),\nmin: 0,\nmax: 100,\nstep: 1,\n}, opts);\n- return () => [\"section\", ctx.ui.slider.root,\n+ return (ctx: AppContext) =>\n+ [\"section\", ctx.ui.slider.root,\n[\"input\",\n{\n...ctx.ui.slider.range,\n",
"new_path": "examples/svg-waveform/src/components/slider.ts",
"old_path": "examples/svg-waveform/src/components/slider.ts"
},
{
"change_type": "MODIFY",
"diff": "import { svgdoc } from \"@thi.ng/hiccup-svg/doc\";\n+import { defs } from \"@thi.ng/hiccup-svg/defs\";\n+import { linearGradient } from \"@thi.ng/hiccup-svg/gradients\";\nimport { polyline } from \"@thi.ng/hiccup-svg/polyline\";\nimport { map } from \"@thi.ng/iterators/map\";\nimport { range } from \"@thi.ng/iterators/range\";\nimport { reduce } from \"@thi.ng/iterators/reduce\";\n-\nimport { AppContext } from \"../api\";\nconst TAU = Math.PI * 2;\n@@ -15,15 +16,28 @@ export interface WaveformOpts {\nharmonics: number;\nhstep: number;\nres: number;\n- osc: number;\n+ fill1: string;\n+ fill2: string;\n+ stroke: string;\n}\n+/**\n+ * Additive synthesis and waveform visualization as SVG\n+ *\n+ * @param opts\n+ */\nexport function waveform(ctx: AppContext, opts: WaveformOpts) {\nconst phase = opts.phase * Math.PI / 180;\nconst amp = opts.amp * 50;\nconst fscale = 1 / opts.res * TAU * opts.freq;\nreturn svgdoc(\n- { class: \"w-100 h-100\", viewBox: `0 -5 ${opts.res} 10` },\n+ { ...ctx.ui.waveform, viewBox: `0 -5 ${opts.res} 10` },\n+ defs(\n+ linearGradient(\n+ \"grad\", 0, 0, 0, 1,\n+ [[0, opts.fill2], [0.5, opts.fill1], [1, opts.fill2]]\n+ )\n+ ),\npolyline(\n[\n[0, 0],\n@@ -33,7 +47,7 @@ export function waveform(ctx: AppContext, opts: WaveformOpts) {\n),\n[opts.res, 0]\n],\n- ctx.ui.wave,\n+ { stroke: opts.stroke, fill: \"url(#grad)\", \"stoke-linejoin\": \"round\" }\n)\n);\n}\n",
"new_path": "examples/svg-waveform/src/components/waveform.ts",
"old_path": "examples/svg-waveform/src/components/waveform.ts"
},
{
"change_type": "MODIFY",
"diff": "import { valueSetter, ensureParamRange } from \"@thi.ng/interceptors/interceptors\"\nimport { AppConfig } from \"./api\";\n-import * as ev from \"./events\";\n+// import * as ev from \"./events\";\n// import * as fx from \"./effects\";\nimport { main } from \"./components/main\";\n+import { SLIDERS } from \"./sliders\";\n+\n// main App configuration\nexport const CONFIG: AppConfig = {\n@@ -18,12 +20,23 @@ export const CONFIG: AppConfig = {\n// Docs here:\n// https://github.com/thi-ng/umbrella/blob/master/packages/interceptors/src/event-bus.ts#L14\n+\nevents: {\n- [ev.SET_AMP]: [ensureParamRange(0, 4), valueSetter(\"amp\")],\n- [ev.SET_FREQ]: [ensureParamRange(0, 10), valueSetter(\"freq\")],\n- [ev.SET_PHASE]: [ensureParamRange(0, 360), valueSetter(\"phase\")],\n- [ev.SET_HARMONICS]: [ensureParamRange(1, 20), valueSetter(\"harmonics\")],\n- [ev.SET_HSTEP]: [ensureParamRange(1, 3), valueSetter(\"hstep\")],\n+ // generate event handlers from imported slider definitions\n+ // the same defs are used in the main root component (main.ts) to generate\n+ // their respective UI components\n+ // each of these handlers is dynamically composed of 2 interceptors:\n+ // the first to validate the event param, the second to update the app state\n+ // the state update will only be executed if validation\n+ // succeeds, else the event is canceled\n+ ...SLIDERS.reduce(\n+ (events, spec) => {\n+ events[spec.event] = [\n+ ensureParamRange(spec.min, spec.max),\n+ valueSetter(spec.view)\n+ ];\n+ return events;\n+ }, {})\n},\n// custom side effects\n@@ -39,11 +52,11 @@ export const CONFIG: AppConfig = {\n// initial app state\ninitialState: {\n- amp: 2,\n- freq: 2,\n- phase: 0,\n+ amp: 2.5,\n+ freq: 3,\nharmonics: 20,\nhstep: 2,\n+ phase: 0,\n},\n// derived view declarations\n@@ -51,6 +64,7 @@ export const CONFIG: AppConfig = {\n// a state path or `[path, transformer]` tuple\n// docs here:\n// https://github.com/thi-ng/umbrella/tree/master/packages/atom#derived-views\n+ // also see `app.ts` for view initialization\nviews: {\namp: \"amp\",\nfreq: \"freq\",\n@@ -59,17 +73,18 @@ export const CONFIG: AppConfig = {\nhstep: \"hstep\",\n},\n- // component CSS class config using http://tachyons.io/\n- // these attribs are being passed to all/most components\n+ // component CSS class config using http://tachyons.io/ these\n+ // attribs are made available to all components and allow for easy\n+ // re-skinning of the whole app\nui: {\nslider: {\n- root: { class: \"f7 ttu mb3\" },\n+ root: { class: \"ttu mb3\" },\nrange: { class: \"w-100\" },\nnumber: { class: \"fr w3 tr ttu bn bg-transparent\" },\n},\n- link: { class: \"pointer link blue\" },\n+ link: { class: \"pointer link dim black b\" },\nroot: { class: \"vw-100 vh-100 flex\" },\n- sidebar: { class: \"bg-light-gray pa2 w5\" },\n- wave: { stroke: \"#f04\", fill: \"#f04\", \"stroke-linejoin\": \"round\" }\n+ sidebar: { class: \"bg-light-gray pa2 pt3 w5 f7\" },\n+ waveform: { class: \"w-100 h-100\" }\n}\n};\n",
"new_path": "examples/svg-waveform/src/config.ts",
"old_path": "examples/svg-waveform/src/config.ts"
},
{
"change_type": "MODIFY",
"diff": "/**\n* Effect description\n*/\n-export const FOO = \"foo\";\n+// export const FOO = \"foo\";\n",
"new_path": "examples/svg-waveform/src/effects.ts",
"old_path": "examples/svg-waveform/src/effects.ts"
},
{
"change_type": "MODIFY",
"diff": "// also see pre-defined event handlers & interceptors in @thi.ng/atom:\n// https://github.com/thi-ng/umbrella/blob/master/packages/interceptors/src/api.ts#L14\n-/**\n- * Event description\n- */\nexport const SET_AMP = \"set-amp\";\nexport const SET_FREQ = \"set-freq\";\nexport const SET_PHASE = \"set-phase\";\n",
"new_path": "examples/svg-waveform/src/events.ts",
"old_path": "examples/svg-waveform/src/events.ts"
},
{
"change_type": "ADD",
"diff": "+import * as ev from \"./events\";\n+\n+/**\n+ * Slider definitions used to generate UI components and their event handlers\n+ */\n+export const SLIDERS = [\n+ { event: ev.SET_PHASE, view: \"phase\", label: \"phase\", min: 0, max: 360 },\n+ { event: ev.SET_FREQ, view: \"freq\", label: \"frequency\", min: 1, max: 10, step: 0.01 },\n+ { event: ev.SET_AMP, view: \"amp\", label: \"amplitude\", min: 0, max: 4, step: 0.01 },\n+ { event: ev.SET_HARMONICS, view: \"harmonics\", label: \"harmonics\", min: 1, max: 20 },\n+ { event: ev.SET_HSTEP, view: \"hstep\", label: \"h step\", min: 1, max: 4, step: 0.01 },\n+];\n",
"new_path": "examples/svg-waveform/src/sliders.ts",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(examples): update svg-waveform demo
| 1
|
refactor
|
examples
|
679,913
|
14.04.2018 00:54:21
| -3,600
|
c6b3025cfdd012ac5561857f81950142f3a5a2d4
|
build: import depgraph script
|
[
{
"change_type": "ADD",
"diff": "+#!/usr/bin/env node\n+const fs = require(\"fs\");\n+const execSync = require('child_process').execSync;\n+const dg = require(\"@thi.ng/dgraph\");\n+const tx = require(\"@thi.ng/transducers\");\n+\n+const baseDir = \"./packages/\";\n+const col = \"#555555\";\n+const ecol = \"#aaaaaa\";\n+\n+const xform = tx.comp(\n+ tx.map((f) => baseDir + f),\n+ tx.filter((f) => f.indexOf(\".DS_Store\") < 0 && fs.statSync(f).isDirectory),\n+ tx.map((f) => fs.readFileSync(f + \"/package.json\")),\n+ tx.map((p) => {\n+ p = JSON.parse(p.toString());\n+ return {\n+ id: p.name,\n+ v: p.version,\n+ deps: p.dependencies ? Object.keys(p.dependencies) : []\n+ };\n+ }));\n+\n+const packages = tx.transduce(xform, tx.push(), fs.readdirSync(baseDir));\n+const formatted = tx.transduce(\n+ tx.map((m) => `\"${m.id}\"[color=\"${col}\",label=\"${m.id}\\\\n${m.v}\"];\\n` +\n+ m.deps.map((d) => `\"${m.id}\" -> \"${d}\"[color=\"${ecol}\"];`).join(\"\\n\")),\n+ tx.str(\"\\n\"),\n+ packages\n+);\n+const leaves = tx.transduce(\n+ tx.comp(tx.filter((p) => !p.deps.length), tx.map((p) => `\"${p.id}\";`)),\n+ tx.str(\" \"),\n+ packages\n+);\n+\n+const dot = `digraph g {\n+ # size=\"16,9\";\n+ # ratio=fill;\n+ rankdir=RL;\n+ node[fontname=Inconsolata,fontsize=9,fontcolor=white,style=filled];\n+ edge[arrowsize=0.66];\n+ ${formatted}\n+ subgraph cluster0 { color=\"white\"; rank=same; ${leaves} }\n+ }`;\n+fs.writeFileSync(\"assets/deps.dot\", dot, \"utf8\");\n+execSync(\"dot -Tpng -o assets/deps.png assets/deps.dot\");\n+\n+const g = new dg.DGraph();\n+tx.run(\n+ tx.mapcat((p) => tx.tuples(tx.repeat(p.id), p.deps)),\n+ ([p, d]) => g.addDependency(p, d),\n+ packages);\n+\n+console.log(\"topo order:\", g.sort().map((x) => x.replace(\"@thi.ng/\", \"\")).join(\" \"));\n+console.log(\"done\");\n\\ No newline at end of file\n",
"new_path": "scripts/depgraph",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build: import depgraph script
| 1
|
build
| null |
679,913
|
14.04.2018 01:01:24
| -3,600
|
7b5104879498146d32b8eaaa3b53a049c9da1fe5
|
build(examples): add html & webpack config
|
[
{
"change_type": "ADD",
"diff": "+<!DOCTYPE html>\n+<html lang=\"en\">\n+\n+<head>\n+ <meta charset=\"UTF-8\">\n+ <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n+ <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n+ <title>svg-waveform</title>\n+ <link href=\"https://unpkg.com/tachyons@4.9.1/css/tachyons.min.css\" rel=\"stylesheet\">\n+</head>\n+\n+<body class=\"ma0 pa0 lh-copy sans-serif\">\n+ <div id=\"app\"></div>\n+ <script type=\"text/javascript\" src=\"bundle.js\"></script>\n+</body>\n+\n+</html>\n\\ No newline at end of file\n",
"new_path": "examples/svg-waveform/public/index.html",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+const path = require(\"path\");\n+\n+module.exports = {\n+ entry: \"./src/index.ts\",\n+ output: {\n+ path: path.resolve(__dirname, \"public\"),\n+ filename: \"bundle.js\"\n+ },\n+ resolve: {\n+ extensions: [\".ts\", \".js\"]\n+ },\n+ module: {\n+ rules: [\n+ { test: /\\.ts$/, use: \"ts-loader\" }\n+ ]\n+ },\n+ devServer: {\n+ contentBase: \"public\"\n+ }\n+};\n",
"new_path": "examples/svg-waveform/webpack.config.js",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build(examples): add html & webpack config
| 1
|
build
|
examples
|
679,913
|
14.04.2018 15:13:26
| -3,600
|
de1ac7bb9aef4476be5ded20017fc788b319fef4
|
feat(rstream-gestures): 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/rstream-gestures/.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/rstream-gestures/LICENSE",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+# @thi.ng/rstream-gestures\n+\n+[](https://www.npmjs.com/package/@thi.ng/rstream-gestures)\n+\n+## About\n+\n+Unified mouse, mouse wheel & single-touch event stream abstraction.\n+Stream emits tuples of:\n+\n+```\n+[type, {pos, click?, delta?, zoom}]\n+```\n+\n+The `click` and `delta` values are only present if `type ==\n+GestureType.DRAG`. Both (and `pos` too) are 2-element arrays of `[x,y]`\n+coordinates.\n+\n+The `zoom` value is always present, but is only updated with wheel\n+events. The value will be constrained to `minZoom` ... `maxZoom`\n+interval (provided via options object).\n+\n+## Installation\n+\n+```\n+yarn add @thi.ng/rstream-gestures\n+```\n+\n+## Usage examples\n+\n+```typescript\n+import * as rsg from \"@thi.ng/rstream-gestures\";\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/rstream-gestures/README.md",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"@thi.ng/rstream-gestures\",\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.0.0\",\n+ \"@types/node\": \"^9.6.1\",\n+ \"mocha\": \"^5.0.5\",\n+ \"nyc\": \"^11.6.0\",\n+ \"typedoc\": \"^0.11.1\",\n+ \"typescript\": \"^2.8.1\"\n+ },\n+ \"dependencies\": {\n+ \"@thi.ng/api\": \"^2.2.0\",\n+ \"@thi.ng/rstream\": \"^1.2.7\",\n+ \"@thi.ng/transducers\": \"^1.8.0\"\n+ },\n+ \"keywords\": [\n+ \"ES6\",\n+ \"events\",\n+ \"interaction\",\n+ \"mouse\",\n+ \"mousewheel\",\n+ \"stream\",\n+ \"touch\",\n+ \"typescript\"\n+ ],\n+ \"publishConfig\": {\n+ \"access\": \"public\"\n+ }\n+}\n\\ No newline at end of file\n",
"new_path": "packages/rstream-gestures/package.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { fromEvent } from \"@thi.ng/rstream/from/event\";\n+import { merge, StreamMerge } from \"@thi.ng/rstream/stream-merge\";\n+import { map } from \"@thi.ng/transducers/xform/map\";\n+\n+export enum GestureType {\n+ START,\n+ MOVE,\n+ DRAG,\n+ END,\n+ ZOOM,\n+}\n+\n+export interface GestureInfo {\n+ pos: number[];\n+ click: number[];\n+ delta: number[];\n+ zoom: number;\n+}\n+\n+export interface GestureEvent {\n+ [0]: GestureType;\n+ [1]: GestureInfo;\n+}\n+\n+export interface GestureStreamOpts {\n+ zoom: number;\n+ minZoom: number;\n+ maxZoom: number;\n+}\n+\n+/**\n+ * Attaches mouse & touch event listeners to given DOM element and\n+ * returns a stream of custom \"gesture\" events in the form of tuples:\n+ *\n+ * ```\n+ * [type, {pos, click?, delta?, zoom}]\n+ * ```\n+ *\n+ * The `click` and `delta` values are only present if `type ==\n+ * GestureType.DRAG`. Both (and `pos` too) are 2-element arrays of\n+ * `[x,y]` coordinates.\n+ *\n+ * The `zoom` value is always present, but is only updated with wheel\n+ * events. The value will be constrained to `minZoom` ... `maxZoom`\n+ * interval (provided via options object).\n+ *\n+ * Note: For touch events `preventDefault()` is called automatically.\n+ * Since Chrome 56 (other browsers too), this means the event target\n+ * element cannot be `document.body` anymore.\n+ *\n+ * See: https://www.chromestatus.com/features/5093566007214080\n+ *\n+ * @param el\n+ * @param opts\n+ */\n+export function gestureStream(el: Element, opts?: GestureStreamOpts): StreamMerge<any, GestureEvent> {\n+ let isDown = false,\n+ clickPos: number[];\n+ opts = Object.assign({\n+ zoom: 1,\n+ minZoom: 0.25,\n+ maxZoom: 4,\n+ }, opts);\n+ let zoom = Math.min(Math.max(opts.zoom, opts.minZoom), opts.maxZoom);\n+ return merge({\n+ src: [\n+ \"mousedown\", \"mousemove\", \"mouseup\",\n+ \"touchstart\", \"touchmove\", \"touchend\", \"touchcancel\",\n+ \"wheel\"\n+ ].map((e) => fromEvent(el, e)),\n+\n+ xform: map((e: MouseEvent | TouchEvent | WheelEvent) => {\n+ let evt, type;\n+ if (e instanceof TouchEvent) {\n+ e.preventDefault();\n+ type = {\n+ \"touchstart\": GestureType.START,\n+ \"touchmove\": GestureType.DRAG,\n+ \"touchend\": GestureType.END,\n+ \"touchcancel\": GestureType.END\n+ }[e.type];\n+ evt = e.changedTouches[0];\n+ } else {\n+ type = {\n+ \"mousedown\": GestureType.START,\n+ \"mousemove\": isDown ? GestureType.DRAG : GestureType.MOVE,\n+ \"mouseup\": GestureType.END,\n+ \"wheel\": GestureType.ZOOM,\n+ }[e.type];\n+ evt = e;\n+ }\n+ const pos = [evt.clientX | 0, evt.clientY | 0];\n+ const body = <GestureInfo>{ pos, zoom };\n+ switch (type) {\n+ case GestureType.START:\n+ isDown = true;\n+ clickPos = pos;\n+ break;\n+ case GestureType.END:\n+ isDown = false;\n+ clickPos = null;\n+ break;\n+ case GestureType.DRAG:\n+ body.click = clickPos;\n+ body.delta = [pos[0] - clickPos[0], pos[1] - clickPos[1]];\n+ break;\n+ case GestureType.ZOOM:\n+ body.zoom = zoom = Math.min(Math.max(zoom + (<WheelEvent>e).deltaY, opts.minZoom), opts.maxZoom);\n+ break;\n+ default:\n+ }\n+ return <GestureEvent>[type, body];\n+ })\n+ });\n+}\n",
"new_path": "packages/rstream-gestures/src/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+// import * as assert from \"assert\";\n+// import * as rstream-gestures from \"../src/index\";\n+\n+describe(\"rstream-gestures\", () => {\n+ it(\"tests pending\");\n+});\n",
"new_path": "packages/rstream-gestures/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/rstream-gestures/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/rstream-gestures/tsconfig.json",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(rstream-gestures): initial import @thi.ng/rstream-gestures
| 1
|
feat
|
rstream-gestures
|
679,913
|
14.04.2018 15:14:01
| -3,600
|
3f8dbc9e024c8fbb1fe8daf717dada6c2f8ad62d
|
refactor(examples): update rs-dataflow demo
|
[
{
"change_type": "MODIFY",
"diff": "@@ -23,6 +23,7 @@ above dataflow graph in a declarative manner:\n- [@thi.ng/paths](https://github.com/thi-ng/umbrella/tree/master/packages/paths) - nested value accessors\n- [@thi.ng/resolve-map](https://github.com/thi-ng/umbrella/tree/master/packages/resolve-map) - DAG-based object resolution\n- [@thi.ng/rstream](https://github.com/thi-ng/umbrella/tree/master/packages/rstream) - reactive stream constructs\n+- [@thi.ng/rstream-gestures](https://github.com/thi-ng/umbrella/tree/master/packages/rstream-gestures) - unified mouse & single-touch event stream\n- [@thi.ng/transducers](https://github.com/thi-ng/umbrella/tree/master/packages/transducers) - data transformations (here used for stream transforms)\nPlease see detailed comments in the source code for further explanations.\n",
"new_path": "examples/rstream-dataflow/README.md",
"old_path": "examples/rstream-dataflow/README.md"
},
{
"change_type": "MODIFY",
"diff": "\"@thi.ng/paths\": \"latest\",\n\"@thi.ng/resolve-map\": \"latest\",\n\"@thi.ng/rstream\": \"latest\",\n+ \"@thi.ng/rstream-gestures\": \"latest\",\n\"@thi.ng/transducers\": \"latest\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "examples/rstream-dataflow/package.json",
"old_path": "examples/rstream-dataflow/package.json"
},
{
"change_type": "DELETE",
"diff": "-import { Event } from \"@thi.ng/interceptors/api\";\n-import { fromEvent } from \"@thi.ng/rstream/from/event\";\n-import { merge } from \"@thi.ng/rstream/stream-merge\";\n-import { map } from \"@thi.ng/transducers/xform/map\";\n-\n-export enum GestureType {\n- START,\n- MOVE,\n- DRAG,\n- END\n-}\n-\n-export interface GestureEvent extends Event {\n- [0]: GestureType;\n- [1]: number[][];\n-}\n-\n-/**\n- * Attaches mouse & touch event listeners to given DOM element and\n- * returns a stream of custom \"gesture\" events in the form of tuples:\n- *\n- * ```\n- * [type, [currpos, clickpos, delta]]\n- * ```\n- *\n- * The `clickpos` and `delta` values are only present if `type ==\n- * GestureType.DRAG`. Both (and `currpos` too) are 2-element arrays of\n- * `[x,y]` coordinates.\n- *\n- * Note: For touch events `preventDefault()` is called automatically.\n- * Since Chrome 56 (other browsers too), this means the event target\n- * element cannot be `document.body` anymore.\n- *\n- * See: https://www.chromestatus.com/features/5093566007214080\n- *\n- * @param el\n- */\n-export function gestureStream(el: Element) {\n- let isDown = false,\n- clickPos: number[];\n- return merge({\n- src: [\n- \"mousedown\", \"mousemove\", \"mouseup\",\n- \"touchstart\", \"touchmove\", \"touchend\", \"touchcancel\"\n- ].map((e) => fromEvent(el, e)),\n-\n- xform: map((e: MouseEvent | TouchEvent) => {\n- let evt, type;\n- if (e instanceof TouchEvent) {\n- e.preventDefault();\n- type = {\n- \"touchstart\": GestureType.START,\n- \"touchmove\": GestureType.DRAG,\n- \"touchend\": GestureType.END,\n- \"touchcancel\": GestureType.END\n- }[e.type];\n- evt = e.changedTouches[0];\n- } else {\n- type = {\n- \"mousedown\": GestureType.START,\n- \"mousemove\": isDown ? GestureType.DRAG : GestureType.MOVE,\n- \"mouseup\": GestureType.END\n- }[e.type];\n- evt = e;\n- }\n- const body = [[evt.clientX | 0, evt.clientY | 0]];\n- switch (type) {\n- case GestureType.START:\n- isDown = true;\n- clickPos = body[0];\n- break;\n- case GestureType.END:\n- isDown = false;\n- clickPos = null;\n- break;\n- case GestureType.DRAG:\n- body.push(clickPos, [body[0][0] - clickPos[0], body[0][1] - clickPos[1]]);\n- default:\n- }\n- return <GestureEvent>[type, body];\n- })\n- });\n-}\n",
"new_path": null,
"old_path": "examples/rstream-dataflow/src/gesture-stream.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -3,12 +3,12 @@ import { Atom } from \"@thi.ng/atom/atom\";\nimport { start } from \"@thi.ng/hdom\";\nimport { getIn } from \"@thi.ng/paths\";\nimport { fromRAF } from \"@thi.ng/rstream/from/raf\";\n+import { gestureStream } from \"@thi.ng/rstream-gestures\";\nimport { comp } from \"@thi.ng/transducers/func/comp\";\nimport { choices } from \"@thi.ng/transducers/iter/choices\";\nimport { dedupe } from \"@thi.ng/transducers/xform/dedupe\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\n-import { gestureStream } from \"./gesture-stream\";\nimport { extract, initGraph, node, node1, mul } from \"./nodes\";\nimport { circle } from \"./circle\";\n@@ -49,7 +49,7 @@ const graph = initGraph(db, {\n// extracts current mouse/touch position from gesture tuple\n// the `[1, 0]` is the lookup path, i.e. `gesture[1][0]`\nmpos: {\n- fn: extract([1, 0]),\n+ fn: extract([1, \"pos\"]),\nins: [{ stream: () => gestures }],\nout: \"mpos\"\n},\n@@ -58,7 +58,7 @@ const graph = initGraph(db, {\n// the `[1, 1]` is the lookup path, i.e. `gesture[1][1]`\n// (only defined during drag gestures)\nclickpos: {\n- fn: extract([1, 1]),\n+ fn: extract([1, \"click\"]),\nins: [{ stream: () => gestures }],\nout: \"clickpos\"\n},\n@@ -69,7 +69,7 @@ const graph = initGraph(db, {\n// `node1` is a helper function for nodes using only a single input\ndist: {\nfn: node1(map((gesture) => {\n- const delta = getIn(gesture, [1, 2]);\n+ const delta = getIn(gesture, [1, \"delta\"]);\nreturn delta && Math.hypot.apply(null, delta) | 0;\n})),\nins: [{ stream: () => gestures }],\n",
"new_path": "examples/rstream-dataflow/src/index.ts",
"old_path": "examples/rstream-dataflow/src/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(examples): update rs-dataflow demo
| 1
|
refactor
|
examples
|
217,922
|
14.04.2018 17:54:43
| -7,200
|
03cf2e440b2200abdd41aa76e9ce6909b6d83857
|
revert: add proper tag settings in some main pages
This reverts commit
|
[
{
"change_type": "MODIFY",
"diff": "@@ -13,7 +13,6 @@ import {Title} from '@angular/platform-browser';\nimport {TranslateService} from '@ngx-translate/core';\nimport {LocalizedDataService} from '../../../core/data/localized-data.service';\nimport {ObservableMedia} from '@angular/flex-layout';\n-import {SeoService} from '../../../core/seo/seo.service';\n@Component({\nselector: 'app-list',\n@@ -31,7 +30,7 @@ export class ListComponent extends PageComponent implements OnInit, OnDestroy {\nconstructor(protected dialog: MatDialog, help: HelpService, private route: ActivatedRoute,\nprivate listService: ListService, private title: Title, private translate: TranslateService,\n- private data: LocalizedDataService, protected media: ObservableMedia, private seo: SeoService) {\n+ private data: LocalizedDataService, protected media: ObservableMedia) {\nsuper(dialog, help, media);\n}\n@@ -62,13 +61,6 @@ export class ListComponent extends PageComponent implements OnInit, OnDestroy {\nthis.notFound = true;\nreturn Observable.of(null);\n});\n- }).do(list => {\n- this.seo.setConfig({\n- title: 'FFXIV Teamcraft',\n- description: list.name,\n- image: '/assets/branding/logo.png',\n- slug: '/list/' + list.$key\n- })\n});\n}\n",
"new_path": "src/app/pages/list/list/list.component.ts",
"old_path": "src/app/pages/list/list/list.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -9,9 +9,6 @@ import 'rxjs/add/operator/mergeMap';\nimport 'rxjs/add/operator/combineLatest';\nimport {UserService} from '../../../core/database/user.service';\nimport 'rxjs/add/observable/empty';\n-import {SeoService} from '../../../core/seo/seo.service';\n-import 'rxjs/add/observable/zip';\n-import {SeoConfig} from '../../../core/seo/seo-config';\n@Component({\nselector: 'app-workshop',\n@@ -29,7 +26,7 @@ export class WorkshopComponent implements OnInit {\nfavorite: Observable<boolean>;\nconstructor(private route: ActivatedRoute, private workshopService: WorkshopService, private listService: ListService,\n- private userService: UserService, private seo: SeoService) {\n+ private userService: UserService) {\n}\ntoggleFavorite(workshop: Workshop): void {\n@@ -67,14 +64,6 @@ export class WorkshopComponent implements OnInit {\n).map(lists => lists.filter(l => l !== null));\nthis.author = this.workshop.mergeMap(workshop => this.userService.getCharacter(workshop.authorId))\n.catch(() => Observable.of(null));\n- Observable.zip(this.author, this.workshop, (author, ws) => {\n- return <SeoConfig>{\n- title: ws.name,\n- description: 'Created by ' + author.name,\n- image: 'assets/branding/logo.png',\n- slug: 'workshop/' + ws.$key,\n- };\n- }).subscribe(this.seo.setConfig);\n}\ntrackByListsFn(index: number, item: List) {\n",
"new_path": "src/app/pages/workshop/workshop/workshop.component.ts",
"old_path": "src/app/pages/workshop/workshop/workshop.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
revert: add proper tag settings in some main pages
This reverts commit dfb709106ed92cad903f759bd03bfe9f6114c260.
| 1
|
revert
| null |
217,922
|
14.04.2018 17:55:13
| -7,200
|
ff3ddca87b7d01a1bdd24eea871bf377019db1c9
|
revert: better seo configuration
This reverts commit
|
[
{
"change_type": "MODIFY",
"diff": "\"rewrites\": [\n{\n\"source\": \"**\",\n- \"function\": \"app\"\n+ \"destination\": \"/index.html\"\n}\n],\n\"headers\": [{\n",
"new_path": "firebase.json",
"old_path": "firebase.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -3,100 +3,26 @@ require('firebase/firestore');\nconst functions = require('firebase-functions');\nconst admin = require('firebase-admin');\nadmin.initializeApp(functions.config().firebase);\n-const express = require('express');\n-const fetch = require('node-fetch');\n-const url = require('url');\n-const app = express();\n-const appUrl = 'beta.ffxivteamcraft.com';\n-const renderUrl = 'https://render-tron.appspot.com/render';\n-\n-function generateUrl(request) {\n- return url.format({\n- protocol: request.protocol,\n- host: appUrl,\n- pathname: request.originalUrl\n- });\n-}\n-\n-\n-function isBot(bots, userAgent) {\n- const agent = userAgent.toLowerCase();\n- for (const bot of bots) {\n- if (agent.indexOf(bot) > -1) {\n- return true;\n- }\n- }\n- return false;\n-}\n-\n-\n-function detectLinkBot(userAgent) {\n- const bots = [\n- 'twitterbot',\n- 'facebookexternalhit',\n- 'linkedinbot',\n- 'embedly',\n- 'baiduspider',\n- 'pinterest',\n- 'slackbot',\n- 'discord',\n- 'vkShare',\n- 'facebot',\n- 'outbrain',\n- 'W3C_Validator'\n- ];\n- return isBot(bots, userAgent);\n-}\n-\n-function detectSEBot(userAgent) {\n- const bots = [\n- 'googlebot',\n- 'bingbot',\n- 'yandexbot',\n- 'duckduckbot',\n- 'slurp'\n- ];\n- return isBot(bots, userAgent);\n-}\n-\n-app.get('*', (req, res) => {\n-\n- const isLinkBot = detectLinkBot(req.headers['user-agent']);\n- const isSEBot = detectSEBot(req.headers['user-agent']);\n- // If it's a bot, use rendertron\n- if (isLinkBot) {\n- const botUrl = generateUrl(req);\n- fetch(`${renderUrl}/${botUrl}`)\n- .then(res => res.text())\n- .then(body => {\n- res.set('Cache-Control', 'public, max-age=300, s-maxage=600');\n- res.set('Vary', 'User-Agent');\n-\n- res.send(body.toString());\n- });\n- } else if (isSEBot && req.originalUrl.indexOf('/list/') === -1) {\n- const botUrl = generateUrl(req);\n- fetch(`${renderUrl}/${botUrl}`)\n- .then(res => res.text())\n- .then(body => {\n- res.set('Cache-Control', 'public, max-age=300, s-maxage=600');\n- res.set('Vary', 'User-Agent');\n-\n- res.send(body.toString());\n- });\n- } else {\n- fetch(`https://${appUrl}`)\n- .then(res => res.text())\n- .then(body => {\n- res.send(body);\n- });\n- }\n-\n-});\n-\n-//Rendertron SSR for bots\n-exports.app = functions.https.onRequest(app);\n+//Firebase counts\n+// exports.countlistsCreate = functions.database.ref('/lists/{uid}').onCreate(() => {\n+// const ref = admin.database().ref('/list_count');\n+// const creationsRef = admin.database().ref('/lists_created');\n+// // Increment the number of lists created using the tool.\n+// creationsRef.transaction(current => {\n+// return current + 1;\n+// }).then(() => null);\n+// return ref.transaction(current => {\n+// return current + 1;\n+// }).then(() => null);\n+// });\n+//\n+// exports.countlistsDelete = functions.database.ref('/lists/{uid}').onDelete(() => {\n+// const ref = admin.database().ref('/list_count');\n+// return ref.transaction(current => {\n+// return current - 1;\n+// }).then(() => null);\n+// });\n// Firestore counts\nexports.firestoreCountlistsCreate = functions.firestore.document('/lists/{uid}').onCreate(() => {\n",
"new_path": "functions/index.js",
"old_path": "functions/index.js"
},
{
"change_type": "MODIFY",
"diff": "}\n},\n\"accepts\": {\n- \"version\": \"1.3.5\",\n- \"resolved\": \"https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz\",\n- \"integrity\": \"sha1-63d99gEXI6OxTopywIBcjoZ0a9I=\",\n+ \"version\": \"1.3.4\",\n+ \"resolved\": \"https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz\",\n+ \"integrity\": \"sha1-hiRnWMfdbSGmR0/whKR0DsBesh8=\",\n\"requires\": {\n- \"mime-types\": \"2.1.18\",\n+ \"mime-types\": \"2.1.17\",\n\"negotiator\": \"0.6.1\"\n- },\n- \"dependencies\": {\n- \"mime-db\": {\n- \"version\": \"1.33.0\",\n- \"resolved\": \"https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz\",\n- \"integrity\": \"sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==\"\n- },\n- \"mime-types\": {\n- \"version\": \"2.1.18\",\n- \"resolved\": \"https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz\",\n- \"integrity\": \"sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==\",\n- \"requires\": {\n- \"mime-db\": \"1.33.0\"\n- }\n- }\n}\n},\n\"acorn\": {\n\"content-type\": \"1.0.4\",\n\"debug\": \"2.6.9\",\n\"depd\": \"1.1.2\",\n- \"http-errors\": \"1.6.3\",\n+ \"http-errors\": \"1.6.2\",\n\"iconv-lite\": \"0.4.19\",\n\"on-finished\": \"2.3.0\",\n\"qs\": \"6.5.1\",\n\"raw-body\": \"2.3.2\",\n- \"type-is\": \"1.6.16\"\n+ \"type-is\": \"1.6.15\"\n}\n},\n\"boom\": {\n\"integrity\": \"sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=\"\n},\n\"express\": {\n- \"version\": \"4.16.3\",\n- \"resolved\": \"https://registry.npmjs.org/express/-/express-4.16.3.tgz\",\n- \"integrity\": \"sha1-avilAjUNsyRuzEvs9rWjTSL37VM=\",\n+ \"version\": \"4.16.2\",\n+ \"resolved\": \"https://registry.npmjs.org/express/-/express-4.16.2.tgz\",\n+ \"integrity\": \"sha1-41xt/i1kt9ygpc1PIXgb4ymeB2w=\",\n\"requires\": {\n- \"accepts\": \"1.3.5\",\n+ \"accepts\": \"1.3.4\",\n\"array-flatten\": \"1.1.1\",\n\"body-parser\": \"1.18.2\",\n\"content-disposition\": \"0.5.2\",\n\"encodeurl\": \"1.0.2\",\n\"escape-html\": \"1.0.3\",\n\"etag\": \"1.8.1\",\n- \"finalhandler\": \"1.1.1\",\n+ \"finalhandler\": \"1.1.0\",\n\"fresh\": \"0.5.2\",\n\"merge-descriptors\": \"1.0.1\",\n\"methods\": \"1.1.2\",\n\"on-finished\": \"2.3.0\",\n\"parseurl\": \"1.3.2\",\n\"path-to-regexp\": \"0.1.7\",\n- \"proxy-addr\": \"2.0.3\",\n+ \"proxy-addr\": \"2.0.2\",\n\"qs\": \"6.5.1\",\n\"range-parser\": \"1.2.0\",\n\"safe-buffer\": \"5.1.1\",\n- \"send\": \"0.16.2\",\n- \"serve-static\": \"1.13.2\",\n+ \"send\": \"0.16.1\",\n+ \"serve-static\": \"1.13.1\",\n\"setprototypeof\": \"1.1.0\",\n- \"statuses\": \"1.4.0\",\n- \"type-is\": \"1.6.16\",\n+ \"statuses\": \"1.3.1\",\n+ \"type-is\": \"1.6.15\",\n\"utils-merge\": \"1.0.1\",\n\"vary\": \"1.1.2\"\n}\n}\n},\n\"finalhandler\": {\n- \"version\": \"1.1.1\",\n- \"resolved\": \"https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz\",\n- \"integrity\": \"sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==\",\n+ \"version\": \"1.1.0\",\n+ \"resolved\": \"https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz\",\n+ \"integrity\": \"sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=\",\n\"requires\": {\n\"debug\": \"2.6.9\",\n\"encodeurl\": \"1.0.2\",\n\"escape-html\": \"1.0.3\",\n\"on-finished\": \"2.3.0\",\n\"parseurl\": \"1.3.2\",\n- \"statuses\": \"1.4.0\",\n+ \"statuses\": \"1.3.1\",\n\"unpipe\": \"1.0.0\"\n}\n},\n\"@types/jsonwebtoken\": \"7.2.5\",\n\"@types/lodash\": \"4.14.101\",\n\"@types/sha1\": \"1.1.1\",\n- \"express\": \"4.16.3\",\n+ \"express\": \"4.16.2\",\n\"jsonwebtoken\": \"7.4.3\",\n\"lodash\": \"4.17.5\",\n\"sha1\": \"1.1.1\"\n\"integrity\": \"sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=\"\n},\n\"http-errors\": {\n- \"version\": \"1.6.3\",\n- \"resolved\": \"https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz\",\n- \"integrity\": \"sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=\",\n+ \"version\": \"1.6.2\",\n+ \"resolved\": \"https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz\",\n+ \"integrity\": \"sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=\",\n\"requires\": {\n- \"depd\": \"1.1.2\",\n+ \"depd\": \"1.1.1\",\n\"inherits\": \"2.0.3\",\n- \"setprototypeof\": \"1.1.0\",\n- \"statuses\": \"1.4.0\"\n+ \"setprototypeof\": \"1.0.3\",\n+ \"statuses\": \"1.3.1\"\n+ },\n+ \"dependencies\": {\n+ \"depd\": {\n+ \"version\": \"1.1.1\",\n+ \"resolved\": \"https://registry.npmjs.org/depd/-/depd-1.1.1.tgz\",\n+ \"integrity\": \"sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=\"\n+ },\n+ \"setprototypeof\": {\n+ \"version\": \"1.0.3\",\n+ \"resolved\": \"https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz\",\n+ \"integrity\": \"sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=\"\n+ }\n}\n},\n\"http-parser-js\": {\n\"integrity\": \"sha1-EEqOSqym09jNFXqO+L+rLXo//bY=\"\n},\n\"ipaddr.js\": {\n- \"version\": \"1.6.0\",\n- \"resolved\": \"https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.6.0.tgz\",\n- \"integrity\": \"sha1-4/o1e3c9phnybpXwSdBVxyeW+Gs=\"\n+ \"version\": \"1.5.2\",\n+ \"resolved\": \"https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.5.2.tgz\",\n+ \"integrity\": \"sha1-1LUFvemUaYfM8PxY2QEP+WB+P6A=\"\n},\n\"is\": {\n\"version\": \"3.2.1\",\n\"resolved\": \"https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz\",\n\"integrity\": \"sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=\"\n},\n- \"node-fetch\": {\n- \"version\": \"2.1.2\",\n- \"resolved\": \"https://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz\",\n- \"integrity\": \"sha1-q4hOjn5X44qUR1POxwb3iNF2i7U=\"\n- },\n\"node-forge\": {\n\"version\": \"0.7.1\",\n\"resolved\": \"https://registry.npmjs.org/node-forge/-/node-forge-0.7.1.tgz\",\n}\n},\n\"proxy-addr\": {\n- \"version\": \"2.0.3\",\n- \"resolved\": \"https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.3.tgz\",\n- \"integrity\": \"sha512-jQTChiCJteusULxjBp8+jftSQE5Obdl3k4cnmLA6WXtK6XFuWRnvVL7aCiBqaLPM8c4ph0S4tKna8XvmIwEnXQ==\",\n+ \"version\": \"2.0.2\",\n+ \"resolved\": \"https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.2.tgz\",\n+ \"integrity\": \"sha1-ZXFQT0e7mI7IGAJT+F3X4UlSvew=\",\n\"requires\": {\n\"forwarded\": \"0.1.2\",\n- \"ipaddr.js\": \"1.6.0\"\n+ \"ipaddr.js\": \"1.5.2\"\n}\n},\n\"pump\": {\n\"http-errors\": \"1.6.2\",\n\"iconv-lite\": \"0.4.19\",\n\"unpipe\": \"1.0.0\"\n- },\n- \"dependencies\": {\n- \"depd\": {\n- \"version\": \"1.1.1\",\n- \"resolved\": \"https://registry.npmjs.org/depd/-/depd-1.1.1.tgz\",\n- \"integrity\": \"sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=\"\n- },\n- \"http-errors\": {\n- \"version\": \"1.6.2\",\n- \"resolved\": \"https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz\",\n- \"integrity\": \"sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=\",\n- \"requires\": {\n- \"depd\": \"1.1.1\",\n- \"inherits\": \"2.0.3\",\n- \"setprototypeof\": \"1.0.3\",\n- \"statuses\": \"1.4.0\"\n- }\n- },\n- \"setprototypeof\": {\n- \"version\": \"1.0.3\",\n- \"resolved\": \"https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz\",\n- \"integrity\": \"sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=\"\n- }\n}\n},\n\"readable-stream\": {\n\"integrity\": \"sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==\"\n},\n\"send\": {\n- \"version\": \"0.16.2\",\n- \"resolved\": \"https://registry.npmjs.org/send/-/send-0.16.2.tgz\",\n- \"integrity\": \"sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==\",\n+ \"version\": \"0.16.1\",\n+ \"resolved\": \"https://registry.npmjs.org/send/-/send-0.16.1.tgz\",\n+ \"integrity\": \"sha512-ElCLJdJIKPk6ux/Hocwhk7NFHpI3pVm/IZOYWqUmoxcgeyM+MpxHHKhb8QmlJDX1pU6WrgaHBkVNm73Sv7uc2A==\",\n\"requires\": {\n\"debug\": \"2.6.9\",\n\"depd\": \"1.1.2\",\n\"escape-html\": \"1.0.3\",\n\"etag\": \"1.8.1\",\n\"fresh\": \"0.5.2\",\n- \"http-errors\": \"1.6.3\",\n+ \"http-errors\": \"1.6.2\",\n\"mime\": \"1.4.1\",\n\"ms\": \"2.0.0\",\n\"on-finished\": \"2.3.0\",\n\"range-parser\": \"1.2.0\",\n- \"statuses\": \"1.4.0\"\n+ \"statuses\": \"1.3.1\"\n}\n},\n\"serve-static\": {\n- \"version\": \"1.13.2\",\n- \"resolved\": \"https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz\",\n- \"integrity\": \"sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==\",\n+ \"version\": \"1.13.1\",\n+ \"resolved\": \"https://registry.npmjs.org/serve-static/-/serve-static-1.13.1.tgz\",\n+ \"integrity\": \"sha512-hSMUZrsPa/I09VYFJwa627JJkNs0NrfL1Uzuup+GqHfToR2KcsXFymXSV90hoyw3M+msjFuQly+YzIH/q0MGlQ==\",\n\"requires\": {\n\"encodeurl\": \"1.0.2\",\n\"escape-html\": \"1.0.3\",\n\"parseurl\": \"1.3.2\",\n- \"send\": \"0.16.2\"\n+ \"send\": \"0.16.1\"\n}\n},\n\"setprototypeof\": {\n}\n},\n\"statuses\": {\n- \"version\": \"1.4.0\",\n- \"resolved\": \"https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz\",\n- \"integrity\": \"sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==\"\n+ \"version\": \"1.3.1\",\n+ \"resolved\": \"https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz\",\n+ \"integrity\": \"sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=\"\n},\n\"stream-combiner\": {\n\"version\": \"0.0.4\",\n\"optional\": true\n},\n\"type-is\": {\n- \"version\": \"1.6.16\",\n- \"resolved\": \"https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz\",\n- \"integrity\": \"sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==\",\n+ \"version\": \"1.6.15\",\n+ \"resolved\": \"https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz\",\n+ \"integrity\": \"sha1-yrEPtJCeRByChC6v4a1kbIGARBA=\",\n\"requires\": {\n\"media-typer\": \"0.3.0\",\n- \"mime-types\": \"2.1.18\"\n- },\n- \"dependencies\": {\n- \"mime-db\": {\n- \"version\": \"1.33.0\",\n- \"resolved\": \"https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz\",\n- \"integrity\": \"sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==\"\n- },\n- \"mime-types\": {\n- \"version\": \"2.1.18\",\n- \"resolved\": \"https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz\",\n- \"integrity\": \"sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==\",\n- \"requires\": {\n- \"mime-db\": \"1.33.0\"\n- }\n- }\n+ \"mime-types\": \"2.1.17\"\n}\n},\n\"type-name\": {\n",
"new_path": "functions/package-lock.json",
"old_path": "functions/package-lock.json"
},
{
"change_type": "MODIFY",
"diff": "\"description\": \"Firebase cloud function to count the amount of list created\",\n\"private\": true,\n\"dependencies\": {\n- \"express\": \"^4.16.3\",\n\"firebase\": \"4.6.2\",\n\"firebase-admin\": \"^5.4.2\",\n\"firebase-functions\": \"^0.8.1\",\n\"grpc\": \"1.9.0\",\n- \"node-fetch\": \"^2.1.2\",\n\"protobufjs\": \"^6.8.4\"\n}\n}\n",
"new_path": "functions/package.json",
"old_path": "functions/package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -37,7 +37,6 @@ import {VenturesExtractor} from './list/data/extractor/ventures-extractor';\nimport {CustomLinksService} from './database/custom-links/custom-links.service';\nimport {PatreonGuard} from './guard/patreon.guard';\nimport {MathToolsService} from './tools/math-tools';\n-import {SeoService} from './seo/seo.service';\nconst dataExtractorProviders: Provider[] = [\n@@ -85,7 +84,6 @@ const dataExtractorProviders: Provider[] = [\nCustomLinksService,\nPatreonGuard,\nMathToolsService,\n- SeoService,\n],\ndeclarations: [\nI18nPipe,\n",
"new_path": "src/app/core/core.module.ts",
"old_path": "src/app/core/core.module.ts"
},
{
"change_type": "DELETE",
"diff": "-export interface SeoConfig {\n- title: string;\n- description: string;\n- image: string;\n- slug?: string;\n-}\n",
"new_path": null,
"old_path": "src/app/core/seo/seo-config.ts"
},
{
"change_type": "DELETE",
"diff": "-import {Injectable} from '@angular/core';\n-import {Meta} from '@angular/platform-browser';\n-import {SeoConfig} from './seo-config';\n-\n-@Injectable()\n-export class SeoService {\n-\n- constructor(private meta: Meta) {\n- }\n-\n- public setConfig(config: SeoConfig): void {\n- this.meta.updateTag({name: 'twitter:card', content: 'FFXIV Teamcraft'});\n- this.meta.updateTag({name: 'twitter:site', content: '@FlavienNormand'});\n- this.meta.updateTag({name: 'twitter:title', content: config.title});\n- this.meta.updateTag({name: 'twitter:description', content: config.description});\n- this.meta.updateTag({name: 'twitter:image', content: config.image});\n-\n- this.meta.updateTag({property: 'og:type', content: 'article'});\n- this.meta.updateTag({property: 'og:site_name', content: 'AngularFirebase'});\n- this.meta.updateTag({property: 'og:title', content: config.title});\n- this.meta.updateTag({property: 'og:description', content: config.description});\n- this.meta.updateTag({property: 'og:image', content: config.image});\n- if (config.slug !== undefined) {\n- this.meta.updateTag({property: 'og:url', content: `https://instafire-app.firebaseapp.com/${config.slug}`});\n- }\n- }\n-}\n",
"new_path": null,
"old_path": "src/app/core/seo/seo.service.ts"
},
{
"change_type": "MODIFY",
"diff": "import {Component} from '@angular/core';\nimport {AngularFireDatabase} from 'angularfire2/database';\nimport {ObservableMedia} from '@angular/flex-layout';\n-import {SeoService} from '../../../core/seo/seo.service';\n@Component({\nselector: 'app-home',\n@@ -14,13 +13,7 @@ export class HomeComponent {\nlists_created = this.firebase.object('lists_created').valueChanges();\n- constructor(private firebase: AngularFireDatabase, private media: ObservableMedia, private seo: SeoService) {\n- this.seo.setConfig({\n- title: 'FFXIV Teamcraft - Home',\n- description: 'Create lists, share, contribute, craft',\n- image: '/assets/branding/logo.png',\n- slug: 'home'\n- });\n+ constructor(private firebase: AngularFireDatabase, private media: ObservableMedia) {\n}\nisMobile(): boolean {\n",
"new_path": "src/app/pages/home/home/home.component.ts",
"old_path": "src/app/pages/home/home/home.component.ts"
},
{
"change_type": "DELETE",
"diff": "Binary files a/src/assets/branding/logo.png and /dev/null differ\n",
"new_path": "src/assets/branding/logo.png",
"old_path": "src/assets/branding/logo.png"
},
{
"change_type": "MODIFY",
"diff": "<title>Teamcraft</title>\n<base href=\"/\">\n- <!-- twitter -->\n- <meta name=\"twitter:card\" content=\"summary\">\n- <meta name=\"twitter:site\" content=\"@FlavienNormand\">\n- <meta name=\"twitter:title\" content=\"FFXIV Teamcraft\">\n- <meta name=\"twitter:description\" content=\"Final Fantasy XIV collaborative crafting made easy.\">\n- <meta name=\"twitter:image\" content=\"https://beta.ffxivteamcraft.com/assets/branding/logo.png\">\n-\n- <!-- facebook and other social sites -->\n- <meta property=\"og:type\" content=\"article\">\n- <meta property=\"og:site_name\" content=\"FFXIV Teamcraft\">\n- <meta property=\"og:title\" content=\"Home Page\">\n- <meta property=\"og:description\" content=\"Final Fantasy XIV collaborative crafting made easy.\">\n- <meta property=\"og:image\" content=\"https://beta.ffxivteamcraft.com/assets/branding/logo.png\">\n- <meta property=\"og:url\" content=\"https://beta.ffxivteamcraft.com\">\n+ <meta name=\"description\" content=\"Final Fantasy XIV collaborative crafting made easy.\" />\n<meta name=\"viewport\" content=\"width=device-width,user-scalable=no\">\n<link rel=\"icon\" type=\"image/x-icon\" href=\"favicon.ico\">\n",
"new_path": "src/index.html",
"old_path": "src/index.html"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
revert: better seo configuration
This reverts commit d288a847fc26ae8677a83db1a87911bb5d5e5af2.
| 1
|
revert
| null |
679,913
|
14.04.2018 18:04:49
| -3,600
|
183af61402619e7ab14311d517cbda2c57a53fa8
|
feat(interceptors): update processQueue(), expose full ctx to handlers
update InterceptorFn / InterceptorPredicate to pass ctx as opt last arg
|
[
{
"change_type": "MODIFY",
"diff": "import { ReadonlyAtom } from \"@thi.ng/atom/api\";\n-export type InterceptorFn = (state: any, e: Event, bus?: IDispatch) => InterceptorContext | void;\n-export type InterceptorPredicate = (state: any, e: Event, bus?: IDispatch) => boolean;\n+export type InterceptorFn = (state: any, e: Event, bus?: IDispatch, ctx?: InterceptorContext) => InterceptorContext | void;\n+export type InterceptorPredicate = (state: any, e: Event, bus?: IDispatch, ctx?: InterceptorContext) => boolean;\nexport type SideEffect = (x: any, bus?: IDispatch) => any;\nexport type EventDef = Interceptor | InterceptorFn | (Interceptor | InterceptorFn)[];\n",
"new_path": "packages/interceptors/src/api.ts",
"old_path": "packages/interceptors/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -350,12 +350,12 @@ export class StatelessEventBus implements\n* invocations of the same effect type per frame. If no side effects\n* are requested, an interceptor can return `undefined`.\n*\n- * Processing of the current event stops immediatedly, if an\n+ * Processing of the current event stops immediately, if an\n* interceptor sets the `FX_CANCEL` side effect key to `true`.\n* However, the results of any previous interceptors (incl. the one\n* which cancelled) are kept and processed further as usual.\n*\n- * @param fx\n+ * @param ctx\n* @param e\n*/\nprotected processEvent(ctx: api.InterceptorContext, e: api.Event) {\n@@ -369,7 +369,7 @@ export class StatelessEventBus implements\nfor (let i = 0; i <= n && !ctx[FX_CANCEL]; i++) {\nconst icep = iceps[i];\nif (icep.pre) {\n- this.mergeEffects(ctx, icep.pre(ctx[FX_STATE], e, this));\n+ this.mergeEffects(ctx, icep.pre(ctx[FX_STATE], e, this, ctx));\n}\nhasPost = hasPost || !!icep.post;\n}\n@@ -379,7 +379,7 @@ export class StatelessEventBus implements\nfor (let i = n; i >= 0 && !ctx[FX_CANCEL]; i--) {\nconst icep = iceps[i];\nif (icep.post) {\n- this.mergeEffects(ctx, icep.post(ctx[FX_STATE], e, this));\n+ this.mergeEffects(ctx, icep.post(ctx[FX_STATE], e, this, ctx));\n}\n}\n}\n@@ -388,7 +388,7 @@ export class StatelessEventBus implements\n* Takes a collection of side effects generated during event\n* processing and applies them in order of configured priorities.\n*\n- * @param fx\n+ * @param ctx\n*/\nprotected processEffects(ctx: api.InterceptorContext) {\nconst effects = this.effects;\n@@ -573,13 +573,18 @@ export class EventBus extends StatelessEventBus implements\n* If an event handler triggers the `FX_DISPATCH_NOW` side effect,\n* the new event will be added to the currently processed batch and\n* therefore executed in the same frame. Also see `dispatchNow()`.\n+ *\n+ * If the optional `ctx` arg is provided it will be merged into the\n+ * `InterceptorContext` object passed to each interceptor. Since the\n+ * merged object is also used to collect triggered side effects,\n+ * care must be taken that there're no key name clashes.\n*/\n- processQueue() {\n+ processQueue(ctx?: api.InterceptorContext) {\nif (this.eventQueue.length > 0) {\nconst prev = this.state.deref();\nthis.currQueue = [...this.eventQueue];\nthis.eventQueue.length = 0;\n- const ctx = this.currCtx = { [FX_STATE]: prev };\n+ ctx = this.currCtx = { ...ctx, [FX_STATE]: prev };\nfor (let e of this.currQueue) {\nthis.processEvent(ctx, e);\n}\n",
"new_path": "packages/interceptors/src/event-bus.ts",
"old_path": "packages/interceptors/src/event-bus.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(interceptors): update processQueue(), expose full ctx to handlers
- update InterceptorFn / InterceptorPredicate to pass ctx as opt last arg
| 1
|
feat
|
interceptors
|
679,913
|
14.04.2018 19:06:38
| -3,600
|
ba0c876d0a226135799a25b23a11b7c89cc8bdfa
|
refactor(interceptors): also pass ctx to sidefx handlers
|
[
{
"change_type": "MODIFY",
"diff": "@@ -3,7 +3,7 @@ import { ReadonlyAtom } from \"@thi.ng/atom/api\";\nexport type InterceptorFn = (state: any, e: Event, bus?: IDispatch, ctx?: InterceptorContext) => InterceptorContext | void;\nexport type InterceptorPredicate = (state: any, e: Event, bus?: IDispatch, ctx?: InterceptorContext) => boolean;\n-export type SideEffect = (x: any, bus?: IDispatch) => any;\n+export type SideEffect = (x: any, bus?: IDispatch, ctx?: InterceptorContext) => any;\nexport type EventDef = Interceptor | InterceptorFn | (Interceptor | InterceptorFn)[];\nexport type EffectDef = SideEffect | [SideEffect, number];\nexport type AsyncEffectDef = [string, any, string, string];\n",
"new_path": "packages/interceptors/src/api.ts",
"old_path": "packages/interceptors/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -399,10 +399,10 @@ export class StatelessEventBus implements\nconst fn = effects[id];\nif (id !== FX_STATE) {\nfor (let v of val) {\n- fn(v, this);\n+ fn(v, this, ctx);\n}\n} else {\n- fn(val, this);\n+ fn(val, this, ctx);\n}\n}\n}\n",
"new_path": "packages/interceptors/src/event-bus.ts",
"old_path": "packages/interceptors/src/event-bus.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(interceptors): also pass ctx to sidefx handlers
| 1
|
refactor
|
interceptors
|
679,913
|
15.04.2018 00:37:09
| -3,600
|
a102eb7c947e8f73b0dc63a452d7624775f9b2c9
|
feat(interceptors): add default FX_UNDO/REDO side fx
|
[
{
"change_type": "MODIFY",
"diff": "@@ -27,17 +27,17 @@ export const FX_STATE = \"--state\";\n/**\n* Currently unused\n*/\n-export const FX_REDO_RESTORE = \"--redo-restore\";\n+export const FX_REDO = \"--redo\";\n/**\n* Currently unused\n*/\n-export const FX_UNDO_STORE = \"--undo-store\";\n+export const FX_UNDO = \"--undo\";\n/**\n* Currently unused\n*/\n-export const FX_UNDO_RESTORE = \"--undo-restore\";\n+export const FX_UNDO_STORE = \"--undo-store\";\nexport interface Event extends Array<any> {\n[0]: PropertyKey;\n@@ -61,5 +61,8 @@ export interface InterceptorContext {\n[FX_DISPATCH]?: Event | Event[];\n[FX_DISPATCH_NOW]?: Event | Event[];\n[FX_DISPATCH_ASYNC]?: AsyncEffectDef | AsyncEffectDef[];\n+ [FX_UNDO_STORE]?: string | string[];\n+ [FX_UNDO]?: string | string[];\n+ [FX_REDO]?: string | string[];\n[id: string]: any;\n}\n",
"new_path": "packages/interceptors/src/api.ts",
"old_path": "packages/interceptors/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -551,6 +551,22 @@ export class EventBus extends StatelessEventBus implements\n* Resets state atom to provided value (only a single update per\n* processing frame)\n*\n+ * #### `FX_UNDO`\n+ *\n+ * Calls `ctx[fxarg].undo()` where `fxarg` is the value assigned to\n+ * the `FX_UNDO` side effect by an event handler, e.g.\n+ *\n+ * ```\n+ * // example event handler\n+ * // assumes that `ctx.history` is a @thi.ng/atom/History instance or similar\n+ * (state, e, bus, ctx) => ({ [FX_UNDO]: \"history\" })\n+ * ```\n+ *\n+ * #### `FX_REDO`\n+ *\n+ * Similar to `FX_UNDO`, but calls `ctx[fxarg].redo()` where `fxarg`\n+ * is the value assigned to the `FX_REDO` side effect by an event\n+ * handler.\n*/\naddBuiltIns(): any {\nsuper.addBuiltIns();\n@@ -563,7 +579,11 @@ export class EventBus extends StatelessEventBus implements\n({ [FX_STATE]: updateIn(state, path, fn, ...args) }));\n// effects\n- this.addEffect(FX_STATE, (x) => this.state.reset(x), -1000);\n+ this.addEffects({\n+ [FX_STATE]: [(x) => this.state.reset(x), -1000],\n+ [api.FX_UNDO]: [(x, _, ctx) => ctx[x].undo(), -1000],\n+ [api.FX_REDO]: [(x, _, ctx) => ctx[x].redo(), -1000],\n+ });\n}\n/**\n",
"new_path": "packages/interceptors/src/event-bus.ts",
"old_path": "packages/interceptors/src/event-bus.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(interceptors): add default FX_UNDO/REDO side fx
| 1
|
feat
|
interceptors
|
724,000
|
15.04.2018 05:30:31
| -3,600
|
27bcee702e71e5214fb26bc326dab664cef01d66
|
docs: add optional options to trigger page
|
[
{
"change_type": "MODIFY",
"diff": "-# `trigger(eventName)`\n+# `trigger(eventType [, options ])`\nTriggers an event on every `Wrapper` in the `WrapperArray` DOM node.\n**Note every `Wrapper` must contain a Vue instance.**\n- **Arguments:**\n- - `{string} eventName`\n+ - `{string} eventType` **required**\n+ - `{Object} options` **optional**\n- **Example:**\n",
"new_path": "docs/en/api/wrapper-array/trigger.md",
"old_path": "docs/en/api/wrapper-array/trigger.md"
},
{
"change_type": "MODIFY",
"diff": "-# `trigger(eventName)`\n+# `trigger(eventType [, options ])`\nTriggers an event on the `Wrapper` DOM node.\n`trigger` takes an optional `options` object. The properties in the `options` object are added to the Event.\n- **Arguments:**\n- - `{string} eventName`\n- - `{Object} options`\n+ - `{string} eventType` **required**\n+ - `{Object} options` **optional**\n- **Example:**\n",
"new_path": "docs/en/api/wrapper/trigger.md",
"old_path": "docs/en/api/wrapper/trigger.md"
}
] |
JavaScript
|
MIT License
|
vuejs/vue-test-utils
|
docs: add optional options to trigger page
| 1
|
docs
| null |
217,922
|
15.04.2018 12:35:43
| -7,200
|
a2a0018c553f2697c0b3f1f018b42c75fc57baeb
|
chore(permissions): Lists without right access considered as not found
|
[
{
"change_type": "MODIFY",
"diff": "@@ -207,7 +207,9 @@ export class ListDetailsPanelComponent implements OnChanges, OnInit {\n}\nngOnChanges(changes: SimpleChanges): void {\n+ if (this.user !== undefined) {\nthis.permissions = this.list.getPermissions(this.user.$key);\n+ }\nif (this.showTier) {\nthis.generateTiers();\n}\n@@ -217,7 +219,9 @@ export class ListDetailsPanelComponent implements OnChanges, OnInit {\n}\nngOnInit(): void {\n+ if (this.user !== undefined) {\nthis.permissions = this.list.getPermissions(this.user.$key);\n+ }\nif (this.showTier) {\nthis.generateTiers();\n}\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": "{{'Public_list' | translate}}\n</mat-checkbox>\n</div>\n- <h4 class=\"not-found\" *ngIf=\"notFound\">{{\"List_not_found\" | translate}}</h4>\n<ng-template #loading>\n<div class=\"loader-container\" *ngIf=\"!notFound\">\n<mat-spinner></mat-spinner>\n",
"new_path": "src/app/pages/list/list-details/list-details.component.html",
"old_path": "src/app/pages/list/list-details/list-details.component.html"
},
{
"change_type": "MODIFY",
"diff": "}\n}\n}\n-\n-.not-found {\n- margin-top: 50px;\n- text-align: center;\n- font-size: 40px;\n- opacity: 0.6;\n-}\n",
"new_path": "src/app/pages/list/list-details/list-details.component.scss",
"old_path": "src/app/pages/list/list-details/list-details.component.scss"
},
{
"change_type": "MODIFY",
"diff": "-<app-list-details [listData]=\"list | async\" (reload)=\"reload$.next(null)\" [notFound]=\"notFound\"></app-list-details>\n+<div *ngIf=\"list | async as listData\">\n+ <app-list-details [listData]=\"listData\" (reload)=\"reload$.next(null)\" *ngIf=\"!notFound\"></app-list-details>\n+ <h4 class=\"not-found\" *ngIf=\"notFound\">{{\"List_not_found\" | translate}}</h4>\n+</div>\n",
"new_path": "src/app/pages/list/list/list.component.html",
"old_path": "src/app/pages/list/list/list.component.html"
},
{
"change_type": "MODIFY",
"diff": "+.not-found {\n+ margin-top: 50px;\n+ text-align: center;\n+ font-size: 40px;\n+ opacity: 0.6;\n+}\n",
"new_path": "src/app/pages/list/list/list.component.scss",
"old_path": "src/app/pages/list/list/list.component.scss"
},
{
"change_type": "MODIFY",
"diff": "@@ -13,6 +13,7 @@ import {Title} from '@angular/platform-browser';\nimport {TranslateService} from '@ngx-translate/core';\nimport {LocalizedDataService} from '../../../core/data/localized-data.service';\nimport {ObservableMedia} from '@angular/flex-layout';\n+import {UserService} from '../../../core/database/user.service';\n@Component({\nselector: 'app-list',\n@@ -30,7 +31,7 @@ export class ListComponent extends PageComponent implements OnInit, OnDestroy {\nconstructor(protected dialog: MatDialog, help: HelpService, private route: ActivatedRoute,\nprivate listService: ListService, private title: Title, private translate: TranslateService,\n- private data: LocalizedDataService, protected media: ObservableMedia) {\n+ private data: LocalizedDataService, protected media: ObservableMedia, private userService: UserService) {\nsuper(dialog, help, media);\n}\n@@ -42,11 +43,15 @@ export class ListComponent extends PageComponent implements OnInit, OnDestroy {\nngOnInit() {\nsuper.ngOnInit();\nthis.list = this.route.params.switchMap(params => {\n+ return this.userService.getUserData().mergeMap(user => {\nreturn this.reload$\n.mergeMap(() => this.listService.get(params.listId))\n+ .do(list => {\n+ this.notFound = !list.getPermissions(user.$key).read;\n+ })\n.filter(list => list !== null)\n.do((l: List) => {\n- if (l.name !== undefined) {\n+ if (!this.notFound && l.name !== undefined) {\nthis.title.setTitle(`${l.name}`);\n} else {\nthis.title.setTitle(this.translate.instant('List_not_found'));\n@@ -62,6 +67,7 @@ export class ListComponent extends PageComponent implements OnInit, OnDestroy {\nreturn Observable.of(null);\n});\n});\n+ });\n}\n",
"new_path": "src/app/pages/list/list/list.component.ts",
"old_path": "src/app/pages/list/list/list.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore(permissions): Lists without right access considered as not found
#277
| 1
|
chore
|
permissions
|
217,922
|
15.04.2018 13:17:48
| -7,200
|
9b01248412293104cbb0758448dde88cf1cb90e3
|
chore(permissions): fixed an issue with deleted user reference inside permissions
|
[
{
"change_type": "MODIFY",
"diff": "@@ -93,9 +93,10 @@ export class ListPanelComponent extends ComponentWithSubscriptions implements On\n}\npublic openPermissions(list: List): void {\n- this.dialog.open(PermissionsPopupComponent, {data: list}).afterClosed().filter(res => res !== '')\n+ this.dialog.open(PermissionsPopupComponent, {data: list})\n+ .afterClosed()\n+ .filter(res => res !== '')\n.mergeMap(res => this.listService.set(res.$key, res))\n- .first()\n.subscribe();\n}\n",
"new_path": "src/app/modules/common-components/list-panel/list-panel.component.ts",
"old_path": "src/app/modules/common-components/list-panel/list-panel.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -44,9 +44,11 @@ export class PermissionsPopupComponent {\n.map(character => {\nreturn {userId: userId, character: character, permissions: data.getPermissions(userId)};\n})\n+ .catch(() => Observable.of(null))\n);\n});\n- return Observable.combineLatest(observables);\n+ return Observable.combineLatest(observables)\n+ .map(results => results.filter(res => res !== null));\n});\n}\n",
"new_path": "src/app/modules/common-components/permissions-popup/permissions-popup.component.ts",
"old_path": "src/app/modules/common-components/permissions-popup/permissions-popup.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -252,7 +252,7 @@ export class ListsComponent extends ComponentWithSubscriptions implements OnInit\nngOnInit() {\nthis.sharedLists = this.userService.getUserData().mergeMap(user => {\nreturn Observable.combineLatest(user.sharedLists.map(listId => this.listService.get(listId)));\n- })\n+ });\nthis.workshops = this.auth.authState.mergeMap(user => {\nif (user === null) {\nreturn this.reloader$.mergeMap(() => Observable.of([]));\n",
"new_path": "src/app/pages/lists/lists/lists.component.ts",
"old_path": "src/app/pages/lists/lists/lists.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore(permissions): fixed an issue with deleted user reference inside permissions
#277
| 1
|
chore
|
permissions
|
679,913
|
15.04.2018 13:19:55
| -3,600
|
3c92f7e60e8782658beebf6ba7059fe3505c91a3
|
feat(interceptors): add undo/redo handlers/fx & snapshot() interceptor
|
[
{
"change_type": "MODIFY",
"diff": "@@ -25,19 +25,32 @@ export const FX_FETCH = \"--fetch\";\nexport const FX_STATE = \"--state\";\n/**\n- * Currently unused\n+ * Event ID to trigger redo action.\n+ * See `EventBus.addBuiltIns()` for further details.\n+ * Also see `snapshot()` interceptor docs.\n*/\n-export const FX_REDO = \"--redo\";\n+export const EV_REDO = \"--redo\";\n/**\n- * Currently unused\n+ * Event ID to trigger undo action.\n+ * See `EventBus.addBuiltIns()` for further details.\n+ * Also see `snapshot()` interceptor docs.\n*/\n-export const FX_UNDO = \"--undo\";\n+export const EV_UNDO = \"--undo\";\n/**\n- * Currently unused\n+ * Side effect ID to execute redo action.\n+ * See `EventBus.addBuiltIns()` for further details.\n+ * Also see `snapshot()` interceptor docs.\n*/\n-export const FX_UNDO_STORE = \"--undo-store\";\n+export const FX_REDO = EV_REDO;\n+\n+/**\n+ * Side effect ID to execute undo action.\n+ * See `EventBus.addBuiltIns()` for further details.\n+ * Also see `snapshot()` interceptor docs.\n+ */\n+export const FX_UNDO = EV_UNDO;\nexport interface Event extends Array<any> {\n[0]: PropertyKey;\n@@ -61,7 +74,6 @@ export interface InterceptorContext {\n[FX_DISPATCH]?: Event | Event[];\n[FX_DISPATCH_NOW]?: Event | Event[];\n[FX_DISPATCH_ASYNC]?: AsyncEffectDef | AsyncEffectDef[];\n- [FX_UNDO_STORE]?: string | string[];\n[FX_UNDO]?: string | string[];\n[FX_REDO]?: string | string[];\n[id: string]: any;\n",
"new_path": "packages/interceptors/src/api.ts",
"old_path": "packages/interceptors/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -19,7 +19,7 @@ const FX_STATE = api.FX_STATE;\n*\n* Events processed by this class are simple 2-element tuples/arrays of\n* this form: `[\"event-id\", payload?]`, where the `payload` is optional\n- * and can be any data.\n+ * and can be of any type.\n*\n* Events are processed by registered handlers which transform each\n* event into a number of side effect descriptions to be executed later.\n@@ -83,7 +83,8 @@ export class StatelessEventBus implements\n* definitions (all optional).\n*\n* In addition to the user provided handlers & effects, a number of\n- * built-ins are added automatically. See `addBuiltIns()`.\n+ * built-ins are added automatically. See `addBuiltIns()`. User\n+ * handlers can override built-ins.\n*\n* @param handlers\n* @param effects\n@@ -500,7 +501,8 @@ export class EventBus extends StatelessEventBus implements\n* automatically creates an `Atom` with empty state object.\n*\n* In addition to the user provided handlers & effects, a number of\n- * built-ins are added automatically. See `addBuiltIns()`.\n+ * built-ins are added automatically. See `addBuiltIns()`. User\n+ * handlers can override built-ins.\n*\n* @param state\n* @param handlers\n@@ -521,7 +523,7 @@ export class EventBus extends StatelessEventBus implements\n/**\n* Adds same built-in event & side effect handlers as in\n- * `StatelessEventBus.addBuiltIns()` with the following additions:\n+ * `StatelessEventBus.addBuiltIns()` and the following additions:\n*\n* ### Handlers\n*\n@@ -544,6 +546,16 @@ export class EventBus extends StatelessEventBus implements\n* [EV_UPDATE_VALUE, [\"path.to.value\", (x, y) => x + y, 1]]\n* ```\n*\n+ * #### `EV_UNDO`\n+ *\n+ * Triggers `FX_UNDO` side effect with context key `\"history\"`. See\n+ * side effect description below.\n+ *\n+ * #### `EV_REDO`\n+ *\n+ * Triggers `FX_REDO` side effect with context key `\"history\"`. See\n+ * side effect description below.\n+ *\n* ### Side effects\n*\n* #### `FX_STATE`\n@@ -571,18 +583,20 @@ export class EventBus extends StatelessEventBus implements\naddBuiltIns(): any {\nsuper.addBuiltIns();\n// handlers\n- this.addHandler(api.EV_SET_VALUE,\n- (state, [_, [path, val]]) =>\n- ({ [FX_STATE]: setIn(state, path, val) }));\n- this.addHandler(api.EV_UPDATE_VALUE,\n- (state, [_, [path, fn, ...args]]) =>\n- ({ [FX_STATE]: updateIn(state, path, fn, ...args) }));\n+ this.addHandlers({\n+ [api.EV_SET_VALUE]: (state, [_, [path, val]]) =>\n+ ({ [FX_STATE]: setIn(state, path, val) }),\n+ [api.EV_UPDATE_VALUE]: (state, [_, [path, fn, ...args]]) =>\n+ ({ [FX_STATE]: updateIn(state, path, fn, ...args) }),\n+ [api.EV_UNDO]: () => ({ [api.FX_UNDO]: \"history\" }),\n+ [api.EV_REDO]: () => ({ [api.FX_REDO]: \"history\" }),\n+ });\n// effects\nthis.addEffects({\n- [FX_STATE]: [(x) => this.state.reset(x), -1000],\n- [api.FX_UNDO]: [(x, _, ctx) => ctx[x].undo(), -1000],\n- [api.FX_REDO]: [(x, _, ctx) => ctx[x].redo(), -1000],\n+ [FX_STATE]: [(state) => this.state.reset(state), -1000],\n+ [api.FX_UNDO]: [(id, _, ctx) => ctx[id].undo(), -1001],\n+ [api.FX_REDO]: [(id, _, ctx) => ctx[id].redo(), -1001],\n});\n}\n@@ -598,6 +612,15 @@ export class EventBus extends StatelessEventBus implements\n* `InterceptorContext` object passed to each interceptor. Since the\n* merged object is also used to collect triggered side effects,\n* care must be taken that there're no key name clashes.\n+ *\n+ * In order to use the built-in `EV_UNDO`, `EV_REDO` events and\n+ * their related side effects, users MUST provide a\n+ * @thi.ng/atom History (or compatible undo history instance) via\n+ * the `ctx` arg, e.g.\n+ *\n+ * ```\n+ * bus.processQueue({ history });\n+ * ```\n*/\nprocessQueue(ctx?: api.InterceptorContext) {\nif (this.eventQueue.length > 0) {\n",
"new_path": "packages/interceptors/src/event-bus.ts",
"old_path": "packages/interceptors/src/event-bus.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -10,13 +10,45 @@ export function trace(_, e) {\n}\n/**\n- * Higher-order interceptor. Return interceptor which unpacks payload\n+ * Higher-order interceptor. Returns interceptor which unpacks payload\n* from event and assigns it as is to given side effect ID.\n*\n- * @param id side effect ID\n+ * @param fxID side effect ID\n*/\n-export function forwardSideFx(id: string) {\n- return (_, [__, body]) => ({ [id]: body });\n+export function forwardSideFx(fxID: string): InterceptorFn {\n+ return (_, [__, body]) => ({ [fxID]: body });\n+}\n+\n+/**\n+ * Higher-order interceptor. Returns interceptor which calls\n+ * `ctx[id].record()`, where `ctx` is the currently active\n+ * `InterceptorContext` passed to all event handlers and `ctx[id]` is\n+ * assumed to be a @thi.ng/atom `History` instance, passed to\n+ * `processQueue()`. The default ID for the history instance is\n+ * `\"history\"`.\n+ *\n+ * Example usage:\n+ *\n+ * ```\n+ * state = new Atom({});\n+ * history = new History(state);\n+ * bus = new EventBus(state);\n+ * // register event handler\n+ * // each time the `foo` event is triggered, a snapshot of\n+ * // current app state is recorded first\n+ * bus.addHandlers({\n+ * foo: [snapshot(), valueSetter(\"foo\")]\n+ * undo: [forwardSideFx(FX_UNDO)]\n+ * });\n+ * ...\n+ * // pass history instance via interceptor context to handlers\n+ * bus.processQueue({ history });\n+ * ```\n+ *\n+ * @param id\n+ */\n+export function snapshot(id = \"history\"): InterceptorFn {\n+ return (_, __, ___, ctx) => (ctx[id].record());\n}\n/**\n",
"new_path": "packages/interceptors/src/interceptors.ts",
"old_path": "packages/interceptors/src/interceptors.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(interceptors): add undo/redo handlers/fx & snapshot() interceptor
| 1
|
feat
|
interceptors
|
217,922
|
15.04.2018 13:26:06
| -7,200
|
294d5690381aea9ae69b35f6fdae3e3b3a9d1ad1
|
chore(permissions): shared lists now appear in recipes addition menus
|
[
{
"change_type": "MODIFY",
"diff": "<span>{{list.name}}</span>\n</button>\n</div>\n+ <span mat-menu-item (click)=\"$event.stopPropagation();\">\n+ <mat-icon>folder_shared</mat-icon>\n+ {{\"LISTS.Shared_lists\" | translate}}</span>\n+ <button mat-menu-item *ngFor=\"let list of sharedLists | async\"\n+ class=\"workshop-list\"\n+ (click)=\"addAllRecipes(list, list.$key)\">\n+ <mat-icon>playlist_play</mat-icon>\n+ <span>{{list.name}}</span>\n+ </button>\n</mat-menu>\n<div class=\"add-all-wrapper\">\n<span>{{list.name}}</span>\n</button>\n</div>\n+\n+ <span mat-menu-item (click)=\"$event.stopPropagation();\">\n+ <mat-icon>folder_shared</mat-icon>\n+ {{\"LISTS.Shared_lists\" | translate}}\n+ </span>\n+ <button mat-menu-item *ngFor=\"let list of sharedLists | async\"\n+ class=\"workshop-list\"\n+ (click)=\"addRecipe(recipe, list, list.$key,amount.value, collectible.checked)\">\n+ <mat-icon>playlist_play</mat-icon>\n+ <span>{{list.name}}</span>\n+ </button>\n</mat-menu>\n<button mat-icon-button [matMenuTriggerFor]=\"appMenu\">\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": "@@ -101,6 +101,8 @@ export class RecipesComponent extends PageComponent implements OnInit {\nlists: { basicLists: List[], rows: { [index: string]: List[] } } = {basicLists: [], rows: {}};\n+ sharedLists: Observable<List[]>;\n+\nworkshops: Observable<Workshop[]>;\nloading = false;\n@@ -118,6 +120,11 @@ export class RecipesComponent extends PageComponent implements OnInit {\nngOnInit() {\nsuper.ngOnInit();\n+\n+ this.sharedLists = this.userService.getUserData().mergeMap(user => {\n+ return Observable.combineLatest(user.sharedLists.map(listId => this.listService.get(listId)));\n+ }).publishReplay(1).refCount();\n+\nthis.workshops = this.userService.getUserData().mergeMap(user => {\nif (user.$key !== undefined) {\nreturn this.workshopService.getUserWorkshops(user.$key);\n",
"new_path": "src/app/pages/recipes/recipes/recipes.component.ts",
"old_path": "src/app/pages/recipes/recipes/recipes.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore(permissions): shared lists now appear in recipes addition menus
#277
| 1
|
chore
|
permissions
|
217,922
|
15.04.2018 14:17:33
| -7,200
|
f2e637df7ff0d879042f6103d9794e892b9e1e32
|
chore(permissions): added workshops implementation
|
[
{
"change_type": "MODIFY",
"diff": "@@ -28,4 +28,6 @@ export class AppUser extends DataModel {\nlistDetailsFilters: ListDetailsFilters = ListDetailsFilters.DEFAULT;\n// List ids user has write access to\nsharedLists: string[] = [];\n+ // Workshop ids user has write access to\n+ sharedWorkshops: 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": "(click)=\"$event.stopPropagation()\">\n<mat-icon>playlist_play</mat-icon>\n</button>\n- <button mat-icon-button *ngIf=\"!readonly && buttons\"\n+ <button mat-icon-button *ngIf=\"!readonly && buttons && list.authorId === userUid\"\n(click)=\"ondelete.emit(); $event.stopPropagation()\">\n<mat-icon>delete</mat-icon>\n</button>\n",
"new_path": "src/app/modules/common-components/list-panel/list-panel.component.html",
"old_path": "src/app/modules/common-components/list-panel/list-panel.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -8,6 +8,8 @@ import {PermissionsRegistry} from '../../../core/database/permissions/permission\nimport {BehaviorSubject} from 'rxjs/BehaviorSubject';\nimport {UserService} from '../../../core/database/user.service';\nimport {NgSerializerService} from '@kaiu/ng-serializer';\n+import {List} from '../../../model/list/list';\n+import {Workshop} from '../../../model/other/workshop';\n@Component({\nselector: 'app-permissions-popup',\n@@ -101,13 +103,21 @@ export class PermissionsPopupComponent {\nObservable.combineLatest(\n...usersSharedDeletions.map(deletion => {\nreturn this.userService.get(deletion).first().map(user => {\n+ if (this.data instanceof List) {\nuser.sharedLists = user.sharedLists.filter(listId => listId !== this.data.$key);\n+ } else if (this.data instanceof Workshop) {\n+ user.sharedWorkshops = user.sharedLists.filter(listId => listId !== this.data.$key);\n+ }\nreturn user;\n}).mergeMap(user => this.userService.set(deletion, user));\n}),\n...usersSharedAdditions.map(addition => {\nreturn this.userService.get(addition).first().map(user => {\n+ if (this.data instanceof List) {\nuser.sharedLists.push(this.data.$key);\n+ } else if (this.data instanceof Workshop) {\n+ user.sharedWorkshops.push(this.data.$key);\n+ }\nreturn user;\n}).mergeMap(user => this.userService.set(addition, user));\n})).first().subscribe(() => {\n",
"new_path": "src/app/modules/common-components/permissions-popup/permissions-popup.component.ts",
"old_path": "src/app/modules/common-components/permissions-popup/permissions-popup.component.ts"
},
{
"change_type": "MODIFY",
"diff": "(click)=\"$event.stopPropagation(); openLinkPopup(workshop)\">\n<mat-icon>link</mat-icon>\n</button>\n+ <span *ngIf=\"workshop.authorId === userData.$key\"\n+ [matTooltipDisabled]=\"!anonymous\"\n+ [matTooltip]=\"'PERMISSIONS.No_anonymous' | translate\">\n+ <button mat-icon-button\n+ (click)=\"$event.stopPropagation();openPermissions(workshop)\"\n+ [disabled]=\"anonymous\"\n+ [matTooltip]=\"'PERMISSIONS.Title' | translate\">\n+ <mat-icon>security</mat-icon>\n+ </button>\n+ </span>\n<button mat-icon-button ngxClipboard [cbContent]=\"getLink(workshop)\"\n(click)=\"$event.stopPropagation()\"\nmatTooltip=\"{{'Share' | translate}}\" matTooltipPosition=\"above\"\n<mat-icon>remove</mat-icon>\n</button>\n<app-list-panel\n+ [readonly]=\"!list.getPermissions(userData.$key).write\"\n[list]=\"list\"\n[expanded]=\"expanded.indexOf(list.$key) > -1\"\n(onrecipedelete)=\"removeRecipe($event.recipe, list, list.$key)\"\n{{'WORKSHOP.Add_workshop' | translate}}\n</button>\n</div>\n+ <div class=\"workshops\">\n+ <h2>{{'WORKSHOP.Shared_workshops' | translate}}</h2>\n+ <mat-divider class=\"divider\"></mat-divider>\n+ <div *ngFor=\"let workshopData of sharedWorkshops | async; trackBy: trackByWorkshopFn; let i = index\"\n+ class=\"row\">\n+ <mat-expansion-panel [ngClass]=\"{odd: i%2>0}\">\n+ <mat-expansion-panel-header>\n+ <mat-panel-title class=\"workshop-name\">\n+ {{workshopData.workshop.name}}\n+ <button mat-icon-button (click)=\"$event.stopPropagation();changeWorkshopName(workshop)\">\n+ <mat-icon>edit</mat-icon>\n+ </button>\n+ </mat-panel-title>\n+ <div class=\"buttons\">\n+ <button mat-icon-button *ngIf=\"userData?.patron || userData?.admin\"\n+ matTooltip=\"{{'CUSTOM_LINKS.Add_link' | translate}}\" matTooltipPosition=\"above\"\n+ (click)=\"$event.stopPropagation(); openLinkPopup(workshopData.workshop)\">\n+ <mat-icon>link</mat-icon>\n+ </button>\n+ <span *ngIf=\"workshopData.workshop.authorId === userData.$key\"\n+ [matTooltipDisabled]=\"!anonymous\"\n+ [matTooltip]=\"'PERMISSIONS.No_anonymous' | translate\">\n+ <button mat-icon-button\n+ (click)=\"$event.stopPropagation();openPermissions(workshopData.workshop)\"\n+ [disabled]=\"anonymous\"\n+ [matTooltip]=\"'PERMISSIONS.Title' | translate\">\n+ <mat-icon>security</mat-icon>\n+ </button>\n+ </span>\n+ <button mat-icon-button ngxClipboard [cbContent]=\"getLink(workshopData.workshop)\"\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 routerLink=\"/workshop/{{workshopData.workshop.$key}}\"\n+ (click)=\"$event.stopPropagation()\">\n+ <mat-icon>playlist_play</mat-icon>\n+ </button>\n+ </div>\n+ </mat-expansion-panel-header>\n+ <div class=\"row workshop-row\"\n+ *ngFor=\"let list of workshopData.lists; trackBy: trackByListsFn; let i = index\">\n+ <button mat-icon-button color=\"warn\"\n+ (click)=\"removeListFromWorkshop(workshopData.workshop, list.$key)\">\n+ <mat-icon>remove</mat-icon>\n+ </button>\n+ <app-list-panel\n+ [readonly]=\"!list.getPermissions(userData.$key).write\"\n+ [list]=\"list\"\n+ [expanded]=\"expanded.indexOf(list.$key) > -1\"\n+ (onrecipedelete)=\"removeRecipe($event.recipe, list, list.$key)\"\n+ (onedit)=\"updateAmount($event.recipe, list, list.$key, $event.amount)\"\n+ (ondelete)=\"delete(list)\"\n+ [authorUid]=\"user.uid\"\n+ [odd]=\"i%2>0\"\n+ [linkButton]=\"userData?.patron || userData?.admin\"\n+ [templateButton]=\"userData?.patron || userData?.admin\"></app-list-panel>\n+ </div>\n+ <button mat-button class=\"full-width-button\" color=\"accent\"\n+ (click)=\"addListsToWorkhop(workshopData.workshop, display.basicLists)\">\n+ <mat-icon>add</mat-icon>\n+ {{'WORKSHOP.Add_lists' | translate}}\n+ </button>\n+ </mat-expansion-panel>\n+ </div>\n+ </div>\n</div>\n<div *ngIf=\"(lists | async) === null && loading\" class=\"loader-container\">\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": "@@ -28,6 +28,7 @@ import {CustomLinkPopupComponent} from '../../custom-links/custom-link-popup/cus\nimport {CustomLink} from '../../../core/database/custom-links/costum-link';\nimport {ListTemplateService} from '../../../core/database/list-template/list-template.service';\nimport {ExternalListImportPopupComponent} from '../external-list-import-popup/external-list-import-popup.component';\n+import {PermissionsPopupComponent} from '../../../modules/common-components/permissions-popup/permissions-popup.component';\ndeclare const ga: Function;\n@@ -60,6 +61,8 @@ export class ListsComponent extends ComponentWithSubscriptions implements OnInit\nworkshops: Observable<Workshop[]>;\n+ sharedWorkshops: Observable<{ workshop: Workshop, lists: List[] }[]>;\n+\nuserData: AppUser;\nconstructor(private auth: AngularFireAuth, private alarmService: AlarmService,\n@@ -241,6 +244,14 @@ export class ListsComponent extends ComponentWithSubscriptions implements OnInit\n});\n}\n+ openPermissions(workshop: Workshop): void {\n+ this.dialog.open(PermissionsPopupComponent, {data: workshop})\n+ .afterClosed()\n+ .filter(res => res !== '')\n+ .mergeMap(result => this.workshopService.set(result.$key, result))\n+ .subscribe();\n+ }\n+\ntrackByListsFn(index: number, item: List) {\nreturn item.$key;\n}\n@@ -260,6 +271,21 @@ export class ListsComponent extends ComponentWithSubscriptions implements OnInit\nreturn this.reloader$.mergeMap(() => this.workshopService.getUserWorkshops(user.uid));\n}\n});\n+ this.sharedWorkshops = this.userService.getUserData().mergeMap(user => {\n+ if (user === null) {\n+ return this.reloader$.mergeMap(() => Observable.of([]));\n+ } else {\n+ return this.reloader$.mergeMap(() => {\n+ return Observable.combineLatest(user.sharedWorkshops.map(workshopId => {\n+ return this.workshopService.get(workshopId).mergeMap(workshop => {\n+ return this.listService.fetchWorkshop(workshop).map(lists => {\n+ return {workshop: workshop, lists: lists};\n+ });\n+ });\n+ }));\n+ });\n+ }\n+ });\nthis.lists =\nthis.auth.authState.mergeMap(user => {\nthis.user = user;\n@@ -280,7 +306,25 @@ export class ListsComponent extends ComponentWithSubscriptions implements OnInit\n});\nreturn match;\n});\n- }).map(lists => {\n+ })\n+ .mergeMap(lists => {\n+ const additionalLists = [];\n+ for (const workshop of workshops) {\n+ for (const wsListId of workshop.listIds) {\n+ // If this list is not one of the user's lists, it won't be loaded\n+ if (lists.find(list => list.$key === wsListId) === undefined) {\n+ additionalLists.push(wsListId);\n+ }\n+ }\n+ }\n+ if (additionalLists.length > 0) {\n+ return Observable.combineLatest(additionalLists.map(listId => this.listService.get(listId)))\n+ .map(externalLists => lists.concat(externalLists));\n+ } else {\n+ return Observable.of(lists);\n+ }\n+ })\n+ .map(lists => {\nreturn this.workshopService.getListsByWorkshop(lists, workshops);\n});\n}));\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": "+<div *ngIf=\"!notFound\">\n<mat-card *ngIf=\"workshop | async as workshopData\">\n<mat-card-header>\n<img *ngIf=\"author | async as authorCharacter\" src=\"{{authorCharacter.avatar}}\" alt=\"\" mat-card-avatar\nrouterLink=\"/profile/{{workshopData.authorId}}\">\n<mat-card-title>{{workshopData.name}}</mat-card-title>\n- <mat-card-subtitle *ngIf=\"author | async as authorCharacter\">{{'WORKSHOP.Created_by' | translate : {name: authorCharacter.name} }}</mat-card-subtitle>\n+ <mat-card-subtitle *ngIf=\"author | async as authorCharacter\">{{'WORKSHOP.Created_by' | translate : {name:\n+ authorCharacter.name} }}\n+ </mat-card-subtitle>\n<button mat-mini-fab color=\"accent\"\nclass=\"favorite-fab\"\nmatTooltip=\"{{'Favorite' | translate}}\"\n</div>\n</mat-card-content>\n</mat-card>\n+</div>\n+<h4 class=\"not-found\" *ngIf=\"notFound\">{{\"WORKSHOP.Not_found\" | translate}}</h4>\n",
"new_path": "src/app/pages/workshop/workshop/workshop.component.html",
"old_path": "src/app/pages/workshop/workshop/workshop.component.html"
},
{
"change_type": "MODIFY",
"diff": ".row {\nmargin: 10px 0;\n}\n+.not-found {\n+ margin-top: 50px;\n+ text-align: center;\n+ font-size: 40px;\n+ opacity: 0.6;\n+}\n+\n",
"new_path": "src/app/pages/workshop/workshop/workshop.component.scss",
"old_path": "src/app/pages/workshop/workshop/workshop.component.scss"
},
{
"change_type": "MODIFY",
"diff": "@@ -25,6 +25,8 @@ export class WorkshopComponent implements OnInit {\nfavorite: Observable<boolean>;\n+ notFound = false;\n+\nconstructor(private route: ActivatedRoute, private workshopService: WorkshopService, private listService: ListService,\nprivate userService: UserService) {\n}\n@@ -47,7 +49,17 @@ export class WorkshopComponent implements OnInit {\n}\nngOnInit() {\n- this.workshop = this.route.params.mergeMap(params => this.workshopService.get(params.id));\n+ this.workshop = this.userService.getUserData().mergeMap(user => {\n+ return this.route.params\n+ .mergeMap(params => this.workshopService.get(params.id))\n+ .do(workshop => {\n+ this.notFound = !workshop.getPermissions(user.$key).read;\n+ })\n+ .catch(() => {\n+ this.notFound = true;\n+ return Observable.of(null);\n+ });\n+ });\nthis.favorite = this.workshop.switchMap(workshop => {\nreturn this.userService.getUserData().map(user => {\nreturn (user.favoriteWorkshops || []).indexOf(workshop.$key) > -1;\n",
"new_path": "src/app/pages/workshop/workshop/workshop.component.ts",
"old_path": "src/app/pages/workshop/workshop/workshop.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore(permissions): added workshops implementation
#277
| 1
|
chore
|
permissions
|
217,922
|
15.04.2018 16:05:21
| -7,200
|
0f1da89058e2882e116f6d42f75ac02d0f9416f3
|
feat(permissions): FC-only workshops are now a thing
closes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -135,7 +135,7 @@ export class DataService {\n* @param {number} id\n* @returns {Observable<any>}\n*/\n- public getFreeCompany(id: number): Observable<any> {\n+ public getFreeCompany(id: string): Observable<any> {\nreturn this.http.get<any>(`https://xivsync.com/freecompany/parse/${id}`).map(result => result.data)\n.publishReplay(1)\n.refCount()\n",
"new_path": "src/app/core/api/data.service.ts",
"old_path": "src/app/core/api/data.service.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -10,10 +10,13 @@ export class DataWithPermissions extends DataModel {\n@DeserializeAs(PermissionsRegistry)\npermissionsRegistry: PermissionsRegistry = new PermissionsRegistry();\n- public getPermissions(userId: string): Permissions {\n+ public getPermissions(userId: string, freeCompanyId?: string): Permissions {\nif (userId === this.authorId) {\nreturn {read: true, participate: true, write: true};\n}\n+ if (freeCompanyId !== undefined && this.permissionsRegistry.freeCompanyId === freeCompanyId) {\n+ return this.permissionsRegistry.freeCompany;\n+ }\nreturn this.permissionsRegistry.registry[userId] || this.permissionsRegistry.everyone;\n}\n}\n",
"new_path": "src/app/core/database/permissions/data-with-permissions.ts",
"old_path": "src/app/core/database/permissions/data-with-permissions.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -6,6 +6,10 @@ export class PermissionsRegistry {\npublic everyone: Permissions = {read: true, participate: true, write: false};\n+ freeCompanyId: string;\n+\n+ public freeCompany: Permissions = {read: true, participate: true, write: false};\n+\npublic forEach(callback: (k, v) => void): void {\nObject.keys(this.registry).forEach(key => {\ncallback(key, this.registry[key]);\n",
"new_path": "src/app/core/database/permissions/permissions-registry.ts",
"old_path": "src/app/core/database/permissions/permissions-registry.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -38,6 +38,7 @@ import { AnnouncementPopupComponent } from './announcement-popup/announcement-po\nimport { PermissionsPopupComponent } from './permissions-popup/permissions-popup.component';\nimport { PermissionsRowComponent } from './permissions-popup/permissions-row/permissions-row.component';\nimport { AddNewRowPopupComponent } from './permissions-popup/add-new-row-popup/add-new-row-popup.component';\n+import { FcCrestComponent } from './fc-crest/fc-crest.component';\n@NgModule({\nimports: [\n@@ -87,6 +88,7 @@ import { AddNewRowPopupComponent } from './permissions-popup/add-new-row-popup/a\nPermissionsPopupComponent,\nPermissionsRowComponent,\nAddNewRowPopupComponent,\n+ FcCrestComponent,\n],\nexports: [\nRandomGifComponent,\n",
"new_path": "src/app/modules/common-components/common-components.module.ts",
"old_path": "src/app/modules/common-components/common-components.module.ts"
},
{
"change_type": "ADD",
"diff": "+<div class=\"container\">\n+ <img src=\"{{crest[0]}}\" alt=\"\" class=\"crest-element\">\n+ <img src=\"{{crest[1]}}\" alt=\"\" class=\"crest-element\">\n+ <img src=\"{{crest[2]}}\" alt=\"\" class=\"crest-element\">\n+</div>\n",
"new_path": "src/app/modules/common-components/fc-crest/fc-crest.component.html",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+.container {\n+ position: relative;\n+ height: 100%;\n+ width: 100%;\n+ .crest-element {\n+ position: absolute;\n+ top: 0;\n+ left: 0;\n+ height: 100%;\n+ width: 100%;\n+ }\n+}\n",
"new_path": "src/app/modules/common-components/fc-crest/fc-crest.component.scss",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import {Component, Input} from '@angular/core';\n+\n+@Component({\n+ selector: 'app-fc-crest',\n+ templateUrl: './fc-crest.component.html',\n+ styleUrls: ['./fc-crest.component.scss']\n+})\n+export class FcCrestComponent {\n+\n+ @Input()\n+ crest: [string, string, string];\n+\n+ constructor() {\n+ }\n+\n+}\n",
"new_path": "src/app/modules/common-components/fc-crest/fc-crest.component.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "<h3 mat-dialog-title>{{'PERMISSIONS.Title' | translate}}</h3>\n<div mat-dialog-content *ngIf=\"!saving\">\n<mat-list *ngIf=\"rows | async as rowsData; else loading\">\n+ <span *ngIf=\"isWorkshop() && registry.freeCompanyId !== undefined && freeCompany !== undefined\">\n+ <app-permissions-row *ngIf=\"freeCompany | async as fc\"\n+ [name]=\"fc.name\"\n+ [fcCrest]=\"fc.crest\"\n+ [permissions]=\"registry.freeCompany\"\n+ (permissionsChange)=\"handleFcPermissionsChange($event)\"\n+ (delete)=\"unbindFreeCompany()\">\n+ </app-permissions-row>\n+ </span>\n+\n<app-permissions-row *ngFor=\"let row of rowsData\"\n[permissions]=\"row.permissions\"\n(permissionsChange)=\"handlePermissionsChange($event, row.userId)\"\n[name]=\"row.character.name\"\n[isAuthor]=\"row.userId === data.authorId\"\n(delete)=\"deleteRow(row.userId)\"></app-permissions-row>\n+\n<app-permissions-row [permissions]=\"registry.everyone\"\n(permissionsChange)=\"handlePermissionsChange($event)\"\nisEveryone=\"true\"></app-permissions-row>\n<mat-icon>add</mat-icon>\n{{'PERMISSIONS.Add_new' | translate}}\n</button>\n+ <button mat-raised-button color=\"primary\" class=\"add-row\" (click)=\"bindFreeCompany()\"\n+ *ngIf=\"isWorkshop() && registry.freeCompanyId === undefined\">\n+ {{'PERMISSIONS.Bind_free_company' | translate}}\n+ </button>\n</div>\n<div mat-dialog-actions *ngIf=\"!saving\">\n<button mat-raised-button (click)=\"save()\" color=\"primary\">{{'Save' | translate}}</button>\n",
"new_path": "src/app/modules/common-components/permissions-popup/permissions-popup.component.html",
"old_path": "src/app/modules/common-components/permissions-popup/permissions-popup.component.html"
},
{
"change_type": "MODIFY",
"diff": ".add-row {\nwidth: 100%;\n+ margin-top: 10px;\n}\n.loading-container {\n",
"new_path": "src/app/modules/common-components/permissions-popup/permissions-popup.component.scss",
"old_path": "src/app/modules/common-components/permissions-popup/permissions-popup.component.scss"
},
{
"change_type": "MODIFY",
"diff": "-import {Component, Inject} from '@angular/core';\n+import {ChangeDetectionStrategy, Component, Inject} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialog, MatDialogRef} from '@angular/material';\nimport {DataWithPermissions} from '../../../core/database/permissions/data-with-permissions';\nimport {AddNewRowPopupComponent} from './add-new-row-popup/add-new-row-popup.component';\n@@ -10,11 +10,13 @@ import {UserService} from '../../../core/database/user.service';\nimport {NgSerializerService} from '@kaiu/ng-serializer';\nimport {List} from '../../../model/list/list';\nimport {Workshop} from '../../../model/other/workshop';\n+import {DataService} from '../../../core/api/data.service';\n@Component({\nselector: 'app-permissions-popup',\ntemplateUrl: './permissions-popup.component.html',\n- styleUrls: ['./permissions-popup.component.scss']\n+ styleUrls: ['./permissions-popup.component.scss'],\n+ changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class PermissionsPopupComponent {\n@@ -26,10 +28,18 @@ export class PermissionsPopupComponent {\nsaving = false;\n+ freeCompany: Observable<any>;\n+\nconstructor(@Inject(MAT_DIALOG_DATA) public data: DataWithPermissions, private dialog: MatDialog, private userService: UserService,\n- private dialogRef: MatDialogRef<PermissionsPopupComponent>, serializer: NgSerializerService) {\n+ private dialogRef: MatDialogRef<PermissionsPopupComponent>, serializer: NgSerializerService,\n+ private dataService: DataService) {\n// Create a copy to work on.\nthis.registry = serializer.deserialize(JSON.parse(JSON.stringify(data.permissionsRegistry)), PermissionsRegistry);\n+\n+ if (this.registry.freeCompanyId !== undefined) {\n+ this.freeCompany = this.dataService.getFreeCompany(this.registry.freeCompanyId);\n+ }\n+\nthis.registrySubject = new BehaviorSubject<PermissionsRegistry>(this.registry);\nthis.rows = this.registrySubject\n.mergeMap(registry => {\n@@ -62,6 +72,29 @@ export class PermissionsPopupComponent {\n}\n}\n+ handleFcPermissionsChange(after: Permissions): void {\n+ this.registry.freeCompany = after;\n+ }\n+\n+ isWorkshop(): boolean {\n+ return this.data instanceof Workshop;\n+ }\n+\n+ bindFreeCompany(): void {\n+ this.userService.getUserData()\n+ .mergeMap(user => this.userService.getCharacter(user.$key))\n+ .first()\n+ .subscribe(character => {\n+ this.registry.freeCompanyId = character.free_company;\n+ this.freeCompany = this.dataService.getFreeCompany(this.registry.freeCompanyId);\n+ });\n+ }\n+\n+ unbindFreeCompany(): void {\n+ delete this.registry.freeCompanyId;\n+ this.freeCompany = undefined;\n+ }\n+\naddNewRow(): void {\nthis.dialog.open(AddNewRowPopupComponent).afterClosed()\n.filter(u => u !== '')\n",
"new_path": "src/app/modules/common-components/permissions-popup/permissions-popup.component.ts",
"old_path": "src/app/modules/common-components/permissions-popup/permissions-popup.component.ts"
},
{
"change_type": "MODIFY",
"diff": "<mat-list-item>\n- <img mat-list-avatar src=\"{{avatar}}\" alt=\"\" matTooltip=\"{{name}}\" matTooltipPosition=\"above\" *ngIf=\"!isEveryone\">\n+ <img mat-list-avatar src=\"{{avatar}}\" alt=\"\" matTooltip=\"{{name}}\" matTooltipPosition=\"above\"\n+ *ngIf=\"!isEveryone && fcCrest === undefined\">\n+\n+ <app-fc-crest mat-list-avatar [crest]=\"fcCrest\" *ngIf=\"fcCrest !== undefined\" matTooltip=\"{{name}}\"\n+ matTooltipPosition=\"above\"></app-fc-crest>\n+\n<mat-icon mat-list-icon class=\"list-icon\" *ngIf=\"isEveryone\" matTooltip=\"{{'PERMISSIONS.Everyone' | translate}}\"\nmatTooltipPosition=\"above\">group\n</mat-icon>\n(change)=\"handleChanges()\">\n{{'PERMISSIONS.Participate' | translate}}\n</mat-checkbox>\n- <mat-checkbox [(ngModel)]=\"permissions.write\" disabled=\"{{isEveryone || !permissions.read || isAuthor}}\"\n+ <mat-checkbox [(ngModel)]=\"permissions.write\" disabled=\"{{isEveryone || !permissions.read || isAuthor\n+ || fcCrest !== undefined}}\"\n(change)=\"handleChanges()\">\n{{'PERMISSIONS.Write' | translate}}\n</mat-checkbox>\n",
"new_path": "src/app/modules/common-components/permissions-popup/permissions-row/permissions-row.component.html",
"old_path": "src/app/modules/common-components/permissions-popup/permissions-row/permissions-row.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -22,6 +22,9 @@ export class PermissionsRowComponent {\n@Input()\navatar: string;\n+ @Input()\n+ fcCrest: [string, string, string];\n+\n@Input()\nname: string;\n",
"new_path": "src/app/modules/common-components/permissions-popup/permissions-row/permissions-row.component.ts",
"old_path": "src/app/modules/common-components/permissions-popup/permissions-row/permissions-row.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -49,11 +49,18 @@ export class WorkshopComponent implements OnInit {\n}\nngOnInit() {\n- this.workshop = this.userService.getUserData().mergeMap(user => {\n+ this.workshop = this.userService.getUserData()\n+ .mergeMap(user => this.userService.getCharacter(user.$key)\n+ .catch(() => Observable.of(user))\n+ .map(char => {\n+ char.$key = user.$key;\n+ return char;\n+ }))\n+ .mergeMap(character => {\nreturn this.route.params\n.mergeMap(params => this.workshopService.get(params.id))\n.do(workshop => {\n- this.notFound = !workshop.getPermissions(user.$key).read;\n+ this.notFound = !workshop.getPermissions(character.$key, character.free_company).read;\n})\n.catch(() => {\nthis.notFound = true;\n",
"new_path": "src/app/pages/workshop/workshop/workshop.component.ts",
"old_path": "src/app/pages/workshop/workshop/workshop.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
feat(permissions): FC-only workshops are now a thing
closes #251
#277
| 1
|
feat
|
permissions
|
679,913
|
15.04.2018 16:17:55
| -3,600
|
cf42260cf64aa62b9e2903e4bb6fedb09eee6436
|
feat(atom): update History.record(), add IHistory interface
check changed() from record() if called without arg
add IHistory for alt implementations
|
[
{
"change_type": "MODIFY",
"diff": "@@ -49,3 +49,14 @@ export interface CursorOpts<T> {\nvalidate?: api.Predicate<T>;\nid?: string;\n}\n+\n+export interface IHistory<T> extends IAtom<T> {\n+ canUndo(): boolean;\n+ canRedo(): boolean;\n+\n+ undo(): T;\n+ redo(): T;\n+ clear(): void;\n+\n+ record(): void;\n+}\n\\ No newline at end of file\n",
"new_path": "packages/atom/src/api.ts",
"old_path": "packages/atom/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -2,7 +2,7 @@ import { Predicate2, Watch } from \"@thi.ng/api/api\";\nimport { equiv } from \"@thi.ng/api/equiv\";\nimport { Path, getIn, setIn, updateIn } from \"@thi.ng/paths\";\n-import { IAtom, SwapFn, IView, ViewTransform } from \"./api\";\n+import { IAtom, IHistory, IView, SwapFn, ViewTransform } from \"./api\";\nimport { View } from \"./view\";\n/**\n@@ -13,7 +13,7 @@ import { View } from \"./view\";\n* `record()` directly.\n*/\nexport class History<T> implements\n- IAtom<T> {\n+ IHistory<T> {\nstate: IAtom<T>;\nmaxLen: number;\n@@ -137,12 +137,21 @@ export class History<T> implements\n* @param state\n*/\nrecord(state?: T) {\n- if (this.history.length >= this.maxLen) {\n- this.history.shift();\n+ const history = this.history;\n+ const n = history.length;\n+ if (n >= this.maxLen) {\n+ history.shift();\n}\n// check for arg given and not if `state == null` we want to\n// allow null/undefined as possible values\n- this.history.push(arguments.length > 0 ? state : this.state.deref());\n+ if (!arguments.length) {\n+ state = this.state.deref();\n+ if (!n || this.changed(history[n - 1], state)) {\n+ history.push(state);\n+ }\n+ } else {\n+ history.push(state);\n+ }\nthis.future.length = 0;\n}\n",
"new_path": "packages/atom/src/history.ts",
"old_path": "packages/atom/src/history.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(atom): update History.record(), add IHistory interface
- check changed() from record() if called without arg
- add IHistory for alt implementations
| 1
|
feat
|
atom
|
679,913
|
15.04.2018 16:20:46
| -3,600
|
a1d9ae68db4e01f73959c6d541ad81657072d9fb
|
refactor(interceptors): refactor undo handling
update EV_UNDO/REDO handlers & docs
remove FX_UNDO/REDO
|
[
{
"change_type": "MODIFY",
"diff": "@@ -38,20 +38,6 @@ export const EV_REDO = \"--redo\";\n*/\nexport const EV_UNDO = \"--undo\";\n-/**\n- * Side effect ID to execute redo action.\n- * See `EventBus.addBuiltIns()` for further details.\n- * Also see `snapshot()` interceptor docs.\n- */\n-export const FX_REDO = EV_REDO;\n-\n-/**\n- * Side effect ID to execute undo action.\n- * See `EventBus.addBuiltIns()` for further details.\n- * Also see `snapshot()` interceptor docs.\n- */\n-export const FX_UNDO = EV_UNDO;\n-\nexport interface Event extends Array<any> {\n[0]: PropertyKey;\n[1]?: any;\n@@ -74,7 +60,5 @@ export interface InterceptorContext {\n[FX_DISPATCH]?: Event | Event[];\n[FX_DISPATCH_NOW]?: Event | Event[];\n[FX_DISPATCH_ASYNC]?: AsyncEffectDef | AsyncEffectDef[];\n- [FX_UNDO]?: string | string[];\n- [FX_REDO]?: string | string[];\n[id: string]: any;\n}\n",
"new_path": "packages/interceptors/src/api.ts",
"old_path": "packages/interceptors/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -2,6 +2,7 @@ import { IObjectOf, IDeref } from \"@thi.ng/api/api\";\nimport { illegalArgs } from \"@thi.ng/api/error\";\nimport { IAtom } from \"@thi.ng/atom/api\";\nimport { Atom } from \"@thi.ng/atom/atom\";\n+import { implementsFunction } from \"@thi.ng/checks/implements-function\";\nimport { isArray } from \"@thi.ng/checks/is-array\";\nimport { isFunction } from \"@thi.ng/checks/is-function\";\nimport { isPromise } from \"@thi.ng/checks/is-promise\";\n@@ -548,37 +549,30 @@ export class EventBus extends StatelessEventBus implements\n*\n* #### `EV_UNDO`\n*\n- * Triggers `FX_UNDO` side effect with context key `\"history\"`. See\n- * side effect description below.\n+ * Calls `ctx[id].undo()` and uses return value as new state.\n+ * Assumes `ctx[id]` is a @thi.ng/atom `History` instance, provided\n+ * via e.g. `processQueue({ history })`. The event can be triggered\n+ * with or without ID. By default `\"history\"` is used as default key\n+ * to lookup the `History` instance.\n+ *\n+ * ```\n+ * // using default ID\n+ * bus.dispatch([EV_UNDO]);\n+ *\n+ * // using custom ID\n+ * bus.dispatch([EV_UNDO, \"custom\"]);\n+ * ```\n*\n* #### `EV_REDO`\n*\n- * Triggers `FX_REDO` side effect with context key `\"history\"`. See\n- * side effect description below.\n+ * Similar to `EV_UNDO`, but causes state redo.\n*\n* ### Side effects\n*\n* #### `FX_STATE`\n*\n* Resets state atom to provided value (only a single update per\n- * processing frame)\n- *\n- * #### `FX_UNDO`\n- *\n- * Calls `ctx[fxarg].undo()` where `fxarg` is the value assigned to\n- * the `FX_UNDO` side effect by an event handler, e.g.\n- *\n- * ```\n- * // example event handler\n- * // assumes that `ctx.history` is a @thi.ng/atom/History instance or similar\n- * (state, e, bus, ctx) => ({ [FX_UNDO]: \"history\" })\n- * ```\n- *\n- * #### `FX_REDO`\n- *\n- * Similar to `FX_UNDO`, but calls `ctx[fxarg].redo()` where `fxarg`\n- * is the value assigned to the `FX_REDO` side effect by an event\n- * handler.\n+ * processing frame).\n*/\naddBuiltIns(): any {\nsuper.addBuiltIns();\n@@ -588,15 +582,25 @@ export class EventBus extends StatelessEventBus implements\n({ [FX_STATE]: setIn(state, path, val) }),\n[api.EV_UPDATE_VALUE]: (state, [_, [path, fn, ...args]]) =>\n({ [FX_STATE]: updateIn(state, path, fn, ...args) }),\n- [api.EV_UNDO]: () => ({ [api.FX_UNDO]: \"history\" }),\n- [api.EV_REDO]: () => ({ [api.FX_REDO]: \"history\" }),\n+ [api.EV_UNDO]: (_, [__, id = \"history\"], ___, ctx) => {\n+ if (implementsFunction(ctx[id], \"undo\")) {\n+ return { [FX_STATE]: ctx[id].undo() }\n+ } else {\n+ console.warn(\"no history in context\");\n+ }\n+ },\n+ [api.EV_REDO]: (_, [__, id = \"history\"], ___, ctx) => {\n+ if (implementsFunction(ctx[id], \"redo\")) {\n+ return { [FX_STATE]: ctx[id].redo() }\n+ } else {\n+ console.warn(\"no history in context\");\n+ }\n+ }\n});\n// effects\nthis.addEffects({\n[FX_STATE]: [(state) => this.state.reset(state), -1000],\n- [api.FX_UNDO]: [(id, _, ctx) => ctx[id].undo(), -1001],\n- [api.FX_REDO]: [(id, _, ctx) => ctx[id].redo(), -1001],\n});\n}\n@@ -613,10 +617,9 @@ export class EventBus extends StatelessEventBus implements\n* merged object is also used to collect triggered side effects,\n* care must be taken that there're no key name clashes.\n*\n- * In order to use the built-in `EV_UNDO`, `EV_REDO` events and\n- * their related side effects, users MUST provide a\n- * @thi.ng/atom History (or compatible undo history instance) via\n- * the `ctx` arg, e.g.\n+ * In order to use the built-in `EV_UNDO`, `EV_REDO` events, users\n+ * MUST provide a @thi.ng/atom History (or compatible undo history\n+ * instance) via the `ctx` arg, e.g.\n*\n* ```\n* bus.processQueue({ history });\n",
"new_path": "packages/interceptors/src/event-bus.ts",
"old_path": "packages/interceptors/src/event-bus.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -38,9 +38,11 @@ export function forwardSideFx(fxID: string): InterceptorFn {\n* // current app state is recorded first\n* bus.addHandlers({\n* foo: [snapshot(), valueSetter(\"foo\")]\n- * undo: [forwardSideFx(FX_UNDO)]\n* });\n* ...\n+ * // trigger event\n+ * bus.dispatch([\"foo\", 23]);\n+ *\n* // pass history instance via interceptor context to handlers\n* bus.processQueue({ history });\n* ```\n",
"new_path": "packages/interceptors/src/interceptors.ts",
"old_path": "packages/interceptors/src/interceptors.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(interceptors): refactor undo handling
- update EV_UNDO/REDO handlers & docs
- remove FX_UNDO/REDO
| 1
|
refactor
|
interceptors
|
679,913
|
15.04.2018 16:32:27
| -3,600
|
a597e728ae1d59f4050559c4126a1f8bd9e4d491
|
feat(examples): add undo/redo feature to svg-waveform, update components
|
[
{
"change_type": "MODIFY",
"diff": "<meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n<title>svg-waveform</title>\n<link href=\"https://unpkg.com/tachyons@4.9.1/css/tachyons.min.css\" rel=\"stylesheet\">\n+ <style>\n+ * {\n+ user-select: none;\n+ }\n+\n+ *::selection {\n+ background: none;\n+ }\n+ </style>\n</head>\n<body class=\"ma0 pa0 lh-copy sans-serif\">\n",
"new_path": "examples/svg-waveform/public/index.html",
"old_path": "examples/svg-waveform/public/index.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -47,6 +47,9 @@ export interface AppViews extends Record<keyof AppViews, IView<any>> {\n* component functions.\n*/\nexport interface UIAttribs {\n+ button: any;\n+ buttongroup: any;\n+ footer: any;\nlink: any;\nslider: { root: any, range: any, number: any };\nroot: any;\n",
"new_path": "examples/svg-waveform/src/api.ts",
"old_path": "examples/svg-waveform/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "import { IObjectOf } from \"@thi.ng/api/api\";\nimport { Atom } from \"@thi.ng/atom/atom\";\n+import { History } from \"@thi.ng/atom/history\";\nimport { isArray } from \"@thi.ng/checks/is-array\";\nimport { start } from \"@thi.ng/hdom\";\nimport { EventBus } from \"@thi.ng/interceptors/event-bus\";\nimport { AppConfig, AppContext, AppViews, ViewSpec } from \"./api\";\n+import * as ev from \"./events\";\n/**\n* Generic base app skeleton. You can use this as basis for your own\n@@ -22,10 +24,12 @@ export class App {\nconfig: AppConfig;\nctx: AppContext;\nstate: Atom<any>;\n+ history: History<any>;\nconstructor(config: AppConfig) {\nthis.config = config;\nthis.state = new Atom(config.initialState || {});\n+ this.history = new History(this.state, 1000);\nthis.ctx = {\nbus: new EventBus(this.state, config.events, config.effects),\nviews: <AppViews>{},\n@@ -69,7 +73,7 @@ export class App {\nstart(\nthis.config.domRoot,\n() => {\n- if (this.ctx.bus.processQueue() || firstFrame) {\n+ if (this.ctx.bus.processQueue({ history: this.history }) || firstFrame) {\nfirstFrame = false;\nreturn root();\n}\n@@ -83,6 +87,20 @@ export class App {\n* Automatically called from `start()`\n*/\ninit() {\n+ // initialize key event handlers for undo/redo\n+ document.addEventListener(\"keypress\", (e) => {\n+ // e.preventDefault();\n+ if (e.ctrlKey) {\n+ if (e.key === \"z\") {\n+ this.ctx.bus.dispatch([ev.UNDO]);\n+ } else if (e.key === \"y\") {\n+ this.ctx.bus.dispatch([ev.REDO]);\n+ }\n+ }\n+ });\n// ...add init tasks here\n+\n+ // record snapshot of initial state\n+ this.history.record();\n}\n}\n",
"new_path": "examples/svg-waveform/src/app.ts",
"old_path": "examples/svg-waveform/src/app.ts"
},
{
"change_type": "ADD",
"diff": "+import { AppContext } from \"../api\";\n+import { button } from \"./button\";\n+\n+export function buttonGroup(ctx: AppContext, ...buttons) {\n+ return [\"section\", ctx.ui.buttongroup,\n+ buttons.map((bt) => [button, ...bt])\n+ ];\n+}\n",
"new_path": "examples/svg-waveform/src/components/button-group.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { AppContext } from \"../api\";\n+import { eventLink } from \"./event-link\";\n+\n+export function button(ctx: AppContext, event: Event, label: string) {\n+ return [eventLink, ctx.ui.button, event, label];\n+}\n",
"new_path": "examples/svg-waveform/src/components/button.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { AppContext } from \"../api\";\n+\n+export function link(ctx: AppContext, href, ...body) {\n+ return [\"a\", { ...ctx.ui.link, href }, ...body];\n+}\n",
"new_path": "examples/svg-waveform/src/components/link.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "import { AppContext } from \"../api\";\n+import * as ev from \"../events\";\n+import { buttonGroup } from \"./button-group\";\n+import { link } from \"./link\";\nimport { slider, SliderOpts } from \"./slider\";\nexport function sidebar(ctx: AppContext, ...specs: SliderOpts[]) {\nconst sliders = specs.map((s) => slider(ctx, s));\nreturn [\"div\", ctx.ui.sidebar,\n+ [\"h2.mt0\", \"Additive synthesis\"],\n...sliders,\n- [\"div.absolute.bottom-1\",\n- [\"a\", { ...ctx.ui.link, href: \"https://github.com/thi-ng/umbrella/tree/master/examples/svg-waveform\" }, \"Source\"],\n+ [buttonGroup,\n+ [[ev.UNDO], \"undo\"],\n+ [[ev.REDO], \"redo\"]],\n+ [\"div\", ctx.ui.footer,\n+ [link, \"https://github.com/thi-ng/umbrella/tree/master/examples/svg-waveform\", \"Source\"],\n[\"br\"],\n\"Made with \",\n- [\"a\", { ...ctx.ui.link, href: \"https://github.com/thi-ng/umbrella/tree/master/packages/hdom\" }, \"@thi.ng/hdom\"]\n+ [link, \"https://github.com/thi-ng/umbrella/tree/master/packages/hdom\", \"@thi.ng/hdom\"]\n]\n];\n}\n",
"new_path": "examples/svg-waveform/src/components/sidebar.ts",
"old_path": "examples/svg-waveform/src/components/sidebar.ts"
},
{
"change_type": "MODIFY",
"diff": "-import { valueSetter, ensureParamRange } from \"@thi.ng/interceptors/interceptors\"\n+import { ensureParamRange, snapshot, valueSetter } from \"@thi.ng/interceptors/interceptors\"\nimport { AppConfig } from \"./api\";\n// import * as ev from \"./events\";\n// import * as fx from \"./effects\";\n@@ -25,14 +25,17 @@ export const CONFIG: AppConfig = {\n// generate event handlers from imported slider definitions\n// the same defs are used in the main root component (main.ts) to generate\n// their respective UI components\n- // each of these handlers is dynamically composed of 2 interceptors:\n- // the first to validate the event param, the second to update the app state\n- // the state update will only be executed if validation\n- // succeeds, else the event is canceled\n+ // each of these handlers is dynamically composed of 3 interceptors:\n+ // 1) validate the event param\n+ // 2) record undo history snapshot\n+ // 3) update param in app state\n+ // the last 2 steps are only be executed if validation succeeded\n+ // else the event is canceled\n...SLIDERS.reduce(\n(events, spec) => {\nevents[spec.event] = [\nensureParamRange(spec.min, spec.max),\n+ snapshot(),\nvalueSetter(spec.view)\n];\nreturn events;\n@@ -77,14 +80,17 @@ export const CONFIG: AppConfig = {\n// attribs are made available to all components and allow for easy\n// re-skinning of the whole app\nui: {\n+ button: { class: \"pointer bg-black hover-bg-blue bg-animate white pa2 mr1 w-100 ttu b tracked-tight\" },\n+ buttongroup: { class: \"flex\" },\n+ footer: { class: \"absolute bottom-1\" },\n+ link: { class: \"pointer link dim black b\" },\n+ root: { class: \"vw-100 vh-100 flex\" },\n+ sidebar: { class: \"bg-light-gray pa2 pt3 w5 f7\" },\nslider: {\n- root: { class: \"ttu mb3\" },\n+ root: { class: \"mb3 ttu b tracked-tight\" },\nrange: { class: \"w-100\" },\nnumber: { class: \"fr w3 tr ttu bn bg-transparent\" },\n},\n- link: { class: \"pointer link dim black b\" },\n- root: { class: \"vw-100 vh-100 flex\" },\n- sidebar: { class: \"bg-light-gray pa2 pt3 w5 f7\" },\nwaveform: { class: \"w-100 h-100\" }\n}\n};\n",
"new_path": "examples/svg-waveform/src/config.ts",
"old_path": "examples/svg-waveform/src/config.ts"
},
{
"change_type": "MODIFY",
"diff": "+import { EV_UNDO, EV_REDO } from \"@thi.ng/interceptors/api\";\n+\n// best practice tip: define event & effect names as consts or enums\n// and avoid hardcoded strings for more safety and easier refactoring\n// also see pre-defined event handlers & interceptors in @thi.ng/atom:\n@@ -8,3 +10,6 @@ export const SET_FREQ = \"set-freq\";\nexport const SET_PHASE = \"set-phase\";\nexport const SET_HARMONICS = \"set-harmonics\";\nexport const SET_HSTEP = \"set-hstep\";\n+\n+export const UNDO = EV_UNDO;\n+export const REDO = EV_REDO;\n",
"new_path": "examples/svg-waveform/src/events.ts",
"old_path": "examples/svg-waveform/src/events.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(examples): add undo/redo feature to svg-waveform, update components
| 1
|
feat
|
examples
|
679,913
|
15.04.2018 16:36:17
| -3,600
|
9ae2e0357fc0aff0f9cd6b269f72c354e397ae98
|
build(examples): update project structure for router-basics/svg-waveform
|
[
{
"change_type": "RENAME",
"diff": "",
"new_path": "examples/router-basics/assets/manomine-1.jpg",
"old_path": "examples/router-basics/public/assets/manomine-1.jpg"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "examples/router-basics/assets/manomine-2.jpg",
"old_path": "examples/router-basics/public/assets/manomine-2.jpg"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "examples/router-basics/assets/manomine-3.jpg",
"old_path": "examples/router-basics/public/assets/manomine-3.jpg"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "examples/router-basics/assets/user-1.json",
"old_path": "examples/router-basics/public/assets/user-1.json"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "examples/router-basics/assets/user-2.json",
"old_path": "examples/router-basics/public/assets/user-2.json"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "examples/router-basics/assets/users.json",
"old_path": "examples/router-basics/public/assets/users.json"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "examples/router-basics/index.html",
"old_path": "examples/router-basics/public/index.html"
},
{
"change_type": "MODIFY",
"diff": "-const path = require(\"path\");\n-\nmodule.exports = {\nentry: \"./src/index.ts\",\noutput: {\n- path: path.resolve(__dirname, \"public\"),\n+ path: __dirname,\nfilename: \"bundle.js\"\n},\nresolve: {\n@@ -15,6 +13,6 @@ module.exports = {\n]\n},\ndevServer: {\n- contentBase: \"public\"\n+ contentBase: \".\"\n}\n};\n",
"new_path": "examples/router-basics/webpack.config.js",
"old_path": "examples/router-basics/webpack.config.js"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "examples/svg-waveform/index.html",
"old_path": "examples/svg-waveform/public/index.html"
},
{
"change_type": "MODIFY",
"diff": "-const path = require(\"path\");\n-\nmodule.exports = {\nentry: \"./src/index.ts\",\noutput: {\n- path: path.resolve(__dirname, \"public\"),\n+ path: __dirname,\nfilename: \"bundle.js\"\n},\nresolve: {\n@@ -15,6 +13,6 @@ module.exports = {\n]\n},\ndevServer: {\n- contentBase: \"public\"\n+ contentBase: \".\"\n}\n};\n",
"new_path": "examples/svg-waveform/webpack.config.js",
"old_path": "examples/svg-waveform/webpack.config.js"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
build(examples): update project structure for router-basics/svg-waveform
| 1
|
build
|
examples
|
217,922
|
15.04.2018 18:09:04
| -7,200
|
4eb4b3c75b6ddbc5c73ee854ebb2274589bcd6e9
|
feat: craft icons now have a link to simulator
|
[
{
"change_type": "MODIFY",
"diff": "<div class=\"classes\">\n<div *ngIf=\"recipe\">\n+ <a *ngIf=\"getCraft(item.recipeId) as craft\" href=\"{{craft | simulatorLink | i18n}}\" target=\"_blank\">\n<img [ngClass]=\"{'crafted-by':true, 'compact': settings.compactLists}\"\n- *ngIf=\"getCraft(item.recipeId) as craft\"\nmatTooltip=\"{{craft.level}} {{craft.stars_tooltip}}\"\nmatTooltipPosition=\"above\" src=\"{{craft.icon}}\">\n+ </a>\n</div>\n<div *ngIf=\"!recipe\">\n<div *ngFor=\"let craft of item.craftedBy\">\n+ <a href=\"{{craft | simulatorLink: item.id | i18n}}\" target=\"_blank\">\n<img [ngClass]=\"{'crafted-by':true, 'compact': settings.compactLists}\"\n*ngIf=\"craft.icon !== ''\"\nmatTooltip=\"{{craft.level}} {{craft.stars_tooltip}}\"\nmatTooltipPosition=\"above\" src=\"{{craft.icon}}\">\n+ </a>\n</div>\n</div>\n<div>\n<img [ngClass]=\"{'currency':true, 'compact': settings.compactLists}\"\nmatTooltip=\"{{'Trade' | translate}}\"\nmatTooltipPosition=\"above\"\n- src=\"{{getTradeIcon(item) | icon: 'https://www.garlandtools.org/db/images/Shop.png'}}\">\n+ src=\"{{tradeIcon | icon: 'https://www.garlandtools.org/db/images/Shop.png'}}\">\n</button>\n</div>\n<div *ngIf=\"item.instances !== undefined && item.instances.length > 0\">\n<img class=\"currency\"\nmatTooltip=\"{{'Trade' | translate}}\"\nmatTooltipPosition=\"above\"\n- src=\"{{getTradeIcon(item) | icon: 'https://www.garlandtools.org/db/images/Shop.png'}}\">\n+ src=\"{{tradeIcon | icon: 'https://www.garlandtools.org/db/images/Shop.png'}}\">\n</button>\n</div>\n<div *ngIf=\"item.instances !== undefined && item.instances.length > 0\">\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": "@@ -273,6 +273,8 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\nworksOnIt: any;\n+ public tradeIcon: number;\n+\nconstructor(private i18n: I18nToolsService,\nprivate dialog: MatDialog,\nprivate media: ObservableMedia,\n@@ -325,6 +327,7 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\nngOnInit(): void {\nthis.updateCanBeCrafted();\n+ this.updateTradeIcon();\nthis.updateHasTimers();\nthis.updateMasterBooks();\nthis.updateTimers();\n@@ -341,6 +344,7 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\nngOnChanges(changes: SimpleChanges): void {\nthis.updateCanBeCrafted();\n+ this.updateTradeIcon();\nthis.updateHasTimers();\nthis.updateMasterBooks();\nthis.updateTimers();\n@@ -598,18 +602,21 @@ export class ItemComponent extends ComponentWithSubscriptions implements OnInit,\n});\n}\n- public getTradeIcon(item: ListRow): number {\n+ public updateTradeIcon(): void {\n+ if (this.item.tradeSources !== undefined) {\nconst res = {priority: 0, icon: 0};\n- item.tradeSources.forEach(ts => {\n+ this.item.tradeSources.forEach(ts => {\nts.trades.forEach(trade => {\nconst id = trade.currencyId;\n- if (ItemComponent.TRADE_SOURCES_PRIORITIES[id] !== undefined && ItemComponent.TRADE_SOURCES_PRIORITIES[id] > res.priority) {\n+ if (ItemComponent.TRADE_SOURCES_PRIORITIES[id] !== undefined &&\n+ ItemComponent.TRADE_SOURCES_PRIORITIES[id] > res.priority) {\nres.icon = trade.currencyIcon;\nres.priority = ItemComponent.TRADE_SOURCES_PRIORITIES[id];\n}\n});\n});\n- return res.icon;\n+ this.tradeIcon = res.icon;\n+ }\n}\npublic openTradeDetails(item: ListRow): void {\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": "@@ -5,7 +5,8 @@ import {LocalizedDataService} from '../../../core/data/localized-data.service';\nimport {LinkBase} from '../link-base/link-base.enum';\n@Pipe({\n- name: 'itemLink'\n+ name: 'itemLink',\n+ pure: true\n})\nexport class ItemLinkPipe implements PipeTransform {\n",
"new_path": "src/app/pages/settings/pipe/item-link.pipe.ts",
"old_path": "src/app/pages/settings/pipe/item-link.pipe.ts"
},
{
"change_type": "ADD",
"diff": "+import {Pipe, PipeTransform} from '@angular/core';\n+import {I18nName} from '../../../model/list/i18n-name';\n+import {SettingsService} from '../settings.service';\n+import {LocalizedDataService} from '../../../core/data/localized-data.service';\n+import {Recipe} from '../../../model/list/recipe';\n+\n+@Pipe({\n+ name: 'simulatorLink',\n+ pure: true\n+})\n+export class SimulatorLinkPipe implements PipeTransform {\n+\n+ constructor(private settings: SettingsService, private localizedData: LocalizedDataService) {\n+ }\n+\n+ transform(craft: Recipe): I18nName {\n+ return {\n+ en: `${this.settings.baseSimulatorLink}#/recipe?lang=en&class=${this.getJobName(craft)}&name=${this.localizedData.getItem(craft.itemId).en}`,\n+ fr: `${this.settings.baseSimulatorLink}#/recipe?lang=fr&class=${this.getJobName(craft)}&name=${this.localizedData.getItem(craft.itemId).fr}`,\n+ de: `${this.settings.baseSimulatorLink}#/recipe?lang=de&class=${this.getJobName(craft)}&name=${this.localizedData.getItem(craft.itemId).de}`,\n+ ja: `${this.settings.baseSimulatorLink}#/recipe?lang=ja&class=${this.getJobName(craft)}&name=${this.localizedData.getItem(craft.itemId).ja}`\n+ };\n+ }\n+\n+ getJobName(craft: Recipe): string {\n+ const splitIcon = craft.icon.split('/');\n+ const lowerCaseJobName = splitIcon[splitIcon.length - 1].replace('.png', '');\n+ return lowerCaseJobName.charAt(0).toUpperCase() + lowerCaseJobName.slice(1);\n+ }\n+\n+}\n",
"new_path": "src/app/pages/settings/pipe/simulator-link.pipe.ts",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -8,6 +8,7 @@ import {FormsModule} from '@angular/forms';\nimport {SettingsService} from './settings.service';\nimport {ItemLinkPipe} from './pipe/item-link.pipe';\nimport {FlexLayoutModule} from '@angular/flex-layout';\n+import {SimulatorLinkPipe} from './pipe/simulator-link.pipe';\nconst routing: Routes = [\n{\n@@ -35,12 +36,14 @@ const routing: Routes = [\ndeclarations: [\nSettingsComponent,\nItemLinkPipe,\n+ SimulatorLinkPipe,\n],\nproviders: [\nSettingsService,\n],\nexports: [\nItemLinkPipe,\n+ SimulatorLinkPipe,\n]\n})\nexport class SettingsModule {\n",
"new_path": "src/app/pages/settings/settings.module.ts",
"old_path": "src/app/pages/settings/settings.module.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -20,6 +20,14 @@ export class SettingsService {\nthis.setSetting('base-link', base);\n}\n+ public get baseSimulatorLink(): string {\n+ return this.getSetting('base-simulator-link', 'http://ffxiv-beta.lokyst.net');\n+ }\n+\n+ public set baseSimulatorLink(base: string) {\n+ this.setSetting('base-simulator-link', base);\n+ }\n+\npublic get compactLists(): boolean {\nreturn this.getSetting('compact-lists', 'false') === 'true';\n}\n",
"new_path": "src/app/pages/settings/settings.service.ts",
"old_path": "src/app/pages/settings/settings.service.ts"
},
{
"change_type": "MODIFY",
"diff": "</mat-select>\n</mat-form-field>\n</div>\n+\n+<div class=\"settings-row\">\n+ <mat-form-field>\n+ <mat-select [(ngModel)]=\"settings.baseSimulatorLink\" class=\"select-box\"\n+ placeholder=\"{{'SETTINGS.simulator_link_base' | translate}}\">\n+ <mat-option *ngFor=\"let row of simulatorLinkBases\" [value]=\"row.value\">{{row.name}}</mat-option>\n+ </mat-select>\n+ </mat-form-field>\n+</div>\n+\n<div class=\"settings-row\" fxHide fxShow.gt-sm>\n<mat-checkbox [(ngModel)]=\"settings.compactLists\">{{'SETTINGS.compact_lists' | translate}}</mat-checkbox>\n</div>\n",
"new_path": "src/app/pages/settings/settings/settings.component.html",
"old_path": "src/app/pages/settings/settings/settings.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -16,6 +16,12 @@ export class SettingsComponent {\n// {name: 'Lodestone', value: 'LODESTONE'}, TODO\n];\n+ simulatorLinkBases = [\n+ {name: 'lokyst', value: 'http://ffxiv-beta.lokyst.net'},\n+ {name: 'ermad', value: 'https://ermad.github.io/ffxiv-craft-opt-web/app'},\n+ {name: 'ryan20340', value: 'https://ryan20340.github.io/app'},\n+ ];\n+\nthemes = ['dark-orange', 'light-orange', 'light-teal', 'dark-teal', 'light-brown',\n'light-amber', 'dark-amber', 'light-green', 'dark-lime', 'light-lime',\n'dark-cyan', 'light-cyan', 'dark-indigo', 'light-indigo', 'dark-blue', 'light-blue',\n",
"new_path": "src/app/pages/settings/settings/settings.component.ts",
"old_path": "src/app/pages/settings/settings/settings.component.ts"
},
{
"change_type": "MODIFY",
"diff": "\"List_selection_title\": \"Select lists to add to workshop {{workshopName}}\",\n\"Name_dialog\": \"Workshop name\",\n\"Created_by\": \"Created by {{name}}\",\n- \"Share_link_copied\": \"Workshop share link copied\"\n+ \"Share_link_copied\": \"Workshop share link copied\",\n+ \"Not_found\": \"Workshop not found or you don't have access to it\"\n},\n\"ABOUT\": {\n\"title\": \"About\",\n\"Character_not_found\": \"Character not found\",\n\"List_forked\": \"List copied to your account\",\n\"List_fork\": \"Copy this list to your account\",\n- \"List_not_found\": \"List not found\",\n+ \"List_not_found\": \"List not found or you don't have access to it\",\n\"Requirements_for_craft\": \"See requirements\",\n\"Zone_breakdown\": \"Area breakdown\",\n\"Timer_options\": \"Timer options\",\n},\n\"PERMISSIONS\": {\n\"Read\": \"Read\",\n- \"Title\": \"Permissions management\",\n+ \"Read_description\": \"The ability to see the list\",\n\"Participate\": \"Participate\",\n+ \"Participate_description\": \"This gives you permission to tick items and modify amounts done\",\n\"Write\": \"Write\",\n+ \"Write_description\": \"This gives you the permission to add items, add lists (for workshops)\",\n+ \"Title\": \"Permissions management\",\n\"Everyone\": \"Everyone\",\n\"You\": \"You\",\n\"Add_new\": \"Add a user\",\n- \"Placeholder\": \"Email or User ID\"\n+ \"Placeholder\": \"Email or User ID\",\n+ \"Bind_free_company\": \"Bind some permissions to your Free Company\"\n}\n}\n",
"new_path": "src/assets/i18n/en.json",
"old_path": "src/assets/i18n/en.json"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
feat: craft icons now have a link to simulator
| 1
|
feat
| null |
217,922
|
15.04.2018 19:27:18
| -7,200
|
b8dccc977075a22cbb0c4350e907640ba46490b3
|
feat: you can now create alarms from the gathering location finder
closes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -42,6 +42,10 @@ export class BellNodesService {\n}\ngetNode(id: number): any {\n- return this.nodes.find(node => node.id === id);\n+ const node = this.nodes.find(n => n.id === id);\n+ node.itemId = id;\n+ node.zoneid = this.localizedDataService.getAreaIdByENName(node.zone);\n+ node.areaid = this.localizedDataService.getAreaIdByENName(node.title);\n+ return node;\n}\n}\n",
"new_path": "src/app/core/data/bell-nodes.service.ts",
"old_path": "src/app/core/data/bell-nodes.service.ts"
},
{
"change_type": "MODIFY",
"diff": "</mat-card-subtitle>\n</mat-card-header>\n<div class=\"timed\" *ngIf=\"node.timed\">\n+ <button mat-raised-button color=\"accent\" (click)=\"createAlarm(node, row)\">\n<mat-icon>access_alarm</mat-icon>\n+ {{'ALARMS.Add_alarm' | translate}}\n+ </button>\n<div class=\"spawns\">\n<span *ngFor=\"let spawn of getSpawns(node); let first = first\">\n<span *ngIf=\"!first\"> / </span>\n",
"new_path": "src/app/pages/gathering-location/gathering-location/gathering-location.component.html",
"old_path": "src/app/pages/gathering-location/gathering-location/gathering-location.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -6,6 +6,11 @@ import 'rxjs/add/observable/fromEvent';\nimport {ObservableMedia} from '@angular/flex-layout';\nimport {BellNodesService} from '../../../core/data/bell-nodes.service';\nimport {AlarmCardComponent} from '../../alarms/alarm-card/alarm-card.component';\n+import {AlarmService} from '../../../core/time/alarm.service';\n+import {Alarm} from '../../../core/time/alarm';\n+import {MatSnackBar} from '@angular/material';\n+import {TranslateService} from '@ngx-translate/core';\n+import {LocalizedDataService} from '../../../core/data/localized-data.service';\n@Component({\nselector: 'app-gathering-location',\n@@ -22,7 +27,9 @@ export class GatheringLocationComponent implements OnInit {\nsearching = false;\n- constructor(private dataService: DataService, private media: ObservableMedia, private bell: BellNodesService) {\n+ constructor(private dataService: DataService, private media: ObservableMedia, private bell: BellNodesService,\n+ private alarmService: AlarmService, private snack: MatSnackBar, private translator: TranslateService,\n+ private localizedDataService: LocalizedDataService) {\n}\nngOnInit() {\n@@ -41,7 +48,8 @@ export class GatheringLocationComponent implements OnInit {\nitem.nodes = Object.keys(nodePositions)\n.map(key => {\nconst node = nodePositions[key];\n- node.id = key;\n+ node.id = +key;\n+ node.itemId = item.obj.i;\nreturn node;\n})\n.filter(row => {\n@@ -71,6 +79,31 @@ export class GatheringLocationComponent implements OnInit {\n.do(() => this.searching = false);\n}\n+ createAlarm(nodeInput: any): void {\n+ const node = this.bell.getNode(nodeInput.id);\n+ const match = node.items.find(item => item.id === +nodeInput.itemId);\n+ node.icon = match.icon;\n+ node.slot = +match.slot;\n+ const alarms: Alarm[] = [];\n+ if (node.time !== undefined) {\n+ node.time.forEach(spawn => {\n+ alarms.push({\n+ spawn: spawn,\n+ duration: node.uptime / 60,\n+ itemId: node.itemId,\n+ icon: node.icon,\n+ slot: node.slot,\n+ areaId: node.areaid,\n+ coords: node.coords,\n+ zoneId: node.zoneid,\n+ type: this.alarmService.getType(node),\n+ });\n+ });\n+ }\n+ this.alarmService.registerAlarms(...alarms);\n+ this.snack.open(this.translator.instant('ALARMS.Alarm_created'), '', {duration: 3000});\n+ }\n+\ngetClassIcon(type: number): string {\nreturn AlarmCardComponent.icons[type];\n}\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"
},
{
"change_type": "MODIFY",
"diff": "},\n\"ALARMS\": {\n\"No_alarm\": \"No alarms set\",\n- \"Add_alarm\": \"Add alarm\"\n+ \"Add_alarm\": \"Add alarm\",\n+ \"Alarm_created\": \"Alarm created\"\n},\n\"Item_name\": \"Item name\",\n\"No_items_found\": \"No item found\",\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 create alarms from the gathering location finder
closes #286
| 1
|
feat
| null |
217,922
|
15.04.2018 19:45:30
| -7,200
|
1de6208cb26fc0f1f39798667a8b381de3dff9f2
|
feat: it's now possible to enable tracking on crystals
closes
|
[
{
"change_type": "MODIFY",
"diff": "<mat-expansion-panel class=\"panel\">\n<mat-expansion-panel-header>\n<mat-panel-title>{{'Crystals'| translate}}</mat-panel-title>\n+ <mat-checkbox [(ngModel)]=\"settings.crystalsTracking\" (click)=\"$event.stopPropagation()\" class=\"crystals-toggle\">\n+ {{'LIST.Enable_crystals_tracking' | translate}}\n+ </mat-checkbox>\n</mat-expansion-panel-header>\n- <div class=\"crystal-row\" *ngFor=\"let crystal of listData?.crystals\">\n- <div *ngIf=\"crystal.amount > crystal.done\">\n+ <div *ngFor=\"let crystal of listData?.crystals\" class=\"crystals\">\n+ <div *ngIf=\"crystal.amount > crystal.done\" class=\"crystal-row\"\n+ [class.mat-elevation-z8]=\"settings.crystalsTracking\" [class.tracked]=\"settings.crystalsTracking\">\n<img [ngClass]=\"{'crystal':true, 'compact': settings.compactLists}\"\nmatTooltip=\"{{crystal.id | itemName | i18n}}\" matTooltipPosition=\"above\"\nsrc=\"{{crystal.icon | icon}}\" alt=\"{{crystal.id | itemName | i18n}}\">\n- <div>{{(crystal.amount - crystal.done) | ceil}}</div>\n+ <div *ngIf=\"!settings.crystalsTracking\">\n+ {{(crystal.amount - crystal.done) | ceil}}\n+ </div>\n+ <div *ngIf=\"settings.crystalsTracking\">\n+ <app-amount-input max=\"{{crystal.amount}}\"\n+ maxlength=\"{{crystal.amount?.toString().length}}\"\n+ min=\"0\"\n+ (onchange)=\"setDone(listData, {row: crystal, preCraft: false, amount: $event - crystal.done})\"\n+ [value]=\"crystal.done | ceil\"></app-amount-input>\n+ </div>\n</div>\n</div>\n</mat-expansion-panel>\n",
"new_path": "src/app/pages/list/list-details/list-details.component.html",
"old_path": "src/app/pages/list/list-details/list-details.component.html"
},
{
"change_type": "MODIFY",
"diff": "flex: 1 1 auto;\n}\n-.crystal-row {\n+.crystals {\ndisplay: inline-block;\ntext-align: center;\n+ .crystal-row {\n+ &.tracked{\n+ padding: 10px;\n+ margin: 0 10px;\n+ }\n.crystal {\nmargin: 0 5px;\nwidth: 40px;\n}\n}\n+}\n+\n+.crystals-toggle {\n+ margin-right: 10px;\n+}\n+\n.panel {\nmargin: 10px 0;\n}\n",
"new_path": "src/app/pages/list/list-details/list-details.component.scss",
"old_path": "src/app/pages/list/list-details/list-details.component.scss"
},
{
"change_type": "MODIFY",
"diff": "@@ -28,6 +28,14 @@ export class SettingsService {\nthis.setSetting('base-simulator-link', base);\n}\n+ public get crystalsTracking(): boolean {\n+ return this.getSetting('crystals-tracking', 'false') === 'true';\n+ }\n+\n+ public set crystalsTracking(enabled: boolean) {\n+ this.setSetting('crystals-tracking', enabled.toString());\n+ }\n+\npublic get compactLists(): boolean {\nreturn this.getSetting('compact-lists', 'false') === 'true';\n}\n",
"new_path": "src/app/pages/settings/settings.service.ts",
"old_path": "src/app/pages/settings/settings.service.ts"
},
{
"change_type": "MODIFY",
"diff": "}\n},\n\"LIST\": {\n- \"Copied_x_times\": \"Copied {{count}} times\"\n+ \"Copied_x_times\": \"Copied {{count}} times\",\n+ \"Enable_crystals_tracking\": \"Enable crystals tracking\"\n},\n\"LIST_DETAILS\": {\n\"Missing_tags_before_button\": \"This list is shown as community list but has no tags, please add some tags using \",\n",
"new_path": "src/assets/i18n/en.json",
"old_path": "src/assets/i18n/en.json"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
feat: it's now possible to enable tracking on crystals
closes #254
| 1
|
feat
| null |
217,922
|
15.04.2018 20:07:19
| -7,200
|
f06116b8bd7127a2e734077fc92a6834ee902000
|
chore: preparing thinigs for
|
[
{
"change_type": "MODIFY",
"diff": "@@ -77,6 +77,15 @@ export class SettingsService {\nthis.setSetting('alarm:hours-before', hours.toString());\n}\n+ public get preferredStartingPint(): number {\n+ // Default value is Rhalgr's reach, 2403\n+ return +this.getSetting('preferred-starting-point', '2403');\n+ }\n+\n+ public set preferredStartingPint(id: number) {\n+ this.setSetting('preferred-starting-point', id.toString());\n+ }\n+\npublic get alarmSound(): string {\nreturn this.getSetting('alarm:sound', 'Notification');\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
|
chore: preparing thinigs for #313
| 1
|
chore
| null |
217,922
|
15.04.2018 20:07:39
| -7,200
|
dcdc145562011bbfe7c59a1b481f183bde00e0f9
|
chore: 3.5.0 translations
|
[
{
"change_type": "MODIFY",
"diff": "<div mat-dialog-actions>\n<button mat-raised-button [mat-dialog-close]=\"result?.user\" color=\"primary\"\n[disabled]=\"notFound || result === undefined\">\n- {{'PERMISSIONS.Add_confirm' | translate}}\n+ {{'PERMISSIONS.Confirm' | translate}}\n</button>\n<button mat-button mat-dialog-close color=\"warn\">\n{{'Cancel' | translate}}\n",
"new_path": "src/app/modules/common-components/permissions-popup/add-new-row-popup/add-new-row-popup.component.html",
"old_path": "src/app/modules/common-components/permissions-popup/add-new-row-popup/add-new-row-popup.component.html"
},
{
"change_type": "MODIFY",
"diff": "<div class=\"settings-row\">\n<mat-form-field>\n<mat-select [(ngModel)]=\"settings.baseSimulatorLink\" class=\"select-box\"\n- placeholder=\"{{'SETTINGS.simulator_link_base' | translate}}\">\n+ placeholder=\"{{'SETTINGS.Simulator_link_base' | translate}}\">\n<mat-option *ngFor=\"let row of simulatorLinkBases\" [value]=\"row.value\">{{row.name}}</mat-option>\n</mat-select>\n</mat-form-field>\n",
"new_path": "src/app/pages/settings/settings/settings.component.html",
"old_path": "src/app/pages/settings/settings/settings.component.html"
},
{
"change_type": "MODIFY",
"diff": "\"link_base\": \"Item links\",\n\"compact_lists\": \"Compact list display\",\n\"theme\": \"Theme\",\n- \"ffxivcrafting_display\": \"FFXIVcrafting.com-like amounts\"\n+ \"ffxivcrafting_display\": \"FFXIVcrafting.com-like amounts\",\n+ \"Simulator_link_base\": \"Simulator link\"\n},\n\"PROFILE\": {\n\"Masterbooks\": \"Masterbooks\",\n\"You\": \"You\",\n\"Add_new\": \"Add a user\",\n\"Placeholder\": \"Email or User ID\",\n- \"Bind_free_company\": \"Bind some permissions to your Free Company\"\n+ \"Bind_free_company\": \"Bind some permissions to your Free Company\",\n+ \"User_not_found\": \"User not found\"\n}\n}\n",
"new_path": "src/assets/i18n/en.json",
"old_path": "src/assets/i18n/en.json"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore: 3.5.0 translations
| 1
|
chore
| null |
679,913
|
15.04.2018 20:44:59
| -3,600
|
619b4b37fd3be56aea4a02930dfdae9c3afd82ca
|
feat(rstream-graph): 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/rstream-graph/.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/rstream-graph/LICENSE",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+# @thi.ng/rstream-graph\n+\n+[](https://www.npmjs.com/package/@thi.ng/rstream-graph)\n+\n+This project is part of the\n+[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.\n+\n+## About\n+\n+Declarative, reactive dataflow graph construction using\n+[@thi.ng/rstream](https://github.com/thi-ng/umbrella/tree/master/packages/rstream)\n+&\n+[@thi.ng/atom](https://github.com/thi-ng/umbrella/tree/master/packages/atom)\n+primitives.\n+\n+## Installation\n+\n+```\n+yarn add @thi.ng/rstream-graph\n+```\n+\n+## Usage examples\n+\n+```typescript\n+import { Atom } from \"@thi.ng/atom\";\n+import * as rs from \"@thi.ng/rstream\";\n+import * as rsg from \"@thi.ng/rstream-graph\";\n+\n+// (optional) state atom to source value change streams from\n+const state = new Atom({a: 1, b: 2});\n+\n+// graph declaration / definition\n+const graph = rsg.initGraph(state, {\n+ // this node sources both of its inputs\n+ // from values in the state atom\n+ add: {\n+ fn: rsg.add,\n+ ins: [\n+ { path: \"a\" },\n+ { path: \"b\" }\n+ ],\n+ },\n+ // this node receives values from the `add` node\n+ // and the given iterable\n+ mul: {\n+ fn: rsg.mul,\n+ ins: [\n+ { stream: \"add\" },\n+ { stream: () => rs.fromIterable([10, 20, 30]) }\n+ ],\n+ }\n+});\n+\n+// (optional) subscribe to individual nodes\n+graph.mul.subscribe({\n+ next: (x) => console.log(\"result:\", x)\n+});\n+\n+// result: 30\n+// result: 60\n+// result: 90\n+\n+// changes in subscribed atom values flow through the graph\n+state.resetIn(\"a\", 10);\n+// result: 360\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/rstream-graph/README.md",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"@thi.ng/rstream-graph\",\n+ \"version\": \"0.0.1\",\n+ \"description\": \"Declarative dataflow graph construction for @thi.ng/rstream\",\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 nodes\",\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.0.0\",\n+ \"@types/node\": \"^9.6.1\",\n+ \"mocha\": \"^5.0.5\",\n+ \"nyc\": \"^11.6.0\",\n+ \"typedoc\": \"^0.11.1\",\n+ \"typescript\": \"^2.8.1\"\n+ },\n+ \"dependencies\": {\n+ \"@thi.ng/api\": \"^2.2.0\",\n+ \"@thi.ng/paths\": \"^1.1.6\",\n+ \"@thi.ng/resolve-map\": \"^0.1.7\",\n+ \"@thi.ng/rstream\": \"^1.2.9\",\n+ \"@thi.ng/transducers\": \"^1.8.0\"\n+ },\n+ \"keywords\": [\n+ \"compute\",\n+ \"dataflow\",\n+ \"ES6\",\n+ \"graph\",\n+ \"reactive\",\n+ \"rstream\",\n+ \"typescript\"\n+ ],\n+ \"publishConfig\": {\n+ \"access\": \"public\"\n+ }\n+}\n\\ No newline at end of file\n",
"new_path": "packages/rstream-graph/package.json",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { ISubscribable } from \"@thi.ng/rstream/api\";\n+import { Transducer } from \"@thi.ng/transducers/api\";\n+import { IObjectOf } from \"@thi.ng/api/api\";\n+\n+export type MultiInputNodeFn<T> = (src: ISubscribable<any>[]) => ISubscribable<T>;\n+\n+/**\n+ * A dataflow graph spec is simply an object where keys are node names\n+ * and their values are NodeSpec's, defining inputs and the operation to\n+ * be applied to produce a result stream.\n+ */\n+export type GraphSpec = IObjectOf<NodeSpec>;\n+\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+ *\n+ * The `fn` function is responsible to produce such a stream construct.\n+ *\n+ * See `initGraph` and `nodeFromSpec` for more details (in /src/nodes.ts)\n+ */\n+export interface NodeSpec {\n+ fn: (src: ISubscribable<any>[]) => ISubscribable<any>;\n+ ins: NodeInput[];\n+ out?: NodeOutput;\n+}\n+\n+/**\n+ * Specification for a single input, which can be given in different\n+ * ways:\n+ *\n+ * 1) Create a stream for given path in state atom (passed to\n+ * `initGraph`):\n+ *\n+ * ```\n+ * { path: \"nested.src.path\" }\n+ * ```\n+ *\n+ * 2) Reference another node in the GraphSpec object:\n+ *\n+ * ```\n+ * { stream: \"node-id\" }\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+ *\n+ * ```\n+ * { stream: (resolve) => resolve(\"src\").subscribe(map(x => x * 10)) }\n+ * ```\n+ *\n+ * 4) Provide an external input stream:\n+ *\n+ * ```\n+ * { stream: () => fromIterable([1,2,3], 500) }\n+ * ```\n+ *\n+ * 5) Single value input stream:\n+ *\n+ * ```\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+ *\n+ * If the optional `id` is specified, a dummy subscription with the ID\n+ * is added to the input and used as input instead. This allows for\n+ * local renaming of inputs and is needed for some ops (e.g.\n+ * `StreamSync` based nodes).\n+ */\n+export interface NodeInput {\n+ id?: string;\n+ path?: string;\n+ stream?: string | ((resolve) => ISubscribable<any>);\n+ const?: any;\n+ xform?: Transducer<any, any>;\n+}\n+\n+export type NodeOutput = string | ((node: ISubscribable<any>) => void);\n",
"new_path": "packages/rstream-graph/src/api.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { IObjectOf } from \"@thi.ng/api/api\";\n+import { illegalArgs } from \"@thi.ng/api/error\";\n+import { IAtom } from \"@thi.ng/atom/api\";\n+import { isString } from \"@thi.ng/checks/is-string\";\n+import { resolveMap } from \"@thi.ng/resolve-map\";\n+import { ISubscribable } from \"@thi.ng/rstream/api\";\n+import { fromIterableSync } from \"@thi.ng/rstream/from/iterable\";\n+import { fromView } from \"@thi.ng/rstream/from/view\";\n+import { sync, StreamSync } from \"@thi.ng/rstream/stream-sync\";\n+import { Transducer } from \"@thi.ng/transducers/api\";\n+\n+import { NodeSpec } from \"./api\";\n+import { Subscription } from \"../../rstream/subscription\";\n+\n+/**\n+ * Dataflow graph initialization function. Takes an object of\n+ * NodeSpec's, calls `nodeFromSpec` for each and then recursively\n+ * resolves references via `@thi.ng/resolve-map/resolveMap`. Returns\n+ * updated graph object (mutates in-place, original specs are replaced\n+ * by stream constructs).\n+ *\n+ * @param state\n+ * @param nodes\n+ */\n+export const initGraph = (state: IAtom<any>, nodes: IObjectOf<NodeSpec>): IObjectOf<ISubscribable<any>> => {\n+ for (let k in nodes) {\n+ (<any>nodes)[k] = nodeFromSpec(state, nodes[k]);\n+ }\n+ return resolveMap(nodes);\n+};\n+\n+/**\n+ * Transforms a single NodeSpec into a lookup function for `resolveMap`\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. If the spec\n+ * includes the optional `out` key, it also executes the provided\n+ * function, or if the value is a string, adds a subscription to this\n+ * node's result stream which then updates the provide state atom at the\n+ * path defined by `out`. Returns an ISubscribable.\n+ *\n+ * See `api.ts` for further details and possible spec variations.\n+ *\n+ * @param spec\n+ */\n+const nodeFromSpec = (state: IAtom<any>, spec: NodeSpec) => (resolve) => {\n+ const src: ISubscribable<any>[] = [];\n+ for (let i of spec.ins) {\n+ let s;\n+ if (i.path) {\n+ s = fromView(state, i.path);\n+ } else if (i.stream) {\n+ s = isString(i.stream) ? resolve(i.stream) : i.stream(resolve);\n+ } else if (i.const) {\n+ s = fromIterableSync([i.const]);\n+ } else {\n+ illegalArgs(`invalid node spec`);\n+ }\n+ if (i.xform) {\n+ s = s.subscribe(i.xform, i.id);\n+ } else if (i.id) {\n+ s = s.subscribe({}, i.id);\n+ }\n+ src.push(s);\n+ }\n+ const node = spec.fn(src);\n+ if (spec.out) {\n+ if (isString(spec.out)) {\n+ ((path) => node.subscribe({ next: (x) => state.resetIn(path, x) }))(spec.out);\n+ } else {\n+ spec.out(node);\n+ }\n+ }\n+ return node;\n+};\n+\n+/**\n+ * Higher order node / stream creator. Takes a transducer and optional\n+ * arity (number of required input streams). The returned function takes\n+ * an array of input streams and returns a new\n+ * @thi.ng/rstream/StreamSync instance.\n+ *\n+ * @param xform\n+ * @param arity\n+ */\n+export const node = (xform: Transducer<IObjectOf<any>, any>, arity?: number) =>\n+ (src: ISubscribable<any>[]): StreamSync<any, any> => {\n+ if (arity !== undefined && src.length !== arity) {\n+ illegalArgs(`wrong number of inputs: got ${src.length}, but needed ${arity}`);\n+ }\n+ return sync({ src, xform, reset: false });\n+ };\n+\n+/**\n+ * Syntax sugar / helper fn for nodes using only single input.\n+ *\n+ * @param xform\n+ */\n+export const node1 = (xform: Transducer<any, any>) =>\n+ ([src]: ISubscribable<any>[]): Subscription<any, any> => src.subscribe(xform);\n",
"new_path": "packages/rstream-graph/src/graph.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+export * from \"./api\";\n+export * from \"./graph\";\n+\n+export * from \"./nodes/extract\";\n+export * from \"./nodes/math\";\n",
"new_path": "packages/rstream-graph/src/index.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { Path, getIn } from \"@thi.ng/paths\";\n+import { map } from \"@thi.ng/transducers/xform/map\";\n+\n+import { MultiInputNodeFn } from \"../api\";\n+import { node1 } from \"../graph\";\n+\n+/**\n+ * Nested value extraction node. Higher order function.\n+ *\n+ * Inputs: 1\n+ */\n+export const extract = (path: Path): MultiInputNodeFn<any> =>\n+ node1(map((x) => getIn(x, path)));\n",
"new_path": "packages/rstream-graph/src/nodes/extract.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+import { IObjectOf } from \"@thi.ng/api/api\";\n+import { map } from \"@thi.ng/transducers/xform/map\";\n+\n+import { MultiInputNodeFn } from \"../api\";\n+import { node } from \"../graph\";\n+\n+/**\n+ * Addition node.\n+ *\n+ * Inputs: any\n+ */\n+export const add: MultiInputNodeFn<number> = node(\n+ map((ports: IObjectOf<number>) => {\n+ let acc = 0;\n+ let v;\n+ for (let p in ports) {\n+ if ((v = ports[p]) == null) return;\n+ acc += v;\n+ }\n+ return acc;\n+ }));\n+\n+/**\n+ * Multiplication node.\n+ *\n+ * Inputs: any\n+ */\n+export const mul: MultiInputNodeFn<number> = node(\n+ map((ports: IObjectOf<number>) => {\n+ let acc = 1;\n+ let v;\n+ for (let p in ports) {\n+ if ((v = ports[p]) == null) return;\n+ acc *= v;\n+ }\n+ return acc;\n+ }));\n+\n+/**\n+ * Subtraction node.\n+ *\n+ * Inputs: 2\n+ */\n+export const sub: MultiInputNodeFn<number> =\n+ node(map((ports: IObjectOf<number>) => ports.a - ports.b), 2);\n+\n+/**\n+ * Division node.\n+ *\n+ * Inputs: 2\n+ */\n+export const div: MultiInputNodeFn<number> =\n+ node(map((ports: IObjectOf<number>) => ports.a / ports.b), 2);\n",
"new_path": "packages/rstream-graph/src/nodes/math.ts",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+// import * as assert from \"assert\";\n+// import * as rsg from \"../src/index\";\n+\n+describe(\"rstream-graph\", () => {\n+ it(\"tests pending\");\n+});\n",
"new_path": "packages/rstream-graph/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/rstream-graph/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/rstream-graph/tsconfig.json",
"old_path": null
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(rstream-graph): initial import @thi.ng/rstream-graph
| 1
|
feat
|
rstream-graph
|
679,913
|
15.04.2018 20:51:32
| -3,600
|
a00639929dc448783dd9deb4d0dcd08ee1f45c94
|
refactor(examples): simplify rstream-dataflow example
|
[
{
"change_type": "MODIFY",
"diff": "\"@thi.ng/atom\": \"latest\",\n\"@thi.ng/hdom\": \"latest\",\n\"@thi.ng/paths\": \"latest\",\n- \"@thi.ng/resolve-map\": \"latest\",\n\"@thi.ng/rstream\": \"latest\",\n\"@thi.ng/rstream-gestures\": \"latest\",\n+ \"@thi.ng/rstream-graph\": \"latest\",\n\"@thi.ng/transducers\": \"latest\"\n}\n}\n\\ No newline at end of file\n",
"new_path": "examples/rstream-dataflow/package.json",
"old_path": "examples/rstream-dataflow/package.json"
},
{
"change_type": "DELETE",
"diff": "-import { ISubscribable } from \"@thi.ng/rstream/api\";\n-import { Transducer } from \"@thi.ng/transducers/api\";\n-import { IObjectOf } from \"@thi.ng/api/api\";\n-\n-/**\n- * A dataflow graph spec is simply an object where keys are node names\n- * and their values are NodeSpec's, defining inputs and the operation to\n- * be applied to produce a result stream.\n- */\n-export type GraphSpec = IObjectOf<NodeSpec>;\n-\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- *\n- * The `fn` function is responsible to produce such a stream construct.\n- *\n- * See `initGraph` and `nodeFromSpec` for more details (in /src/nodes.ts)\n- */\n-export interface NodeSpec {\n- fn: (src: ISubscribable<any>[]) => ISubscribable<any>;\n- ins: NodeInput[];\n- out?: NodeOutput;\n-}\n-\n-/**\n- * Specification for a single input, which can be given in different\n- * ways:\n- *\n- * 1) Create a stream for given path in state atom (passed to\n- * `initGraph`):\n- *\n- * ```\n- * { path: \"nested.src.path\" }\n- * ```\n- *\n- * 2) Reference another node in the GraphSpec object:\n- *\n- * ```\n- * { stream: \"node-id\" }\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- *\n- * ```\n- * { stream: (resolve) => resolve(\"src\").subscribe(map(x => x * 10)) }\n- * ```\n- *\n- * 4) Provide an external input stream:\n- *\n- * ```\n- * { stream: () => fromIterable([1,2,3], 500) }\n- * ```\n- *\n- * 5) Single value input stream:\n- *\n- * ```\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- *\n- * If the optional `id` is specified, a dummy subscription with the ID\n- * is added to the input and used as input instead. This allows for\n- * local renaming of inputs and is needed for some ops (e.g.\n- * `StreamSync` based nodes).\n- */\n-export interface NodeInput {\n- id?: string;\n- path?: string;\n- stream?: string | ((resolve) => ISubscribable<any>);\n- const?: any;\n- xform?: Transducer<any, any>;\n-}\n-\n-export type NodeOutput = string | ((node: ISubscribable<any>) => void);\n",
"new_path": null,
"old_path": "examples/rstream-dataflow/src/api.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -4,12 +4,14 @@ import { start } from \"@thi.ng/hdom\";\nimport { getIn } from \"@thi.ng/paths\";\nimport { fromRAF } from \"@thi.ng/rstream/from/raf\";\nimport { gestureStream } from \"@thi.ng/rstream-gestures\";\n+import { initGraph, node, node1 } from \"@thi.ng/rstream-graph/graph\";\n+import { extract } from \"@thi.ng/rstream-graph/nodes/extract\";\n+import { mul } from \"@thi.ng/rstream-graph/nodes/math\";\nimport { comp } from \"@thi.ng/transducers/func/comp\";\nimport { choices } from \"@thi.ng/transducers/iter/choices\";\nimport { dedupe } from \"@thi.ng/transducers/xform/dedupe\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\n-import { extract, initGraph, node, node1, mul } from \"./nodes\";\nimport { circle } from \"./circle\";\n// infinite iterator of randomized colors (Tachyons CSS class names)\n",
"new_path": "examples/rstream-dataflow/src/index.ts",
"old_path": "examples/rstream-dataflow/src/index.ts"
},
{
"change_type": "DELETE",
"diff": "-import { IObjectOf } from \"@thi.ng/api/api\";\n-import { illegalArgs } from \"@thi.ng/api/error\";\n-import { IAtom } from \"@thi.ng/atom/api\";\n-import { isString } from \"@thi.ng/checks/is-string\";\n-import { Path, getIn } from \"@thi.ng/paths\";\n-import { resolveMap } from \"@thi.ng/resolve-map\";\n-import { ISubscribable } from \"@thi.ng/rstream/api\";\n-import { fromIterableSync } from \"@thi.ng/rstream/from/iterable\";\n-import { fromView } from \"@thi.ng/rstream/from/view\";\n-import { sync } from \"@thi.ng/rstream/stream-sync\";\n-import { map } from \"@thi.ng/transducers/xform/map\";\n-import { Transducer } from \"@thi.ng/transducers/api\";\n-\n-import { NodeSpec } from \"./api\";\n-\n-/**\n- * Dataflow graph initialization function. Takes an object of\n- * NodeSpec's, calls `nodeFromSpec` for each and then recursively\n- * resolves references via `@thi.ng/resolve-map/resolveMap`. Returns\n- * updated graph object (mutates in-place, original specs are replaced\n- * by stream constructs).\n- *\n- * @param state\n- * @param nodes\n- */\n-export const initGraph = (state: IAtom<any>, nodes: IObjectOf<NodeSpec>): IObjectOf<ISubscribable<any>> => {\n- for (let k in nodes) {\n- (<any>nodes)[k] = nodeFromSpec(state, nodes[k]);\n- }\n- return resolveMap(nodes);\n-};\n-\n-/**\n- * Transforms a single NodeSpec into a lookup function for `resolveMap`\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. If the spec\n- * includes the optional `out` key, it also executes the provided\n- * function, or if the value is a string, adds a subscription to this\n- * node's result stream which then updates the provide state atom at the\n- * path defined by `out`. Returns an ISubscribable.\n- *\n- * See `api.ts` for further details and possible spec variations.\n- *\n- * @param spec\n- */\n-const nodeFromSpec = (state: IAtom<any>, spec: NodeSpec) => (resolve) => {\n- const src: ISubscribable<any>[] = [];\n- for (let i of spec.ins) {\n- let s;\n- if (i.path) {\n- s = fromView(state, i.path);\n- } else if (i.stream) {\n- s = isString(i.stream) ? resolve(i.stream) : i.stream(resolve);\n- } else if (i.const) {\n- s = fromIterableSync([i.const]);\n- } else {\n- illegalArgs(`invalid node spec`);\n- }\n- if (i.xform) {\n- s = s.subscribe(i.xform, i.id);\n- } else if (i.id) {\n- s = s.subscribe({}, i.id);\n- }\n- src.push(s);\n- }\n- const node = spec.fn(src);\n- if (spec.out) {\n- if (isString(spec.out)) {\n- ((path) => node.subscribe({ next: (x) => state.resetIn(path, x) }))(spec.out);\n- } else {\n- spec.out(node);\n- }\n- }\n- return node;\n-};\n-\n-/**\n- * Higher order node / stream creator. Takes a transducer and optional\n- * arity (number of required input streams). The returned function takes\n- * an array of input streams and returns a new\n- * @thi.ng/rstream/StreamSync instance.\n- *\n- * @param xform\n- * @param arity\n- */\n-export const node = (xform: Transducer<IObjectOf<any>, any>, arity?: number) =>\n- (src: ISubscribable<any>[]) => {\n- if (arity !== undefined && src.length !== arity) {\n- illegalArgs(`wrong number of inputs: got ${src.length}, but needed ${arity}`);\n- }\n- return sync({ src, xform, reset: false });\n- };\n-\n-/**\n- * Syntax sugar / helper fn for nodes using only single input.\n- *\n- * @param xform\n- */\n-export const node1 = (xform: Transducer<any, any>) =>\n- ([src]: ISubscribable<any>[]) => src.subscribe(xform);\n-\n-/**\n- * Addition node. Supports any number of inputs.\n- * Currently unused, but illustrates use of `node` HOF.\n- */\n-export const add = node(\n- map((ports: IObjectOf<number>) => {\n- let acc = 0;\n- let v;\n- for (let p in ports) {\n- if ((v = ports[p]) == null) return;\n- acc += v;\n- }\n- return acc;\n- }));\n-\n-/**\n- * Multiplication node. Supports any number of inputs.\n- * Currently unused, but illustrates use of `node` HOF.\n- */\n-export const mul = node(\n- map((ports: IObjectOf<number>) => {\n- let acc = 1;\n- let v;\n- for (let p in ports) {\n- if ((v = ports[p]) == null) return;\n- acc *= v;\n- }\n- return acc;\n- }));\n-\n-/**\n- * Substraction node. 2 inputs.\n- * Currently unused, but illustrates use of `node` HOF.\n- */\n-export const sub = node(map((ports: IObjectOf<number>) => ports.a - ports.b), 2);\n-\n-/**\n- * Division node. 2 inputs.\n- * Currently unused, but illustrates use of `node` HOF.\n- */\n-export const div = node(map((ports: IObjectOf<number>) => ports.a / ports.b), 2);\n-\n-/**\n- * Nested value extraction node. Higher order function. Only 1 input.\n- */\n-export const extract = (path: Path) => node1(map((x) => getIn(x, path)));\n\\ No newline at end of file\n",
"new_path": null,
"old_path": "examples/rstream-dataflow/src/nodes.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(examples): simplify rstream-dataflow example
| 1
|
refactor
|
examples
|
679,913
|
15.04.2018 21:49:23
| -3,600
|
2164ddfdc49ad854e2aeae35546b2f96e42b27c2
|
feat(rstream): add Subscription.transform()
|
[
{
"change_type": "MODIFY",
"diff": "import { illegalArity, illegalState } from \"@thi.ng/api/error\";\nimport { isFunction } from \"@thi.ng/checks/is-function\";\nimport { implementsFunction } from \"@thi.ng/checks/implements-function\";\n+import { isString } from \"@thi.ng/checks/is-string\";\nimport { Reducer, Transducer, SEMAPHORE } from \"@thi.ng/transducers/api\";\n+import { comp } from \"@thi.ng/transducers/func/comp\";\nimport { push } from \"@thi.ng/transducers/rfn/push\";\nimport { isReduced, unreduced } from \"@thi.ng/transducers/reduced\";\n@@ -45,6 +47,10 @@ export class Subscription<A, B> implements\nreturn this.state;\n}\n+ /**\n+ * Creates new child subscription with given subscriber and/or\n+ * transducer and optional subscription ID.\n+ */\nsubscribe(sub: Partial<ISubscriber<B>>, id?: string): Subscription<B, B>\nsubscribe<C>(xform: Transducer<B, C>, id?: string): Subscription<B, C>;\nsubscribe<C>(sub: Partial<ISubscriber<C>>, xform: Transducer<B, C>, id?: string): Subscription<B, C>\n@@ -83,6 +89,12 @@ export class Subscription<A, B> implements\nreturn <Subscription<B, B>>this.addWrapped(sub);\n}\n+ /**\n+ * Returns array of new child subscriptions for all given\n+ * subscribers.\n+ *\n+ * @param subs\n+ */\nsubscribeAll(...subs: ISubscriber<B>[]) {\nconst wrapped: Subscription<B, B>[] = [];\nfor (let s of subs) {\n@@ -91,6 +103,27 @@ export class Subscription<A, B> implements\nreturn wrapped;\n}\n+ /**\n+ * Creates a new child subscription using given transducers and\n+ * optional subscription ID. Supports up to 4 transducers and if\n+ * more than one transducer is given, composes them in left-to-right\n+ * order using @thi.ng/transducers `comp()`.\n+ *\n+ * Shorthand for `subscribe(comp(xf1, xf2,...), id)`\n+ */\n+ transform<C>(a: Transducer<B, C>, id?: string): Subscription<B, C>;\n+ transform<C, D>(a: Transducer<B, C>, b: Transducer<C, D>, id?: string): Subscription<B, D>;\n+ transform<C, D, E>(a: Transducer<B, C>, b: Transducer<C, D>, c: Transducer<D, E>, id?: string): Subscription<B, E>;\n+ transform<C, D, E, F>(a: Transducer<B, C>, b: Transducer<C, D>, c: Transducer<D, E>, d: Transducer<E, F>, id?: string): Subscription<B, F>;\n+ transform(...xf: any[]) {\n+ const n = xf.length - 1;\n+ if (isString(xf[n])) {\n+ return this.subscribe((<any>comp)(...xf.slice(0, n)), xf[n]);\n+ } else {\n+ return this.subscribe((<any>comp)(...xf));\n+ }\n+ }\n+\n/**\n* If called without arg, removes this subscription from parent (if\n* any), cleans up internal state and goes into DONE state. If\n",
"new_path": "packages/rstream/src/subscription.ts",
"old_path": "packages/rstream/src/subscription.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(rstream): add Subscription.transform()
| 1
|
feat
|
rstream
|
679,913
|
15.04.2018 22:27:56
| -3,600
|
e6c75b4acc64730c3ad2c8a9bf39e429e725d438
|
refactor(rstream-log): update package structure & readme example
BREAKING CHANGE: update package structure
rename src/transform => src/xform
move src/format.ts => src/xform/format.ts
|
[
{
"change_type": "MODIFY",
"diff": "@@ -30,13 +30,11 @@ const logger = new log.Logger(\"main\", log.Level.DEBUG);\n// add console output w/ string formatter (a transducer)\nlogger.subscribe(log.writeConsole(), log.formatString());\n-// add file output w/ JSON output & post-filtering (only WARN or ERROR levels)\n-import * as tx from \"@thi.ng/transducers\";\n-logger.subscribe(\n- log.writeFile(\"main.log\"),\n- // compose filter + formatter transducers\n- tx.comp(log.minLevel(log.Level.WARN), log.formatJSON())\n-);\n+// add file output w/ post-filtering (only WARN or ERROR levels)\n+// and formatted as JSON\n+logger\n+ .transform(log.minLevel(log.Level.WARN), log.formatJSON())\n+ .subscribe(log.writeFile(\"main.log\"))\nlogger.debug(\"hello world\");\n",
"new_path": "packages/rstream-log/README.md",
"old_path": "packages/rstream-log/README.md"
},
{
"change_type": "MODIFY",
"diff": "\"license\": \"Apache-2.0\",\n\"scripts\": {\n\"build\": \"yarn clean && tsc --declaration\",\n- \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc output transform\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc output xform\",\n\"cover\": \"yarn test && nyc report --reporter=lcov\",\n\"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n\"pub\": \"yarn build && yarn publish --access public\",\n",
"new_path": "packages/rstream-log/package.json",
"old_path": "packages/rstream-log/package.json"
},
{
"change_type": "MODIFY",
"diff": "export * from \"./api\";\n-export * from \"./format\";\nexport * from \"./logger\";\nexport * from \"./output/console\";\nexport * from \"./output/file\";\n-export * from \"./transform/filter\";\n+export * from \"./xform/filter\";\n+export * from \"./xform/format\";\n",
"new_path": "packages/rstream-log/src/index.ts",
"old_path": "packages/rstream-log/src/index.ts"
},
{
"change_type": "RENAME",
"diff": "",
"new_path": "packages/rstream-log/src/xform/filter.ts",
"old_path": "packages/rstream-log/src/transform/filter.ts"
},
{
"change_type": "RENAME",
"diff": "import { Transducer } from \"@thi.ng/transducers/api\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\n-import { BodyFormat, DateFormat, LogEntryObj, Level, LogEntry } from \"./api\";\n+import { BodyFormat, DateFormat, LogEntryObj, Level, LogEntry } from \"../api\";\nexport function formatString(dtFmt?: DateFormat, bodyFmt?: BodyFormat): Transducer<LogEntry, string> {\ndtFmt = dtFmt || ((dt) => new Date(dt).toISOString());\n",
"new_path": "packages/rstream-log/src/xform/format.ts",
"old_path": "packages/rstream-log/src/format.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
refactor(rstream-log): update package structure & readme example
BREAKING CHANGE: update package structure
- rename src/transform => src/xform
- move src/format.ts => src/xform/format.ts
| 1
|
refactor
|
rstream-log
|
679,913
|
15.04.2018 22:36:49
| -3,600
|
df32a59ea4508e85b00206fd4e3834dd6109d79b
|
docs(rstream-gestures): update package
|
[
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@thi.ng/rstream-gestures\",\n\"version\": \"0.1.1\",\n- \"description\": \"TODO\",\n+ \"description\": \"Unified mouse, mouse wheel & single-touch event stream abstraction\",\n\"main\": \"./index.js\",\n\"typings\": \"./index.d.ts\",\n\"repository\": \"https://github.com/thi-ng/umbrella\",\n",
"new_path": "packages/rstream-gestures/package.json",
"old_path": "packages/rstream-gestures/package.json"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
docs(rstream-gestures): update package
| 1
|
docs
|
rstream-gestures
|
217,922
|
15.04.2018 22:56:47
| -7,200
|
30cefc0f3e589ffd2e5a76334089618377945317
|
chore: fixed missing translations and issue with gathering location alarms
|
[
{
"change_type": "MODIFY",
"diff": "@@ -90,7 +90,7 @@ export class GatheringLocationComponent implements OnInit {\nalarms.push({\nspawn: spawn,\nduration: node.uptime / 60,\n- itemId: node.itemId,\n+ itemId: nodeInput.itemId,\nicon: node.icon,\nslot: node.slot,\nareaId: node.areaid,\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"
},
{
"change_type": "MODIFY",
"diff": "\"Name_dialog\": \"Workshop name\",\n\"Created_by\": \"Created by {{name}}\",\n\"Share_link_copied\": \"Workshop share link copied\",\n- \"Not_found\": \"Workshop not found or you don't have access to it\"\n+ \"Not_found\": \"Workshop not found or you don't have access to it\",\n+ \"Shared_workshops\": \"Workshops shared with you\"\n},\n\"ABOUT\": {\n\"title\": \"About\",\n",
"new_path": "src/assets/i18n/en.json",
"old_path": "src/assets/i18n/en.json"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore: fixed missing translations and issue with gathering location alarms
| 1
|
chore
| null |
679,913
|
16.04.2018 01:37:36
| -3,600
|
9a83d4ef5a5f3cbc7a330937265ed1e6b3e0ef77
|
fix(interceptors): update undo handling to support history cursors
|
[
{
"change_type": "MODIFY",
"diff": "@@ -582,16 +582,18 @@ export class EventBus extends StatelessEventBus implements\n({ [FX_STATE]: setIn(state, path, val) }),\n[api.EV_UPDATE_VALUE]: (state, [_, [path, fn, ...args]]) =>\n({ [FX_STATE]: updateIn(state, path, fn, ...args) }),\n- [api.EV_UNDO]: (_, [__, id = \"history\"], ___, ctx) => {\n+ [api.EV_UNDO]: (_, [__, id = \"history\"], bus, ctx) => {\nif (implementsFunction(ctx[id], \"undo\")) {\n- return { [FX_STATE]: ctx[id].undo() }\n+ ctx[id].undo();\n+ return { [FX_STATE]: bus.state.deref() };\n} else {\nconsole.warn(\"no history in context\");\n}\n},\n- [api.EV_REDO]: (_, [__, id = \"history\"], ___, ctx) => {\n+ [api.EV_REDO]: (_, [__, id = \"history\"], bus, ctx) => {\nif (implementsFunction(ctx[id], \"redo\")) {\n- return { [FX_STATE]: ctx[id].redo() }\n+ ctx[id].redo();\n+ return { [FX_STATE]: bus.state.deref() };\n} else {\nconsole.warn(\"no history in context\");\n}\n",
"new_path": "packages/interceptors/src/event-bus.ts",
"old_path": "packages/interceptors/src/event-bus.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(interceptors): update undo handling to support history cursors
| 1
|
fix
|
interceptors
|
679,913
|
16.04.2018 02:13:33
| -3,600
|
56d919c0c13f96a7c57a69bf55bf78d9ba2cd177
|
fix(rstream-graph): create null sub for ID renaming
this ensures auto-teardown when unsubscribing nodes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -59,7 +59,7 @@ const nodeFromSpec = (state: IAtom<any>, spec: NodeSpec) => (resolve) => {\nif (i.xform) {\ns = s.subscribe(i.xform, i.id);\n} else if (i.id) {\n- s = s.subscribe({}, i.id);\n+ s = s.subscribe(null, i.id);\n}\nsrc.push(s);\n}\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): create null sub for ID renaming
- this ensures auto-teardown when unsubscribing nodes
| 1
|
fix
|
rstream-graph
|
815,746
|
16.04.2018 10:02:53
| -10,800
|
6ca1ffb95f37cf4757fb089cd30c6ea9b9d70cdf
|
chore(release): 1.0.1-rc.0
|
[
{
"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=\"1.0.1-rc.0\"></a>\n+## [1.0.1-rc.0](https://github.com/ng-select/ng-select/compare/v0.36.2...v1.0.1-rc.0) (2018-04-16)\n+\n+\n+### Bug Fixes\n+\n+* add ng-option-marked class for custom tags ([a158d7b](https://github.com/ng-select/ng-select/commit/a158d7b))\n+* remove input if searchable is false ([#442](https://github.com/ng-select/ng-select/issues/442)) ([2149517](https://github.com/ng-select/ng-select/commit/2149517))\n+* rename focusSearchInput to focus ([#447](https://github.com/ng-select/ng-select/issues/447)) ([cb71544](https://github.com/ng-select/ng-select/commit/cb71544))\n+\n+\n+\n<a name=\"0.36.2\"></a>\n## [0.36.2](https://github.com/ng-select/ng-select/compare/v0.36.1...v0.36.2) (2018-04-11)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"$schema\": \"../node_modules/ng-packagr/package.schema.json\",\n\"name\": \"@ng-select/ng-select\",\n- \"version\": \"0.36.2\",\n+ \"version\": \"1.0.1-rc.0\",\n\"description\": \"Angular ng-select - All in One UI Select, Multiselect and Autocomplete\",\n\"author\": \"@ng-select/ng-select\",\n\"license\": \"MIT\",\n",
"new_path": "src/package.json",
"old_path": "src/package.json"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
chore(release): 1.0.1-rc.0
| 1
|
chore
|
release
|
217,922
|
16.04.2018 10:09:07
| -7,200
|
fd4d63cb1b0cf0ec3ecf3ba4717972e9a802bcb2
|
chore(requirements-popup): changed amount for a ceiled value
|
[
{
"change_type": "MODIFY",
"diff": "<img mat-list-avatar [src]=\"getRequirementDetails(requirement)?.icon | icon\"\nalt=\"{{getRequirementDetails(requirement)?.id | itemName | i18n}}\">\n<div mat-line>{{getRequirementDetails(requirement)?.id | itemName | i18n}}</div>\n- <p mat-line>x{{requirement.amount * (data.item.amount_needed - data.item.done / data.item.yield)}}</p>\n+ <p mat-line>x{{(requirement.amount * (data.item.amount_needed - data.item.done / data.item.yield)) | ceil}}</p>\n</mat-list-item>\n</mat-list>\n</mat-tab>\n",
"new_path": "src/app/modules/item/requirements-popup/requirements-popup.component.html",
"old_path": "src/app/modules/item/requirements-popup/requirements-popup.component.html"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore(requirements-popup): changed amount for a ceiled value
| 1
|
chore
|
requirements-popup
|
217,922
|
16.04.2018 10:19:40
| -7,200
|
bfc857c8ccfd884e6d5f2a4f5336df0d652d3ce0
|
fix: fixed a bug with list regeneration sometimes settings the wrong amount done
closes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -140,7 +140,7 @@ export class ListManagerService {\n}\nlistRow.done = row.item.done;\nlistRow.used = row.item.used || 0;\n- if (row.array === 'recipes') {\n+ if (row.item.craftedBy !== undefined && row.item.craftedBy.length > 0) {\nif (listRow.done > listRow.amount) {\nlistRow.done = listRow.amount;\n}\n",
"new_path": "src/app/core/list/list-manager.service.ts",
"old_path": "src/app/core/list/list-manager.service.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
fix: fixed a bug with list regeneration sometimes settings the wrong amount done
closes #318
| 1
|
fix
| null |
807,849
|
16.04.2018 11:06:19
| 25,200
|
6907e90bafb03c419dfa2bdcb975998c2d583f36
|
fix(git-utils): Pass `--follow-tags` to `git push`
This works now because we create annotated tags.
|
[
{
"change_type": "MODIFY",
"diff": "@@ -157,7 +157,6 @@ describe(\"PublishCommand\", () => {\nexpect(GitUtilities.pushWithTags).lastCalledWith(\n\"origin\",\n- gitTagsAdded(),\nexpect.objectContaining({\ncwd: testDir,\n})\n@@ -221,7 +220,6 @@ describe(\"PublishCommand\", () => {\nexpect(GitUtilities.pushWithTags).lastCalledWith(\n\"origin\",\n- gitTagsAdded(),\nexpect.objectContaining({\ncwd: testDir,\n})\n@@ -396,7 +394,6 @@ describe(\"PublishCommand\", () => {\nexpect(gitCommitMessage()).toEqual(\"v1.0.1\");\nexpect(GitUtilities.pushWithTags).lastCalledWith(\n\"origin\",\n- [\"v1.0.1\"],\nexpect.objectContaining({\ncwd: testDir,\n})\n@@ -473,7 +470,6 @@ describe(\"PublishCommand\", () => {\nexpect(GitUtilities.pushWithTags).lastCalledWith(\n\"origin\",\n- [\"v1.0.1\"],\nexpect.objectContaining({\ncwd: testDir,\n})\n@@ -716,7 +712,6 @@ describe(\"PublishCommand\", () => {\nexpect(GitUtilities.pushWithTags).lastCalledWith(\n\"upstream\",\n- [\"v1.0.1\"],\nexpect.objectContaining({\ncwd: testDir,\n})\n",
"new_path": "commands/publish/__tests__/publish-command.test.js",
"old_path": "commands/publish/__tests__/publish-command.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -181,7 +181,7 @@ class PublishCommand extends Command {\npushToRemote() {\nthis.logger.info(\"git\", \"Pushing tags...\");\n- return GitUtilities.pushWithTags(this.gitRemote, this.tags, this.execOpts);\n+ return GitUtilities.pushWithTags(this.gitRemote, this.execOpts);\n}\nresolveLocalDependencyLinks() {\n",
"new_path": "commands/publish/index.js",
"old_path": "commands/publish/index.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -136,11 +136,15 @@ describe(\"GitUtilities\", () => {\nawait execa(\"git\", [\"commit\", \"--allow-empty\", \"-m\", \"change\"], { cwd });\nawait execa(\"git\", [\"tag\", \"v1.2.3\", \"-m\", \"v1.2.3\"], { cwd });\n+ await execa(\"git\", [\"tag\", \"foo@2.3.1\", \"-m\", \"foo@2.3.1\"], { cwd });\n+ await execa(\"git\", [\"tag\", \"bar@3.2.1\", \"-m\", \"bar@3.2.1\"], { cwd });\nawait GitUtilities.pushWithTags(\"origin\", [\"v1.2.3\"], { cwd });\nconst list = await execa.stdout(\"git\", [\"ls-remote\", \"--tags\", \"--refs\", \"--quiet\"], { cwd });\nexpect(list).toMatch(\"v1.2.3\");\n+ expect(list).toMatch(\"foo@2.3.1\");\n+ expect(list).toMatch(\"bar@3.2.1\");\n});\n});\n",
"new_path": "core/git-utils/__tests__/git-utils.test.js",
"old_path": "core/git-utils/__tests__/git-utils.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -102,11 +102,11 @@ function getFirstCommit(opts) {\nreturn firstCommit;\n}\n-function pushWithTags(remote, tags, opts) {\n- log.silly(\"pushWithTags\", [remote, tags]);\n+function pushWithTags(remote, opts) {\n+ log.silly(\"pushWithTags\", remote);\nreturn Promise.resolve(exports.getCurrentBranch(opts)).then(branch =>\n- ChildProcessUtilities.exec(\"git\", [\"push\", \"--no-verify\", remote, branch].concat(tags), opts)\n+ ChildProcessUtilities.exec(\"git\", [\"push\", \"--follow-tags\", \"--no-verify\", remote, branch], opts)\n);\n}\n",
"new_path": "core/git-utils/index.js",
"old_path": "core/git-utils/index.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
fix(git-utils): Pass `--follow-tags` to `git push`
This works now because we create annotated tags.
| 1
|
fix
|
git-utils
|
217,922
|
16.04.2018 11:16:41
| -7,200
|
62bd87b6d50be1e10e904de3bfc946fcc045dda2
|
chore: UX updates
|
[
{
"change_type": "MODIFY",
"diff": "<h2 mat-dialog-title> {{'PERMISSIONS.Add_new' | translate}}</h2>\n-<div mat-dialog-content>\n- <mat-input-container>\n+<div mat-dialog-content class=\"container\">\n+ <mat-input-container class=\"search-field\">\n<input type=\"email\" matInput #inputField [(ngModel)]=\"input\"\n[placeholder]=\"'PERMISSIONS.Placeholder' | translate\">\n+ <mat-hint>{{'PERMISSIONS.User_id_tip' | translate}}</mat-hint>\n</mat-input-container>\n<mat-error *ngIf=\"notFound\">{{'PERMISSIONS.User_not_found' | translate}}</mat-error>\n<mat-list *ngIf=\"result && !notFound\">\n",
"new_path": "src/app/modules/common-components/permissions-popup/add-new-row-popup/add-new-row-popup.component.html",
"old_path": "src/app/modules/common-components/permissions-popup/add-new-row-popup/add-new-row-popup.component.html"
},
{
"change_type": "MODIFY",
"diff": "+.container {\n+ min-height: 200px;\n+ .search-field {\n+ margin-bottom: 25px;\n+ }\n+}\n",
"new_path": "src/app/modules/common-components/permissions-popup/add-new-row-popup/add-new-row-popup.component.scss",
"old_path": "src/app/modules/common-components/permissions-popup/add-new-row-popup/add-new-row-popup.component.scss"
},
{
"change_type": "MODIFY",
"diff": "<h2>{{'Favorites' | translate}}</h2>\n-<div *ngIf=\"(favorites | async)?.length === 0 && (favorites | async) === null ||\n-(favoriteWorkshops | async)?.length === 0 || (favoriteWorkshops | async) === null\" class=\"not-found\">\n+<div *ngIf=\"(favorites | async)?.length === 0 && ((favoriteWorkshops | async)?.length === 0 || (favoriteWorkshops | async) === null)\" class=\"not-found\">\n<h3>{{\"No_favorites\" | translate}}</h3>\n</div>\n<div *ngIf=\"(favorites | async) !== null\">\n",
"new_path": "src/app/pages/favorites/favorites/favorites.component.html",
"old_path": "src/app/pages/favorites/favorites/favorites.component.html"
},
{
"change_type": "MODIFY",
"diff": "</div>\n</mat-grid-tile>\n</mat-grid-list>\n+ <div class=\"user-id\">\n+ <i>{{\"COMMON.User_id\" | translate}} : {{user.$key}}</i>\n+ </div>\n</mat-card>\n</mat-grid-tile>\n<mat-grid-tile colspan=\"3\" *ngIf=\"user.patron || user.admin\">\n",
"new_path": "src/app/pages/profile/profile/profile.component.html",
"old_path": "src/app/pages/profile/profile/profile.component.html"
},
{
"change_type": "MODIFY",
"diff": "align-items: start;\njustify-content: start;\n}\n+\n+ .user-id {\n+ position: absolute;\n+ bottom: 5px;\n+ right: 5px;\n+ }\n}\n",
"new_path": "src/app/pages/profile/profile/profile.component.scss",
"old_path": "src/app/pages/profile/profile/profile.component.scss"
},
{
"change_type": "MODIFY",
"diff": "\"COMMON\": {\n\"Save\": \"Save\",\n\"Reset\": \"Reset\",\n- \"Total\": \"Total\"\n+ \"Total\": \"Total\",\n+ \"User_id\": \"User ID\"\n},\n\"ALARMS\": {\n\"No_alarm\": \"No alarms set\",\n\"Add_new\": \"Add a user\",\n\"Placeholder\": \"Email or User ID\",\n\"Bind_free_company\": \"Bind some permissions to your Free Company\",\n- \"User_not_found\": \"User not found\"\n+ \"User_not_found\": \"User not found\",\n+ \"User_id_tip\": \"The user ID can be found in profile page in bottom-right corner\"\n}\n}\n",
"new_path": "src/assets/i18n/en.json",
"old_path": "src/assets/i18n/en.json"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore: UX updates
| 1
|
chore
| null |
807,938
|
16.04.2018 12:15:47
| 18,000
|
0b88ffbbcfe95543d71f6c72e7053087cdc7d19a
|
fix(git-utils): Pass --no-verify to `git push`
Also, this condenses the two `git push` calls into one call.
Closes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -106,9 +106,7 @@ function pushWithTags(remote, tags, opts) {\nlog.silly(\"pushWithTags\", [remote, tags]);\nreturn Promise.resolve(exports.getCurrentBranch(opts)).then(branch =>\n- ChildProcessUtilities.exec(\"git\", [\"push\", remote, branch], opts).then(() =>\n- ChildProcessUtilities.exec(\"git\", [\"push\", remote].concat(tags), opts)\n- )\n+ ChildProcessUtilities.exec(\"git\", [\"push\", \"--no-verify\", remote, branch].concat(tags), opts)\n);\n}\n",
"new_path": "core/git-utils/index.js",
"old_path": "core/git-utils/index.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
fix(git-utils): Pass --no-verify to `git push` (#1376)
Also, this condenses the two `git push` calls into one call.
Closes #1366
| 1
|
fix
|
git-utils
|
791,690
|
16.04.2018 12:34:09
| 25,200
|
93ce1dc0ee3f259db0d9af53eaa55057d724b373
|
core(metrics): add first CPU idle lantern metric
|
[
{
"change_type": "MODIFY",
"diff": "@@ -39,6 +39,7 @@ class PredictivePerf extends Audit {\nconst fcp = await artifacts.requestLanternFirstContentfulPaint({trace, devtoolsLog});\nconst fmp = await artifacts.requestLanternFirstMeaningfulPaint({trace, devtoolsLog});\nconst ttci = await artifacts.requestLanternConsistentlyInteractive({trace, devtoolsLog});\n+ const ttfcpui = await artifacts.requestLanternFirstCPUIdle({trace, devtoolsLog});\nconst values = {\nroughEstimateOfFCP: fcp.timing,\n@@ -52,6 +53,10 @@ class PredictivePerf extends Audit {\nroughEstimateOfTTCI: ttci.timing,\noptimisticTTCI: ttci.optimisticEstimate.timeInMs,\npessimisticTTCI: ttci.pessimisticEstimate.timeInMs,\n+\n+ roughEstimateOfTTFCPUI: ttfcpui.timing,\n+ optimisticTTFCPUI: ttfcpui.optimisticEstimate.timeInMs,\n+ pessimisticTTFCPUI: ttfcpui.pessimisticEstimate.timeInMs,\n};\nconst score = Audit.computeLogNormalScore(\n",
"new_path": "lighthouse-core/audits/predictive-perf.js",
"old_path": "lighthouse-core/audits/predictive-perf.js"
},
{
"change_type": "MODIFY",
"diff": "* 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-\nconst ComputedArtifact = require('./computed-artifact');\nconst TracingProcessor = require('../../lib/traces/tracing-processor');\nconst LHError = require('../../lib/errors');\n@@ -67,22 +66,24 @@ class FirstInteractive extends ComputedArtifact {\n* Clusters tasks after startIndex that are in the specified window if they are within\n* MIN_TASK_CLUSTER_PADDING ms of each other. Can return tasks that start outside of the window,\n* but all clusters are guaranteed to have started before windowEnd.\n- * @param {!Array<{start: number, end: number}>} tasks\n+ * @param {Array<Task>} tasks\n* @param {number} startIndex\n* @param {number} windowEnd\n- * @return {!Array<{start: number, end: number, duration: number}>}\n+ * @return {Array<TaskCluster>}\n*/\nstatic getTaskClustersInWindow(tasks, startIndex, windowEnd) {\nconst clusters = [];\nlet previousTaskEndTime = -Infinity;\n- let currentCluster = null;\n+ /** @type {Array<Task>} */\n+ let currentCluster = [];\n// Examine all tasks that could possibly be part of a cluster starting before windowEnd.\n// Consider the case where window end is 15s, there's a 100ms task from 14.9-15s and a 500ms\n// task from 15.5-16s, we need that later task to be clustered with the first so we can properly\n// identify that main thread isn't quiet.\nconst clusteringWindowEnd = windowEnd + MIN_TASK_CLUSTER_PADDING;\n+ /** @param {Task} task */\nconst isInClusteringWindow = task => task.start < clusteringWindowEnd;\nfor (let i = startIndex; i < tasks.length; i++) {\nif (!isInClusteringWindow(tasks[i])) {\n@@ -119,7 +120,7 @@ class FirstInteractive extends ComputedArtifact {\n* of the trace.\n* @param {number} FMP\n* @param {number} traceEnd\n- * @param {!Array<{start: number, end: number>}} longTasks\n+ * @param {Array<Task>} longTasks\n* @return {number}\n*/\nstatic findQuietWindow(FMP, traceEnd, longTasks) {\n@@ -129,8 +130,11 @@ class FirstInteractive extends ComputedArtifact {\nreturn FMP;\n}\n+ /** @param {TaskCluster} cluster */\nconst isTooCloseToFMP = cluster => cluster.start < FMP + MIN_TASK_CLUSTER_FMP_DISTANCE;\n+ /** @param {TaskCluster} cluster */\nconst isTooLong = cluster => cluster.duration > MAX_TASK_CLUSTER_DURATION;\n+ /** @param {TaskCluster} cluster */\nconst isBadCluster = cluster => isTooCloseToFMP(cluster) || isTooLong(cluster);\n// FirstInteractive must start at the end of a long task, consider each long task and\n@@ -192,9 +196,9 @@ class FirstInteractive extends ComputedArtifact {\n}\n/**\n- * @param {!Trace} trace\n- * @param {!ComputedArtifacts} artifacts\n- * @return {{timeInMs: number, timestamp: number}}\n+ * @param {LH.Trace} trace\n+ * @param {LH.Artifacts} artifacts\n+ * @return {Promise<{timeInMs: number, timestamp: number}>}\n*/\ncompute_(trace, artifacts) {\nreturn artifacts.requestTraceOfTab(trace).then(traceOfTab => {\n@@ -203,4 +207,9 @@ class FirstInteractive extends ComputedArtifact {\n}\n}\n+/**\n+ * @typedef {{start: number, end: number}} Task\n+ * @typedef {{start: number, end: number, duration: number}} TaskCluster\n+ */\n+\nmodule.exports = FirstInteractive;\n",
"new_path": "lighthouse-core/gather/computed/first-interactive.js",
"old_path": "lighthouse-core/gather/computed/first-interactive.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+const Node = require('../../../lib/dependency-graph/node');\n+const CPUNode = require('../../../lib/dependency-graph/cpu-node'); // eslint-disable-line no-unused-vars\n+const NetworkNode = require('../../../lib/dependency-graph/network-node'); // eslint-disable-line no-unused-vars\n+\n+const FirstInteractive = require('../first-interactive');\n+const LanternConsistentlyInteractive = require('./lantern-consistently-interactive');\n+\n+class FirstCPUIdle extends LanternConsistentlyInteractive {\n+ get name() {\n+ return 'LanternFirstCPUIdle';\n+ }\n+\n+ /**\n+ * @param {LH.Gatherer.Simulation.Result} simulationResult\n+ * @param {Object} extras\n+ * @return {LH.Gatherer.Simulation.Result}\n+ */\n+ getEstimateFromSimulation(simulationResult, extras) {\n+ const fmpTimeInMs = extras.optimistic\n+ ? extras.fmpResult.optimisticEstimate.timeInMs\n+ : extras.fmpResult.pessimisticEstimate.timeInMs;\n+\n+ return {\n+ timeInMs: FirstCPUIdle.getFirstCPUIdleWindowStart(simulationResult.nodeTiming, fmpTimeInMs),\n+ nodeTiming: simulationResult.nodeTiming,\n+ };\n+ }\n+\n+ /**\n+ *\n+ * @param {Map<Node, LH.Gatherer.Simulation.NodeTiming>} nodeTiming\n+ * @param {number} fmpTimeInMs\n+ */\n+ static getFirstCPUIdleWindowStart(nodeTiming, fmpTimeInMs, longTaskLength = 50) {\n+ /** @type {Array<{start: number, end: number}>} */\n+ const longTasks = [];\n+ for (const [node, timing] of nodeTiming.entries()) {\n+ if (node.type !== Node.TYPES.CPU) continue;\n+ if (!timing.endTime || !timing.startTime) continue;\n+ if (timing.endTime - timing.startTime < longTaskLength) continue;\n+ longTasks.push({start: timing.startTime, end: timing.endTime});\n+ }\n+\n+ return FirstInteractive.findQuietWindow(fmpTimeInMs, Infinity, longTasks);\n+ }\n+}\n+\n+module.exports = FirstCPUIdle;\n",
"new_path": "lighthouse-core/gather/computed/metrics/lantern-first-cpu-idle.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+/**\n+ * @license Copyright 2017 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+const Runner = require('../../../../runner');\n+const assert = require('assert');\n+\n+const trace = require('../../../fixtures/traces/progressive-app-m60.json');\n+const devtoolsLog = require('../../../fixtures/traces/progressive-app-m60.devtools.log.json');\n+\n+/* eslint-env mocha */\n+describe('Metrics: Lantern TTFCPUI', () => {\n+ it('should compute predicted value', async () => {\n+ const artifacts = Runner.instantiateComputedArtifacts();\n+ const result = await artifacts.requestLanternFirstCPUIdle({trace, devtoolsLog});\n+\n+ assert.equal(Math.round(result.timing), 5308);\n+ assert.equal(Math.round(result.optimisticEstimate.timeInMs), 2451);\n+ assert.equal(Math.round(result.pessimisticEstimate.timeInMs), 2752);\n+ assert.equal(result.optimisticEstimate.nodeTiming.size, 19);\n+ assert.equal(result.pessimisticEstimate.nodeTiming.size, 79);\n+ assert.ok(result.optimisticGraph, 'should have created optimistic graph');\n+ assert.ok(result.pessimisticGraph, 'should have created pessimistic graph');\n+ });\n+});\n",
"new_path": "lighthouse-core/test/gather/computed/metrics/lantern-first-cpu-idle-test.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -14,6 +14,8 @@ declare global {\ndevtoolsLogs: {[passName: string]: DevtoolsLog};\nsettings: Config.Settings;\nRobotsTxt: {status: number|null, content: string|null};\n+ // TODO(bckenny): remove this for real computed artifacts approach\n+ requestTraceOfTab(trace: Trace): Promise<Artifacts.TraceOfTab>\n}\nmodule Artifacts {\n",
"new_path": "typings/artifacts.d.ts",
"old_path": "typings/artifacts.d.ts"
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(metrics): add first CPU idle lantern metric (#4966)
| 1
|
core
|
metrics
|
679,913
|
16.04.2018 13:02:17
| -3,600
|
4c1bd85c9bd5e72483480aa653e70ee538175c3a
|
feat(paths): add mutator() & mutIn()
|
[
{
"change_type": "MODIFY",
"diff": "@@ -229,3 +229,61 @@ export function deleteIn(state: any, path: Path) {\nreturn updateIn(state, ks, (x) => { x = { ...x }; delete x[k]; return x; });\n}\n}\n+\n+/**\n+ * Higher-order function, similar to `setter()`. Returns function which\n+ * when called mutates given object/array at given path location and\n+ * bails if any intermediate path values are non-indexable (only the\n+ * very last path element can be missing in the actual object\n+ * structure). If successful, returns original (mutated) object, else\n+ * `undefined`. This function provides optimized versions for path\n+ * lengths <= 4.\n+ *\n+ * @param path\n+ */\n+export function mutator(path: Path) {\n+ const ks = toPath(path);\n+ let [a, b, c, d] = ks;\n+ switch (ks.length) {\n+ case 0:\n+ return (_, x) => x;\n+ case 1:\n+ return (s, x) => s ? (s[a] = x, s) : undefined;\n+ case 2:\n+ return (s, x) => { let t; return s ? (t = s[a]) ? (t[b] = x, s) : undefined : undefined };\n+ case 3:\n+ return (s, x) => { let t; return s ? (t = s[a]) ? (t = t[b]) ? (t[c] = x, s) : undefined : undefined : undefined };\n+ case 4:\n+ return (s, x) => { let t; return s ? (t = s[a]) ? (t = t[b]) ? (t = t[c]) ? (t[d] = x, s) : undefined : undefined : undefined : undefined };\n+ default:\n+ return (s, x) => {\n+ let t = s;\n+ const n = ks.length - 1;\n+ for (let k = 0; k < n; k++) {\n+ if (!(t = t[ks[k]])) return;\n+ }\n+ t[ks[n]] = x;\n+ return s;\n+ }\n+ }\n+}\n+\n+/**\n+ * Immediate use mutator, i.e. same as: `mutator(path)(state, val)`.\n+ *\n+ * ```\n+ * mutIn({ a: { b: [10, 20] } }, \"a.b.1\", 23);\n+ * // { a: { b: [ 10, 23 ] } }\n+ *\n+ * // fails (see `mutator` docs)\n+ * mutIn({}, \"a.b.c\", 23);\n+ * // undefined\n+ * ```\n+ *\n+ * @param state\n+ * @param path\n+ * @param val\n+ */\n+export function mutIn(state: any, path: Path, val: any) {\n+ return mutator(path)(state, val);\n+}\n",
"new_path": "packages/paths/src/index.ts",
"old_path": "packages/paths/src/index.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(paths): add mutator() & mutIn()
| 1
|
feat
|
paths
|
730,429
|
16.04.2018 14:37:16
| 14,400
|
7f2f0d23e34abe6e24333de6dc3b866a06bda9f5
|
feat(widget-recents): remove incoming call screen
|
[
{
"change_type": "MODIFY",
"diff": "@@ -31,7 +31,6 @@ import {events as metricEvents} from '@ciscospark/react-redux-spark-metrics';\nimport LoadingScreen from '@ciscospark/react-component-loading-screen';\nimport Spinner from '@ciscospark/react-component-spinner';\nimport ErrorDisplay from '@ciscospark/react-component-error-display';\n-import IncomingCall from '@ciscospark/react-component-incoming-call';\nimport messages from './messages';\nimport getRecentsWidgetProps from './selector';\n@@ -463,32 +462,6 @@ export class RecentsWidget extends Component {\n}\n}\n- @autobind\n- handleAnswer() {\n- const space = this.getSpaceFromCall(this.props.incomingCall);\n- this.handleEvent(eventNames.SPACES_SELECTED, {\n- action: eventNames.ACTION_CALL_ANSWER,\n- ...constructRoomsEventData(space)\n- });\n- this.props.dismissIncomingCall(this.props.incomingCall.instance.locus.url);\n- }\n-\n- @autobind\n- handleDecline() {\n- const {\n- props,\n- getSpaceFromCall,\n- handleEvent\n- } = this;\n- const space = getSpaceFromCall(props.incomingCall);\n-\n- props.declineIncomingCall(props.incomingCall.instance);\n- handleEvent(eventNames.SPACES_SELECTED, {\n- action: eventNames.ACTION_CALL_REJECT,\n- ...constructRoomsEventData(space)\n- });\n- }\n-\n@autobind\nhandleSpaceClick(spaceId) {\nconst space = this.props.spacesList.get(spaceId);\n@@ -535,7 +508,6 @@ export class RecentsWidget extends Component {\nconst {\nerrors,\nhasGroupCalling,\n- incomingCall,\nmedia,\nspacesList,\nspaces,\n@@ -565,23 +537,6 @@ export class RecentsWidget extends Component {\nconst isWebRTCSupported = media.getIn(['webRTC', 'isSupported']);\nif (spacesList && hasFetchedSpaces) {\n- if (incomingCall && isWebRTCSupported) {\n- const space = this.getSpaceFromCall(incomingCall);\n- return (\n- <div className={classNames('ciscospark-recents-widget', styles.recentsWidget)}>\n- <IncomingCall\n- answerButtonLabel={formatMessage(messages.answerButtonLabel)}\n- avatarImage={space.avatarUrl}\n- declineButtonLabel={formatMessage(messages.declineButtonLabel)}\n- displayName={space.name}\n- incomingCallMessage={formatMessage(messages.incomingCallMessage)}\n- onAnswerClick={this.handleAnswer}\n- onDeclineClick={this.handleDecline}\n- />\n- </div>\n- );\n- }\n-\nconst handleCallClick = isWebRTCSupported ? this.handleSpaceCallClick : undefined;\nreturn (\n<div className={classNames('ciscospark-recents-widget', styles.recentsWidget)}>\n",
"new_path": "packages/node_modules/@ciscospark/widget-recents/src/container.js",
"old_path": "packages/node_modules/@ciscospark/widget-recents/src/container.js"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
feat(widget-recents): remove incoming call screen
| 1
|
feat
|
widget-recents
|
807,849
|
16.04.2018 14:43:20
| 25,200
|
abecfcc50bbeca575abe8213975d1b8d9b136eb3
|
feat(command): Move GitUtilities.isInitialized into class method
BREAKING CHANGE: GitUtilities.isInitialized no longer exists. You shouldn't be using GitUtilities.
|
[
{
"change_type": "MODIFY",
"diff": "@@ -33,7 +33,7 @@ class InitCommand extends Command {\ninitialize() {\nthis.exact = this.options.exact;\n- if (!GitUtilities.isInitialized(this.execOpts)) {\n+ if (!this.gitInitialized()) {\nthis.logger.info(\"\", \"Initializing Git repository\");\nGitUtilities.init(this.execOpts);\n",
"new_path": "commands/init/index.js",
"old_path": "commands/init/index.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -104,7 +104,6 @@ describe(\"PublishCommand\", () => {\nwriteJsonFile.mockResolvedValue();\n// we've already tested these utilities elsewhere\n- GitUtilities.isInitialized.mockReturnValue(true);\ngetCurrentBranch.mockReturnValue(\"master\");\nGitUtilities.getCurrentSHA.mockReturnValue(\"FULL_SHA\");\nGitUtilities.getShortSHA.mockReturnValue(\"deadbeef\");\n",
"new_path": "commands/publish/__tests__/publish-command.test.js",
"old_path": "commands/publish/__tests__/publish-command.test.js"
},
{
"change_type": "MODIFY",
"diff": "const _ = require(\"lodash\");\nconst dedent = require(\"dedent\");\n+const execa = require(\"execa\");\nconst log = require(\"npmlog\");\n-const GitUtilities = require(\"@lerna/git-utils\");\nconst PackageGraph = require(\"@lerna/package-graph\");\nconst Project = require(\"@lerna/project\");\nconst writeLogFile = require(\"@lerna/write-log-file\");\n@@ -158,11 +158,20 @@ class Command {\n}\n}\n+ gitInitialized() {\n+ const opts = {\n+ cwd: this.project.rootPath,\n+ // don't throw, just want boolean\n+ reject: false,\n+ // only return code, no stdio needed\n+ stdio: \"ignore\",\n+ };\n+\n+ return execa.sync(\"git\", [\"rev-parse\"], opts).code === 0;\n+ }\n+\nrunValidations() {\n- if (\n- (this.options.since !== undefined || this.requiresGit) &&\n- !GitUtilities.isInitialized(this.execOpts)\n- ) {\n+ if ((this.options.since !== undefined || this.requiresGit) && !this.gitInitialized()) {\nthrow new ValidationError(\"ENOGIT\", \"The git binary was not found, or this is not a git repository.\");\n}\n",
"new_path": "core/command/index.js",
"old_path": "core/command/index.js"
},
{
"change_type": "MODIFY",
"diff": "\"@lerna/collect-packages\": \"file:../../utils/collect-packages\",\n\"@lerna/collect-updates\": \"file:../../utils/collect-updates\",\n\"@lerna/filter-packages\": \"file:../../utils/filter-packages\",\n- \"@lerna/git-utils\": \"file:../git-utils\",\n\"@lerna/package-graph\": \"file:../package-graph\",\n\"@lerna/project\": \"file:../project\",\n\"@lerna/validation-error\": \"file:../validation-error\",\n\"@lerna/write-log-file\": \"file:../../utils/write-log-file\",\n\"dedent\": \"^0.7.0\",\n+ \"execa\": \"^0.9.0\",\n\"lodash\": \"^4.17.5\",\n\"npmlog\": \"^4.1.2\"\n}\n",
"new_path": "core/command/package.json",
"old_path": "core/command/package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -13,17 +13,6 @@ const initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\nconst GitUtilities = require(\"..\");\ndescribe(\"GitUtilities\", () => {\n- describe(\".isInitialized()\", () => {\n- it(\"returns true when git command succeeds\", async () => {\n- const cwd = await initFixture(\"basic\");\n-\n- expect(GitUtilities.isInitialized({ cwd })).toBe(true);\n-\n- await fs.remove(path.join(cwd, \".git\"));\n- expect(GitUtilities.isInitialized({ cwd })).toBe(false);\n- });\n- });\n-\ndescribe(\".hasTags()\", () => {\nit(\"returns true when one or more git tags exist\", async () => {\nconst cwd = await initFixture(\"basic\");\n",
"new_path": "core/git-utils/__tests__/git-utils.test.js",
"old_path": "core/git-utils/__tests__/git-utils.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -6,30 +6,6 @@ const slash = require(\"slash\");\nconst ChildProcessUtilities = require(\"@lerna/child-process\");\n-function isInitialized(opts) {\n- log.silly(\"isInitialized\");\n- let initialized;\n-\n- try {\n- // we only want the return code, so ignore stdout/stderr\n- ChildProcessUtilities.execSync(\n- \"git\",\n- [\"rev-parse\"],\n- Object.assign({}, opts, {\n- stdio: \"ignore\",\n- })\n- );\n- initialized = true;\n- } catch (err) {\n- log.verbose(\"isInitialized\", \"swallowed error\", err);\n- initialized = false;\n- }\n-\n- // this does not need to be verbose\n- log.silly(\"isInitialized\", initialized);\n- return initialized;\n-}\n-\nfunction hasTags(opts) {\nlog.silly(\"hasTags\");\nlet result = false;\n@@ -137,7 +113,6 @@ function hasCommit(opts) {\nreturn retVal;\n}\n-exports.isInitialized = isInitialized;\nexports.hasTags = hasTags;\nexports.getLastTaggedCommit = getLastTaggedCommit;\nexports.getFirstCommit = getFirstCommit;\n",
"new_path": "core/git-utils/index.js",
"old_path": "core/git-utils/index.js"
},
{
"change_type": "MODIFY",
"diff": "\"@lerna/collect-packages\": \"file:utils/collect-packages\",\n\"@lerna/collect-updates\": \"file:utils/collect-updates\",\n\"@lerna/filter-packages\": \"file:utils/filter-packages\",\n- \"@lerna/git-utils\": \"file:core/git-utils\",\n\"@lerna/package-graph\": \"file:core/package-graph\",\n\"@lerna/project\": \"file:core/project\",\n\"@lerna/validation-error\": \"file:core/validation-error\",\n\"@lerna/write-log-file\": \"file:utils/write-log-file\",\n\"dedent\": \"0.7.0\",\n+ \"execa\": \"0.9.0\",\n\"lodash\": \"4.17.5\",\n\"npmlog\": \"4.1.2\"\n}\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
feat(command): Move GitUtilities.isInitialized into class method
BREAKING CHANGE: GitUtilities.isInitialized no longer exists. You shouldn't be using GitUtilities.
| 1
|
feat
|
command
|
807,849
|
16.04.2018 14:44:39
| 25,200
|
6e401e1a56d86bacb27406ff8e5d0e583c8e85cf
|
feat(init): Inline GitUtilities.init()
BREAKING CHANGE: GitUtilities.init() no longer exists. You shouldn't be using GitUtilities.
|
[
{
"change_type": "MODIFY",
"diff": "@@ -6,7 +6,7 @@ const pMap = require(\"p-map\");\nconst writeJsonFile = require(\"write-json-file\");\nconst Command = require(\"@lerna/command\");\n-const GitUtilities = require(\"@lerna/git-utils\");\n+const childProcess = require(\"@lerna/child-process\");\nmodule.exports = factory;\n@@ -36,7 +36,7 @@ class InitCommand extends Command {\nif (!this.gitInitialized()) {\nthis.logger.info(\"\", \"Initializing Git repository\");\n- GitUtilities.init(this.execOpts);\n+ return childProcess.exec(\"git\", [\"init\"], this.execOpts);\n}\n}\n",
"new_path": "commands/init/index.js",
"old_path": "commands/init/index.js"
},
{
"change_type": "MODIFY",
"diff": "\"test\": \"echo \\\"Run tests from root\\\" && exit 1\"\n},\n\"dependencies\": {\n+ \"@lerna/child-process\": \"file:../../core/child-process\",\n\"@lerna/command\": \"file:../../core/command\",\n- \"@lerna/git-utils\": \"file:../../core/git-utils\",\n\"fs-extra\": \"^5.0.0\",\n\"p-map\": \"^1.2.0\",\n\"write-json-file\": \"^2.3.0\"\n",
"new_path": "commands/init/package.json",
"old_path": "commands/init/package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -4,7 +4,6 @@ const execa = require(\"execa\");\nconst fs = require(\"fs-extra\");\nconst path = require(\"path\");\nconst slash = require(\"slash\");\n-const tempy = require(\"tempy\");\n// helpers\nconst initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\n@@ -99,17 +98,6 @@ describe(\"GitUtilities\", () => {\n});\n});\n- describe(\".init()\", () => {\n- it(\"calls git init\", async () => {\n- const cwd = tempy.directory();\n-\n- GitUtilities.init({ cwd });\n-\n- const { code } = await execa(\"git\", [\"status\"], { cwd });\n- expect(code).toBe(0);\n- });\n- });\n-\ndescribe(\".hasCommit()\", () => {\nit(\"returns true when git command succeeds\", async () => {\nconst cwd = await initFixture(\"basic\");\n",
"new_path": "core/git-utils/__tests__/git-utils.test.js",
"old_path": "core/git-utils/__tests__/git-utils.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -93,11 +93,6 @@ function getShortSHA(opts) {\nreturn sha;\n}\n-function init(opts) {\n- log.silly(\"git init\");\n- ChildProcessUtilities.execSync(\"git\", [\"init\"], opts);\n-}\n-\nfunction hasCommit(opts) {\nlog.silly(\"hasCommit\");\nlet retVal;\n@@ -121,5 +116,4 @@ exports.diffSinceIn = diffSinceIn;\nexports.getWorkspaceRoot = getWorkspaceRoot;\nexports.getCurrentSHA = getCurrentSHA;\nexports.getShortSHA = getShortSHA;\n-exports.init = init;\nexports.hasCommit = hasCommit;\n",
"new_path": "core/git-utils/index.js",
"old_path": "core/git-utils/index.js"
},
{
"change_type": "MODIFY",
"diff": "\"@lerna/init\": {\n\"version\": \"file:commands/init\",\n\"requires\": {\n+ \"@lerna/child-process\": \"file:core/child-process\",\n\"@lerna/command\": \"file:core/command\",\n- \"@lerna/git-utils\": \"file:core/git-utils\",\n\"fs-extra\": \"5.0.0\",\n\"p-map\": \"1.2.0\",\n\"write-json-file\": \"2.3.0\"\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
feat(init): Inline GitUtilities.init()
BREAKING CHANGE: GitUtilities.init() no longer exists. You shouldn't be using GitUtilities.
| 1
|
feat
|
init
|
730,429
|
16.04.2018 14:47:34
| 14,400
|
7107b9a2b06ba4ad6400af27ba51a7aa2674365d
|
test(journeys): change incoming call screen to join button
|
[
{
"change_type": "MODIFY",
"diff": "@@ -9,6 +9,7 @@ export const elements = {\nunreadIndicator: '.space-unread-indicator',\nlastActivity: '.space-last-activity',\ncallButton: 'button[aria-label=\"Call Space\"]',\n+ joinCallButton: 'button[aria-label=\"Join Call\"]',\nanswerButton: 'button[aria-label=\"Answer\"]'\n};\n",
"new_path": "test/journeys/lib/test-helpers/recents-widget/index.js",
"old_path": "test/journeys/lib/test-helpers/recents-widget/index.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -180,10 +180,10 @@ describe('Widget Recents: Data API', () => {\n});\ndescribe('incoming call', () => {\n- it('should display incoming call screen', () => {\n+ it('displays a call in progress button', () => {\nbrowserRemote.waitForVisible(meetElements.callButton);\nbrowserRemote.click(meetElements.callButton);\n- browserLocal.waitUntil(() => browserLocal.isVisible(elements.answerButton));\n+ browserLocal.waitUntil(() => browserLocal.isVisible(elements.joinCallButton));\nhangup(browserRemote);\n});\n});\n",
"new_path": "test/journeys/specs/recents/dataApi/basic.js",
"old_path": "test/journeys/specs/recents/dataApi/basic.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -238,10 +238,10 @@ describe('Widget Recents', () => {\n});\ndescribe('incoming call', () => {\n- it('should display incoming call screen', () => {\n+ it('displays a call in progress button', () => {\nbrowserRemote.waitForVisible(meetElements.callButton);\nbrowserRemote.click(meetElements.callButton);\n- browserLocal.waitUntil(() => browserLocal.isVisible(elements.answerButton));\n+ browserLocal.waitUntil(() => browserLocal.isVisible(elements.joinCallButton));\nhangup(browserRemote);\n});\n});\n",
"new_path": "test/journeys/specs/recents/global/basic.js",
"old_path": "test/journeys/specs/recents/global/basic.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -352,7 +352,7 @@ The \"recents\" test suite opens a recents widget and does things via the sdk that\n- displays a new one on one\n- displays a call button on hover\n- incoming call\n- - should display incoming call screen\n+ - displays a call in progress button\n- Global Object\n- group space\n- displays a new incoming message\n@@ -371,7 +371,7 @@ The \"recents\" test suite opens a recents widget and does things via the sdk that\n- displays a new one on one\n- displays a call button on hover\n- incoming call\n- - should display incoming call screen\n+ - displays a call in progress button\n- accessibility\n- should have no accessibility violations\n",
"new_path": "test/journeys/testplan.md",
"old_path": "test/journeys/testplan.md"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
test(journeys): change incoming call screen to join button
| 1
|
test
|
journeys
|
807,849
|
16.04.2018 14:49:54
| 25,200
|
925080e01a82f609dc0e1bfb2026c7acbe998f0b
|
feat(import): Inline GitUtilities.getWorkspaceRoot()
BREAKING CHANGE: GitUtilities.getWorkspaceRoot no longer exists. You shouldn't be using GitUtilities.
|
[
{
"change_type": "MODIFY",
"diff": "@@ -64,7 +64,7 @@ class ImportCommand extends Command {\nconst targetDir = path.join(this.getTargetBase(), externalRepoBase);\n// Compute a target directory relative to the Git root\n- const gitRepoRoot = GitUtilities.getWorkspaceRoot(this.execOpts);\n+ const gitRepoRoot = this.getWorkspaceRoot();\nconst lernaRootRelativeToGitRoot = path.relative(gitRepoRoot, this.project.rootPath);\nthis.targetDirRelativeToGitRoot = path.join(lernaRootRelativeToGitRoot, targetDir);\n@@ -115,6 +115,10 @@ class ImportCommand extends Command {\n);\n}\n+ getWorkspaceRoot() {\n+ return ChildProcessUtilities.execSync(\"git\", [\"rev-parse\", \"--show-toplevel\"], this.execOpts);\n+ }\n+\nexternalExecSync(cmd, args) {\nreturn ChildProcessUtilities.execSync(cmd, args, this.externalExecOpts);\n}\n",
"new_path": "commands/import/index.js",
"old_path": "commands/import/index.js"
},
{
"change_type": "MODIFY",
"diff": "const execa = require(\"execa\");\nconst fs = require(\"fs-extra\");\nconst path = require(\"path\");\n-const slash = require(\"slash\");\n// helpers\nconst initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\n@@ -72,16 +71,6 @@ describe(\"GitUtilities\", () => {\n});\n});\n- describe(\".getWorkspaceRoot()\", () => {\n- it(\"calls `git rev-parse --show-toplevel`\", async () => {\n- const topLevel = await initFixture(\"basic\");\n- const cwd = path.join(topLevel, \"foo\");\n-\n- await fs.mkdirp(cwd);\n- expect(GitUtilities.getWorkspaceRoot({ cwd })).toBe(slash(topLevel));\n- });\n- });\n-\ndescribe(\".getCurrentSHA()\", () => {\nit(\"returns full SHA of current ref\", async () => {\nconst cwd = await initFixture(\"basic\");\n",
"new_path": "core/git-utils/__tests__/git-utils.test.js",
"old_path": "core/git-utils/__tests__/git-utils.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -66,15 +66,6 @@ function diffSinceIn(committish, location, opts) {\nreturn diff;\n}\n-function getWorkspaceRoot(opts) {\n- log.silly(\"getWorkspaceRoot\");\n-\n- const workRoot = ChildProcessUtilities.execSync(\"git\", [\"rev-parse\", \"--show-toplevel\"], opts);\n- log.verbose(\"getWorkspaceRoot\", workRoot);\n-\n- return workRoot;\n-}\n-\nfunction getCurrentSHA(opts) {\nlog.silly(\"getCurrentSHA\");\n@@ -113,7 +104,6 @@ exports.getLastTaggedCommit = getLastTaggedCommit;\nexports.getFirstCommit = getFirstCommit;\nexports.getLastTag = getLastTag;\nexports.diffSinceIn = diffSinceIn;\n-exports.getWorkspaceRoot = getWorkspaceRoot;\nexports.getCurrentSHA = getCurrentSHA;\nexports.getShortSHA = getShortSHA;\nexports.hasCommit = hasCommit;\n",
"new_path": "core/git-utils/index.js",
"old_path": "core/git-utils/index.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
feat(import): Inline GitUtilities.getWorkspaceRoot()
BREAKING CHANGE: GitUtilities.getWorkspaceRoot no longer exists. You shouldn't be using GitUtilities.
| 1
|
feat
|
import
|
679,913
|
16.04.2018 15:10:37
| -3,600
|
6992e82bb0126f08f1faa4bfbabe6f15b3f3b00e
|
feat(resolve-map): resolve each ref only once, re-use resolved results
this also fixes function value resolution,
e.g. {a: () => ()=> 1, b: "->a" } only unwraps `a` once now
|
[
{
"change_type": "MODIFY",
"diff": "-import { Path, getIn, toPath } from \"@thi.ng/paths\";\nimport { isArray } from \"@thi.ng/checks/is-array\";\nimport { isFunction } from \"@thi.ng/checks/is-function\";\nimport { isPlainObject } from \"@thi.ng/checks/is-plain-object\";\nimport { isString } from \"@thi.ng/checks/is-string\";\n+import { getIn, mutIn, toPath } from \"@thi.ng/paths\";\n+\n+const SEMAPHORE = Symbol(\"SEMAPHORE\");\n/**\n* Visits all key-value pairs in depth-first order for given object and\n@@ -45,46 +47,45 @@ import { isString } from \"@thi.ng/checks/is-string\";\n* @param obj\n* @param root\n*/\n-export function resolveMap(obj: any, root?: any) {\n+export const resolveMap = (obj: any, root?: any, path: PropertyKey[] = [], resolved: any = {}) => {\n+ root = root || obj;\nfor (let k in obj) {\n- obj[k] = _resolve(k, obj, root);\n+ _resolve(root, [...path, k], resolved);\n}\n+ // console.log(\"resolved:::\", resolved);\nreturn obj;\n}\n-/**\n- * Same as `resolveMap`, but for arrays.\n- *\n- * @param arr\n- * @param root\n- */\n-export function resolveArray(arr: any[], root?: any) {\n- for (let i = 0, n = arr.length; i < n; i++) {\n- arr[i] = _resolve(i, arr, root);\n+export const resolveArray = (arr: any[], root?: any, path: PropertyKey[] = [], resolved: any = {}) => {\n+ root = root || arr;\n+ for (let k = 0, n = arr.length; k < n; k++) {\n+ _resolve(root, [...path, k], resolved);\n}\nreturn arr;\n}\n-function _resolve(k: Path, obj: any, root?: any, makeAbs = false) {\n- root = root || obj;\n- const v = getIn(obj, k);\n+const _resolve = (root: any, path: PropertyKey[], resolved: any) => {\n+ let v = getIn(root, path), rv = SEMAPHORE;\n+ const pp = path.join(\".\");\n+ if (!resolved[pp]) {\nif (isString(v) && v.indexOf(\"->\") === 0) {\nif (v.charAt(2) === \"/\") {\n- return _resolve(v.substr(3), root, root);\n+ rv = _resolve(root, toPath(v.substr(3)), resolved);\n} else {\n- if (makeAbs) {\n- const path = toPath(k);\n- return _resolve([...path.slice(0, path.length - 1), ...toPath(v.substr(2))], root);\n- }\n- return _resolve(v.substr(2), obj, root);\n+ rv = _resolve(root, [...path.slice(0, path.length - 1), ...toPath(v.substr(2))], resolved);\n}\n} else if (isPlainObject(v)) {\n- return resolveMap(v, root);\n+ resolveMap(v, root, path, resolved);\n} else if (isArray(v)) {\n- return resolveArray(v, root);\n+ resolveArray(v, root, path, resolved);\n} else if (isFunction(v)) {\n- return v((x) => _resolve(x, root, root, true));\n- } else {\n- return v;\n+ rv = v((p) => _resolve(root, toPath(p), resolved));\n}\n+ if (rv !== SEMAPHORE) {\n+ mutIn(root, path, rv);\n+ v = rv;\n+ }\n+ resolved[pp] = true;\n+ }\n+ return v;\n}\n",
"new_path": "packages/resolve-map/src/index.ts",
"old_path": "packages/resolve-map/src/index.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -34,6 +34,7 @@ describe(\"resolve-map\", () => {\nit(\"cycles\", () => {\nassert.throws(() => resolveMap({ a: \"->a\" }));\nassert.throws(() => resolveMap({ a: { b: \"->b\" } }));\n+ assert.throws(() => resolveMap({ a: { b: \"->/a\" } }));\nassert.throws(() => resolveMap({ a: { b: \"->/a.b\" } }));\nassert.throws(() => resolveMap({ a: \"->b\", b: \"->a\" }));\n});\n@@ -43,5 +44,10 @@ describe(\"resolve-map\", () => {\nresolveMap({ a: (x) => x(\"b.c\") * 10, b: { c: \"->d\", d: \"->/e\" }, e: () => 1 }),\n{ a: 10, b: { c: 1, d: 1 }, e: 1 }\n);\n+ const res = resolveMap({ a: (x) => x(\"b.c\")() * 10, b: { c: \"->d\", d: \"->/e\" }, e: () => () => 1 });\n+ assert.equal(res.a, 10);\n+ assert.strictEqual(res.b.c, res.e);\n+ assert.strictEqual(res.b.d, res.e);\n+ assert.strictEqual(res.e(), 1);\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): resolve each ref only once, re-use resolved results
- this also fixes function value resolution,
e.g. {a: () => ()=> 1, b: "->a" } only unwraps `a` once now
| 1
|
feat
|
resolve-map
|
217,922
|
16.04.2018 15:21:34
| -7,200
|
569c40e18ff97bcfdbf22fb532a31eb8babd4fdf
|
chore: removed participation permission on workshops and added some decription for UX
|
[
{
"change_type": "MODIFY",
"diff": "*ngIf=\"!isMobile() && isEveryone && !isAuthor\">{{'PERMISSIONS.Everyone' | translate}}</span>\n<span class=\"row-name\" *ngIf=\"!isMobile() && !isEveryone && isAuthor\">{{'PERMISSIONS.You' | translate}}</span>\n<span class=\"checkboxes\">\n- <mat-checkbox [(ngModel)]=\"permissions.read\" [disabled]=\"isAuthor\" (change)=\"handleChanges()\">\n+ <mat-checkbox matTooltip=\"{{'PERMISSIONS.Read_description' | translate}}\"\n+ matTooltipPosition=\"above\"\n+ [(ngModel)]=\"permissions.read\" [disabled]=\"isAuthor\" (change)=\"handleChanges()\">\n{{'PERMISSIONS.Read' | translate}}\n</mat-checkbox>\n- <mat-checkbox disabled=\"{{!permissions.read || isAuthor}}\" [(ngModel)]=\"permissions.participate\"\n+ <mat-checkbox matTooltip=\"{{'PERMISSIONS.Participate_description' | translate}}\"\n+ matTooltipPosition=\"above\"\n+ disabled=\"{{!permissions.read || isAuthor}}\"\n+ *ngIf=\"!isWorkshop()\"\n+ [(ngModel)]=\"permissions.participate\"\n(change)=\"handleChanges()\">\n{{'PERMISSIONS.Participate' | translate}}\n</mat-checkbox>\n- <mat-checkbox [(ngModel)]=\"permissions.write\" disabled=\"{{isEveryone || !permissions.read || isAuthor\n+ <mat-checkbox matTooltip=\"{{'PERMISSIONS.Write_description' | translate}}\"\n+ matTooltipPosition=\"above\"\n+ [(ngModel)]=\"permissions.write\" disabled=\"{{isEveryone || !permissions.read || isAuthor\n|| fcCrest !== undefined}}\"\n(change)=\"handleChanges()\">\n{{'PERMISSIONS.Write' | translate}}\n",
"new_path": "src/app/modules/common-components/permissions-popup/permissions-row/permissions-row.component.html",
"old_path": "src/app/modules/common-components/permissions-popup/permissions-row/permissions-row.component.html"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore: removed participation permission on workshops and added some decription for UX
| 1
|
chore
| null |
807,849
|
16.04.2018 15:22:33
| 25,200
|
ecbc1d3dcfc43b01c4979c9ff1c2156a5d05827a
|
feat(git-utils): Devolve getCurrentSHA() to consumers
BREAKING CHANGE: Don't use GitUtilities.
|
[
{
"change_type": "MODIFY",
"diff": "@@ -7,7 +7,6 @@ const pMapSeries = require(\"p-map-series\");\nconst ChildProcessUtilities = require(\"@lerna/child-process\");\nconst Command = require(\"@lerna/command\");\n-const GitUtilities = require(\"@lerna/git-utils\");\nconst PromptUtilities = require(\"@lerna/prompt\");\nconst ValidationError = require(\"@lerna/validation-error\");\n@@ -88,7 +87,7 @@ class ImportCommand extends Command {\n}\n// Stash the repo's pre-import head away in case something goes wrong.\n- this.preImportHead = GitUtilities.getCurrentSHA(this.execOpts);\n+ this.preImportHead = this.getCurrentSHA();\nif (ChildProcessUtilities.execSync(\"git\", [\"diff-index\", \"HEAD\"], this.execOpts)) {\nthrow new ValidationError(\"ECHANGES\", \"Local repository has un-committed changes\");\n@@ -115,6 +114,10 @@ class ImportCommand extends Command {\n);\n}\n+ getCurrentSHA() {\n+ return ChildProcessUtilities.execSync(\"git\", [\"rev-parse\", \"HEAD\"], this.execOpts);\n+ }\n+\ngetWorkspaceRoot() {\nreturn ChildProcessUtilities.execSync(\"git\", [\"rev-parse\", \"--show-toplevel\"], this.execOpts);\n}\n",
"new_path": "commands/import/index.js",
"old_path": "commands/import/index.js"
},
{
"change_type": "MODIFY",
"diff": "\"dependencies\": {\n\"@lerna/child-process\": \"file:../../core/child-process\",\n\"@lerna/command\": \"file:../../core/command\",\n- \"@lerna/git-utils\": \"file:../../core/git-utils\",\n\"@lerna/prompt\": \"file:../../core/prompt\",\n\"@lerna/validation-error\": \"file:../../core/validation-error\",\n\"dedent\": \"^0.7.0\",\n",
"new_path": "commands/import/package.json",
"old_path": "commands/import/package.json"
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\n+const getCurrentSHA = require(\"../lib/get-current-sha\");\n+\n+test(\"getCurrentSHA\", async () => {\n+ const cwd = await initFixture(\"root-manifest-only\");\n+\n+ expect(getCurrentSHA({ cwd })).toMatch(/^[0-9a-f]{40}$/);\n+});\n",
"new_path": "commands/publish/__tests__/get-current-sha.test.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -9,6 +9,7 @@ jest.mock(\"@lerna/npm-dist-tag\");\njest.mock(\"@lerna/npm-publish\");\njest.mock(\"@lerna/run-lifecycle\");\njest.mock(\"../lib/get-current-branch\");\n+jest.mock(\"../lib/get-current-sha\");\njest.mock(\"../lib/git-add\");\njest.mock(\"../lib/git-checkout\");\njest.mock(\"../lib/git-commit\");\n@@ -31,6 +32,7 @@ const npmDistTag = require(\"@lerna/npm-dist-tag\");\nconst npmPublish = require(\"@lerna/npm-publish\");\nconst runLifecycle = require(\"@lerna/run-lifecycle\");\nconst getCurrentBranch = require(\"../lib/get-current-branch\");\n+const getCurrentSHA = require(\"../lib/get-current-sha\");\nconst gitAdd = require(\"../lib/git-add\");\nconst gitCheckout = require(\"../lib/git-checkout\");\nconst gitCommit = require(\"../lib/git-commit\");\n@@ -105,7 +107,7 @@ describe(\"PublishCommand\", () => {\n// we've already tested these utilities elsewhere\ngetCurrentBranch.mockReturnValue(\"master\");\n- GitUtilities.getCurrentSHA.mockReturnValue(\"FULL_SHA\");\n+ getCurrentSHA.mockReturnValue(\"FULL_SHA\");\nGitUtilities.getShortSHA.mockReturnValue(\"deadbeef\");\nGitUtilities.diffSinceIn.mockReturnValue(\"\");\n",
"new_path": "commands/publish/__tests__/publish-command.test.js",
"old_path": "commands/publish/__tests__/publish-command.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -26,6 +26,7 @@ const runParallelBatches = require(\"@lerna/run-parallel-batches\");\nconst ValidationError = require(\"@lerna/validation-error\");\nconst getCurrentBranch = require(\"./lib/get-current-branch\");\n+const getCurrentSHA = require(\"./lib/get-current-sha\");\nconst gitAdd = require(\"./lib/git-add\");\nconst gitCheckout = require(\"./lib/git-checkout\");\nconst gitCommit = require(\"./lib/git-commit\");\n@@ -215,7 +216,7 @@ class PublishCommand extends Command {\n}\nannotateGitHead() {\n- const gitHead = GitUtilities.getCurrentSHA(this.execOpts);\n+ const gitHead = getCurrentSHA(this.execOpts);\nreturn pMap(this.updates, ({ pkg }) => {\nif (!pkg.private) {\n",
"new_path": "commands/publish/index.js",
"old_path": "commands/publish/index.js"
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const log = require(\"npmlog\");\n+const childProcess = require(\"@lerna/child-process\");\n+\n+module.exports = getCurrentSHA;\n+\n+function getCurrentSHA(opts) {\n+ log.silly(\"getCurrentSHA\");\n+\n+ const sha = childProcess.execSync(\"git\", [\"rev-parse\", \"HEAD\"], opts);\n+ log.verbose(\"getCurrentSHA\", sha);\n+\n+ return sha;\n+}\n",
"new_path": "commands/publish/lib/get-current-sha.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -71,14 +71,6 @@ describe(\"GitUtilities\", () => {\n});\n});\n- describe(\".getCurrentSHA()\", () => {\n- it(\"returns full SHA of current ref\", async () => {\n- const cwd = await initFixture(\"basic\");\n-\n- expect(GitUtilities.getCurrentSHA({ cwd })).toMatch(/^[0-9a-f]{40}$/);\n- });\n- });\n-\ndescribe(\".getShortSHA()\", () => {\nit(\"returns short SHA of current ref\", async () => {\nconst cwd = await initFixture(\"basic\");\n",
"new_path": "core/git-utils/__tests__/git-utils.test.js",
"old_path": "core/git-utils/__tests__/git-utils.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -66,15 +66,6 @@ function diffSinceIn(committish, location, opts) {\nreturn diff;\n}\n-function getCurrentSHA(opts) {\n- log.silly(\"getCurrentSHA\");\n-\n- const sha = ChildProcessUtilities.execSync(\"git\", [\"rev-parse\", \"HEAD\"], opts);\n- log.verbose(\"getCurrentSHA\", sha);\n-\n- return sha;\n-}\n-\nfunction getShortSHA(opts) {\nlog.silly(\"getShortSHA\");\n@@ -104,6 +95,5 @@ exports.getLastTaggedCommit = getLastTaggedCommit;\nexports.getFirstCommit = getFirstCommit;\nexports.getLastTag = getLastTag;\nexports.diffSinceIn = diffSinceIn;\n-exports.getCurrentSHA = getCurrentSHA;\nexports.getShortSHA = getShortSHA;\nexports.hasCommit = hasCommit;\n",
"new_path": "core/git-utils/index.js",
"old_path": "core/git-utils/index.js"
},
{
"change_type": "MODIFY",
"diff": "\"requires\": {\n\"@lerna/child-process\": \"file:core/child-process\",\n\"@lerna/command\": \"file:core/command\",\n- \"@lerna/git-utils\": \"file:core/git-utils\",\n\"@lerna/prompt\": \"file:core/prompt\",\n\"@lerna/validation-error\": \"file:core/validation-error\",\n\"dedent\": \"0.7.0\",\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
feat(git-utils): Devolve getCurrentSHA() to consumers
BREAKING CHANGE: Don't use GitUtilities.
| 1
|
feat
|
git-utils
|
217,922
|
16.04.2018 15:25:55
| -7,200
|
f930cbe7fed07fde52691095a343ab3c2638ad33
|
chore: fixed a small mistake on data binding for permissions-row
|
[
{
"change_type": "MODIFY",
"diff": "[fcCrest]=\"fc.crest\"\n[permissions]=\"registry.freeCompany\"\n(permissionsChange)=\"handleFcPermissionsChange($event)\"\n- (delete)=\"unbindFreeCompany()\">\n+ (delete)=\"unbindFreeCompany()\"\n+ [isWorkshop]=\"isWorkshop()\">\n</app-permissions-row>\n</span>\n[avatar]=\"row.character.avatar\"\n[name]=\"row.character.name\"\n[isAuthor]=\"row.userId === data.authorId\"\n- (delete)=\"deleteRow(row.userId)\"></app-permissions-row>\n+ (delete)=\"deleteRow(row.userId)\"\n+ [isWorkshop]=\"isWorkshop()\"></app-permissions-row>\n<app-permissions-row [permissions]=\"registry.everyone\"\n(permissionsChange)=\"handlePermissionsChange($event)\"\n- isEveryone=\"true\"></app-permissions-row>\n+ isEveryone=\"true\"\n+ [isWorkshop]=\"isWorkshop()\"></app-permissions-row>\n</mat-list>\n<ng-template #loading>\n<div class=\"loading-container\">\n",
"new_path": "src/app/modules/common-components/permissions-popup/permissions-popup.component.html",
"old_path": "src/app/modules/common-components/permissions-popup/permissions-popup.component.html"
},
{
"change_type": "MODIFY",
"diff": "<mat-checkbox matTooltip=\"{{'PERMISSIONS.Participate_description' | translate}}\"\nmatTooltipPosition=\"above\"\ndisabled=\"{{!permissions.read || isAuthor}}\"\n- *ngIf=\"!isWorkshop()\"\n+ *ngIf=\"!isWorkshop\"\n[(ngModel)]=\"permissions.participate\"\n(change)=\"handleChanges()\">\n{{'PERMISSIONS.Participate' | translate}}\n",
"new_path": "src/app/modules/common-components/permissions-popup/permissions-row/permissions-row.component.html",
"old_path": "src/app/modules/common-components/permissions-popup/permissions-row/permissions-row.component.html"
},
{
"change_type": "MODIFY",
"diff": "@@ -34,6 +34,9 @@ export class PermissionsRowComponent {\n@Input()\nisAuthor = false;\n+ @Input()\n+ isWorkshop = false;\n+\nconstructor(private media: ObservableMedia) {\n}\n",
"new_path": "src/app/modules/common-components/permissions-popup/permissions-row/permissions-row.component.ts",
"old_path": "src/app/modules/common-components/permissions-popup/permissions-row/permissions-row.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore: fixed a small mistake on data binding for permissions-row
| 1
|
chore
| null |
807,849
|
16.04.2018 15:35:15
| 25,200
|
95d179d46c6443c8be5e2ef2350b8a8fdc5905d8
|
feat(git-utils): Devolve getShortSHA() to consumers
BREAKING CHANGE: Don't use GitUtilities!
|
[
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const initFixture = require(\"@lerna-test/init-fixture\")(__dirname);\n+const getShortSHA = require(\"../lib/get-short-sha\");\n+\n+test(\"getShortSHA\", async () => {\n+ const cwd = await initFixture(\"root-manifest-only\");\n+\n+ expect(getShortSHA({ cwd })).toMatch(/^[0-9a-f]{7,8}$/);\n+});\n",
"new_path": "commands/publish/__tests__/get-short-sha.test.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -10,6 +10,7 @@ jest.mock(\"@lerna/npm-publish\");\njest.mock(\"@lerna/run-lifecycle\");\njest.mock(\"../lib/get-current-branch\");\njest.mock(\"../lib/get-current-sha\");\n+jest.mock(\"../lib/get-short-sha\");\njest.mock(\"../lib/git-add\");\njest.mock(\"../lib/git-checkout\");\njest.mock(\"../lib/git-commit\");\n@@ -33,6 +34,7 @@ const npmPublish = require(\"@lerna/npm-publish\");\nconst runLifecycle = require(\"@lerna/run-lifecycle\");\nconst getCurrentBranch = require(\"../lib/get-current-branch\");\nconst getCurrentSHA = require(\"../lib/get-current-sha\");\n+const getShortSHA = require(\"../lib/get-short-sha\");\nconst gitAdd = require(\"../lib/git-add\");\nconst gitCheckout = require(\"../lib/git-checkout\");\nconst gitCommit = require(\"../lib/git-commit\");\n@@ -108,7 +110,7 @@ describe(\"PublishCommand\", () => {\n// we've already tested these utilities elsewhere\ngetCurrentBranch.mockReturnValue(\"master\");\ngetCurrentSHA.mockReturnValue(\"FULL_SHA\");\n- GitUtilities.getShortSHA.mockReturnValue(\"deadbeef\");\n+ getShortSHA.mockReturnValue(\"deadbeef\");\nGitUtilities.diffSinceIn.mockReturnValue(\"\");\nnpmPublish.mockResolvedValue();\n",
"new_path": "commands/publish/__tests__/publish-command.test.js",
"old_path": "commands/publish/__tests__/publish-command.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -13,7 +13,6 @@ const semver = require(\"semver\");\nconst Command = require(\"@lerna/command\");\nconst ConventionalCommitUtilities = require(\"@lerna/conventional-commits\");\n-const GitUtilities = require(\"@lerna/git-utils\");\nconst PromptUtilities = require(\"@lerna/prompt\");\nconst output = require(\"@lerna/output\");\nconst collectUpdates = require(\"@lerna/collect-updates\");\n@@ -27,6 +26,7 @@ const ValidationError = require(\"@lerna/validation-error\");\nconst getCurrentBranch = require(\"./lib/get-current-branch\");\nconst getCurrentSHA = require(\"./lib/get-current-sha\");\n+const getShortSHA = require(\"./lib/get-short-sha\");\nconst gitAdd = require(\"./lib/git-add\");\nconst gitCheckout = require(\"./lib/git-checkout\");\nconst gitCommit = require(\"./lib/git-commit\");\n@@ -276,7 +276,7 @@ class PublishCommand extends Command {\nconst release = cdVersion || \"minor\";\n// FIXME: this complicated defaulting should be done in yargs option.coerce()\nconst keyword = typeof canary !== \"string\" ? preid || \"alpha\" : canary;\n- const shortHash = GitUtilities.getShortSHA(this.execOpts);\n+ const shortHash = getShortSHA(this.execOpts);\npredicate = ({ version }) => `${semver.inc(version, release)}-${keyword}.${shortHash}`;\n} else if (cdVersion) {\n",
"new_path": "commands/publish/index.js",
"old_path": "commands/publish/index.js"
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const log = require(\"npmlog\");\n+const childProcess = require(\"@lerna/child-process\");\n+\n+module.exports = getShortSHA;\n+\n+function getShortSHA(opts) {\n+ log.silly(\"getShortSHA\");\n+\n+ const sha = childProcess.execSync(\"git\", [\"rev-parse\", \"--short\", \"HEAD\"], opts);\n+ log.verbose(\"getShortSHA\", sha);\n+\n+ return sha;\n+}\n",
"new_path": "commands/publish/lib/get-short-sha.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "\"@lerna/collect-updates\": \"file:../../utils/collect-updates\",\n\"@lerna/command\": \"file:../../core/command\",\n\"@lerna/conventional-commits\": \"file:../../core/conventional-commits\",\n- \"@lerna/git-utils\": \"file:../../core/git-utils\",\n\"@lerna/npm-conf\": \"file:../../utils/npm-conf\",\n\"@lerna/npm-dist-tag\": \"file:../../utils/npm-dist-tag\",\n\"@lerna/npm-publish\": \"file:../../utils/npm-publish\",\n",
"new_path": "commands/publish/package.json",
"old_path": "commands/publish/package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -71,14 +71,6 @@ describe(\"GitUtilities\", () => {\n});\n});\n- describe(\".getShortSHA()\", () => {\n- it(\"returns short SHA of current ref\", async () => {\n- const cwd = await initFixture(\"basic\");\n-\n- expect(GitUtilities.getShortSHA({ cwd })).toMatch(/^[0-9a-f]{7,8}$/);\n- });\n- });\n-\ndescribe(\".hasCommit()\", () => {\nit(\"returns true when git command succeeds\", async () => {\nconst cwd = await initFixture(\"basic\");\n",
"new_path": "core/git-utils/__tests__/git-utils.test.js",
"old_path": "core/git-utils/__tests__/git-utils.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -66,15 +66,6 @@ function diffSinceIn(committish, location, opts) {\nreturn diff;\n}\n-function getShortSHA(opts) {\n- log.silly(\"getShortSHA\");\n-\n- const sha = ChildProcessUtilities.execSync(\"git\", [\"rev-parse\", \"--short\", \"HEAD\"], opts);\n- log.verbose(\"getShortSHA\", sha);\n-\n- return sha;\n-}\n-\nfunction hasCommit(opts) {\nlog.silly(\"hasCommit\");\nlet retVal;\n@@ -95,5 +86,4 @@ exports.getLastTaggedCommit = getLastTaggedCommit;\nexports.getFirstCommit = getFirstCommit;\nexports.getLastTag = getLastTag;\nexports.diffSinceIn = diffSinceIn;\n-exports.getShortSHA = getShortSHA;\nexports.hasCommit = hasCommit;\n",
"new_path": "core/git-utils/index.js",
"old_path": "core/git-utils/index.js"
},
{
"change_type": "MODIFY",
"diff": "\"@lerna/collect-updates\": {\n\"version\": \"file:utils/collect-updates\",\n\"requires\": {\n+ \"@lerna/child-process\": \"file:core/child-process\",\n\"@lerna/git-utils\": \"file:core/git-utils\",\n\"minimatch\": \"3.0.4\",\n\"semver\": \"5.5.0\"\n\"@lerna/collect-updates\": \"file:utils/collect-updates\",\n\"@lerna/command\": \"file:core/command\",\n\"@lerna/conventional-commits\": \"file:core/conventional-commits\",\n- \"@lerna/git-utils\": \"file:core/git-utils\",\n\"@lerna/npm-conf\": \"file:utils/npm-conf\",\n\"@lerna/npm-dist-tag\": \"file:utils/npm-dist-tag\",\n\"@lerna/npm-publish\": \"file:utils/npm-publish\",\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
},
{
"change_type": "MODIFY",
"diff": "const semver = require(\"semver\");\n+const childProcess = require(\"@lerna/child-process\");\nconst GitUtilities = require(\"@lerna/git-utils\");\nconst collectDependents = require(\"./lib/collect-dependents\");\nconst getForcedPackages = require(\"./lib/get-forced-packages\");\n@@ -21,7 +22,7 @@ function collectUpdates({ filteredPackages, packageGraph, options, execOpts, log\nif (GitUtilities.hasTags(execOpts)) {\nif (options.canary) {\n- const sha = GitUtilities.getShortSHA(execOpts);\n+ const sha = childProcess.execSync(\"git\", [\"rev-parse\", \"--short\", \"HEAD\"], execOpts);\n// if it's a merge commit, it will return all the commits that were part of the merge\n// ex: If `ab7533e` had 2 commits, ab7533e^..ab7533e would contain 2 commits + the merge commit\n",
"new_path": "utils/collect-updates/collect-updates.js",
"old_path": "utils/collect-updates/collect-updates.js"
},
{
"change_type": "MODIFY",
"diff": "\"test\": \"echo \\\"Run tests from root\\\" && exit 1\"\n},\n\"dependencies\": {\n+ \"@lerna/child-process\": \"file:../../core/child-process\",\n\"@lerna/git-utils\": \"file:../../core/git-utils\",\n\"minimatch\": \"^3.0.4\",\n\"semver\": \"^5.5.0\"\n",
"new_path": "utils/collect-updates/package.json",
"old_path": "utils/collect-updates/package.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
feat(git-utils): Devolve getShortSHA() to consumers
BREAKING CHANGE: Don't use GitUtilities!
| 1
|
feat
|
git-utils
|
807,849
|
16.04.2018 15:41:23
| 25,200
|
47dc0e25c00547b34d8c084085575162c91d3059
|
feat(diff): Move diff-only git utilities
BREAKING CHANGE: Don't use GitUtilities.
|
[
{
"change_type": "MODIFY",
"diff": "const ChildProcessUtilities = require(\"@lerna/child-process\");\nconst Command = require(\"@lerna/command\");\n-const GitUtilities = require(\"@lerna/git-utils\");\nconst ValidationError = require(\"@lerna/validation-error\");\nconst getLastCommit = require(\"./lib/get-last-commit\");\n+const hasCommit = require(\"./lib/has-commit\");\nmodule.exports = factory;\n@@ -26,7 +26,7 @@ class DiffCommand extends Command {\n}\n}\n- if (!GitUtilities.hasCommit(this.execOpts)) {\n+ if (!hasCommit(this.execOpts)) {\nthrow new ValidationError(\"ENOCOMMITS\", \"Cannot diff, there are no commits in this repository yet.\");\n}\n",
"new_path": "commands/diff/index.js",
"old_path": "commands/diff/index.js"
},
{
"change_type": "MODIFY",
"diff": "\"use strict\";\n-const GitUtilities = require(\"@lerna/git-utils\");\n+const log = require(\"npmlog\");\n+const childProcess = require(\"@lerna/child-process\");\nmodule.exports = getLastCommit;\nfunction getLastCommit(execOpts) {\n- if (GitUtilities.hasTags(execOpts)) {\n- return GitUtilities.getLastTaggedCommit(execOpts);\n+ if (hasTags(execOpts)) {\n+ return getLastTaggedCommit(execOpts);\n}\n- return GitUtilities.getFirstCommit(execOpts);\n+ return getFirstCommit(execOpts);\n+}\n+\n+function hasTags(opts) {\n+ log.silly(\"hasTags\");\n+ let result = false;\n+\n+ try {\n+ result = !!childProcess.execSync(\"git\", [\"tag\"], opts);\n+ } catch (err) {\n+ log.warn(\"ENOTAGS\", \"No git tags were reachable from this branch!\");\n+ log.verbose(\"hasTags error\", err);\n+ }\n+\n+ log.verbose(\"hasTags\", result);\n+\n+ return result;\n+}\n+\n+function getLastTaggedCommit(opts) {\n+ log.silly(\"getLastTaggedCommit\");\n+\n+ const taggedCommit = childProcess.execSync(\"git\", [\"rev-list\", \"--tags\", \"--max-count=1\"], opts);\n+ log.verbose(\"getLastTaggedCommit\", taggedCommit);\n+\n+ return taggedCommit;\n+}\n+\n+function getFirstCommit(opts) {\n+ log.silly(\"getFirstCommit\");\n+\n+ const firstCommit = childProcess.execSync(\"git\", [\"rev-list\", \"--max-parents=0\", \"HEAD\"], opts);\n+ log.verbose(\"getFirstCommit\", firstCommit);\n+\n+ return firstCommit;\n}\n",
"new_path": "commands/diff/lib/get-last-commit.js",
"old_path": "commands/diff/lib/get-last-commit.js"
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const log = require(\"npmlog\");\n+const childProcess = require(\"@lerna/child-process\");\n+\n+module.exports = hasCommit;\n+\n+function hasCommit(opts) {\n+ log.silly(\"hasCommit\");\n+ let retVal;\n+\n+ try {\n+ childProcess.execSync(\"git\", [\"log\"], opts);\n+ retVal = true;\n+ } catch (e) {\n+ retVal = false;\n+ }\n+\n+ log.verbose(\"hasCommit\", retVal);\n+ return retVal;\n+}\n",
"new_path": "commands/diff/lib/has-commit.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "\"dependencies\": {\n\"@lerna/child-process\": \"file:../../core/child-process\",\n\"@lerna/command\": \"file:../../core/command\",\n- \"@lerna/git-utils\": \"file:../../core/git-utils\",\n- \"@lerna/validation-error\": \"file:../../core/validation-error\"\n+ \"@lerna/validation-error\": \"file:../../core/validation-error\",\n+ \"npmlog\": \"^4.1.2\"\n}\n}\n",
"new_path": "commands/diff/package.json",
"old_path": "commands/diff/package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -22,24 +22,6 @@ describe(\"GitUtilities\", () => {\n});\n});\n- describe(\".getLastTaggedCommit()\", () => {\n- it(\"returns SHA of closest git tag\", async () => {\n- const cwd = await initFixture(\"basic\");\n-\n- await execa(\"git\", [\"tag\", \"v1.2.3\", \"-m\", \"v1.2.3\"], { cwd });\n-\n- expect(GitUtilities.getLastTaggedCommit({ cwd })).toMatch(/^[0-9a-f]{40}$/);\n- });\n- });\n-\n- describe(\".getFirstCommit()\", () => {\n- it(\"returns SHA of first commit\", async () => {\n- const cwd = await initFixture(\"basic\");\n-\n- expect(GitUtilities.getFirstCommit({ cwd })).toMatch(/^[0-9a-f]{40}$/);\n- });\n- });\n-\ndescribe(\".getLastTag()\", () => {\nit(\"returns the closest tag\", async () => {\nconst cwd = await initFixture(\"basic\");\n@@ -70,15 +52,4 @@ describe(\"GitUtilities\", () => {\nexpect(fileDiff).toBe(\"packages/pkg-5/index.js\");\n});\n});\n-\n- describe(\".hasCommit()\", () => {\n- it(\"returns true when git command succeeds\", async () => {\n- const cwd = await initFixture(\"basic\");\n-\n- expect(GitUtilities.hasCommit({ cwd })).toBe(true);\n-\n- await fs.remove(path.join(cwd, \".git\"));\n- expect(GitUtilities.hasCommit({ cwd })).toBe(false);\n- });\n- });\n});\n",
"new_path": "core/git-utils/__tests__/git-utils.test.js",
"old_path": "core/git-utils/__tests__/git-utils.test.js"
},
{
"change_type": "MODIFY",
"diff": "@@ -22,24 +22,6 @@ function hasTags(opts) {\nreturn result;\n}\n-function getLastTaggedCommit(opts) {\n- log.silly(\"getLastTaggedCommit\");\n-\n- const taggedCommit = ChildProcessUtilities.execSync(\"git\", [\"rev-list\", \"--tags\", \"--max-count=1\"], opts);\n- log.verbose(\"getLastTaggedCommit\", taggedCommit);\n-\n- return taggedCommit;\n-}\n-\n-function getFirstCommit(opts) {\n- log.silly(\"getFirstCommit\");\n-\n- const firstCommit = ChildProcessUtilities.execSync(\"git\", [\"rev-list\", \"--max-parents=0\", \"HEAD\"], opts);\n- log.verbose(\"getFirstCommit\", firstCommit);\n-\n- return firstCommit;\n-}\n-\nfunction getLastTag(opts) {\nlog.silly(\"getLastTag\");\n@@ -66,24 +48,6 @@ function diffSinceIn(committish, location, opts) {\nreturn diff;\n}\n-function hasCommit(opts) {\n- log.silly(\"hasCommit\");\n- let retVal;\n-\n- try {\n- ChildProcessUtilities.execSync(\"git\", [\"log\"], opts);\n- retVal = true;\n- } catch (e) {\n- retVal = false;\n- }\n-\n- log.verbose(\"hasCommit\", retVal);\n- return retVal;\n-}\n-\nexports.hasTags = hasTags;\n-exports.getLastTaggedCommit = getLastTaggedCommit;\n-exports.getFirstCommit = getFirstCommit;\nexports.getLastTag = getLastTag;\nexports.diffSinceIn = diffSinceIn;\n-exports.hasCommit = hasCommit;\n",
"new_path": "core/git-utils/index.js",
"old_path": "core/git-utils/index.js"
},
{
"change_type": "MODIFY",
"diff": "\"requires\": {\n\"@lerna/child-process\": \"file:core/child-process\",\n\"@lerna/command\": \"file:core/command\",\n- \"@lerna/git-utils\": \"file:core/git-utils\",\n- \"@lerna/validation-error\": \"file:core/validation-error\"\n+ \"@lerna/validation-error\": \"file:core/validation-error\",\n+ \"npmlog\": \"4.1.2\"\n}\n},\n\"@lerna/exec\": {\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
feat(diff): Move diff-only git utilities
BREAKING CHANGE: Don't use GitUtilities.
| 1
|
feat
|
diff
|
730,414
|
16.04.2018 15:42:53
| 14,400
|
8299d302ff96fa57ff8c8dcb7949f5b0c36854a8
|
style(widget-space): correct lint exceptions
|
[
{
"change_type": "MODIFY",
"diff": "@@ -10,6 +10,15 @@ const getCurrentUser = (state, ownProps) => ownProps.currentUser;\nconst getFeatures = (state) => state.features;\nconst getOwnProps = (state, ownProps) => ownProps;\n+function getToUser(conversation, currentUser) {\n+ // Return a CASE-INSENSITIVE filter\n+ function getToUserFilter(participant) {\n+ return participant.get('emailAddress').toLowerCase() !== currentUser.email.toLowerCase();\n+ }\n+\n+ return conversation.get('participants').filter(getToUserFilter).first();\n+}\n+\nexport const getSpaceDetails = createSelector(\n[getWidget, getConversation, getUsers, getCurrentUser],\n(widget, conversation, users, currentUser) => {\n@@ -20,8 +29,7 @@ export const getSpaceDetails = createSelector(\nlet toUser;\n// Grab avatar if we're in a direct conversation\nif (spaceDetails.get('type') === 'direct') {\n- toUser = conversation.get('participants')\n- .filter((p) => p.get('emailAddress') !== currentUser.email).first();\n+ toUser = getToUser(conversation, currentUser);\nif (toUser) {\ntitle = toUser.get('displayName');\navatarId = toUser.get('id');\n@@ -39,6 +47,7 @@ export const getSpaceDetails = createSelector(\n}\n);\n+\nexport const getActivityTypes = createSelector(\n[getWidget, getFeatures],\n(widget, features) => {\n",
"new_path": "packages/node_modules/@ciscospark/widget-space/src/selector.js",
"old_path": "packages/node_modules/@ciscospark/widget-space/src/selector.js"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
style(widget-space): correct lint exceptions
| 1
|
style
|
widget-space
|
730,429
|
16.04.2018 15:45:33
| 14,400
|
c631441fadd349d2340e2126caf740cd563c7af7
|
chore(Jenkinsfile): git checkout reordering
Tags were being cleared and never refetched.
Causing the release process not to be able to find previous version.
This way matches the order the js-sdk works.
|
[
{
"change_type": "MODIFY",
"diff": "@@ -46,8 +46,10 @@ ansiColor('xterm') {\nsshagent(['d8533977-c4c5-4e2b-938d-ae7fcbe27aac']) {\n// return the exit code because we don't care about failures\nsh script: 'git remote add upstream git@github.com:ciscospark/react-ciscospark.git', returnStatus: true\n-\n- sh 'git fetch upstream'\n+ // Make sure local tags don't include failed releases\n+ sh 'git tag -l | xargs git tag -d'\n+ sh 'git gc'\n+ sh 'git fetch upstream --tags'\n}\nchangedFiles = sh script: 'git diff --name-only upstream/master..$(git merge-base HEAD upstream/master)', returnStdout: true\n@@ -57,8 +59,6 @@ ansiColor('xterm') {\n}\nsh 'git checkout upstream/master'\n- sh 'git reset --hard && git clean -f'\n- sh 'git tag -l | xargs git tag -d'\ntry {\nsh \"git merge --ff ${GIT_COMMIT}\"\n}\n",
"new_path": "Jenkinsfile",
"old_path": "Jenkinsfile"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
chore(Jenkinsfile): git checkout reordering
Tags were being cleared and never refetched.
Causing the release process not to be able to find previous version.
This way matches the order the js-sdk works.
| 1
|
chore
|
Jenkinsfile
|
791,690
|
16.04.2018 16:52:21
| 25,200
|
e2fc6dddf74bc68fee3d743aca6caa263710c761
|
core(metrics): add lantern speed index
|
[
{
"change_type": "MODIFY",
"diff": "@@ -40,6 +40,7 @@ class PredictivePerf extends Audit {\nconst fmp = await artifacts.requestLanternFirstMeaningfulPaint({trace, devtoolsLog});\nconst ttci = await artifacts.requestLanternConsistentlyInteractive({trace, devtoolsLog});\nconst ttfcpui = await artifacts.requestLanternFirstCPUIdle({trace, devtoolsLog});\n+ const si = await artifacts.requestLanternSpeedIndex({trace, devtoolsLog});\nconst values = {\nroughEstimateOfFCP: fcp.timing,\n@@ -57,6 +58,10 @@ class PredictivePerf extends Audit {\nroughEstimateOfTTFCPUI: ttfcpui.timing,\noptimisticTTFCPUI: ttfcpui.optimisticEstimate.timeInMs,\npessimisticTTFCPUI: ttfcpui.pessimisticEstimate.timeInMs,\n+\n+ roughEstimateOfSI: si.timing,\n+ optimisticSI: si.optimisticEstimate.timeInMs,\n+ pessimisticSI: si.pessimisticEstimate.timeInMs,\n};\nconst score = Audit.computeLogNormalScore(\n",
"new_path": "lighthouse-core/audits/predictive-perf.js",
"old_path": "lighthouse-core/audits/predictive-perf.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+const MetricArtifact = require('./lantern-metric');\n+const Node = require('../../../lib/dependency-graph/node');\n+const CPUNode = require('../../../lib/dependency-graph/cpu-node'); // eslint-disable-line no-unused-vars\n+\n+class SpeedIndex extends MetricArtifact {\n+ get name() {\n+ return 'LanternSpeedIndex';\n+ }\n+\n+ /**\n+ * @return {LH.Gatherer.Simulation.MetricCoefficients}\n+ */\n+ get COEFFICIENTS() {\n+ return {\n+ intercept: 200,\n+ optimistic: 1.16,\n+ pessimistic: 0.57,\n+ };\n+ }\n+\n+ /**\n+ * @param {Node} dependencyGraph\n+ * @return {Node}\n+ */\n+ getOptimisticGraph(dependencyGraph) {\n+ return dependencyGraph;\n+ }\n+\n+ /**\n+ * @param {Node} dependencyGraph\n+ * @return {Node}\n+ */\n+ getPessimisticGraph(dependencyGraph) {\n+ return dependencyGraph;\n+ }\n+\n+ /**\n+ * @param {LH.Gatherer.Simulation.Result} simulationResult\n+ * @param {Object} extras\n+ * @return {LH.Gatherer.Simulation.Result}\n+ */\n+ getEstimateFromSimulation(simulationResult, extras) {\n+ const fcpTimeInMs = extras.fcpResult.timing;\n+ const estimate = extras.optimistic\n+ ? extras.speedline.perceptualSpeedIndex\n+ : SpeedIndex.computeLayoutBasedSpeedIndex(simulationResult.nodeTiming, fcpTimeInMs);\n+ return {\n+ timeInMs: estimate,\n+ nodeTiming: simulationResult.nodeTiming,\n+ };\n+ }\n+\n+ /**\n+ * @param {LH.Artifacts.MetricComputationData} data\n+ * @param {Object} artifacts\n+ * @return {Promise<LH.Artifacts.LanternMetric>}\n+ */\n+ async compute_(data, artifacts) {\n+ const speedline = await artifacts.requestSpeedline(data.trace);\n+ const fcpResult = await artifacts.requestLanternFirstContentfulPaint(data, artifacts);\n+ const metricResult = await this.computeMetricWithGraphs(data, artifacts, {\n+ speedline,\n+ fcpResult,\n+ });\n+ metricResult.timing = Math.max(metricResult.timing, fcpResult.timing);\n+ return metricResult;\n+ }\n+\n+ /**\n+ * Approximate speed index using layout events from the simulated node timings.\n+ * The layout-based speed index is the weighted average of the endTime of CPU nodes that contained\n+ * a 'Layout' task. log(duration) is used as the weight to stand for \"significance\" to the page.\n+ *\n+ * If no layout events can be found or the endTime of a CPU task is too early, FCP is used instead.\n+ *\n+ * This approach was determined after evaluating the accuracy/complexity tradeoff of many\n+ * different methods. Read more in the evaluation doc.\n+ *\n+ * @see https://docs.google.com/document/d/1qJWXwxoyVLVadezIp_Tgdk867G3tDNkkVRvUJSH3K1E/edit#\n+ * @param {Map<Node, LH.Gatherer.Simulation.NodeTiming>} nodeTiming\n+ * @param {number} fcpTimeInMs\n+ * @return {number}\n+ */\n+ static computeLayoutBasedSpeedIndex(nodeTiming, fcpTimeInMs) {\n+ /** @type {Array<{time: number, weight: number}>} */\n+ const layoutWeights = [];\n+ for (const [node, timing] of nodeTiming.entries()) {\n+ if (node.type !== Node.TYPES.CPU) continue;\n+ if (!timing.startTime || !timing.endTime) continue;\n+\n+ const cpuNode = /** @type {CPUNode} */ (node);\n+ if (cpuNode.childEvents.some(x => x.name === 'Layout')) {\n+ const timingWeight = Math.max(Math.log2(timing.endTime - timing.startTime), 0);\n+ layoutWeights.push({time: timing.endTime, weight: timingWeight});\n+ }\n+ }\n+\n+ if (!layoutWeights.length) {\n+ return fcpTimeInMs;\n+ }\n+\n+ const totalWeightedTime = layoutWeights\n+ .map(evt => evt.weight * Math.max(evt.time, fcpTimeInMs))\n+ .reduce((a, b) => a + b, 0);\n+ const totalWeight = layoutWeights.map(evt => evt.weight).reduce((a, b) => a + b, 0);\n+ return totalWeightedTime / totalWeight;\n+ }\n+}\n+\n+module.exports = SpeedIndex;\n",
"new_path": "lighthouse-core/gather/computed/metrics/lantern-speed-index.js",
"old_path": null
},
{
"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+const Runner = require('../../../../runner');\n+const assert = require('assert');\n+\n+const trace = require('../../../fixtures/traces/progressive-app-m60.json');\n+const devtoolsLog = require('../../../fixtures/traces/progressive-app-m60.devtools.log.json');\n+\n+/* eslint-env mocha */\n+describe('Metrics: Lantern Speed Index', () => {\n+ it('should compute predicted value', async () => {\n+ const artifacts = Runner.instantiateComputedArtifacts();\n+ const result = await artifacts.requestLanternSpeedIndex({trace, devtoolsLog});\n+\n+ assert.equal(Math.round(result.timing), 2069);\n+ assert.equal(Math.round(result.optimisticEstimate.timeInMs), 609);\n+ assert.equal(Math.round(result.pessimisticEstimate.timeInMs), 2038);\n+ });\n+});\n",
"new_path": "lighthouse-core/test/gather/computed/metrics/lantern-speed-index-test.js",
"old_path": null
}
] |
JavaScript
|
Apache License 2.0
|
googlechrome/lighthouse
|
core(metrics): add lantern speed index (#4695)
| 1
|
core
|
metrics
|
815,746
|
16.04.2018 17:21:12
| -10,800
|
829fea57989e813e232429c3d5bd44a17ca62ad6
|
fix: support object value in ng-option
fixes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -68,7 +68,7 @@ import { Observable } from 'rxjs/Observable';\n<button type=\"button\" class=\"btn btn-secondary btn-sm\" (click)=\"toggleDisabled()\">Toggle disabled</button>\n<hr/>\n---html,true\n- <ng-select [searchable]=\"false\" [(ngModel)]=\"selectedCarId\">\n+ <ng-select [(ngModel)]=\"selectedCarId\">\n<ng-option *ngFor=\"let car of cars\" [value]=\"car.id\" [disabled]=\"car.disabled\" >{{car.name}}</ng-option>\n<ng-option [value]=\"'custom'\">Custom</ng-option>\n</ng-select>\n",
"new_path": "demo/app/examples/data-source.component.ts",
"old_path": "demo/app/examples/data-source.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -208,11 +208,18 @@ export class ItemsList {\n}\nmapItem(item: any, index: number): NgOption {\n- const label = this.resolveNested(item, this._ngSelect.bindLabel);\n+ let label = '';\n+ if (isDefined(item.label)) {\n+ label = item.label;\n+ } else {\n+ label = this.resolveNested(item, this._ngSelect.bindLabel);\n+ label = isDefined(label) ? label.toString() : '';\n+ }\n+ const value = isDefined(item.value) ? item.value : item;\nreturn {\nindex: index,\n- label: isDefined(label) ? label.toString() : '',\n- value: item,\n+ label: label,\n+ value: value,\ndisabled: item.disabled,\nhtmlId: newId()\n};\n",
"new_path": "src/ng-select/items-list.ts",
"old_path": "src/ng-select/items-list.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -24,20 +24,41 @@ import { ConsoleService } from './console.service';\ndescribe('NgSelectComponent', function () {\n- describe('Init', () => {\n- it('should map items correctly', fakeAsync(() => {\n+ describe('Data source', () => {\n+ it('should set items from primitive numbers array', fakeAsync(() => {\nconst fixture = createTestingModule(\nNgSelectTestCmp,\n- `<ng-select [searchable]=\"false\"\n- [clearable]=\"false\"\n- [items]=\"[0, 30, 60, 90, 120, 180, 240]\"\n- [(ngModel)]=\"selectedCityId\">\n+ `<ng-select [items]=\"[0, 30, 60, 90, 120, 180, 240]\">\n</ng-select>`);\n- fixture.componentInstance.selectedCityId = 0;\ntickAndDetectChanges(fixture);\n- expect(fixture.componentInstance.selectedCityId).toEqual(0);\n- expect(fixture.componentInstance.select.itemsList.items[0].label).toEqual('0');\n+ const itemsList = fixture.componentInstance.select.itemsList;\n+ expect(itemsList.items.length).toBe(7);\n+ expect(itemsList.items[0]).toEqual(jasmine.objectContaining({\n+ label: '0',\n+ value: 0\n+ }));\n+ }));\n+\n+ it('should set ng-option dom elements', fakeAsync(() => {\n+ const fixture = createTestingModule(\n+ NgSelectTestCmp,\n+ `<ng-select [(ngModel)]=\"selectedCityId\">\n+ <ng-option [value]=\"'a'\">A</ng-option>\n+ <ng-option [value]=\"'b'\">B</ng-option>\n+ </ng-select>`);\n+\n+ tickAndDetectChanges(fixture);\n+ const itemsList = fixture.componentInstance.select.itemsList;\n+ expect(itemsList.items.length).toBe(2);\n+ expect(itemsList.items[0]).toEqual(jasmine.objectContaining({\n+ label: 'A',\n+ value: 'a'\n+ }));\n+ expect(itemsList.items[1]).toEqual(jasmine.objectContaining({\n+ label: 'B',\n+ value: 'b'\n+ }));\n}));\n});\n@@ -482,6 +503,30 @@ describe('NgSelectComponent', function () {\ndiscardPeriodicTasks();\n}));\n+ it('bind to dom ng-option value object', fakeAsync(() => {\n+ const fixture = createTestingModule(\n+ NgSelectTestCmp,\n+ `<ng-select [(ngModel)]=\"selectedCityId\">\n+ <ng-option [value]=\"1\">A</ng-option>\n+ <ng-option [value]=\"2\">B</ng-option>\n+ </ng-select>`);\n+\n+ // from component to model\n+ selectOption(fixture, KeyCode.ArrowDown, 0);\n+ tickAndDetectChanges(fixture);\n+ expect(fixture.componentInstance.selectedCityId).toEqual(1);\n+\n+ // from model to component\n+ fixture.componentInstance.selectedCityId = 2\n+ tickAndDetectChanges(fixture);\n+\n+ expect(fixture.componentInstance.select.selectedItems).toEqual([jasmine.objectContaining({\n+ value: 2,\n+ label: 'B'\n+ })]);\n+ discardPeriodicTasks();\n+ }));\n+\nit('should not set internal model when single select ngModel is not valid', fakeAsync(() => {\nconst fixture = createTestingModule(\nNgSelectTestCmp,\n@@ -1369,10 +1414,10 @@ describe('NgSelectComponent', function () {\nconst items = fixture.componentInstance.select.itemsList.items;\nexpect(items.length).toBe(2);\nexpect(items[0]).toEqual(jasmine.objectContaining({\n- value: { label: 'Yes', value: true, disabled: false }\n+ label: 'Yes', value: true, disabled: false\n}));\nexpect(items[1]).toEqual(jasmine.objectContaining({\n- value: { label: 'No', value: false, disabled: false }\n+ label: 'No', value: false, disabled: false\n}));\n}));\n@@ -1970,7 +2015,7 @@ describe('NgSelectComponent', function () {\n});\n});\n- describe('aria', () => {\n+ describe('Accessability', () => {\nlet fixture: ComponentFixture<NgSelectTestCmp>;\nlet select: NgSelectComponent;\nlet input: HTMLInputElement;\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": "@@ -148,7 +148,6 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nselectedItemId = 0;\nprivate _defaultLabel = 'label';\n- private _defaultValue = 'value';\nprivate _typeaheadLoading = false;\nprivate _primitive: boolean;\nprivate _compareWith: CompareWithFn;\n@@ -454,9 +453,6 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\nprivate _setItemsFromNgOptions() {\n- this.bindLabel = this.bindLabel || this._defaultLabel;\n- this.bindValue = this.bindValue || this._defaultValue;\n-\nconst handleNgOptions = (options: QueryList<NgOptionComponent>) => {\nthis.items = options.map(option => ({\nvalue: option.value,\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
|
fix: support object value in ng-option (#459)
fixes #414
| 1
|
fix
| null |
815,746
|
16.04.2018 17:56:01
| -10,800
|
5de7e30b50f6ccea9f7c93413f33d522857c2c01
|
fix: do not use HostBinding for focus state
|
[
{
"change_type": "MODIFY",
"diff": "@@ -11,7 +11,7 @@ import { AppComponent } from './app.component';\nimport { SelectWithTemplatesComponent } from './examples/custom-templates.component';\nimport { SelectBindingsComponent } from './examples/bindings.component';\nimport { SelectSearchComponent } from './examples/search.component';\n-import { ReactiveFormsComponent } from './examples/reactive-forms.component';\n+import { ReactiveFormsComponent, ConfirmationComponent } from './examples/reactive-forms.component';\nimport { SelectEventsComponent } from './examples/events.component';\nimport { SelectMultiComponent } from './examples/multi.component';\nimport { SelectTagsComponent } from './examples/tags.component';\n@@ -91,8 +91,10 @@ export const appRoutes: Routes = [\nVirtualScrollComponent,\nAppendToComponent,\nDataSourceComponent,\n- SelectGroupsComponent\n+ SelectGroupsComponent,\n+ ConfirmationComponent\n],\n+ entryComponents: [ConfirmationComponent],\nbootstrap: [AppComponent]\n})\nexport class AppModule {\n",
"new_path": "demo/app/app.module.ts",
"old_path": "demo/app/app.module.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -49,6 +49,7 @@ import { delay } from 'rxjs/operators';\n<ng-select #agesSelect [items]=\"ages\"\n[selectOnTab]=\"true\"\nbindValue=\"value\"\n+ (ngModelChange)=\"showConfirm()\"\nplaceholder=\"Select age\"\nformControlName=\"age\">\n</ng-select>\n@@ -261,6 +262,10 @@ export class ReactiveFormsComponent {\n}\n}\n+ showConfirm() {\n+ this.modalService.open(ConfirmationComponent, { size: 'lg', backdrop: 'static' });\n+ }\n+\nprivate loadAlbums() {\nthis.dataService.getAlbums().pipe(delay(500)).subscribe(albums => {\nthis.allAlbums = albums;\n@@ -277,3 +282,27 @@ export class ReactiveFormsComponent {\n}\n}\n+import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';\n+\n+@Component({\n+ selector: 'app-confirmation',\n+ template: `\n+ <div class=\"modal-header\">Next Step</div>\n+ <div class=\"modal-body\">Do you wish to continue?</div>\n+ <div class=\"modal-footer\">\n+ <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\" (click)=\"clear()\">Cancel</button>\n+ <button type=\"button\" class=\"btn btn-primary\">Yes</button>\n+ </div>\n+`\n+})\n+export class ConfirmationComponent {\n+\n+ constructor(\n+ public activeModal: NgbActiveModal,\n+ ) {}\n+\n+ clear() {\n+ this.activeModal.close();\n+ }\n+\n+}\n",
"new_path": "demo/app/examples/reactive-forms.component.ts",
"old_path": "demo/app/examples/reactive-forms.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -137,7 +137,6 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n@ViewChild('filterInput') filterInput: ElementRef;\n@HostBinding('class.ng-select-opened') isOpen = false;\n- @HostBinding('class.ng-select-focused') isFocused = false;\n@HostBinding('class.ng-select-disabled') isDisabled = false;\n@HostBinding('class.ng-select-filtered') get filtered() { return !!this.filterValue };\n@@ -331,16 +330,14 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\nselect(item: NgOption) {\n- if (!item.selected) {\nthis.itemsList.select(item);\nthis._clearSearch();\n- this._updateNgModel();\nthis.addEvent.emit(item.value);\n- }\n-\nif (this.closeOnSelect || this.itemsList.noItemsToSelect) {\nthis.close();\n}\n+\n+ this._updateNgModel();\n}\nfocus() {\n@@ -412,12 +409,12 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\nonInputFocus() {\n- this.isFocused = true;\n+ (<HTMLElement>this.elementRef.nativeElement).classList.add('ng-select-focused');\nthis.focusEvent.emit(null);\n}\nonInputBlur() {\n- this.isFocused = false;\n+ (<HTMLElement>this.elementRef.nativeElement).classList.remove('ng-select-focused');\nthis.blurEvent.emit(null);\nif (!this.isOpen && !this.isDisabled) {\nthis._onTouched();\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
|
fix: do not use HostBinding for focus state (#461)
| 1
|
fix
| null |
679,913
|
16.04.2018 17:56:51
| -3,600
|
8bcc2870d2182f19a6a3233e3516093f1eabab79
|
feat(rstream): add StreamMerge/Sync.removeID() & removeAllIDs()
update remove() & removeAll() to return boolean
|
[
{
"change_type": "MODIFY",
"diff": "@@ -59,13 +59,34 @@ export class StreamMerge<A, B> extends Subscription<A, B> {\nif (sub) {\nthis.sources.delete(src);\nsub.unsubscribe();\n+ return true;\n}\n+ return false;\n+ }\n+\n+ removeID(id: string) {\n+ for (let s of this.sources) {\n+ if (s[0].id === id) {\n+ return this.remove(s[0]);\n+ }\n+ }\n+ return false;\n}\nremoveAll(src: ISubscribable<A>[]) {\n+ let ok = true;\nfor (let s of src) {\n- this.remove(s);\n+ ok = this.remove(s) && ok;\n+ }\n+ return ok;\n+ }\n+\n+ removeAllIDs(ids: string[]) {\n+ let ok = true;\n+ for (let id of ids) {\n+ ok = this.removeID(id) && ok;\n}\n+ return ok;\n}\nunsubscribe(sub?: Subscription<B, any>) {\n",
"new_path": "packages/rstream/src/stream-merge.ts",
"old_path": "packages/rstream/src/stream-merge.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -117,7 +117,18 @@ export class StreamSync<A, B> extends Subscription<A, B> {\nthis.sourceIDs.delete(src.id);\nthis.sources.delete(src);\nsub.unsubscribe();\n+ return true;\n}\n+ return false;\n+ }\n+\n+ removeID(id: string) {\n+ for (let s of this.sources) {\n+ if (s[0].id === id) {\n+ return this.remove(s[0]);\n+ }\n+ }\n+ return false;\n}\nremoveAll(src: ISubscribable<A>[]) {\n@@ -125,9 +136,19 @@ export class StreamSync<A, B> extends Subscription<A, B> {\nfor (let s of src) {\nthis.sourceIDs.delete(s.id);\n}\n+ let ok = true;\nfor (let s of src) {\n- this.remove(s);\n+ ok = this.remove(s) && ok;\n+ }\n+ return ok;\n+ }\n+\n+ removeAllIDs(ids: string[]) {\n+ let ok = true;\n+ for (let id of ids) {\n+ ok = this.removeID(id) && ok;\n}\n+ return ok;\n}\nunsubscribe(sub?: Subscription<B, any>) {\n",
"new_path": "packages/rstream/src/stream-sync.ts",
"old_path": "packages/rstream/src/stream-sync.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(rstream): add StreamMerge/Sync.removeID() & removeAllIDs()
- update remove() & removeAll() to return boolean
| 1
|
feat
|
rstream
|
815,746
|
16.04.2018 17:57:59
| -10,800
|
f5101d0540508a17a7abf3677944860897b2ea68
|
chore(release): 1.0.2
|
[
{
"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=\"1.0.2\"></a>\n+## [1.0.2](https://github.com/ng-select/ng-select/compare/v1.0.1...v1.0.2) (2018-04-16)\n+\n+\n+\n<a name=\"1.0.1\"></a>\n## [1.0.1](https://github.com/ng-select/ng-select/compare/v1.0.1-rc.0...v1.0.1) (2018-04-16)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"$schema\": \"../node_modules/ng-packagr/package.schema.json\",\n\"name\": \"@ng-select/ng-select\",\n- \"version\": \"1.0.1\",\n+ \"version\": \"1.0.2\",\n\"description\": \"Angular ng-select - All in One UI Select, Multiselect and Autocomplete\",\n\"author\": \"@ng-select/ng-select\",\n\"license\": \"MIT\",\n",
"new_path": "src/package.json",
"old_path": "src/package.json"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
chore(release): 1.0.2
| 1
|
chore
|
release
|
679,913
|
16.04.2018 18:00:24
| -3,600
|
5ddb19c6f0e0935308b4ce8f25e4e45f5e788f3a
|
feat(rstream-graph): add addNode()/removeNode()
|
[
{
"change_type": "MODIFY",
"diff": "@@ -74,6 +74,17 @@ const nodeFromSpec = (state: IAtom<any>, spec: NodeSpec) => (resolve) => {\nreturn node;\n};\n+export const addNode = (graph: IObjectOf<ISubscribable<any>>, state: IAtom<any>, id: string, spec: NodeSpec) =>\n+ graph[id] = nodeFromSpec(state, spec)((nodeID) => graph[nodeID]);\n+\n+export const removeNode = (graph: IObjectOf<ISubscribable<any>>, id: string) => {\n+ if (graph[id]) {\n+ graph[id].unsubscribe();\n+ delete graph[id];\n+ return true;\n+ }\n+};\n+\n/**\n* Higher order node / stream creator. Takes a transducer and optional\n* arity (number of required input streams). The returned function takes\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
|
feat(rstream-graph): add addNode()/removeNode()
| 1
|
feat
|
rstream-graph
|
217,922
|
16.04.2018 19:10:46
| -7,200
|
645dad7765e52cbab70aaaaea19504258c1db197
|
chore: better handling of deleted shared lists/workshops
|
[
{
"change_type": "MODIFY",
"diff": "@@ -100,6 +100,9 @@ export class ListService {\n* @returns {Observable<List[]>}\n*/\npublic fetchWorkshop(workshop: Workshop): Observable<List[]> {\n+ if (workshop.listIds.length === 0) {\n+ return Observable.of([]);\n+ }\nreturn Observable.combineLatest(workshop.listIds.map(listId => this.get(listId)));\n}\n",
"new_path": "src/app/core/database/list.service.ts",
"old_path": "src/app/core/database/list.service.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -262,7 +262,12 @@ export class ListsComponent extends ComponentWithSubscriptions implements OnInit\nngOnInit() {\nthis.sharedLists = this.userService.getUserData().mergeMap(user => {\n- return Observable.combineLatest(user.sharedLists.map(listId => this.listService.get(listId)));\n+ return Observable.combineLatest(user.sharedLists.map(listId => this.listService.get(listId)\n+ .catch(() => {\n+ user.sharedLists = user.sharedLists.filter(id => id !== listId);\n+ return this.userService.set(user.$key, user).map(() => null);\n+ })))\n+ .map(lists => lists.filter(l => l !== null));\n});\nthis.workshops = this.auth.authState.mergeMap(user => {\nif (user === null) {\n@@ -277,12 +282,20 @@ export class ListsComponent extends ComponentWithSubscriptions implements OnInit\n} else {\nreturn this.reloader$.mergeMap(() => {\nreturn Observable.combineLatest(user.sharedWorkshops.map(workshopId => {\n- return this.workshopService.get(workshopId).mergeMap(workshop => {\n+ return this.workshopService.get(workshopId)\n+ .catch(() => {\n+ user.sharedWorkshops = user.sharedWorkshops.filter(id => id !== workshopId);\n+ return this.userService.set(user.$key, user).map(() => null);\n+ })\n+ .mergeMap(workshop => {\n+ if (workshop !== null) {\nreturn this.listService.fetchWorkshop(workshop).map(lists => {\nreturn {workshop: workshop, lists: lists};\n});\n+ }\n+ return Observable.of(null);\n});\n- }));\n+ })).map(workshops => workshops.filter(w => w !== null));\n});\n}\n});\n",
"new_path": "src/app/pages/lists/lists/lists.component.ts",
"old_path": "src/app/pages/lists/lists/lists.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore: better handling of deleted shared lists/workshops
| 1
|
chore
| null |
217,922
|
16.04.2018 20:47:18
| -7,200
|
bf1f4179f71721b690d45928d817870b9e54cf85
|
chore: small fixes for 3.5.0
added fallback for shared lists and workshops, fixed a translation and added more details to the Not Found error
|
[
{
"change_type": "MODIFY",
"diff": "@@ -47,7 +47,7 @@ export abstract class FirestoreStorage<T extends DataModel> extends DataStore<T>\n.map((snap: Action<DocumentSnapshot>) => {\nconst valueWithKey: T = <T>{$key: snap.payload.id, ...snap.payload.data()};\nif (!snap.payload.exists) {\n- throw new Error('Not found');\n+ throw new Error(`${this.getBaseUri()}/${uid} Not found`);\n}\ndelete snap.payload;\nreturn this.serializer.deserialize<T>(valueWithKey, this.getClass());\n",
"new_path": "src/app/core/database/storage/firebase/firestore-storage.ts",
"old_path": "src/app/core/database/storage/firebase/firestore-storage.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -262,7 +262,7 @@ export class ListsComponent extends ComponentWithSubscriptions implements OnInit\nngOnInit() {\nthis.sharedLists = this.userService.getUserData().mergeMap(user => {\n- return Observable.combineLatest(user.sharedLists.map(listId => this.listService.get(listId)\n+ return Observable.combineLatest((user.sharedLists || []).map(listId => this.listService.get(listId)\n.catch(() => {\nuser.sharedLists = user.sharedLists.filter(id => id !== listId);\nreturn this.userService.set(user.$key, user).map(() => null);\n@@ -281,7 +281,7 @@ export class ListsComponent extends ComponentWithSubscriptions implements OnInit\nreturn this.reloader$.mergeMap(() => Observable.of([]));\n} else {\nreturn this.reloader$.mergeMap(() => {\n- return Observable.combineLatest(user.sharedWorkshops.map(workshopId => {\n+ return Observable.combineLatest((user.sharedWorkshops || []).map(workshopId => {\nreturn this.workshopService.get(workshopId)\n.catch(() => {\nuser.sharedWorkshops = user.sharedWorkshops.filter(id => id !== workshopId);\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": "@@ -122,7 +122,7 @@ export class RecipesComponent extends PageComponent implements OnInit {\nsuper.ngOnInit();\nthis.sharedLists = this.userService.getUserData().mergeMap(user => {\n- return Observable.combineLatest(user.sharedLists.map(listId => this.listService.get(listId)));\n+ return Observable.combineLatest((user.sharedLists || []).map(listId => this.listService.get(listId)));\n}).publishReplay(1).refCount();\nthis.workshops = this.userService.getUserData().mergeMap(user => {\n",
"new_path": "src/app/pages/recipes/recipes/recipes.component.ts",
"old_path": "src/app/pages/recipes/recipes/recipes.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore: small fixes for 3.5.0
added fallback for shared lists and workshops, fixed a translation and added more details to the Not Found error
| 1
|
chore
| null |
217,922
|
16.04.2018 21:37:14
| -7,200
|
c10e72a34c97af1656821f06ffde41df10f040a7
|
chore: fixed japanese json file mistake
|
[
{
"change_type": "MODIFY",
"diff": "@@ -152,7 +152,6 @@ export class ListPanelComponent extends ComponentWithSubscriptions implements On\nngOnInit(): void {\nthis.author = this.userService.getCharacter(this.list.authorId)\n.catch(err => {\n- console.error(err);\nreturn Observable.of(null);\n});\n",
"new_path": "src/app/modules/common-components/list-panel/list-panel.component.ts",
"old_path": "src/app/modules/common-components/list-panel/list-panel.component.ts"
},
{
"change_type": "MODIFY",
"diff": "\"Feature_requires_nickname\": \"This feature requires you to set a nickname\",\n\"Nickname\": \"Nickname\",\n\"No_nickname\": \"No nickname set\",\n- \"Patreon_link_email\": \"Link patreon email\",,\n+ \"Patreon_link_email\": \"Link patreon email\",\n\"Patreon_edit_email\": \"Edit patreon email\",\n\"Email_already_used\": \"Email already linked to another account\",\n\"Patreon_email\": \"Patreon Email\",\n",
"new_path": "src/assets/i18n/ja.json",
"old_path": "src/assets/i18n/ja.json"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore: fixed japanese json file mistake
| 1
|
chore
| null |
217,922
|
16.04.2018 21:42:37
| -7,200
|
642e7c77778c7ed54452d000e4d6d00fb2779f44
|
chore: UX fix for permissions tooltip and missing translations
|
[
{
"change_type": "MODIFY",
"diff": "</button>\n<span *ngIf=\"list.authorId === userUid\"\n[matTooltipDisabled]=\"!anonymous\"\n- [matTooltip]=\"'PERMISSIONS.No_anonymous' | translate\">\n+ [matTooltip]=\"'PERMISSIONS.No_anonymous' | translate\"\n+ matTooltipPosition=\"above\">\n<button mat-icon-button\n(click)=\"$event.stopPropagation();openPermissions(list)\"\n[disabled]=\"anonymous\"\n- [matTooltip]=\"'PERMISSIONS.Title' | translate\">\n+ [matTooltip]=\"'PERMISSIONS.Title' | translate\"\n+ matTooltipPosition=\"above\">\n<mat-icon>security</mat-icon>\n</button>\n</span>\n",
"new_path": "src/app/modules/common-components/list-panel/list-panel.component.html",
"old_path": "src/app/modules/common-components/list-panel/list-panel.component.html"
},
{
"change_type": "MODIFY",
"diff": "</button>\n<span *ngIf=\"workshop.authorId === userData.$key\"\n[matTooltipDisabled]=\"!anonymous\"\n- [matTooltip]=\"'PERMISSIONS.No_anonymous' | translate\">\n+ [matTooltip]=\"'PERMISSIONS.No_anonymous' | translate\"\n+ matTooltipPosition=\"above\">\n<button mat-icon-button\n(click)=\"$event.stopPropagation();openPermissions(workshop)\"\n[disabled]=\"anonymous\"\n- [matTooltip]=\"'PERMISSIONS.Title' | translate\">\n+ [matTooltip]=\"'PERMISSIONS.Title' | translate\"\n+ matTooltipPosition=\"above\">\n<mat-icon>security</mat-icon>\n</button>\n</span>\n</button>\n<span *ngIf=\"workshopData.workshop.authorId === userData.$key\"\n[matTooltipDisabled]=\"!anonymous\"\n- [matTooltip]=\"'PERMISSIONS.No_anonymous' | translate\">\n+ [matTooltip]=\"'PERMISSIONS.No_anonymous' | translate\"\n+ matTooltipPosition=\"above\">\n<button mat-icon-button\n(click)=\"$event.stopPropagation();openPermissions(workshopData.workshop)\"\n[disabled]=\"anonymous\"\n- [matTooltip]=\"'PERMISSIONS.Title' | translate\">\n+ [matTooltip]=\"'PERMISSIONS.Title' | translate\"\n+ matTooltipPosition=\"above\">\n<mat-icon>security</mat-icon>\n</button>\n</span>\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": "\"Placeholder\": \"Email or User ID\",\n\"Bind_free_company\": \"Bind some permissions to your Free Company\",\n\"User_not_found\": \"User not found\",\n- \"User_id_tip\": \"The user ID can be found in profile page in bottom-right corner\"\n+ \"User_id_tip\": \"The user ID can be found in profile page in bottom-right corner\",\n+ \"Saving\": \"Saving permissions\",\n+ \"No_anonymous\": \"You need an account to manage permissions\"\n}\n}\n",
"new_path": "src/assets/i18n/en.json",
"old_path": "src/assets/i18n/en.json"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore: UX fix for permissions tooltip and missing translations
| 1
|
chore
| null |
217,922
|
16.04.2018 22:44:14
| -7,200
|
720b6c09305598465a038d2e1a3695c1cdf58cbb
|
chore: small refactoring on workshops fetch
|
[
{
"change_type": "MODIFY",
"diff": "@@ -269,11 +269,11 @@ export class ListsComponent extends ComponentWithSubscriptions implements OnInit\n})))\n.map(lists => lists.filter(l => l !== null));\n});\n- this.workshops = this.auth.authState.mergeMap(user => {\n+ this.workshops = this.userService.getUserData().mergeMap(user => {\nif (user === null) {\nreturn this.reloader$.mergeMap(() => Observable.of([]));\n} else {\n- return this.reloader$.mergeMap(() => this.workshopService.getUserWorkshops(user.uid));\n+ return this.reloader$.mergeMap(() => this.workshopService.getUserWorkshops(user.$key));\n}\n});\nthis.sharedWorkshops = this.userService.getUserData().mergeMap(user => {\n@@ -331,7 +331,9 @@ export class ListsComponent extends ComponentWithSubscriptions implements OnInit\n}\n}\nif (additionalLists.length > 0) {\n- return Observable.combineLatest(additionalLists.map(listId => this.listService.get(listId)))\n+ return Observable.combineLatest(additionalLists.map(listId => this.listService.get(listId)\n+ .catch(() => Observable.of(null))))\n+ .map(ls => ls.filter(l => l !== null))\n.map(externalLists => lists.concat(externalLists));\n} else {\nreturn Observable.of(lists);\n",
"new_path": "src/app/pages/lists/lists/lists.component.ts",
"old_path": "src/app/pages/lists/lists/lists.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore: small refactoring on workshops fetch
| 1
|
chore
| null |
730,412
|
17.04.2018 00:36:49
| 0
|
152bbb12902197117103b23adcb739024836cf58
|
chore(release): 0.1.275
|
[
{
"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.275\"></a>\n+## [0.1.275](https://github.com/ciscospark/react-ciscospark/compare/v0.1.274...v0.1.275) (2018-04-17)\n+\n+\n+\n<a name=\"0.1.274\"></a>\n## 0.1.274 (2018-04-16)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@ciscospark/react-ciscospark\",\n- \"version\": \"0.1.274\",\n+ \"version\": \"0.1.275\",\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.275
| 1
|
chore
|
release
|
815,745
|
17.04.2018 08:40:27
| -10,800
|
852643fc93c6557c7b5bb896e5e080d82a4429fc
|
fix(hideSelected): allow to open dropdown when tagging enabled
fixes
|
[
{
"change_type": "MODIFY",
"diff": "@@ -21,6 +21,7 @@ import { Component, ChangeDetectionStrategy } from '@angular/core';\n---html,true\n<ng-select [items]=\"companies\"\n[addTag]=\"addTag\"\n+ [hideSelected]=\"true\"\nmultiple=\"true\"\nbindLabel=\"name\"\n[(ngModel)]=\"selectedCompanyCustom\">\n",
"new_path": "demo/app/examples/tags.component.ts",
"old_path": "demo/app/examples/tags.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -1533,6 +1533,14 @@ describe('NgSelectComponent', function () {\nexpect(select.isOpen).toBeFalsy();\n}));\n+ it('should open dropdown when all items are selected and tagging is enabled', fakeAsync(() => {\n+ select.addTag = true;\n+ fixture.componentInstance.cities = [];\n+ tickAndDetectChanges(fixture);\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n+ expect(select.isOpen).toBeTruthy();\n+ }));\n+\nit('should remove selected item from items list', fakeAsync(() => {\nfixture.componentInstance.selectedCities = [fixture.componentInstance.cities[0]];\ntickAndDetectChanges(fixture);\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": "@@ -294,7 +294,8 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nif (this.isDisabled || this.isOpen || this.itemsList.maxItemsSelected) {\nreturn;\n}\n- if (!this._isTypeahead && (this.itemsList.noItemsToSelect)) {\n+\n+ if (!this._isTypeahead && !this.addTag && this.itemsList.noItemsToSelect) {\nreturn;\n}\nthis.isOpen = true;\n@@ -376,7 +377,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nshowAddTag() {\nreturn this.addTag &&\nthis.filterValue &&\n- !this.itemsList.filteredItems.some(x => x.label.toLowerCase() === this.filterValue.toLowerCase()) &&\n+ !this.selectedItems.some(x => x.label.toLowerCase() === this.filterValue.toLowerCase()) &&\n!this.isLoading;\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
|
fix(hideSelected): allow to open dropdown when tagging enabled (#464)
fixes #457
| 1
|
fix
|
hideSelected
|
807,849
|
17.04.2018 12:33:13
| 25,200
|
cb9c19d9ec0390cbc45c22208bde6ab5468ac8c5
|
feat(collect-updates): Copy remaining git utilities into module
BREAKING CHANGE: GitUtilities is going away soon.
|
[
{
"change_type": "MODIFY",
"diff": "\"version\": \"file:utils/collect-updates\",\n\"requires\": {\n\"@lerna/child-process\": \"file:core/child-process\",\n- \"@lerna/git-utils\": \"file:core/git-utils\",\n\"minimatch\": \"3.0.4\",\n- \"semver\": \"5.5.0\"\n+ \"npmlog\": \"4.1.2\",\n+ \"semver\": \"5.5.0\",\n+ \"slash\": \"1.0.0\"\n}\n},\n\"@lerna/command\": {\n\"npmlog\": \"4.1.2\"\n}\n},\n- \"@lerna/git-utils\": {\n- \"version\": \"file:core/git-utils\",\n- \"requires\": {\n- \"@lerna/child-process\": \"file:core/child-process\",\n- \"npmlog\": \"4.1.2\",\n- \"slash\": \"1.0.0\"\n- }\n- },\n\"@lerna/global-options\": {\n\"version\": \"file:core/global-options\"\n},\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
},
{
"change_type": "MODIFY",
"diff": "\"use strict\";\n+const childProcess = require(\"@lerna/child-process\");\nconst semver = require(\"semver\");\n-const childProcess = require(\"@lerna/child-process\");\n-const GitUtilities = require(\"@lerna/git-utils\");\n+const hasTags = require(\"./lib/has-tags\");\nconst collectDependents = require(\"./lib/collect-dependents\");\nconst getForcedPackages = require(\"./lib/get-forced-packages\");\nconst makeDiffPredicate = require(\"./lib/make-diff-predicate\");\n@@ -20,7 +20,7 @@ function collectUpdates({ filteredPackages, packageGraph, options, execOpts, log\nlet { since: committish } = options;\n- if (GitUtilities.hasTags(execOpts)) {\n+ if (hasTags(execOpts)) {\nif (options.canary) {\nconst sha = childProcess.execSync(\"git\", [\"rev-parse\", \"--short\", \"HEAD\"], execOpts);\n@@ -28,7 +28,7 @@ function collectUpdates({ filteredPackages, packageGraph, options, execOpts, log\n// ex: If `ab7533e` had 2 commits, ab7533e^..ab7533e would contain 2 commits + the merge commit\ncommittish = `${sha}^..${sha}`;\n} else if (!committish) {\n- committish = GitUtilities.getLastTag(execOpts);\n+ committish = childProcess.execSync(\"git\", [\"describe\", \"--tags\", \"--abbrev=0\"], execOpts);\n}\n}\n",
"new_path": "utils/collect-updates/collect-updates.js",
"old_path": "utils/collect-updates/collect-updates.js"
},
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const childProcess = require(\"@lerna/child-process\");\n+const log = require(\"npmlog\");\n+\n+module.exports = hasTags;\n+\n+function hasTags(opts) {\n+ log.silly(\"hasTags\");\n+ let result = false;\n+\n+ try {\n+ result = !!childProcess.execSync(\"git\", [\"tag\"], opts);\n+ } catch (err) {\n+ log.warn(\"ENOTAGS\", \"No git tags were reachable from this branch!\");\n+ log.verbose(\"hasTags error\", err);\n+ }\n+\n+ log.verbose(\"hasTags\", result);\n+\n+ return result;\n+}\n",
"new_path": "utils/collect-updates/lib/has-tags.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "\"use strict\";\n+const childProcess = require(\"@lerna/child-process\");\n+const log = require(\"npmlog\");\nconst minimatch = require(\"minimatch\");\n-const GitUtilities = require(\"@lerna/git-utils\");\n+const path = require(\"path\");\n+const slash = require(\"slash\");\nmodule.exports = makeDiffPredicate;\n@@ -9,7 +12,7 @@ function makeDiffPredicate(committish, execOpts, ignorePatterns = []) {\nconst ignoreFilters = new Set(ignorePatterns.map(p => minimatch.filter(`!${p}`, { matchBase: true })));\nreturn function hasDiffSinceThatIsntIgnored(node) {\n- const diff = GitUtilities.diffSinceIn(committish, node.location, execOpts);\n+ const diff = diffSinceIn(committish, node.location, execOpts);\nif (diff === \"\") {\nreturn false;\n@@ -26,3 +29,20 @@ function makeDiffPredicate(committish, execOpts, ignorePatterns = []) {\nreturn changedFiles.length > 0;\n};\n}\n+\n+function diffSinceIn(committish, location, opts) {\n+ const args = [\"diff\", \"--name-only\", committish];\n+ const formattedLocation = slash(path.relative(opts.cwd, location));\n+\n+ if (formattedLocation) {\n+ // avoid same-directory path.relative() === \"\"\n+ args.push(\"--\", formattedLocation);\n+ }\n+\n+ log.silly(\"diffSinceIn\", committish, formattedLocation);\n+\n+ const diff = childProcess.execSync(\"git\", args, opts);\n+ log.silly(\"diff\", diff);\n+\n+ return diff;\n+}\n",
"new_path": "utils/collect-updates/lib/make-diff-predicate.js",
"old_path": "utils/collect-updates/lib/make-diff-predicate.js"
},
{
"change_type": "MODIFY",
"diff": "},\n\"dependencies\": {\n\"@lerna/child-process\": \"file:../../core/child-process\",\n- \"@lerna/git-utils\": \"file:../../core/git-utils\",\n\"minimatch\": \"^3.0.4\",\n- \"semver\": \"^5.5.0\"\n+ \"npmlog\": \"^4.1.2\",\n+ \"semver\": \"^5.5.0\",\n+ \"slash\": \"^1.0.0\"\n}\n}\n",
"new_path": "utils/collect-updates/package.json",
"old_path": "utils/collect-updates/package.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
feat(collect-updates): Copy remaining git utilities into module
BREAKING CHANGE: GitUtilities is going away soon.
| 1
|
feat
|
collect-updates
|
807,849
|
17.04.2018 12:44:57
| 25,200
|
00242afa1efa43a98dc84815ac8f554ffa58d472
|
chore(helpers): Extract helper
|
[
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+const execa = require(\"execa\");\n+const serializeGitSHA = require(\"@lerna-test/serialize-git-sha\");\n+\n+module.exports = showCommit;\n+\n+function showCommit(cwd, ...args) {\n+ return execa\n+ .stdout(\"git\", [\"show\", \"--unified=0\", \"--ignore-space-at-eol\", \"--pretty=%B%+D\", ...args], { cwd })\n+ .then(stdout => serializeGitSHA.print(stdout));\n+}\n",
"new_path": "helpers/show-commit/index.js",
"old_path": null
},
{
"change_type": "ADD",
"diff": "+{\n+ \"name\": \"@lerna-test/show-commit\",\n+ \"version\": \"0.0.0-test-only\",\n+ \"description\": \"A local test helper\",\n+ \"main\": \"index.js\",\n+ \"private\": true,\n+ \"license\": \"MIT\",\n+ \"dependencies\": {\n+ \"@lerna-test/serialize-git-sha\": \"file:../serialize-git-sha\",\n+ \"execa\": \"^0.9.0\"\n+ }\n+}\n",
"new_path": "helpers/show-commit/package.json",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "@@ -263,6 +263,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline\nexports[`lerna publish replaces file: specifier with local version before npm publish but after git commit 1`] = `\nv2.0.0\n+HEAD -> master, tag: v2.0.0, origin/master\n+\ndiff --git a/lerna.json b/lerna.json\nindex SHA..SHA 100644\n--- a/lerna.json\n",
"new_path": "integration/__snapshots__/lerna-publish.test.js.snap",
"old_path": "integration/__snapshots__/lerna-publish.test.js.snap"
},
{
"change_type": "MODIFY",
"diff": "@@ -14,6 +14,7 @@ const cliRunner = require(\"@lerna-test/cli-runner\");\nconst gitAdd = require(\"@lerna-test/git-add\");\nconst gitCommit = require(\"@lerna-test/git-commit\");\nconst gitTag = require(\"@lerna-test/git-tag\");\n+const showCommit = require(\"@lerna-test/show-commit\");\nconst cloneFixture = require(\"@lerna-test/clone-fixture\")(\npath.resolve(__dirname, \"../commands/publish/__tests__\")\n);\n@@ -134,9 +135,7 @@ describe(\"lerna publish\", () => {\nawait cliRunner(cwd)(\"publish\", \"--cd-version=major\", \"--skip-npm\", \"--yes\");\n- expect(\n- await execa.stdout(\"git\", [\"show\", \"--unified=0\", \"--ignore-space-at-eol\", \"--format=%s\"], { cwd })\n- ).toMatchSnapshot();\n+ expect(await showCommit(cwd)).toMatchSnapshot();\n});\ntest(\"calls lifecycle scripts\", async () => {\n",
"new_path": "integration/lerna-publish.test.js",
"old_path": "integration/lerna-publish.test.js"
},
{
"change_type": "MODIFY",
"diff": "\"version\": \"file:helpers/set-npm-userconfig\",\n\"dev\": true\n},\n+ \"@lerna-test/show-commit\": {\n+ \"version\": \"file:helpers/show-commit\",\n+ \"dev\": true,\n+ \"requires\": {\n+ \"@lerna-test/serialize-git-sha\": \"file:helpers/serialize-git-sha\",\n+ \"execa\": \"0.9.0\"\n+ }\n+ },\n\"@lerna-test/silence-logging\": {\n\"version\": \"file:helpers/silence-logging\",\n\"dev\": true,\n",
"new_path": "package-lock.json",
"old_path": "package-lock.json"
},
{
"change_type": "MODIFY",
"diff": "\"@lerna-test/serialize-git-sha\": \"file:helpers/serialize-git-sha\",\n\"@lerna-test/serialize-placeholders\": \"file:helpers/serialize-placeholders\",\n\"@lerna-test/set-npm-userconfig\": \"file:helpers/set-npm-userconfig\",\n+ \"@lerna-test/show-commit\": \"file:helpers/show-commit\",\n\"@lerna-test/silence-logging\": \"file:helpers/silence-logging\",\n\"@lerna-test/update-lerna-config\": \"file:helpers/update-lerna-config\",\n\"cross-env\": \"^5.1.4\",\n",
"new_path": "package.json",
"old_path": "package.json"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
chore(helpers): Extract @lerna-test/show-commit helper
| 1
|
chore
|
helpers
|
679,905
|
17.04.2018 14:39:11
| -7,200
|
de89f00d2405875ec41cdf0af26f31ce03e802fc
|
fix(transducers): Provide argument types for compR() and deepTransform()
|
[
{
"change_type": "MODIFY",
"diff": "import { Reducer } from \"../api\";\n-export function compR(rfn: Reducer<any, any>, fn: (acc, x) => any) {\n+export function compR(rfn: Reducer<any, any>, fn: (acc: any, x: any) => any) {\nreturn <Reducer<any, any>>[rfn[0], rfn[1], fn];\n}\n",
"new_path": "packages/transducers/src/func/compr.ts",
"old_path": "packages/transducers/src/func/compr.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -63,7 +63,7 @@ import { TransformSpec } from \"../api\";\n*\n* @param spec transformation spec\n*/\n-export function deepTransform(spec: TransformSpec): (x) => any {\n+export function deepTransform(spec: TransformSpec): (x: any) => any {\nif (isFunction(spec)) {\nreturn <any>spec;\n}\n",
"new_path": "packages/transducers/src/func/deep-transform.ts",
"old_path": "packages/transducers/src/func/deep-transform.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(transducers): Provide argument types for compR() and deepTransform()
| 1
|
fix
|
transducers
|
679,913
|
17.04.2018 16:10:15
| -3,600
|
d7ff997b9bddaf8826ee6888ccf3a285c0851bdc
|
fix(interceptors): filter out undefined sidefx vals
only when assigning array of multiple vals to a single side fx
|
[
{
"change_type": "MODIFY",
"diff": "@@ -464,7 +464,7 @@ export class StatelessEventBus implements\n} else if (k === FX_DISPATCH_NOW) {\nif (isArray(v[0])) {\nfor (let e of v) {\n- this.dispatchNow(e);\n+ e && this.dispatchNow(e);\n}\n} else {\nthis.dispatchNow(v);\n@@ -472,7 +472,9 @@ export class StatelessEventBus implements\n} else {\nif (ctx[k]) {\nif (isArray(v[0])) {\n- Array.prototype.push.apply(ctx[k], v);\n+ for (let e of v) {\n+ e !== undefined && ctx[k].push(e);\n+ }\n} else {\nctx[k].push(v)\n}\n",
"new_path": "packages/interceptors/src/event-bus.ts",
"old_path": "packages/interceptors/src/event-bus.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
fix(interceptors): filter out undefined sidefx vals
- only when assigning array of multiple vals to a single side fx
| 1
|
fix
|
interceptors
|
730,414
|
17.04.2018 16:25:28
| 14,400
|
e4a270e9d736d469a9dd4f3d6e47e16da426b24a
|
refactor(widget-space): filter on ID rather than email
|
[
{
"change_type": "MODIFY",
"diff": "@@ -10,13 +10,17 @@ const getCurrentUser = (state, ownProps) => ownProps.currentUser;\nconst getFeatures = (state) => state.features;\nconst getOwnProps = (state, ownProps) => ownProps;\n+/**\n+ * Get the other user in the 1:1 conversation.\n+ * @param {convesation} conversation\n+ * @param {participant} currentUser\n+ * @returns {participant}\n+ */\nfunction getToUser(conversation, currentUser) {\n- // Return a CASE-INSENSITIVE filter\n- function getToUserFilter(participant) {\n- return participant.get('emailAddress').toLowerCase() !== currentUser.email.toLowerCase();\n- }\n-\n- return conversation.get('participants').filter(getToUserFilter).first();\n+ return conversation\n+ .get('participants')\n+ .filter((participant) => participant.get('id') !== currentUser.id)\n+ .first();\n}\nexport const getSpaceDetails = createSelector(\n@@ -47,7 +51,6 @@ export const getSpaceDetails = createSelector(\n}\n);\n-\nexport const getActivityTypes = createSelector(\n[getWidget, getFeatures],\n(widget, features) => {\n",
"new_path": "packages/node_modules/@ciscospark/widget-space/src/selector.js",
"old_path": "packages/node_modules/@ciscospark/widget-space/src/selector.js"
}
] |
JavaScript
|
MIT License
|
webex/react-widgets
|
refactor(widget-space): filter on ID rather than email
| 1
|
refactor
|
widget-space
|
730,412
|
17.04.2018 16:33:00
| 0
|
f403b9ac7adecd6b6746aaeb3c073b559db07e88
|
chore(release): 0.1.276
|
[
{
"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.276\"></a>\n+## [0.1.276](https://github.com/ciscospark/react-ciscospark/compare/v0.1.275...v0.1.276) (2018-04-17)\n+\n+\n+\n<a name=\"0.1.275\"></a>\n## [0.1.275](https://github.com/ciscospark/react-ciscospark/compare/v0.1.273...v0.1.275) (2018-04-17)\n@@ -1242,6 +1247,3 @@ All notable changes to this project will be documented in this file. See [standa\n### Reverts\n* **widget-space:** revert index.html change ([edc403e](https://github.com/ciscospark/react-ciscospark/commit/edc403e))\n-\n-\n-\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"name\": \"@ciscospark/react-ciscospark\",\n- \"version\": \"0.1.275\",\n+ \"version\": \"0.1.276\",\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.276
| 1
|
chore
|
release
|
679,913
|
17.04.2018 16:38:05
| -3,600
|
1a6ac54d6eb877eb3de3ed121d34c2d9f7747456
|
feat(interceptors): add event handler instrumentation
|
[
{
"change_type": "MODIFY",
"diff": "@@ -201,7 +201,7 @@ export class StatelessEventBus implements\naddHandler(id: string, spec: api.EventDef) {\nconst iceps = isArray(spec) ?\n- (<any>spec).map((i) => isFunction(i) ? { pre: i } : i) :\n+ (<any>spec).map(asInterceptor) :\nisFunction(spec) ? [{ pre: spec }] : [spec];\nif (iceps.length > 0) {\nif (this.handlers[id]) {\n@@ -248,6 +248,25 @@ export class StatelessEventBus implements\n}\n}\n+ /**\n+ * Prepends given interceptors (or interceptor functions) to\n+ * selected handlers. If no handler IDs are given, applies\n+ * instrumentation to all currently registered handlers.\n+ *\n+ * @param inject\n+ * @param ids\n+ */\n+ instrumentWith(inject: (api.Interceptor | api.InterceptorFn)[], ids?: string[]) {\n+ const iceps = inject.map(asInterceptor);\n+ const handlers = this.handlers;\n+ for (let id of ids || Object.keys(handlers)) {\n+ const h = handlers[id];\n+ if (h) {\n+ handlers[id] = iceps.concat(h);\n+ }\n+ }\n+ }\n+\nremoveHandler(id: string) {\ndelete this.handlers[id];\n}\n@@ -645,3 +664,7 @@ export class EventBus extends StatelessEventBus implements\nreturn false;\n}\n}\n+\n+function asInterceptor(i: api.Interceptor | api.InterceptorFn) {\n+ return isFunction(i) ? { pre: i } : i;\n+}\n",
"new_path": "packages/interceptors/src/event-bus.ts",
"old_path": "packages/interceptors/src/event-bus.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(interceptors): add event handler instrumentation
| 1
|
feat
|
interceptors
|
679,913
|
17.04.2018 16:41:18
| -3,600
|
2e32c3b999b84335de1c4faf1f80693ec4f6fc88
|
feat(examples): add instrumentation to router-basics demo
|
[
{
"change_type": "MODIFY",
"diff": "@@ -2,7 +2,7 @@ import { IObjectOf } from \"@thi.ng/api/api\";\nimport { Atom } from \"@thi.ng/atom/atom\";\nimport { isArray } from \"@thi.ng/checks/is-array\";\nimport { EventBus } from \"@thi.ng/interceptors/event-bus\";\n-import { valueSetter } from \"@thi.ng/interceptors/interceptors\";\n+import { valueSetter, trace } from \"@thi.ng/interceptors/interceptors\";\nimport { start } from \"@thi.ng/hdom\";\nimport { EVENT_ROUTE_CHANGED } from \"@thi.ng/router/api\";\nimport { HTMLRouter } from \"@thi.ng/router/history\";\n@@ -56,6 +56,10 @@ export class App {\nfx.ROUTE_TO,\n([id, params]) => this.router.routeTo(this.router.format(id, params))\n);\n+\n+ // instrument all event handlers to trace events in console\n+ this.ctx.bus.instrumentWith([trace]);\n+\nthis.addViews({\nroute: \"route\",\nrouteComponent: [\n",
"new_path": "examples/router-basics/src/app.ts",
"old_path": "examples/router-basics/src/app.ts"
},
{
"change_type": "MODIFY",
"diff": "import { Event, FX_DISPATCH_ASYNC, FX_DISPATCH_NOW, EV_SET_VALUE, FX_DELAY } from \"@thi.ng/interceptors/api\";\n-import { valueUpdater, trace } from \"@thi.ng/interceptors/interceptors\";\n+import { valueUpdater } from \"@thi.ng/interceptors/interceptors\";\nimport { AppConfig, StatusType } from \"./api\";\nimport * as ev from \"./events\";\n@@ -94,15 +94,13 @@ export const CONFIG: AppConfig = {\n// stores status (a tuple of `[type, message, done?]`) in app state\n// if status type != DONE & `done` == true, also triggers delayed EV_DONE\n// Note: we inject the `trace` interceptor to log the event to the console\n- [ev.SET_STATUS]: [\n- trace,\n+ [ev.SET_STATUS]:\n(_, [__, status]) => ({\n[FX_DISPATCH_NOW]: [EV_SET_VALUE, [\"status\", status]],\n[FX_DISPATCH_ASYNC]: (status[0] !== StatusType.DONE && status[2]) ?\n[FX_DELAY, [1000], ev.DONE, ev.ERROR] :\nundefined\n- })\n- ],\n+ }),\n// toggles debug state flag on/off\n[ev.TOGGLE_DEBUG]: valueUpdater<number>(\"debug\", (x) => x ^ 1)\n",
"new_path": "examples/router-basics/src/config.ts",
"old_path": "examples/router-basics/src/config.ts"
}
] |
TypeScript
|
Apache License 2.0
|
thi-ng/umbrella
|
feat(examples): add instrumentation to router-basics demo
| 1
|
feat
|
examples
|
217,922
|
17.04.2018 16:59:59
| -7,200
|
a0236be62d0963e10b3af6f5bfaf5d91c7907f2d
|
fix: permissions fixes with workshops
|
[
{
"change_type": "MODIFY",
"diff": "@@ -79,6 +79,7 @@ export class UserService extends FirebaseStorage<AppUser> {\n*/\npublic getUserData(): Observable<AppUser> {\nreturn this.reloader\n+ .filter(() => !this.loggingIn)\n.switchMap(() => {\nreturn this.af.authState.first()\n.mergeMap(user => {\n@@ -107,9 +108,7 @@ export class UserService extends FirebaseStorage<AppUser> {\nu.patron = supporters.find(s => s.email.toLowerCase() === u.patreonEmail.toLowerCase()) !== undefined;\nreturn u;\n});\n- })\n- .publishReplay(1)\n- .refCount();\n+ });\n}\n/**\n",
"new_path": "src/app/core/database/user.service.ts",
"old_path": "src/app/core/database/user.service.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -47,14 +47,20 @@ export class PermissionsPopupComponent {\nobservables.push(\nthis.userService.getCharacter(data.authorId)\n.map(character => {\n- return {userId: data.authorId, character: character, permissions: data.getPermissions(data.authorId)};\n+ return {\n+ userId: data.authorId, character: character, permissions:\n+ this.getPermissions(data, this.registry, data.authorId)\n+ };\n})\n);\nregistry.forEach((userId, permissions) => {\nobservables.push(\nthis.userService.getCharacter(userId)\n.map(character => {\n- return {userId: userId, character: character, permissions: data.getPermissions(userId)};\n+ return {\n+ userId: userId, character: character, permissions:\n+ this.getPermissions(data, this.registry, userId)\n+ };\n})\n.catch(() => Observable.of(null))\n);\n@@ -107,6 +113,17 @@ export class PermissionsPopupComponent {\n});\n}\n+ public getPermissions(data: DataWithPermissions, permissionsRegistry: PermissionsRegistry, userId: string,\n+ freeCompanyId?: string): Permissions {\n+ if (userId === data.authorId) {\n+ return {read: true, participate: true, write: true};\n+ }\n+ if (freeCompanyId !== undefined && permissionsRegistry.freeCompanyId === freeCompanyId) {\n+ return permissionsRegistry.freeCompany;\n+ }\n+ return permissionsRegistry.registry[userId] || permissionsRegistry.everyone;\n+ }\n+\ndeleteRow(userId: string): void {\ndelete this.registry.registry[userId];\nthis.registrySubject.next(this.registry);\n@@ -119,9 +136,12 @@ export class PermissionsPopupComponent {\nthis.data.permissionsRegistry.forEach((userId, permissions) => {\n// If user has been deleted from permissions and had write permissions, remove the list from shared lists, same if write\n// permission has been removed\n+ if (this.registry.registry[userId] !== undefined) {\n+ console.log(permissions.write, this.registry.registry[userId].write, userId);\n+ }\nif (permissions.write && (this.registry.registry[userId] === undefined || this.registry.registry[userId].write === false)) {\nusersSharedDeletions.push(userId)\n- } else if (!permissions.write && this.registry.registry[userId].write) {\n+ } else if (!permissions.write && this.registry.registry[userId] !== undefined && this.registry.registry[userId].write) {\n// If write permission has been granted\nusersSharedAdditions.push(userId);\n}\n@@ -154,10 +174,12 @@ export class PermissionsPopupComponent {\nreturn user;\n}).mergeMap(user => this.userService.set(addition, user));\n})).first().subscribe(() => {\n+ this.registry.everyone.write = false; // Always force write to false for everyone.\nthis.data.permissionsRegistry = this.registry;\nthis.dialogRef.close(this.data);\n});\n} else {\n+ this.registry.everyone.write = false; // Always force write to false for everyone.\nthis.data.permissionsRegistry = this.registry;\nthis.dialogRef.close(this.data);\n}\n",
"new_path": "src/app/modules/common-components/permissions-popup/permissions-popup.component.ts",
"old_path": "src/app/modules/common-components/permissions-popup/permissions-popup.component.ts"
},
{
"change_type": "MODIFY",
"diff": "[templateButton]=\"userData?.patron || userData?.admin\"\n></app-list-panel>\n</div>\n- <div class=\"shared-lists\">\n+ <div class=\"shared-lists\" *ngIf=\"let list of sharedLists | async as sharedListsData\">\n<h2>{{\"LISTS.Shared_lists\" | translate}}</h2>\n<mat-divider class=\"divider\"></mat-divider>\n- <div class=\"row\" *ngFor=\"let list of sharedLists | async;trackBy: trackByListsFn; let i = index;\">\n+ <div class=\"row\" *ngFor=\"sharedListsData;trackBy: trackByListsFn; let i = index;\">\n<app-list-panel\n[list]=\"list\"\n[expanded]=\"expanded.indexOf(list.$key) > -1\"\n{{'WORKSHOP.Add_workshop' | translate}}\n</button>\n</div>\n- <div class=\"workshops\">\n+ <div class=\"workshops\" *ngIf=\"let workshopData of sharedWorkshops as sharedWorkshopsData\">\n<h2>{{'WORKSHOP.Shared_workshops' | translate}}</h2>\n<mat-divider class=\"divider\"></mat-divider>\n- <div *ngFor=\"let workshopData of sharedWorkshops | async; trackBy: trackByWorkshopFn; let i = index\"\n+ <div *ngFor=\"sharedWorkshopsData | async; trackBy: trackByWorkshopFn; let i = index\"\nclass=\"row\">\n<mat-expansion-panel [ngClass]=\"{odd: i%2>0}\">\n<mat-expansion-panel-header>\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": "@@ -267,7 +267,7 @@ export class ListsComponent extends ComponentWithSubscriptions implements OnInit\nuser.sharedLists = user.sharedLists.filter(id => id !== listId);\nreturn this.userService.set(user.$key, user).map(() => null);\n})))\n- .map(lists => lists.filter(l => l !== null));\n+ .map(lists => lists.filter(l => l !== null).filter(l => l.getPermissions(user.$key).write === true));\n});\nthis.workshops = this.userService.getUserData().mergeMap(user => {\nif (user === null) {\n@@ -295,7 +295,8 @@ export class ListsComponent extends ComponentWithSubscriptions implements OnInit\n}\nreturn Observable.of(null);\n});\n- })).map(workshops => workshops.filter(w => w !== null));\n+ })).map(workshops => workshops.filter(w => w !== null)\n+ .filter(row => row.workshop.getPermissions(user.$key).write === true));\n});\n}\n});\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": "@@ -122,8 +122,9 @@ export class RecipesComponent extends PageComponent implements OnInit {\nsuper.ngOnInit();\nthis.sharedLists = this.userService.getUserData().mergeMap(user => {\n- return Observable.combineLatest((user.sharedLists || []).map(listId => this.listService.get(listId)));\n- }).publishReplay(1).refCount();\n+ return Observable.combineLatest((user.sharedLists || []).map(listId => this.listService.get(listId)))\n+ .map(lists => lists.filter(l => l !== null).filter(l => l.getPermissions(user.$key).write === true));\n+ });\nthis.workshops = this.userService.getUserData().mergeMap(user => {\nif (user.$key !== undefined) {\n",
"new_path": "src/app/pages/recipes/recipes/recipes.component.ts",
"old_path": "src/app/pages/recipes/recipes/recipes.component.ts"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
fix: permissions fixes with workshops
| 1
|
fix
| null |
217,922
|
17.04.2018 17:04:50
| -7,200
|
c79eb0118ab2350340f989ed70f374b771c181ab
|
chore: fix for stupid typo made in last commit
|
[
{
"change_type": "MODIFY",
"diff": "[templateButton]=\"userData?.patron || userData?.admin\"\n></app-list-panel>\n</div>\n- <div class=\"shared-lists\" *ngIf=\"let list of sharedLists | async as sharedListsData\">\n+ <div class=\"shared-lists\" *ngIf=\"sharedLists | async as sharedListsData\">\n<h2>{{\"LISTS.Shared_lists\" | translate}}</h2>\n<mat-divider class=\"divider\"></mat-divider>\n- <div class=\"row\" *ngFor=\"sharedListsData;trackBy: trackByListsFn; let i = index;\">\n+ <div class=\"row\" *ngFor=\"let list of sharedListsData;trackBy: trackByListsFn; let i = index;\">\n<app-list-panel\n[list]=\"list\"\n[expanded]=\"expanded.indexOf(list.$key) > -1\"\n{{'WORKSHOP.Add_workshop' | translate}}\n</button>\n</div>\n- <div class=\"workshops\" *ngIf=\"let workshopData of sharedWorkshops as sharedWorkshopsData\">\n+ <div class=\"workshops\" *ngIf=\"sharedWorkshops as sharedWorkshopsData\">\n<h2>{{'WORKSHOP.Shared_workshops' | translate}}</h2>\n<mat-divider class=\"divider\"></mat-divider>\n- <div *ngFor=\"sharedWorkshopsData | async; trackBy: trackByWorkshopFn; let i = index\"\n+ <div *ngFor=\"let workshopData of sharedWorkshopsData | async; trackBy: trackByWorkshopFn; let i = index\"\nclass=\"row\">\n<mat-expansion-panel [ngClass]=\"{odd: i%2>0}\">\n<mat-expansion-panel-header>\n",
"new_path": "src/app/pages/lists/lists/lists.component.html",
"old_path": "src/app/pages/lists/lists/lists.component.html"
}
] |
TypeScript
|
MIT License
|
ffxiv-teamcraft/ffxiv-teamcraft
|
chore: fix for stupid typo made in last commit
| 1
|
chore
| null |
807,849
|
17.04.2018 17:08:58
| 25,200
|
e89fc955d0b2a22d8b8a208d0968d9861753a15c
|
test: Add manual write-pkg spy
|
[
{
"change_type": "ADD",
"diff": "+\"use strict\";\n+\n+// eslint-disable-next-line import/no-extraneous-dependencies, node/no-extraneous-require\n+const writePkg = require.requireActual(\"write-pkg\");\n+const registry = new Map();\n+\n+// by default, act like a spy that populates registry\n+const mockWritePkg = jest.fn((fp, data) => {\n+ registry.set(data.name, data);\n+\n+ return writePkg(fp, data);\n+});\n+\n+// keep test data isolated\n+afterEach(() => {\n+ registry.clear();\n+});\n+\n+module.exports = mockWritePkg;\n+module.exports.registry = registry;\n",
"new_path": "commands/__mocks__/write-pkg.js",
"old_path": null
},
{
"change_type": "MODIFY",
"diff": "\"use strict\";\njest.mock(\"write-json-file\");\n-jest.mock(\"write-pkg\");\n+// write-pkg mocked manually\njest.mock(\"@lerna/git-utils\");\njest.mock(\"@lerna/prompt\");\njest.mock(\"@lerna/conventional-commits\");\n",
"new_path": "commands/publish/__tests__/publish-command.test.js",
"old_path": "commands/publish/__tests__/publish-command.test.js"
},
{
"change_type": "MODIFY",
"diff": "\"use strict\";\njest.mock(\"fs-extra\");\n-jest.mock(\"write-pkg\");\n+// write-pkg mocked manually\njest.mock(\"@lerna/child-process\");\nconst path = require(\"path\");\n",
"new_path": "utils/npm-install/__tests__/npm-install.test.js",
"old_path": "utils/npm-install/__tests__/npm-install.test.js"
}
] |
JavaScript
|
MIT License
|
lerna/lerna
|
test: Add manual write-pkg spy
| 1
|
test
| null |
815,746
|
17.04.2018 18:37:13
| -10,800
|
8d8f2a59db1f48dca547b7f524846aea760adbeb
|
fix: close dropdown on outside click
fixes
fixes
Previously ng-select dropdown close was handled by clicking on invisible overlay, but it causes some issues. This approach uses global document mousedown event listener to determine when to close dropdown.
|
[
{
"change_type": "MODIFY",
"diff": "\"typescript\": \"^2.5.1\",\n\"webpack\": \"3.8.1\",\n\"webpack-dev-server\": \"2.9.1\",\n- \"zone.js\": \"^0.8.16\"\n+ \"zone.js\": \"^0.8.26\"\n}\n}\n",
"new_path": "package.json",
"old_path": "package.json"
},
{
"change_type": "MODIFY",
"diff": "@@ -60,12 +60,13 @@ export class NgDropdownPanelComponent implements OnInit, OnChanges, OnDestroy, A\n@Output() update = new EventEmitter<any[]>();\n@Output() scrollToEnd = new EventEmitter<{ start: number; end: number }>();\n+ @Output() outsideClick = new EventEmitter<void>();\n@ViewChild('content', { read: ElementRef }) contentElementRef: ElementRef;\n@ViewChild('scroll', { read: ElementRef }) scrollElementRef: ElementRef;\n@ViewChild('padding', { read: ElementRef }) paddingElementRef: ElementRef;\n- private _selectElementRef: ElementRef;\n+ private _selectElement: HTMLElement;\nprivate _previousStart: number;\nprivate _previousEnd: number;\nprivate _startupLoop = true;\n@@ -75,6 +76,7 @@ export class NgDropdownPanelComponent implements OnInit, OnChanges, OnDestroy, A\nprivate _currentPosition: 'bottom' | 'top';\nprivate _disposeScrollListener = () => { };\nprivate _disposeDocumentResizeListener = () => { };\n+ private _disposeDocumentClickListener = () => { };\nconstructor(\n@Inject(forwardRef(() => NgSelectComponent)) _ngSelect: NgSelectComponent,\n@@ -84,12 +86,13 @@ export class NgDropdownPanelComponent implements OnInit, OnChanges, OnDestroy, A\nprivate _virtualScrollService: VirtualScrollService,\nprivate _window: WindowService\n) {\n- this._selectElementRef = _ngSelect.elementRef;\n+ this._selectElement = _ngSelect.elementRef.nativeElement;\nthis._itemsList = _ngSelect.itemsList;\n}\nngOnInit() {\nthis._handleScroll();\n+ this._handleDocumentClick();\n}\nngOnChanges(changes: SimpleChanges) {\n@@ -101,6 +104,7 @@ export class NgDropdownPanelComponent implements OnInit, OnChanges, OnDestroy, A\nngOnDestroy() {\nthis._disposeDocumentResizeListener();\nthis._disposeScrollListener();\n+ this._disposeDocumentClickListener();\nif (this.appendTo) {\nthis._renderer.removeChild(this._elementRef.nativeElement.parentNode, this._elementRef.nativeElement);\n}\n@@ -156,6 +160,21 @@ export class NgDropdownPanelComponent implements OnInit, OnChanges, OnDestroy, A\n});\n}\n+ private _handleDocumentClick() {\n+ this._disposeDocumentClickListener = this._renderer.listen('document', 'mousedown', ($event: any) => {\n+ if (this._selectElement.contains($event.target)) {\n+ return;\n+ }\n+\n+ const dropdown: HTMLElement = this._elementRef.nativeElement;\n+ if (dropdown.contains($event.target)) {\n+ return;\n+ }\n+\n+ this.outsideClick.emit();\n+ });\n+ }\n+\nprivate _handleItemsChange(items: { previousValue: NgOption[], currentValue: NgOption[] }) {\nthis._scrollToEndFired = false;\nthis._previousStart = undefined;\n@@ -262,7 +281,7 @@ export class NgDropdownPanelComponent implements OnInit, OnChanges, OnDestroy, A\nconst dropdownEl: HTMLElement = this._elementRef.nativeElement;\nthis._currentPosition = this._calculateCurrentPosition(dropdownEl);\n- const selectEl: HTMLElement = this._selectElementRef.nativeElement;\n+ const selectEl: HTMLElement = this._selectElement;\nif (this._currentPosition === 'top') {\nthis._renderer.addClass(dropdownEl, TOP_CSS_CLASS)\nthis._renderer.removeClass(dropdownEl, BOTTOM_CSS_CLASS)\n@@ -286,7 +305,7 @@ export class NgDropdownPanelComponent implements OnInit, OnChanges, OnDestroy, A\nif (this.position !== 'auto') {\nreturn this.position;\n}\n- const selectRect: ClientRect = this._selectElementRef.nativeElement.getBoundingClientRect();\n+ const selectRect: ClientRect = this._selectElement.getBoundingClientRect();\nconst scrollTop = document.documentElement.scrollTop || document.body.scrollTop;\nconst offsetTop = selectRect.top + window.pageYOffset;\nconst height = selectRect.height;\n@@ -308,7 +327,7 @@ export class NgDropdownPanelComponent implements OnInit, OnChanges, OnDestroy, A\nprivate _updateAppendedDropdownPosition() {\nconst parent = document.querySelector(this.appendTo) || document.body;\n- const selectRect: ClientRect = this._selectElementRef.nativeElement.getBoundingClientRect();\n+ const selectRect: ClientRect = this._selectElement.getBoundingClientRect();\nconst dropdownPanel: HTMLElement = this._elementRef.nativeElement;\nconst boundingRect = parent.getBoundingClientRect();\nconst offsetTop = selectRect.top - boundingRect.top;\n",
"new_path": "src/ng-select/ng-dropdown-panel.component.ts",
"old_path": "src/ng-select/ng-dropdown-panel.component.ts"
},
{
"change_type": "MODIFY",
"diff": "position: relative;\n}\n}\n- .ng-overlay-container {\n- pointer-events: none;\n- top: 0;\n- left: 0;\n- height: 100%;\n- width: 100%;\n- position: fixed;\n- z-index: 1000;\n- .ng-overlay {\n- top: 0;\n- bottom: 0;\n- left: 0;\n- right: 0;\n- opacity: 0;\n- position: absolute;\n- pointer-events: auto;\n- z-index: 1000;\n- }\n- }\n}\n",
"new_path": "src/ng-select/ng-select.component.scss",
"old_path": "src/ng-select/ng-select.component.scss"
},
{
"change_type": "MODIFY",
"diff": "@@ -1128,7 +1128,8 @@ describe('NgSelectComponent', function () {\nbeforeEach(() => {\nfixture = createTestingModule(\nNgSelectTestCmp,\n- ` <ng-select id=\"select\" [items]=\"cities\"\n+ `<div id=\"outside\">Outside</div><br />\n+ <ng-select id=\"select\" [items]=\"cities\"\nbindLabel=\"name\"\nmultiple=\"true\"\n[closeOnSelect]=\"false\"\n@@ -1137,33 +1138,26 @@ describe('NgSelectComponent', function () {\n</ng-select>`);\n});\n- it('close dropdown if opened and clicked outside dropdown container', () => {\n+ it('close dropdown if opened and clicked outside dropdown container', fakeAsync(() => {\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\nexpect(fixture.componentInstance.select.isOpen).toBeTruthy();\n- fixture.whenStable().then(() => {\n- (document.querySelector('.ng-overlay') as HTMLElement).click();\n+ document.getElementById('outside').click();\n+ let event = new MouseEvent('mousedown', {bubbles: true});\n+ document.getElementById('outside').dispatchEvent(event);\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.isOpen).toBeFalsy();\n- });\n- });\n+ }));\n- it('prevent dropdown close if clicked on select', () => {\n+ it('prevent dropdown close if clicked on select', fakeAsync(() => {\ntriggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\nexpect(fixture.componentInstance.select.isOpen).toBeTruthy();\n- fixture.whenStable().then(() => {\ndocument.getElementById('select').click();\n+ let event = new MouseEvent('mousedown', {bubbles: true});\n+ document.getElementById('select').dispatchEvent(event);\n+ tickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.isOpen).toBeTruthy();\n- });\n- });\n+ }));\n- it('should not close dropdown when closeOnSelect is false and in body', () => {\n- triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n- expect(fixture.componentInstance.select.isOpen).toBeTruthy();\n- fixture.whenStable().then(() => {\n- (document.querySelector('.ng-option.ng-option-marked') as HTMLElement).click();\n- fixture.detectChanges();\n- expect(fixture.componentInstance.select.isOpen).toBeTruthy();\n- });\n- });\n});\ndescribe('Dropdown position', () => {\n@@ -1573,7 +1567,7 @@ describe('NgSelectComponent', function () {\nit('should reset list while clearing all selected items', fakeAsync(() => {\nfixture.componentInstance.selectedCities = [...fixture.componentInstance.cities];\ntickAndDetectChanges(fixture);\n- select.handleClearClick(<any>{ stopPropagation: () => { } });\n+ select.handleClearClick();\nexpect(select.selectedItems.length).toBe(0);\nexpect(select.itemsList.filteredItems.length).toBe(3);\n}));\n@@ -1733,7 +1727,7 @@ describe('NgSelectComponent', function () {\nconst placeholder: any = selectEl.querySelector('.ng-placeholder');\nexpect(ngControl.classList.contains('ng-has-value')).toBeTruthy();\n- select.handleClearClick(<any>{ stopPropagation: () => { } });\n+ select.handleClearClick();\ntickAndDetectChanges(fixture);\ntickAndDetectChanges(fixture);\n@@ -1746,6 +1740,7 @@ describe('NgSelectComponent', function () {\nconst selectEl: HTMLElement = fixture.componentInstance.select.elementRef.nativeElement;\nconst ngControl = selectEl.querySelector('.ng-select-container')\nselectOption(fixture, KeyCode.ArrowDown, 2);\n+ tickAndDetectChanges(fixture);\nexpect(ngControl.classList.contains('ng-has-value')).toBeTruthy();\n}));\n});\n@@ -1806,12 +1801,12 @@ describe('NgSelectComponent', function () {\nconst selectInput = fixture.debugElement.query(By.css('.ng-select-container'));\n// open\n- selectInput.triggerEventHandler('mousedown', { stopPropagation: () => { } });\n+ selectInput.triggerEventHandler('mousedown', { target: {} });\ntickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.isOpen).toBe(true);\n// close\n- selectInput.triggerEventHandler('mousedown', { stopPropagation: () => { } });\n+ selectInput.triggerEventHandler('mousedown', { target: {} });\ntickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.isOpen).toBe(false);\n}));\n@@ -2227,7 +2222,7 @@ describe('NgSelectComponent', function () {\nfixture.componentInstance.selectedCities = [fixture.componentInstance.cities[0]];\ntickAndDetectChanges(fixture);\n- fixture.componentInstance.select.handleClearClick(<any>{ stopPropagation: () => { } });\n+ fixture.componentInstance.select.handleClearClick();\ntickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.onClear).toHaveBeenCalled();\n@@ -2236,7 +2231,7 @@ describe('NgSelectComponent', function () {\ndescribe('Clear icon click', () => {\nlet fixture: ComponentFixture<NgSelectTestCmp>;\n- let clickIcon: DebugElement = null;\n+ let triggerClearClick = null;\nbeforeEach(fakeAsync(() => {\nfixture = createTestingModule(\n@@ -2252,11 +2247,14 @@ describe('NgSelectComponent', function () {\nfixture.componentInstance.selectedCity = fixture.componentInstance.cities[0];\ntickAndDetectChanges(fixture);\ntickAndDetectChanges(fixture);\n- clickIcon = fixture.debugElement.query(By.css('.ng-clear-wrapper'));\n+ triggerClearClick = () => {\n+ const control = fixture.debugElement.query(By.css('.ng-select-container'))\n+ control.triggerEventHandler('mousedown', { target: { className: 'ng-clear'} });\n+ };\n}));\nit('should clear model', fakeAsync(() => {\n- clickIcon.triggerEventHandler('click', { stopPropagation: () => { } });\n+ triggerClearClick();\ntickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.selectedCity).toBe(null);\nexpect(fixture.componentInstance.onChange).toHaveBeenCalledTimes(1);\n@@ -2266,14 +2264,14 @@ describe('NgSelectComponent', function () {\nfixture.componentInstance.selectedCity = null;\nfixture.componentInstance.select.filterValue = 'Hey! Whats up!?';\ntickAndDetectChanges(fixture);\n- clickIcon.triggerEventHandler('click', { stopPropagation: () => { } });\n+ triggerClearClick();\ntickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.onChange).toHaveBeenCalledTimes(0);\nexpect(fixture.componentInstance.select.filterValue).toBe(null);\n}));\nit('should not open dropdown', fakeAsync(() => {\n- clickIcon.triggerEventHandler('click', { stopPropagation: () => { } });\n+ triggerClearClick();\ntickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.isOpen).toBe(false);\n}));\n@@ -2289,7 +2287,7 @@ describe('NgSelectComponent', function () {\ndescribe('Arrow icon click', () => {\nlet fixture: ComponentFixture<NgSelectTestCmp>;\n- let arrowIcon: DebugElement = null;\n+ let triggerArrowIconClick = null;\nbeforeEach(fakeAsync(() => {\nfixture = createTestingModule(\n@@ -2301,23 +2299,25 @@ describe('NgSelectComponent', function () {\nfixture.componentInstance.selectedCity = fixture.componentInstance.cities[0];\ntickAndDetectChanges(fixture);\n- arrowIcon = fixture.debugElement.query(By.css('.ng-arrow-wrapper'));\n+ triggerArrowIconClick = () => {\n+ const control = fixture.debugElement.query(By.css('.ng-select-container'))\n+ control.triggerEventHandler('mousedown', { target: { className: 'ng-arrow'} });\n+ };\n}));\nit('should toggle dropdown', fakeAsync(() => {\n- const clickArrow = () => arrowIcon.triggerEventHandler('mousedown', { stopPropagation: () => { } });\n// open\n- clickArrow();\n+ triggerArrowIconClick();\ntickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.isOpen).toBe(true);\n// close\n- clickArrow();\n+ triggerArrowIconClick();\ntickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.isOpen).toBe(false);\n// open\n- clickArrow();\n+ triggerArrowIconClick();\ntickAndDetectChanges(fixture);\nexpect(fixture.componentInstance.select.isOpen).toBe(true);\n}));\n@@ -2338,7 +2338,7 @@ describe('NgSelectComponent', function () {\nfixture.whenStable().then(() => {\nconst dropdown = <HTMLElement>document.querySelector('.ng-dropdown-panel');\nexpect(dropdown.parentElement).toBe(document.body);\n- expect(dropdown.style.top).toBe('18px');\n+ expect(dropdown.style.top).not.toBe('0px');\nexpect(dropdown.style.left).toBe('0px');\n})\n}));\n@@ -2358,7 +2358,7 @@ describe('NgSelectComponent', function () {\nfixture.whenStable().then(() => {\nconst dropdown = <HTMLElement>document.querySelector('.container .ng-dropdown-panel');\n- expect(dropdown.style.top).toBe('18px');\n+ expect(dropdown.style.top).not.toBe('0px');\nexpect(dropdown.style.left).toBe('0px');\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": "@@ -25,6 +25,7 @@ import {\nContentChildren,\nQueryList,\nInjectionToken,\n+ NgZone,\n} from '@angular/core';\nimport {\n@@ -46,6 +47,7 @@ import { NgDropdownPanelComponent } from './ng-dropdown-panel.component';\nimport { isDefined, isFunction, isPromise, isObject } from './value-utils';\nimport { ConsoleService } from './console.service';\nimport { newId } from './id';\n+import { WindowService } from './window.service';\nexport const NG_SELECT_DEFAULT_CONFIG = new InjectionToken<NgSelectConfig>('ng-select-default-options');\nexport type DropdownPosition = 'bottom' | 'top' | 'auto';\n@@ -163,6 +165,8 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nconstructor(@Inject(NG_SELECT_DEFAULT_CONFIG) config: NgSelectConfig,\nprivate _cd: ChangeDetectorRef,\nprivate _console: ConsoleService,\n+ private _zone: NgZone,\n+ private _window: WindowService,\npublic elementRef: ElementRef\n) {\nthis._mergeGlobalConfig(config);\n@@ -233,8 +237,23 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\n}\n- handleArrowClick($event: Event) {\n- $event.stopPropagation();\n+ handleMousedown($event) {\n+ if ($event.target.className === 'ng-clear') {\n+ this.handleClearClick();\n+ return;\n+ }\n+ if ($event.target.className === 'ng-arrow') {\n+ this.handleArrowClick();\n+ return;\n+ }\n+ if (this.searchable) {\n+ this.open();\n+ } else {\n+ this.toggle();\n+ }\n+ }\n+\n+ handleArrowClick() {\nif (this.isOpen) {\nthis.close();\n} else {\n@@ -242,8 +261,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\n}\n- handleClearClick($event: Event) {\n- $event.stopPropagation();\n+ handleClearClick() {\nif (this.hasValue) {\nthis.clearModel();\n}\n@@ -315,7 +333,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nthis._clearSearch();\nthis._onTouched();\nthis.closeEvent.emit();\n- this.detectChanges();\n+ this._cd.markForCheck();\n}\ntoggleItem(item: NgOption) {\n@@ -345,7 +363,11 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nif (!this.filterInput) {\nreturn;\n}\n+ this._zone.runOutsideAngular(() => {\n+ this._window.setTimeout(() => {\nthis.filterInput.nativeElement.focus();\n+ }, 0);\n+ });\n}\nunselect(item: NgOption) {\n",
"new_path": "src/ng-select/ng-select.component.ts",
"old_path": "src/ng-select/ng-select.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -5,4 +5,8 @@ export class WindowService {\nrequestAnimationFrame(fn) {\nreturn window.requestAnimationFrame(fn);\n}\n+\n+ setTimeout(handler: (...args: any[]) => void, timeout: number): number {\n+ return window.setTimeout(handler, timeout);\n+ }\n}\n",
"new_path": "src/ng-select/window.service.ts",
"old_path": "src/ng-select/window.service.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -21,6 +21,11 @@ export class MockNgWindow extends WindowService {\nrequestAnimationFrame(fn: Function): any {\nreturn fn();\n}\n+\n+ setTimeout(handler: (...args: any[]) => void, _: number): number {\n+ handler();\n+ return 0;\n+ }\n}\n@Injectable()\n",
"new_path": "src/testing/mocks.ts",
"old_path": "src/testing/mocks.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -7892,6 +7892,6 @@ yeast@0.1.2:\nversion \"0.1.2\"\nresolved \"https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419\"\n-zone.js@^0.8.16:\n- version \"0.8.18\"\n- resolved \"https://registry.yarnpkg.com/zone.js/-/zone.js-0.8.18.tgz#8cecb3977fcd1b3090562ff4570e2847e752b48d\"\n+zone.js@^0.8.26:\n+ version \"0.8.26\"\n+ resolved \"https://registry.yarnpkg.com/zone.js/-/zone.js-0.8.26.tgz#7bdd72f7668c5a7ad6b118148b4ea39c59d08d2d\"\n",
"new_path": "yarn.lock",
"old_path": "yarn.lock"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
fix: close dropdown on outside click (#465)
fixes #453
fixes #313
Previously ng-select dropdown close was handled by clicking on invisible overlay, but it causes some issues. This approach uses global document mousedown event listener to determine when to close dropdown.
| 1
|
fix
| null |
815,746
|
17.04.2018 18:38:48
| -10,800
|
7e3a12d32f509bbe84a001a28f6f0e08f2ec281f
|
fix: do not try to set loading state automatically
|
[
{
"change_type": "MODIFY",
"diff": "-import { Component, EventEmitter, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';\n-import { distinctUntilChanged, debounceTime, switchMap } from 'rxjs/operators'\n+import { Component, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';\n+import { distinctUntilChanged, debounceTime, switchMap, tap } from 'rxjs/operators'\nimport { DataService, Person } from '../shared/data.service';\n+import { Subject } from 'rxjs/Subject';\n@Component({\n@@ -16,22 +17,20 @@ import { DataService, Person } from '../shared/data.service';\n---html,true\n<ng-select [items]=\"people\"\nbindLabel=\"name\"\n- [loading]=\"peopleLoading\"\n- [(ngModel)]=\"selectedPerson\">\n+ [loading]=\"peopleLoading\">\n</ng-select>\n---\n<br/>\n<h5>Search across multiple fields using <b>[searchFn]</b></h5>\n<hr>\n- <p>Use <b>typeahead</b> to get search term and filter on custom fields. Type <b>female</b> to see only females.</p>\n+ <p>Use search term and filter on custom fields. Type <b>female</b> to see only females.</p>\n---html,true\n- <ng-select [items]=\"peopleFiltered\"\n+ <ng-select [items]=\"people2\"\nbindLabel=\"name\"\n- [searchFn]=\"customSearchFn\"\n- (close)=\"peopleFiltered = people\"\n- [(ngModel)]=\"selectedCustom\">\n+ [loading]=\"people2Loading\"\n+ [searchFn]=\"customSearchFn\">\n<ng-template ng-option-tmp let-item=\"item\">\n{{item.name}} <br />\n<small>{{item.gender}}</small>\n@@ -47,39 +46,39 @@ import { DataService, Person } from '../shared/data.service';\nLoading state is automatically set when filter value changes.</p>\n<label>Multi select + Typeahead + Custom items (tags)</label>\n---html,true\n- <ng-select [items]=\"serverSideFilterItems\"\n+ <ng-select [items]=\"people3\"\nbindLabel=\"name\"\n[addTag]=\"true\"\n[multiple]=\"true\"\n[hideSelected]=\"true\"\n- [typeahead]=\"peopleTypeahead\"\n+ [loading]=\"people3Loading\"\n+ [typeahead]=\"people3Typeahead\"\n[(ngModel)]=\"selectedPersons\">\n</ng-select>\n---\n-\n<p style=\"margin-bottom:300px\">\nSelected persons: {{selectedPersons | json}}\n</p>\n`\n})\nexport class SelectSearchComponent {\n-\npeople: Person[] = [];\n- peopleFiltered = [];\n- serverSideFilterItems = [];\n+ peopleLoading = false;\n- peopleTypeahead = new EventEmitter<string>();\n- selectedPersons: Person[] = <any>[{name: 'Karyn Wright'}, {name: 'Other'}];\n- selectedPerson: Person;\n- selectedCustom: Person;\n+ people2: Person[] = [];\n+ people2Loading = false;\n- peopleLoading = false;\n+ people3: Person[] = [];\n+ people3Loading = false;\n+ people3Typeahead = new Subject<string>();\n+ selectedPersons: Person[] = <any>[{name: 'Karyn Wright'}, {name: 'Other'}];\nconstructor(private dataService: DataService, private cd: ChangeDetectorRef) { }\nngOnInit() {\n- this.loadPeopleForClientSide();\n- this.serverSideSearch();\n+ this.loadPeople();\n+ this.loadPeople2();\n+ this.loadPeople3();\n}\ncustomSearchFn(term: string, item: Person) {\n@@ -87,28 +86,36 @@ export class SelectSearchComponent {\nreturn item.name.toLocaleLowerCase().indexOf(term) > -1 || item.gender.toLocaleLowerCase() === term;\n}\n- private serverSideSearch() {\n- this.peopleTypeahead.pipe(\n- distinctUntilChanged(),\n- debounceTime(200),\n- switchMap(term => this.dataService.getPeople(term))\n- ).subscribe(x => {\n- this.cd.markForCheck();\n- this.serverSideFilterItems = x;\n- }, (err) => {\n- console.log(err);\n- this.serverSideFilterItems = [];\n- });\n- }\n-\n- private loadPeopleForClientSide() {\n+ private loadPeople() {\nthis.peopleLoading = true;\nthis.dataService.getPeople().subscribe(x => {\nthis.people = x;\n- this.peopleFiltered = x;\nthis.peopleLoading = false;\n});\n}\n+\n+ private loadPeople2() {\n+ this.people2Loading = true;\n+ this.dataService.getPeople().subscribe(x => {\n+ this.people2 = x;\n+ this.people2Loading = false;\n+ });\n+ }\n+\n+ private loadPeople3() {\n+ this.people3Typeahead.pipe(\n+ tap(() => this.people3Loading = true),\n+ distinctUntilChanged(),\n+ debounceTime(200),\n+ switchMap(term => this.dataService.getPeople(term)),\n+ ).subscribe(x => {\n+ this.people3 = x;\n+ this.people3Loading = false;\n+ this.cd.markForCheck();\n+ }, () => {\n+ this.people3 = [];\n+ });\n+ }\n}\n",
"new_path": "demo/app/examples/search.component.ts",
"old_path": "demo/app/examples/search.component.ts"
},
{
"change_type": "MODIFY",
"diff": "@@ -1997,15 +1997,6 @@ describe('NgSelectComponent', function () {\nexpect(fixture.componentInstance.select.selectedItems).toEqual([])\n}));\n- it('should start and stop loading indicator', fakeAsync(() => {\n- fixture.componentInstance.filter.subscribe();\n- fixture.componentInstance.select.filter('buk');\n- expect(fixture.componentInstance.select.isLoading).toBeTruthy();\n- fixture.componentInstance.cities = [{ id: 4, name: 'Bukiskes' }];\n- tickAndDetectChanges(fixture);\n- expect(fixture.componentInstance.select.isLoading).toBeFalsy();\n- }));\n-\nit('should open dropdown when hideSelected=true and no items to select', fakeAsync(() => {\nfixture.componentInstance.hideSelected = true;\nfixture.componentInstance.cities = [];\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": "@@ -149,7 +149,6 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nselectedItemId = 0;\nprivate _defaultLabel = 'label';\n- private _typeaheadLoading = false;\nprivate _primitive: boolean;\nprivate _compareWith: CompareWithFn;\n@@ -180,10 +179,6 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nreturn this.selectedItems.map(x => x.value);\n}\n- get isLoading() {\n- return this.loading || this._typeaheadLoading;\n- }\n-\nget hasValue() {\nreturn this.selectedItems.length > 0;\n}\n@@ -400,19 +395,19 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nreturn this.addTag &&\nthis.filterValue &&\n!this.selectedItems.some(x => x.label.toLowerCase() === this.filterValue.toLowerCase()) &&\n- !this.isLoading;\n+ !this.loading;\n}\nshowNoItemsFound() {\nconst empty = this.itemsList.filteredItems.length === 0;\nreturn ((empty && !this._isTypeahead && !this.loading) ||\n- (empty && this._isTypeahead && this.filterValue && !this.isLoading)) &&\n+ (empty && this._isTypeahead && this.filterValue && !this.loading)) &&\n!this.showAddTag();\n}\nshowTypeToSearch() {\nconst empty = this.itemsList.filteredItems.length === 0;\n- return empty && this._isTypeahead && !this.filterValue && !this.isLoading;\n+ return empty && this._isTypeahead && !this.filterValue && !this.loading;\n}\nfilter(term: string) {\n@@ -423,7 +418,6 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nthis.open();\nif (this._isTypeahead) {\n- this._typeaheadLoading = true;\nthis.typeahead.next(this.filterValue);\n} else {\nthis.itemsList.filter(this.filterValue);\n@@ -467,7 +461,6 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\nif (this._isTypeahead) {\n- this._typeaheadLoading = false;\nthis.itemsList.markSelectedOrDefault(this.markFirst);\n}\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
|
fix: do not try to set loading state automatically (#466)
#399
| 1
|
fix
| null |
815,746
|
17.04.2018 18:39:10
| -10,800
|
c08f02eb64e4335c23920113aaa0899af9e2c9f3
|
chore(release): 1.0.3
|
[
{
"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=\"1.0.3\"></a>\n+## [1.0.3](https://github.com/ng-select/ng-select/compare/v1.0.2...v1.0.3) (2018-04-17)\n+\n+\n+### Bug Fixes\n+\n+* **hideSelected:** allow to open dropdown when tagging enabled ([#464](https://github.com/ng-select/ng-select/issues/464)) ([852643f](https://github.com/ng-select/ng-select/commit/852643f)), closes [#457](https://github.com/ng-select/ng-select/issues/457)\n+* close dropdown on outside click ([#465](https://github.com/ng-select/ng-select/issues/465)) ([8d8f2a5](https://github.com/ng-select/ng-select/commit/8d8f2a5)), closes [#453](https://github.com/ng-select/ng-select/issues/453) [#313](https://github.com/ng-select/ng-select/issues/313)\n+* do not try to set loading state automatically ([#466](https://github.com/ng-select/ng-select/issues/466)) ([7e3a12d](https://github.com/ng-select/ng-select/commit/7e3a12d))\n+\n+\n+\n<a name=\"1.0.2\"></a>\n## [1.0.2](https://github.com/ng-select/ng-select/compare/v1.0.1...v1.0.2) (2018-04-16)\n",
"new_path": "CHANGELOG.md",
"old_path": "CHANGELOG.md"
},
{
"change_type": "MODIFY",
"diff": "{\n\"$schema\": \"../node_modules/ng-packagr/package.schema.json\",\n\"name\": \"@ng-select/ng-select\",\n- \"version\": \"1.0.2\",\n+ \"version\": \"1.0.3\",\n\"description\": \"Angular ng-select - All in One UI Select, Multiselect and Autocomplete\",\n\"author\": \"@ng-select/ng-select\",\n\"license\": \"MIT\",\n",
"new_path": "src/package.json",
"old_path": "src/package.json"
}
] |
TypeScript
|
MIT License
|
ng-select/ng-select
|
chore(release): 1.0.3
| 1
|
chore
|
release
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.