From 63eaf567d087e207aa65a1cec3602cfa73b7c133 Mon Sep 17 00:00:00 2001 From: Baylee Swenson Date: Fri, 19 Jun 2020 11:33:14 -0400 Subject: [PATCH 01/25] Add collections analytics --- .../addon/components/branded-navbar/template.hbs | 2 +- .../collection-search-result/node/template.hbs | 8 +++++--- .../discover-page/facets/checklist/component.ts | 6 +++++- lib/collections/addon/discover/route.ts | 12 +++++++++--- lib/collections/addon/provider/discover/route.ts | 8 ++++++++ 5 files changed, 28 insertions(+), 8 deletions(-) diff --git a/lib/app-components/addon/components/branded-navbar/template.hbs b/lib/app-components/addon/components/branded-navbar/template.hbs index 9271b30135d..2dc7efd38f3 100644 --- a/lib/app-components/addon/components/branded-navbar/template.hbs +++ b/lib/app-components/addon/components/branded-navbar/template.hbs @@ -43,7 +43,7 @@
  • {{#link-to 'provider.submit' - click=(action 'click' 'link' (concat 'Navbar - Add ' @objectType) target=this.analytics) + click=(action 'click' 'link' (concat 'Navbar - ' (t @addLinkKey)) target=this.analytics) }} {{t @addLinkKey}} {{/link-to}} diff --git a/lib/collections/addon/components/collection-search-result/node/template.hbs b/lib/collections/addon/components/collection-search-result/node/template.hbs index 4f872b488eb..9a2eb39942b 100644 --- a/lib/collections/addon/components/collection-search-result/node/template.hbs +++ b/lib/collections/addon/components/collection-search-result/node/template.hbs @@ -1,16 +1,18 @@
    diff --git a/lib/collections/addon/components/discover-page/facets/checklist/component.ts b/lib/collections/addon/components/discover-page/facets/checklist/component.ts index 3d90e09e4a1..94934e97b36 100644 --- a/lib/collections/addon/components/discover-page/facets/checklist/component.ts +++ b/lib/collections/addon/components/discover-page/facets/checklist/component.ts @@ -6,6 +6,7 @@ import DS from 'ember-data'; import { layout } from 'ember-osf-web/decorators/component'; import Collection from 'ember-osf-web/models/collection'; import CollectionProvider from 'ember-osf-web/models/collection-provider'; +import Analytics from 'ember-osf-web/services/analytics'; import Base from '../base/component'; import styles from './styles'; @@ -17,6 +18,7 @@ interface Item { @layout(template, styles) export default abstract class SearchFacetChecklist extends Base { + @service analytics!: Analytics; @service store!: DS.Store; allItems: Item[] = []; @@ -72,7 +74,7 @@ export default abstract class SearchFacetChecklist extends Base { didInsertElement(this: SearchFacetChecklist) { super.didInsertElement(); - const { context, filterChanged, filterProperty } = this; + const { analytics, context, filterChanged, filterProperty } = this; setProperties(context, { updateFilters(item?: string) { @@ -81,6 +83,8 @@ export default abstract class SearchFacetChecklist extends Base { if (item) { const method = activeFilter.includes(item) ? 'removeObject' : 'pushObject'; activeFilter[method](item); + const filterAction = method === 'removeObject' ? 'remove' : 'add'; + analytics.track('filter', filterAction, `Collections Discover - Filter ${context.title} ${item}`); } setProperties(context, { diff --git a/lib/collections/addon/discover/route.ts b/lib/collections/addon/discover/route.ts index c0fc5bbced6..667226f8afc 100644 --- a/lib/collections/addon/discover/route.ts +++ b/lib/collections/addon/discover/route.ts @@ -1,9 +1,13 @@ +import { action } from '@ember/object'; import Route from '@ember/routing/route'; import { inject as service } from '@ember/service'; import DS from 'ember-data'; +import Analytics from 'ember-osf-web/services/analytics'; + export default class Discover extends Route { @service store!: DS.Store; + @service analytics!: Analytics; queryParams = { queryString: { @@ -11,10 +15,12 @@ export default class Discover extends Route { }, }; - /** - * Stub - */ model() { return this.store.findAll('collection-provider', { reload: true }); } + + @action + didTransition() { + this.analytics.trackPage(); + } } diff --git a/lib/collections/addon/provider/discover/route.ts b/lib/collections/addon/provider/discover/route.ts index 7a62129ce04..d42a8cd168e 100644 --- a/lib/collections/addon/provider/discover/route.ts +++ b/lib/collections/addon/provider/discover/route.ts @@ -1,6 +1,8 @@ +import { action } from '@ember/object'; import Route from '@ember/routing/route'; import { inject as service } from '@ember/service'; import { DS } from 'ember-data'; +import Analytics from 'ember-osf-web/services/analytics'; import Theme from 'ember-osf-web/services/theme'; export default class ProviderDiscover extends Route { @@ -9,8 +11,14 @@ export default class ProviderDiscover extends Route { @service store!: DS.Store; @service theme!: Theme; + @service analytics!: Analytics; model() { return []; } + + @action + didTransition() { + this.analytics.trackPage(); + } } From 0b1369175fcc593720a2f93fc8c448240c97d4a1 Mon Sep 17 00:00:00 2001 From: Baylee Swenson Date: Fri, 19 Jun 2020 15:44:34 -0400 Subject: [PATCH 02/25] Update test to include analytics stub --- tests/unit/collections/provider/discover/route-test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/unit/collections/provider/discover/route-test.ts b/tests/unit/collections/provider/discover/route-test.ts index f73d419cefd..e0340393154 100644 --- a/tests/unit/collections/provider/discover/route-test.ts +++ b/tests/unit/collections/provider/discover/route-test.ts @@ -5,6 +5,7 @@ import { module, test } from 'qunit'; const themeStub = Service.extend(); const headTagsStub = Service.extend(); +const analyticsStub = Service.extend(); module('Unit | Route | collections/provider/discover', hooks => { setupEngineTest(hooks, 'collections'); @@ -12,6 +13,7 @@ module('Unit | Route | collections/provider/discover', hooks => { hooks.beforeEach(function(this: TestContext) { this.owner.register('service:theme', themeStub); this.owner.register('service:head-tags', headTagsStub); + this.owner.register('service:analytics', analyticsStub); }); test('it exists', function(assert) { From fe798fdfe5709998ab2c56acbfccb295956aaf4a Mon Sep 17 00:00:00 2001 From: Baylee Swenson Date: Tue, 30 Jun 2020 15:33:33 -0400 Subject: [PATCH 03/25] Add ember-template-lint and remove ember-cli-template-lint --- package.json | 2 +- yarn.lock | 265 +++++++++++++++++++++++++++++++++++---------------- 2 files changed, 186 insertions(+), 81 deletions(-) diff --git a/package.json b/package.json index 6620fc746af..bd413598f32 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,6 @@ "ember-cli-showdown": "^4.4.4", "ember-cli-sri": "^2.1.1", "ember-cli-stylelint": "^2.1.0", - "ember-cli-template-lint": "^0.7.6", "ember-cli-test-loader": "^2.2.0", "ember-cli-typescript": "^3.0.0", "ember-cli-typescript-blueprints": "^3.0.0", @@ -173,6 +172,7 @@ "ember-source": "~3.16.0", "ember-tag-input": "^1.2.2", "ember-template-compiler": "^1.9.0-alpha", + "ember-template-lint": "^2.8.0", "ember-toastr": "^1.7.2", "ember-wormhole": "^0.5.4", "ember-youtube": "^0.9.0", diff --git a/yarn.lock b/yarn.lock index 6ae93925b92..60870d2b070 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2138,16 +2138,6 @@ reflect-metadata "^0.1.12" tslib "^1.8.1" -"@glimmer/compiler@^0.35.5": - version "0.35.10" - resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.35.10.tgz#ea830a984ced7fe68dd5e96f21127f76ad22c35c" - integrity sha512-/nwanZgQsXVp0vFSm27CPNuRH6NnSzXU+j8WcKYRx9Dd40Jf8RAmGGgOKkfqGLcDbNVsaxg2zL+WIn9aIU+85Q== - dependencies: - "@glimmer/interfaces" "^0.35.10" - "@glimmer/syntax" "^0.35.10" - "@glimmer/util" "^0.35.10" - "@glimmer/wire-format" "^0.35.10" - "@glimmer/component@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@glimmer/component/-/component-1.0.0.tgz#f9052c8e99fb7b3d48d27c65891c5f0e59084a82" @@ -2177,7 +2167,7 @@ resolved "https://registry.yarnpkg.com/@glimmer/di/-/di-0.2.1.tgz#5286b6b32040232b751138f6d006130c728d4b3d" integrity sha512-0D53YVuEgGdHfTl9LGWDZqVzGhn4cT0CXqyAuOYkKFLvqboJXz6SnkRhQNPhhA2hLVrPnvUz3+choQmPhHLGGQ== -"@glimmer/env@^0.1.7": +"@glimmer/env@0.1.7", "@glimmer/env@^0.1.7": version "0.1.7" resolved "https://registry.yarnpkg.com/@glimmer/env/-/env-0.1.7.tgz#fd2d2b55a9029c6b37a6c935e8c8871ae70dfa07" integrity sha1-/S0rVakCnGs3psk16MiHGucN+gc= @@ -2189,12 +2179,12 @@ dependencies: "@glimmer/wire-format" "^0.30.5" -"@glimmer/interfaces@^0.35.10": - version "0.35.10" - resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.35.10.tgz#1ec18cf7bbcbe42547dd2e131b565a2f71234e3c" - integrity sha512-fegpWTjDd8DAcjvgP4N+5BOnBLpulBvRjUNqvw6raY3OVw5O/Hon+iYqX1bPBbGP16RFj+6BPkc+GnZspQRazQ== +"@glimmer/interfaces@^0.51.1": + version "0.51.1" + resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.51.1.tgz#c5637669ff83c630d91c700598b9963225d656f2" + integrity sha512-ImwkFNj92RaeANQPlnSQ5kTtK18JzkY2FPE7N7Ktn3AvdXgM4P3puQzPuXhTn4UCBl6NZtN8YqCAy7kQ6eRC0w== dependencies: - "@glimmer/wire-format" "^0.35.10" + "@simple-dom/interface" "^1.4.0" "@glimmer/resolver@^0.4.1": version "0.4.3" @@ -2213,15 +2203,15 @@ handlebars "^4.0.6" simple-html-tokenizer "^0.4.1" -"@glimmer/syntax@^0.35.10": - version "0.35.10" - resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.35.10.tgz#8f50dfd841487c469ad5d94cd01b425a51a9ab32" - integrity sha512-rAm0yC3KOEMNiE5260wjmMGMw/+y4HcyhQE/GgAy/CxnJuWE4fenRczucK1aaEcJyFdwF73bkSn1iF1b8fFiGQ== +"@glimmer/syntax@^0.51.1": + version "0.51.1" + resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.51.1.tgz#24cb4f01693bd934075d03087bdc76ab6bff0524" + integrity sha512-z5XSbLgMKGU8tgSm9Ju4mimSAJ6/SZrY2Xw2znEAmUJOIPte+tmkdpggpgj7lAjD5u2YVBVHDbz6RaZDhYASsw== dependencies: - "@glimmer/interfaces" "^0.35.10" - "@glimmer/util" "^0.35.10" - handlebars "^4.0.6" - simple-html-tokenizer "^0.5.5" + "@glimmer/interfaces" "^0.51.1" + "@glimmer/util" "^0.51.1" + handlebars "^4.7.4" + simple-html-tokenizer "^0.5.9" "@glimmer/tracking@^1.0.0": version "1.0.0" @@ -2236,16 +2226,20 @@ resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.30.5.tgz#97f3dcd4029f713c503371e1608e129a833a70e1" integrity sha512-hknvHrof+tq7Gj4C4Xbs/GBuqbf68d5hRfqyHk6zBWMYBiCyr5dRS48/kPiNEdclm3eZGbbl1L+eoj0ioz9GiA== -"@glimmer/util@^0.35.10": - version "0.35.10" - resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.35.10.tgz#2a25fa5c3d2b6114bbb07fd57c6e52abd9d088c3" - integrity sha512-DfO425GLVG9tuEixghIsjYwiJAhtJ0bZVAQYgBvkBk0O1oAaWDJ9eOj5xhuCWiUm8OFulSjqt9kcU0ShxFl4ZQ== - "@glimmer/util@^0.44.0": version "0.44.0" resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.44.0.tgz#45df98d73812440206ae7bda87cfe04aaae21ed9" integrity sha512-duAsm30uVK9jSysElCbLyU6QQYO2X9iLDLBIBUcCqck9qN1o3tK2qWiHbGK5d6g8E2AJ4H88UrfElkyaJlGrwg== +"@glimmer/util@^0.51.1": + version "0.51.1" + resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.51.1.tgz#db27afd2ee7191e8e399c272b9f7fbe05cc26691" + integrity sha512-MCwUvV3z4pqLpeXcv5Mbchdgw0GeEPH8jUEkUTG837b5XlC2M/NO893E5A8AZbGNSP7CDsYibDExz7mjaLqq/A== + dependencies: + "@glimmer/env" "0.1.7" + "@glimmer/interfaces" "^0.51.1" + "@simple-dom/interface" "^1.4.0" + "@glimmer/validator@^0.44.0": version "0.44.0" resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.44.0.tgz#03d127097dc9cb23052cdb7fcae59d0a9dca53e1" @@ -2258,13 +2252,6 @@ dependencies: "@glimmer/util" "^0.30.5" -"@glimmer/wire-format@^0.35.10": - version "0.35.10" - resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.35.10.tgz#8445d51923ccbc6a923d2a911f37c82cc390c2e6" - integrity sha512-HteYOO04QTnjAW7g7RDGDpdVzUTOuF3UUDJLgf6Oi5pYwzSxV3EetErgZfAPjY0L113si3L7eVZmZ62lkfm2vA== - dependencies: - "@glimmer/util" "^0.35.10" - "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" @@ -2306,6 +2293,11 @@ dependencies: any-observable "^0.3.0" +"@simple-dom/interface@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@simple-dom/interface/-/interface-1.4.0.tgz#e8feea579232017f89b0138e2726facda6fbb71f" + integrity sha512-l5qumKFWU0S+4ZzMaLXFU8tQZsicHEMEyAxI5kDFGhJsRqDwe0a7/iPA/GdxlGyDKseQQAgIz5kzU7eXTrlSpA== + "@sindresorhus/is@^0.7.0": version "0.7.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd" @@ -3288,7 +3280,7 @@ ansi-styles@^3.0.0, ansi-styles@^3.2.0, ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" -ansi-styles@^4.1.0: +ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359" integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA== @@ -3624,7 +3616,7 @@ async-limiter@~1.0.0: resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== -async-promise-queue@^1.0.3: +async-promise-queue@^1.0.3, async-promise-queue@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/async-promise-queue/-/async-promise-queue-1.0.5.tgz#cb23bce9fce903a133946a700cc85f27f09ea49d" integrity sha512-xi0aQ1rrjPWYmqbwr18rrSKbSaXIeIwSd1J4KAgVfkq8utNbdZoht7GfvfY6swFUAMJ9obkc4WPJmtGwl+B8dw== @@ -6270,6 +6262,14 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" +chalk@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" + integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + character-entities-html4@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-1.1.2.tgz#c44fdde3ce66b52e8d321d6c1bf46101f0150610" @@ -6519,6 +6519,11 @@ cli-spinners@^2.0.0: resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.2.0.tgz#e8b988d9206c692302d8ee834e7a85c0144d8f77" integrity sha512-tgU3fKwzYjiLEQgPMD9Jt+JjHVL9kW93FiIMX/l7rivvOD4/LL0Mf7gda3+4U2KJBloybwgj5KEoQgGRioMiKQ== +cli-spinners@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.3.0.tgz#0632239a4b5aa4c958610142c34bb7a651fc8df5" + integrity sha512-Xs2Hf2nzrvJMFKimOR7YR0QwZ8fc0u98kdtwN1eNAZzNQgH3vK2pXzff6GJtKh7S5hoJ87ECiAiZFS2fb5Ii2w== + cli-table@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/cli-table/-/cli-table-0.3.1.tgz#f53b05266a8b1a0b934b3d0821e6e2dc5914ae23" @@ -6584,6 +6589,15 @@ cliui@^5.0.0: strip-ansi "^5.2.0" wrap-ansi "^5.1.0" +cliui@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" + integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^6.2.0" + clone-regexp@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/clone-regexp/-/clone-regexp-1.0.1.tgz#051805cd33173375d82118fc0918606da39fd60f" @@ -6681,6 +6695,11 @@ colors@1.0.3: resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" integrity sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs= +colors@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" + integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== + colors@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" @@ -6747,6 +6766,11 @@ commander@^4.1.1: resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== +commander@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" + integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg== + comment-regex@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/comment-regex/-/comment-regex-1.0.1.tgz#e070d2c4db33231955d0979d27c918fcb6f93565" @@ -9010,23 +9034,6 @@ ember-cli-stylelint@^2.1.0: postcss-easy-import "^3.0.0" tailwindcss "^0.5.2" -ember-cli-template-lint@^0.7.6: - version "0.7.6" - resolved "https://registry.yarnpkg.com/ember-cli-template-lint/-/ember-cli-template-lint-0.7.6.tgz#33e55efa460fbfa2f108775318460ba9d6bf8667" - integrity sha1-M+Ve+kYPv6LxCHdTGEYLqda/hmc= - dependencies: - aot-test-generators "^0.1.0" - broccoli-concat "^3.2.2" - broccoli-persistent-filter "^1.2.0" - chalk "^2.0.1" - debug "^3.0.0" - ember-cli-version-checker "^2.1.0" - ember-template-lint "^0.8.16" - json-stable-stringify "^1.0.1" - md5-hex "^2.0.0" - strip-ansi "^4.0.0" - walk-sync "^0.3.2" - ember-cli-test-info@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/ember-cli-test-info/-/ember-cli-test-info-1.0.0.tgz#ed4e960f249e97523cf891e4aed2072ce84577b4" @@ -10250,17 +10257,35 @@ ember-template-compiler@^1.9.0-alpha: resolved "https://registry.yarnpkg.com/ember-template-compiler/-/ember-template-compiler-1.9.0-alpha.tgz#193dfcfcf0d8c1b3595a9609eb46d90d05d34f2f" integrity sha1-GT38/PDYwbNZWpYJ60bZDQXTTy8= -ember-template-lint@^0.8.16: - version "0.8.23" - resolved "https://registry.yarnpkg.com/ember-template-lint/-/ember-template-lint-0.8.23.tgz#45170d6f2fe6336635df1d1067cabab6b5eb02d0" - integrity sha512-8XogixWMyjccLjROoML8bzAxI98BYVQsfe+EFj7Vqp/VwtYhdE4HqoDTu4x5Jq6m2Zs936QdsIGsX209FomFhA== +ember-template-lint@^2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/ember-template-lint/-/ember-template-lint-2.8.0.tgz#01ddc6daf9c8497fe5cfcc55cde25f203a7d8bd3" + integrity sha512-tK4aJewdmtVUGSnX/1MR6TuSFAhmIL/CUsUeW33pQsf324l96XzhPP+66G06vjWw8iLW2zK2Rbh5HnEL+IDZsA== dependencies: - "@glimmer/compiler" "^0.35.5" - chalk "^2.0.0" - glob "^7.0.0" - minimatch "^3.0.4" - resolve "^1.1.3" - strip-bom "^3.0.0" + chalk "^4.0.0" + ember-template-recast "^4.1.4" + find-up "^4.1.0" + get-stdin "^8.0.0" + globby "^11.0.0" + is-valid-glob "^1.0.0" + micromatch "^4.0.2" + resolve "^1.17.0" + yargs "^15.3.1" + +ember-template-recast@^4.1.4: + version "4.1.4" + resolved "https://registry.yarnpkg.com/ember-template-recast/-/ember-template-recast-4.1.4.tgz#0552f4f27d33b17ac05a48107f369032eb45fb97" + integrity sha512-jw38ncM5uJu7INVWYCmm4GNIEdGVLkjABWbj451A83Ag4lBfXIbIHq+5IM7rFzUlw/Ho39WxeKhKZ5KTvIVljQ== + dependencies: + "@glimmer/syntax" "^0.51.1" + async-promise-queue "^1.0.5" + colors "^1.4.0" + commander "^5.1.0" + globby "^11.0.0" + ora "^4.0.4" + slash "^3.0.0" + tmp "^0.1.0" + workerpool "^5.0.4" ember-test-waiters@^1.0.0: version "1.1.1" @@ -12071,6 +12096,11 @@ get-stdin@^7.0.0: resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-7.0.0.tgz#8d5de98f15171a125c5e516643c7a6d0ea8a96f6" integrity sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ== +get-stdin@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53" + integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg== + get-stream@3.0.0, get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" @@ -12327,6 +12357,18 @@ globby@11.0.0: merge2 "^1.3.0" slash "^3.0.0" +globby@^11.0.0: + version "11.0.1" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.1.tgz#9a2bf107a068f3ffeabc49ad702c79ede8cfd357" + integrity sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.1.1" + ignore "^5.1.4" + merge2 "^1.3.0" + slash "^3.0.0" + globby@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" @@ -12496,7 +12538,7 @@ handlebars@^4.3.1: optionalDependencies: uglify-js "^3.1.4" -handlebars@^4.7.3: +handlebars@^4.7.3, handlebars@^4.7.4: version "4.7.6" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.6.tgz#d4c05c1baf90e9945f77aa68a7a219aa4a7df74e" integrity sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA== @@ -13485,6 +13527,11 @@ is-hexadecimal@^1.0.0: resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.2.tgz#b6e710d7d07bb66b98cb8cece5c9b4921deeb835" integrity sha512-but/G3sapV3MNyqiDBLrOi4x8uCIw0RY3o/Vb5GT0sMFHrVV7731wFSVy41T5FO1og7G0gXLJh0MkgPRouko/A== +is-interactive@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" + integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== + is-my-ip-valid@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz#7b351b8e8edd4d3995d4d066680e664d94696824" @@ -13678,6 +13725,11 @@ is-utf8@^0.2.0: resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= +is-valid-glob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-1.0.0.tgz#29bf3eff701be2d4d315dbacc39bc39fe8f601aa" + integrity sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao= + is-whitespace-character@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-whitespace-character/-/is-whitespace-character-1.0.2.tgz#ede53b4c6f6fb3874533751ec9280d01928d03ed" @@ -14992,6 +15044,13 @@ log-symbols@^1.0.2: dependencies: chalk "^1.0.0" +log-symbols@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" + integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== + dependencies: + chalk "^2.4.2" + log-update@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/log-update/-/log-update-2.3.0.tgz#88328fd7d1ce7938b29283746f0b1bc126b24708" @@ -15242,13 +15301,6 @@ md5-hex@^1.3.0: dependencies: md5-o-matic "^0.1.1" -md5-hex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-2.0.0.tgz#d0588e9f1c74954492ecd24ac0ac6ce997d92e33" - integrity sha1-0FiOnxx0lUSS7NJKwKxs6ZfZLjM= - dependencies: - md5-o-matic "^0.1.1" - md5-o-matic@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/md5-o-matic/-/md5-o-matic-0.1.1.tgz#822bccd65e117c514fab176b25945d54100a03c3" @@ -16660,6 +16712,20 @@ ora@^3.4.0: strip-ansi "^5.2.0" wcwidth "^1.0.1" +ora@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/ora/-/ora-4.0.4.tgz#e8da697cc5b6a47266655bf68e0fb588d29a545d" + integrity sha512-77iGeVU1cIdRhgFzCK8aw1fbtT1B/iZAvWjS+l/o1x0RShMgxHUZaD2yDpWsNCPwXg9z1ZA78Kbdvr8kBmG/Ww== + dependencies: + chalk "^3.0.0" + cli-cursor "^3.1.0" + cli-spinners "^2.2.0" + is-interactive "^1.0.0" + log-symbols "^3.0.0" + mute-stream "0.0.8" + strip-ansi "^6.0.0" + wcwidth "^1.0.1" + os-browserify@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" @@ -18650,7 +18716,7 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@1.5.0, resolve@^1.1.3: +resolve@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" integrity sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw== @@ -18671,7 +18737,7 @@ resolve@^1.10.0, resolve@^1.11.1, resolve@^1.12.0, resolve@^1.3.2, resolve@^1.3. dependencies: path-parse "^1.0.6" -resolve@^1.13.1: +resolve@^1.13.1, resolve@^1.17.0: version "1.17.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== @@ -19284,10 +19350,10 @@ simple-html-tokenizer@^0.4.1: resolved "https://registry.yarnpkg.com/simple-html-tokenizer/-/simple-html-tokenizer-0.4.3.tgz#9b00b766e30058b4bb377c0d4f97566a13ab1be1" integrity sha512-OpUzgR+P/Qsu6ztZehr4PxvTbV4sDW91hAqc2tnz4fjuFTqErWIUdUMbnzX+19F4IEpSSfa0vCAz5xJSs0LpPw== -simple-html-tokenizer@^0.5.5: - version "0.5.6" - resolved "https://registry.yarnpkg.com/simple-html-tokenizer/-/simple-html-tokenizer-0.5.6.tgz#e1e442b14f5484bf9a7e2924f78f00855e6b3c14" - integrity sha512-WgtFeFTAzegTCs1/x096l79gscV43LS17fEXBjv1s26oqiu1qmTM0buaqba/HmlxHNfk4yJuKmSJoRDMWuQU6w== +simple-html-tokenizer@^0.5.9: + version "0.5.9" + resolved "https://registry.yarnpkg.com/simple-html-tokenizer/-/simple-html-tokenizer-0.5.9.tgz#1a83fe97f5a3e39b335fddf71cfe9b0263b581c2" + integrity sha512-w/3FEDN94r4JQ9WoYrIr8RqDIPZdyNkdpbK9glFady1CAEyD97XWCv8HFetQO21w81e7h7Nh59iYTyG1mUJftg== sinon@^7.1.1: version "7.3.1" @@ -19788,7 +19854,7 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string-width@^4.1.0: +string-width@^4.1.0, string-width@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== @@ -21648,6 +21714,11 @@ workerpool@^3.1.1, workerpool@^3.1.2: object-assign "4.1.1" rsvp "^4.8.4" +workerpool@^5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-5.0.4.tgz#4f67cb70ff7550a27ab94de25b0b843cd92059a2" + integrity sha512-Sywova24Ow2NQ24JPB68bI89EdqMDjUXo4OpofK/QMD7C2ZVMloYBgQ5J3PChcBJHj2vspsmGx1/3nBKXtUkXQ== + wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" @@ -21673,6 +21744,15 @@ wrap-ansi@^5.1.0: string-width "^3.0.0" strip-ansi "^5.0.0" +wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrappy@1, wrappy@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -21828,6 +21908,14 @@ yargs-parser@^10.0.0: dependencies: camelcase "^4.1.0" +yargs-parser@^18.1.1: + version "18.1.3" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" + integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + yargs-parser@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" @@ -21885,6 +21973,23 @@ yargs@^10.0.3: y18n "^3.2.1" yargs-parser "^8.1.0" +yargs@^15.3.1: + version "15.3.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.3.1.tgz#9505b472763963e54afe60148ad27a330818e98b" + integrity sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA== + dependencies: + cliui "^6.0.0" + decamelize "^1.2.0" + find-up "^4.1.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^4.2.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^18.1.1" + yargs@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" From 6c7932c4d759babba198847378d4a17246a06bc3 Mon Sep 17 00:00:00 2001 From: Baylee Swenson Date: Tue, 30 Jun 2020 15:48:55 -0400 Subject: [PATCH 04/25] Fix linting errors --- lib/registries/addon/application/template.hbs | 4 ++-- lib/registries/addon/discover/template.hbs | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/registries/addon/application/template.hbs b/lib/registries/addon/application/template.hbs index 19aa6fa3a42..f64a6905acf 100644 --- a/lib/registries/addon/application/template.hbs +++ b/lib/registries/addon/application/template.hbs @@ -17,8 +17,8 @@ {{! }} {{! }} - - + + diff --git a/lib/registries/addon/discover/template.hbs b/lib/registries/addon/discover/template.hbs index 0e1297cca82..a1e12c5124d 100644 --- a/lib/registries/addon/discover/template.hbs +++ b/lib/registries/addon/discover/template.hbs @@ -28,7 +28,9 @@
    diff --git a/lib/osf-components/addon/components/contributors/card/styles.scss b/lib/osf-components/addon/components/contributors/card/styles.scss index 85bb40db4e7..5447098f766 100644 --- a/lib/osf-components/addon/components/contributors/card/styles.scss +++ b/lib/osf-components/addon/components/contributors/card/styles.scss @@ -1,15 +1,7 @@ .CardContainer { margin: 0; height: 60px; - - &:not(:first-of-type) { - margin-top: 10px; - } - - &:not(:last-of-type) { - border-bottom: 1px solid $color-border-gray; - margin-bottom: 10px; - } + border-bottom: 1px solid $color-border-gray; } .MainSection { diff --git a/lib/osf-components/addon/components/contributors/list/template.hbs b/lib/osf-components/addon/components/contributors/list/template.hbs index a4d9069a1d2..fa05f7a7ac8 100644 --- a/lib/osf-components/addon/components/contributors/list/template.hbs +++ b/lib/osf-components/addon/components/contributors/list/template.hbs @@ -7,7 +7,9 @@ @widgetMode ) as |Card|}} {{#each @contributorsManager.contributors as |contributor|}} - +
  • + +
  • {{/each}} {{#if (and (not @contributorsManager.isLoading) @contributorsManager.hasMore)}}

    - + {{#let (unique-id 'title') as |titleFieldId|}} - -{{/if}} +{{/if}} \ No newline at end of file diff --git a/mirage/scenarios/default.ts b/mirage/scenarios/default.ts index 57eb1fb2db3..a9c65e8db4b 100644 --- a/mirage/scenarios/default.ts +++ b/mirage/scenarios/default.ts @@ -59,7 +59,7 @@ function registrationScenario( 'page-one_single-select-two': 'Remember who was in NSync and who was in Backstreet Boys', }; - const rootNode = server.create('node'); + const rootNode = server.create('node', { contributors: server.createList('contributor', 21) }); const childNodeA = server.create('node', { parent: rootNode }); server.create('node', { parent: childNodeA }); server.create('node', { parent: childNodeA }); @@ -72,7 +72,6 @@ function registrationScenario( registrationResponses, branchedFrom: rootNode, license: licenseReqFields, - contributors: server.createList('contributor', 21), }, 'withSubjects', 'withAffiliatedInstitutions'); server.create('draft-registration', { diff --git a/tests/integration/components/contributors/component-test.ts b/tests/integration/components/contributors/component-test.ts index 993b4b9ff10..5f6dadccd82 100644 --- a/tests/integration/components/contributors/component-test.ts +++ b/tests/integration/components/contributors/component-test.ts @@ -1,4 +1,4 @@ -import { render } from '@ember/test-helpers'; +import { render, click } from '@ember/test-helpers'; import a11yAudit from 'ember-a11y-testing/test-support/audit'; import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; import { setupIntl, t } from 'ember-intl/test-support'; @@ -7,6 +7,9 @@ import { TestContext } from 'ember-test-helpers'; import hbs from 'htmlbars-inline-precompile'; import { module, test } from 'qunit'; +import { Permission } from 'ember-osf-web/models/osf-model'; +import { selectChoose } from 'ember-power-select/test-support'; +import { clickTrigger } from 'ember-power-select/test-support/helpers'; import { OsfLinkRouterStub } from '../../helpers/osf-link-router-stub'; module('Integration | Component | contributors', hooks => { @@ -48,7 +51,6 @@ module('Integration | Component | contributors', hooks => { this.set('node', registrationModel); const { contributors } = registrationModel; - await render(hbs``); contributors.forEach(contributor => { const userPermission = t(`osf-components.contributors.permissions.${contributor.permission}`); @@ -67,4 +69,32 @@ module('Integration | Component | contributors', hooks => { await a11yAudit(this.element); assert.ok(true, 'No a11y errors on page'); }); + + test('editable user card renders', async function(assert) { + const draftRegistration = server.create('draft-registration'); + const contributor = server.create('contributor', { + draftRegistration, + permission: Permission.Admin, + bibliographic: false, + }); + const registrationModel = await this.store.findRecord('draft-registration', draftRegistration.id); + this.set('node', registrationModel); + + await render(hbs``); + + assert.dom('[data-test-contributor-card]').exists(); + assert.dom('[data-test-contributor-card-main]').exists(); + assert.dom('[data-test-contributor-gravatar]').exists(); + assert.dom(`[data-test-contributor-link="${contributor.id}"]`) + .hasText(contributor.users.fullName); + assert.dom(`[data-test-contributor-permission="${contributor.id}"]`) + .hasText('Administrator'); + assert.dom('[data-test-contributor-citation-checkbox]').isNotChecked(); + await clickTrigger(); + await selectChoose('[data-test-contributor-permission]', 'Read'); + await click('[data-test-contributor-citation-checkbox]'); + assert.dom(`[data-test-contributor-permission="${contributor.id}"]`) + .hasText('Read'); + assert.dom('[data-test-contributor-citation-checkbox]').isChecked(); + }); }); From 28958dc6d14a08f80ed3697b20fae1c033db63d7 Mon Sep 17 00:00:00 2001 From: Futa Ikeda Date: Thu, 2 Jul 2020 15:22:37 -0400 Subject: [PATCH 12/25] Use local class to set position behavior --- lib/collections/addon/components/discover-page/styles.scss | 1 + lib/registries/addon/discover/styles.scss | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/collections/addon/components/discover-page/styles.scss b/lib/collections/addon/components/discover-page/styles.scss index a1bae61b5bc..c86e34b48be 100644 --- a/lib/collections/addon/components/discover-page/styles.scss +++ b/lib/collections/addon/components/discover-page/styles.scss @@ -19,6 +19,7 @@ .sortByOptionList { background-color: #efefef; + left: auto; li:hover { background-color: #d9d9d9; diff --git a/lib/registries/addon/discover/styles.scss b/lib/registries/addon/discover/styles.scss index f3b4bb31c45..c68373ae497 100644 --- a/lib/registries/addon/discover/styles.scss +++ b/lib/registries/addon/discover/styles.scss @@ -10,6 +10,7 @@ .SortDropDown__List { background-color: $color-bg-gray-light; + left: auto; } .SortDropDown__Option { From 54c1528028705c9d406d1efd5bb16acf4ed9aa34 Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Thu, 2 Jul 2020 15:53:36 -0400 Subject: [PATCH 13/25] fix linting --- tests/integration/components/contributors/component-test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/components/contributors/component-test.ts b/tests/integration/components/contributors/component-test.ts index 5f6dadccd82..1df9f61007c 100644 --- a/tests/integration/components/contributors/component-test.ts +++ b/tests/integration/components/contributors/component-test.ts @@ -1,4 +1,4 @@ -import { render, click } from '@ember/test-helpers'; +import { click, render } from '@ember/test-helpers'; import a11yAudit from 'ember-a11y-testing/test-support/audit'; import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; import { setupIntl, t } from 'ember-intl/test-support'; From 9b8027a3119d6b6d9421a54634a2df8546095aaf Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Thu, 2 Jul 2020 15:58:45 -0400 Subject: [PATCH 14/25] add analytics to checkbox --- .../addon/components/contributors/card/editable/template.hbs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/osf-components/addon/components/contributors/card/editable/template.hbs b/lib/osf-components/addon/components/contributors/card/editable/template.hbs index 68cbada8dfb..c6e859b3926 100644 --- a/lib/osf-components/addon/components/contributors/card/editable/template.hbs +++ b/lib/osf-components/addon/components/contributors/card/editable/template.hbs @@ -37,8 +37,9 @@
    From 9195b9400008ae48eb40010547fbc3f4a8b25b89 Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Mon, 6 Jul 2020 11:10:37 -0400 Subject: [PATCH 15/25] use Permission enum --- .../addon/components/contributors/card/editable/component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/osf-components/addon/components/contributors/card/editable/component.ts b/lib/osf-components/addon/components/contributors/card/editable/component.ts index ecde21a7d05..477f0a08a5d 100644 --- a/lib/osf-components/addon/components/contributors/card/editable/component.ts +++ b/lib/osf-components/addon/components/contributors/card/editable/component.ts @@ -2,11 +2,12 @@ import { tagName } from '@ember-decorators/component'; import Component from '@ember/component'; import { layout } from 'ember-osf-web/decorators/component'; +import { Permission } from 'ember-osf-web/models/osf-model'; import styles from './styles'; import template from './template'; @layout(template, styles) @tagName('') export default class ContributorsCardEditable extends Component { - permissionOptions = ['read', 'write', 'admin']; + permissionOptions = [...Object.values(Permission)]; } From f118e5559e260577fef868fd78bc06d6a04186d1 Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Mon, 6 Jul 2020 11:42:21 -0400 Subject: [PATCH 16/25] overflow-y --- .../addon/components/contributors/widget/styles.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/osf-components/addon/components/contributors/widget/styles.scss b/lib/osf-components/addon/components/contributors/widget/styles.scss index 6b2f287278f..b552bde41db 100644 --- a/lib/osf-components/addon/components/contributors/widget/styles.scss +++ b/lib/osf-components/addon/components/contributors/widget/styles.scss @@ -1,7 +1,7 @@ .Container { border: 1px solid $color-border-gray; margin-top: 10px; - overflow: scroll; + overflow-y: scroll; max-height: 500px; } From 715fba87b20e21f6d8d1b6b8ff419ee23b463f95 Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Mon, 6 Jul 2020 12:08:40 -0400 Subject: [PATCH 17/25] text-overflow as ellipsis for name --- .../addon/components/contributors/card/styles.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/osf-components/addon/components/contributors/card/styles.scss b/lib/osf-components/addon/components/contributors/card/styles.scss index 5447098f766..63356495ee8 100644 --- a/lib/osf-components/addon/components/contributors/card/styles.scss +++ b/lib/osf-components/addon/components/contributors/card/styles.scss @@ -18,5 +18,8 @@ &:first-of-type { flex: 2 0 auto; max-width: 40%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } } From ba9fb1c9ce0eb18b2fa6a0f6ebd5463fc6c09f19 Mon Sep 17 00:00:00 2001 From: Fabrice Mizero Date: Mon, 6 Jul 2020 13:46:46 -0400 Subject: [PATCH 18/25] Bump version to 20.8.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f607b93704f..da3e7f597ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ember-osf-web", - "version": "20.7.0", + "version": "20.8.0", "description": "Ember front-end for the Open Science Framework", "license": "Apache-2.0", "author": "Center for Open Science ", From 44341322178a3524d831597760a686893f1cb443 Mon Sep 17 00:00:00 2001 From: Baylee Swenson Date: Thu, 16 Jul 2020 14:57:59 -0400 Subject: [PATCH 19/25] Update collections analytics to include theme --- .../addon/components/branded-navbar/template.hbs | 2 +- .../components/collection-search-result/node/template.hbs | 2 +- .../addon/components/discover-page/component.ts | 5 ++--- .../discover-page/facets/checklist/component.ts | 8 ++++++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/app-components/addon/components/branded-navbar/template.hbs b/lib/app-components/addon/components/branded-navbar/template.hbs index 2dc7efd38f3..f7cabef133e 100644 --- a/lib/app-components/addon/components/branded-navbar/template.hbs +++ b/lib/app-components/addon/components/branded-navbar/template.hbs @@ -43,7 +43,7 @@
  • {{#link-to 'provider.submit' - click=(action 'click' 'link' (concat 'Navbar - ' (t @addLinkKey)) target=this.analytics) + click=(action 'click' 'link' (concat this.theme.id ' Navbar - ' (t @addLinkKey)) target=this.analytics) }} {{t @addLinkKey}} {{/link-to}} diff --git a/lib/collections/addon/components/collection-search-result/node/template.hbs b/lib/collections/addon/components/collection-search-result/node/template.hbs index 9a2eb39942b..6846fc60912 100644 --- a/lib/collections/addon/components/collection-search-result/node/template.hbs +++ b/lib/collections/addon/components/collection-search-result/node/template.hbs @@ -1,6 +1,6 @@
    diff --git a/lib/collections/addon/components/discover-page/component.ts b/lib/collections/addon/components/discover-page/component.ts index 1e91a39e455..55f1494b57a 100644 --- a/lib/collections/addon/components/discover-page/component.ts +++ b/lib/collections/addon/components/discover-page/component.ts @@ -338,8 +338,7 @@ export default class DiscoverPage extends Component { @action clearFilters() { - this.analytics.track('button', 'click', 'Discover - Clear Filters'); - + this.analytics.track('button', 'click', `${this.theme.id} Discover - Clear Filters`); if (this.facetContexts) { // Clear all of the activeFilters this.facetContexts @@ -366,7 +365,7 @@ export default class DiscoverPage extends Component { @action searchAction() { // Only want to track search here when button clicked. Keypress search tracking is debounced in trackSearch - this.analytics.track('button', 'click', 'Discover - Search', this.q); + this.analytics.track('button', 'click', `${this.theme.id} Discover - Search`, this.q); this.search(); } diff --git a/lib/collections/addon/components/discover-page/facets/checklist/component.ts b/lib/collections/addon/components/discover-page/facets/checklist/component.ts index 94934e97b36..af52aa09060 100644 --- a/lib/collections/addon/components/discover-page/facets/checklist/component.ts +++ b/lib/collections/addon/components/discover-page/facets/checklist/component.ts @@ -74,7 +74,7 @@ export default abstract class SearchFacetChecklist extends Base { didInsertElement(this: SearchFacetChecklist) { super.didInsertElement(); - const { analytics, context, filterChanged, filterProperty } = this; + const { analytics, context, filterChanged, filterProperty, theme } = this; setProperties(context, { updateFilters(item?: string) { @@ -84,7 +84,11 @@ export default abstract class SearchFacetChecklist extends Base { const method = activeFilter.includes(item) ? 'removeObject' : 'pushObject'; activeFilter[method](item); const filterAction = method === 'removeObject' ? 'remove' : 'add'; - analytics.track('filter', filterAction, `Collections Discover - Filter ${context.title} ${item}`); + analytics.track( + 'filter', + filterAction, + `${theme.id} Discover - Filter ${context.title} ${item}`, + ); } setProperties(context, { From dda1f873dc7da7cb24b1f54a56664355604d6812 Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Mon, 20 Jul 2020 09:50:06 -0400 Subject: [PATCH 20/25] fix contributor links --- .../addon/components/contributors/card/editable/template.hbs | 2 +- .../addon/components/contributors/card/readonly/template.hbs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/osf-components/addon/components/contributors/card/editable/template.hbs b/lib/osf-components/addon/components/contributors/card/editable/template.hbs index c6e859b3926..be9cda457a9 100644 --- a/lib/osf-components/addon/components/contributors/card/editable/template.hbs +++ b/lib/osf-components/addon/components/contributors/card/editable/template.hbs @@ -13,7 +13,7 @@ data-test-contributor-link={{@contributor.id}} data-analytics-name='View user' @route='guid-user' - @models={{array @contributor.id}} + @models={{array @contributor.users.id}} > {{@contributor.users.fullName}} diff --git a/lib/osf-components/addon/components/contributors/card/readonly/template.hbs b/lib/osf-components/addon/components/contributors/card/readonly/template.hbs index 9b4bc64879e..882caa1dcec 100644 --- a/lib/osf-components/addon/components/contributors/card/readonly/template.hbs +++ b/lib/osf-components/addon/components/contributors/card/readonly/template.hbs @@ -13,7 +13,7 @@ data-test-contributor-link={{@contributor.id}} data-analytics-name='View user' @route='guid-user' - @models={{array @contributor.id}} + @models={{array @contributor.users.id}} > {{@contributor.users.fullName}} From 43d90fa5f61cd99140e51c3fc32ff1ba3563763a Mon Sep 17 00:00:00 2001 From: Baylee Swenson Date: Wed, 22 Jul 2020 15:29:09 -0400 Subject: [PATCH 21/25] Move provider name to the end of analytics labels --- .../addon/components/branded-navbar/template.hbs | 2 +- .../components/collection-search-result/node/template.hbs | 2 +- lib/collections/addon/components/discover-page/component.ts | 4 ++-- .../components/discover-page/facets/checklist/component.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/app-components/addon/components/branded-navbar/template.hbs b/lib/app-components/addon/components/branded-navbar/template.hbs index f7cabef133e..497c673d8de 100644 --- a/lib/app-components/addon/components/branded-navbar/template.hbs +++ b/lib/app-components/addon/components/branded-navbar/template.hbs @@ -43,7 +43,7 @@
  • {{#link-to 'provider.submit' - click=(action 'click' 'link' (concat this.theme.id ' Navbar - ' (t @addLinkKey)) target=this.analytics) + click=(action 'click' 'link' (concat ' Navbar - ' (t @addLinkKey) ' - ' this.theme.id) target=this.analytics) }} {{t @addLinkKey}} {{/link-to}} diff --git a/lib/collections/addon/components/collection-search-result/node/template.hbs b/lib/collections/addon/components/collection-search-result/node/template.hbs index 6846fc60912..a53986c08b5 100644 --- a/lib/collections/addon/components/collection-search-result/node/template.hbs +++ b/lib/collections/addon/components/collection-search-result/node/template.hbs @@ -1,6 +1,6 @@
    diff --git a/lib/collections/addon/components/discover-page/component.ts b/lib/collections/addon/components/discover-page/component.ts index 55f1494b57a..ccf5675e9c3 100644 --- a/lib/collections/addon/components/discover-page/component.ts +++ b/lib/collections/addon/components/discover-page/component.ts @@ -338,7 +338,7 @@ export default class DiscoverPage extends Component { @action clearFilters() { - this.analytics.track('button', 'click', `${this.theme.id} Discover - Clear Filters`); + this.analytics.track('button', 'click', `Discover - Clear Filters - ${this.theme.id}`); if (this.facetContexts) { // Clear all of the activeFilters this.facetContexts @@ -365,7 +365,7 @@ export default class DiscoverPage extends Component { @action searchAction() { // Only want to track search here when button clicked. Keypress search tracking is debounced in trackSearch - this.analytics.track('button', 'click', `${this.theme.id} Discover - Search`, this.q); + this.analytics.track('button', 'click', `Discover - Search - ${this.theme.id}`, this.q); this.search(); } diff --git a/lib/collections/addon/components/discover-page/facets/checklist/component.ts b/lib/collections/addon/components/discover-page/facets/checklist/component.ts index af52aa09060..a7ffcad36fa 100644 --- a/lib/collections/addon/components/discover-page/facets/checklist/component.ts +++ b/lib/collections/addon/components/discover-page/facets/checklist/component.ts @@ -87,7 +87,7 @@ export default abstract class SearchFacetChecklist extends Base { analytics.track( 'filter', filterAction, - `${theme.id} Discover - Filter ${context.title} ${item}`, + `Discover - Filter ${context.title} ${item} - ${theme.id}`, ); } From 88fa9141a6a47d5d8084f4ef405dc3d5b7acb925 Mon Sep 17 00:00:00 2001 From: Baylee Swenson Date: Thu, 23 Jul 2020 10:02:02 -0400 Subject: [PATCH 22/25] Remove space --- lib/app-components/addon/components/branded-navbar/template.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/app-components/addon/components/branded-navbar/template.hbs b/lib/app-components/addon/components/branded-navbar/template.hbs index 497c673d8de..6063690cd93 100644 --- a/lib/app-components/addon/components/branded-navbar/template.hbs +++ b/lib/app-components/addon/components/branded-navbar/template.hbs @@ -43,7 +43,7 @@
  • {{#link-to 'provider.submit' - click=(action 'click' 'link' (concat ' Navbar - ' (t @addLinkKey) ' - ' this.theme.id) target=this.analytics) + click=(action 'click' 'link' (concat 'Navbar - ' (t @addLinkKey) ' - ' this.theme.id) target=this.analytics) }} {{t @addLinkKey}} {{/link-to}} From eff3e98ab571ed57da6f9c7edcf7fff3c9c3ae20 Mon Sep 17 00:00:00 2001 From: Futa Ikeda Date: Mon, 27 Jul 2020 16:50:36 -0400 Subject: [PATCH 23/25] Update contributor card to handle unregistered users --- .../contributors/card/readonly/template.hbs | 20 ++++++++------ mirage/factories/contributor.ts | 4 +-- .../components/contributors/component-test.ts | 26 +++++++++++++++++++ 3 files changed, 39 insertions(+), 11 deletions(-) diff --git a/lib/osf-components/addon/components/contributors/card/readonly/template.hbs b/lib/osf-components/addon/components/contributors/card/readonly/template.hbs index 882caa1dcec..45953417b7f 100644 --- a/lib/osf-components/addon/components/contributors/card/readonly/template.hbs +++ b/lib/osf-components/addon/components/contributors/card/readonly/template.hbs @@ -9,14 +9,18 @@ height='30' width='30' > - - {{@contributor.users.fullName}} - + {{#if @contributor.unregisteredContributor}} + {{@contributor.unregisteredContributor}} + {{else}} + + {{@contributor.users.fullName}} + + {{/if}} ({ permission: faker.list.cycle(...Object.values(Permission)), bibliographic: true, - unregisteredContributor() { - return faker.random.number(5) ? undefined : faker.name.firstName(); - }, + unregisteredContributor: undefined, index(i: number) { return i; }, diff --git a/tests/integration/components/contributors/component-test.ts b/tests/integration/components/contributors/component-test.ts index 1df9f61007c..fc4a4f0d6a6 100644 --- a/tests/integration/components/contributors/component-test.ts +++ b/tests/integration/components/contributors/component-test.ts @@ -70,6 +70,32 @@ module('Integration | Component | contributors', hooks => { assert.ok(true, 'No a11y errors on page'); }); + test('read-only user card renders unregistered contributor', async function(assert) { + const registration = server.create('draft-registration'); + const unregContributor = server.create('contributor', { + draftRegistration: registration, + }, 'unregistered'); + const registrationModel = await this.store.findRecord('draft-registration', registration.id); + this.set('node', registrationModel); + + await render(hbs``); + const userPermission = t(`osf-components.contributors.permissions.${unregContributor.permission}`); + const userCitation = t(`osf-components.contributors.citation.${unregContributor.bibliographic}`); + + assert.dom('[data-test-contributor-card]').exists(); + assert.dom('[data-test-contributor-card-main]').exists(); + assert.dom('[data-test-contributor-gravatar]').exists(); + assert.dom('[data-test-contributor-link]').doesNotExist(); + assert.dom('[data-test-contributor-card-main] CardSection') + .containsText(unregContributor.unregisteredContributor!); + assert.dom(`[data-test-contributor-permission="${unregContributor.id}"]`) + .hasText(userPermission); + assert.dom(`[data-test-contributor-citation="${unregContributor.id}"]`) + .hasText(userCitation); + await a11yAudit(this.element); + assert.ok(true, 'No a11y errors on page'); + }); + test('editable user card renders', async function(assert) { const draftRegistration = server.create('draft-registration'); const contributor = server.create('contributor', { From c08a56ecb8b07cf2ec436ea7310ff9cfa02ba59a Mon Sep 17 00:00:00 2001 From: Futa Ikeda Date: Tue, 28 Jul 2020 10:39:55 -0400 Subject: [PATCH 24/25] Fix broken test --- tests/integration/components/contributors/component-test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/components/contributors/component-test.ts b/tests/integration/components/contributors/component-test.ts index fc4a4f0d6a6..9bd8a1d00c1 100644 --- a/tests/integration/components/contributors/component-test.ts +++ b/tests/integration/components/contributors/component-test.ts @@ -86,7 +86,7 @@ module('Integration | Component | contributors', hooks => { assert.dom('[data-test-contributor-card-main]').exists(); assert.dom('[data-test-contributor-gravatar]').exists(); assert.dom('[data-test-contributor-link]').doesNotExist(); - assert.dom('[data-test-contributor-card-main] CardSection') + assert.dom('[data-test-contributor-card-main]') .containsText(unregContributor.unregisteredContributor!); assert.dom(`[data-test-contributor-permission="${unregContributor.id}"]`) .hasText(userPermission); From b76016dfe29eee3fea5943e04e9cde431fa65171 Mon Sep 17 00:00:00 2001 From: Fabrice Mizero Date: Wed, 29 Jul 2020 12:03:27 -0400 Subject: [PATCH 25/25] Update Changelog --- CHANGELOG.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb9f94563b1..b12479226c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [20.8.0] - 2020-07-29 +### Added +- `contributor-list` read-only to draft metadata page +- `ember-template-lint` addon + +### Changed +- analytics for collections +- styles for registries discover sort dropdown (bugfix) + +### Removed +- `ember-cli-template-lint` + ## [20.7.0] - 2020-07-01 ## Added - user metrics CSV export on the institutional dashboard @@ -1619,7 +1631,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added - Quick Files -[Unreleased]: https://github.com/CenterForOpenScience/ember-osf-web/compare/20.7.0...develop +[Unreleased]: https://github.com/CenterForOpenScience/ember-osf-web/compare/20.8.0...develop +[20.8.0]: https://github.com/CenterForOpenScience/ember-osf-web/releases/tag/20.8.0 [20.7.0]: https://github.com/CenterForOpenScience/ember-osf-web/releases/tag/20.7.0 [20.6.1]: https://github.com/CenterForOpenScience/ember-osf-web/releases/tag/20.6.1 [20.6.0]: https://github.com/CenterForOpenScience/ember-osf-web/releases/tag/20.6.0