From d5128943de2e5e9c2f6b6fed776d12aff67b7e65 Mon Sep 17 00:00:00 2001 From: Stefan Topfstedt Date: Tue, 5 Nov 2024 08:28:47 -0800 Subject: [PATCH 1/3] undo persisting user-context-filter selections in local storage. --- .../addon/components/dashboard/calendar.hbs | 4 ++-- .../addon/components/dashboard/calendar.js | 15 ++------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/packages/ilios-common/addon/components/dashboard/calendar.hbs b/packages/ilios-common/addon/components/dashboard/calendar.hbs index aee80e80a7..7173880dde 100644 --- a/packages/ilios-common/addon/components/dashboard/calendar.hbs +++ b/packages/ilios-common/addon/components/dashboard/calendar.hbs @@ -33,7 +33,7 @@ {{#if @mySchedule}} {{#if this.showUserContextFilters}}
- +
{{/if}} {{else}} @@ -110,4 +110,4 @@ /> - + \ No newline at end of file diff --git a/packages/ilios-common/addon/components/dashboard/calendar.js b/packages/ilios-common/addon/components/dashboard/calendar.js index a8d79f07c1..ba5c55cb1a 100644 --- a/packages/ilios-common/addon/components/dashboard/calendar.js +++ b/packages/ilios-common/addon/components/dashboard/calendar.js @@ -1,12 +1,11 @@ import Component from '@glimmer/component'; import { service } from '@ember/service'; -import { cached } from '@glimmer/tracking'; +import { cached, tracked } from '@glimmer/tracking'; import { action } from '@ember/object'; import { DateTime } from 'luxon'; import { map } from 'rsvp'; import { mapBy, sortBy } from 'ilios-common/utils/array-helpers'; import { TrackedAsyncData } from 'ember-async-data'; -import { storageFor } from 'ember-local-storage'; export default class DashboardCalendarComponent extends Component { @service userEvents; @@ -17,17 +16,7 @@ export default class DashboardCalendarComponent extends Component { @service iliosConfig; @service dataLoader; @service localeDays; - - @storageFor('dashboard') dashboardStorage; - - get userContext() { - return this.dashboardStorage?.get('userContext'); - } - - @action - setUserContext(userContext) { - this.dashboardStorage?.set('userContext', userContext); - } + @tracked userContext; @cached get cohortProxiesData() { From ef0442aeee2558acb67f2cbc990cd10356dfd891 Mon Sep 17 00:00:00 2001 From: Stefan Topfstedt Date: Tue, 5 Nov 2024 08:29:53 -0800 Subject: [PATCH 2/3] rm obsolete ember-local-storage dependency. --- packages/ilios-common/package.json | 1 - pnpm-lock.yaml | 37 ------------------------------ 2 files changed, 38 deletions(-) diff --git a/packages/ilios-common/package.json b/packages/ilios-common/package.json index 213bc709f7..7e0f1d33b4 100644 --- a/packages/ilios-common/package.json +++ b/packages/ilios-common/package.json @@ -49,7 +49,6 @@ "ember-in-viewport": "^4.0.0", "ember-inflector": "^5.0.2", "ember-intl": "^7.0.4", - "ember-local-storage": "^2.0.7", "ember-math-helpers": "^4.0.0", "ember-modifier": "^4.0.0", "ember-on-resize-modifier": "^2.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fe631c0247..3b9ef57792 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -450,9 +450,6 @@ importers: ember-intl: specifier: ^7.0.4 version: 7.0.7(@ember/test-helpers@4.0.4(@babel/core@7.26.0)(ember-source@5.11.1(@glimmer/component@1.1.2(@babel/core@7.26.0))(rsvp@4.8.5)(webpack@5.97.1)))(webpack@5.97.1) - ember-local-storage: - specifier: ^2.0.7 - version: 2.0.7(@babel/core@7.26.0) ember-math-helpers: specifier: ^4.0.0 version: 4.2.1(ember-source@5.11.1(@glimmer/component@1.1.2(@babel/core@7.26.0))(rsvp@4.8.5)(webpack@5.97.1)) @@ -3828,9 +3825,6 @@ packages: blank-object@1.0.2: resolution: {integrity: sha512-kXQ19Xhoghiyw66CUiGypnuRpWlbHAzY/+NyvqTEdTfhfQGH1/dbEMYiXju7fYKIFePpzp/y9dsu5Cu/PkmawQ==} - blob-polyfill@7.0.20220408: - resolution: {integrity: sha512-oD8Ydw+5lNoqq+en24iuPt1QixdPpe/nUF8azTHnviCZYu9zUC+TwdzIp5orpblJosNlgNbVmmAb//c6d6ImUQ==} - bluebird@3.7.2: resolution: {integrity: sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==} @@ -5356,10 +5350,6 @@ packages: resolution: {integrity: sha512-ZbJbXq7dhjqJfOG/BBVlqO1o4Y6SWENrhiEgI7vokwVeuqHrvfaaFWV1emZUrsvoCAbSq/TiEdncO1EdZcI7Fg==} engines: {node: '>= 16.*'} - ember-copy@2.0.1: - resolution: {integrity: sha512-N/XFvZszrzyyX4IcNoeK4mJvIItNuONumhPLqi64T8NDjJkxBj4Pq61rvMkJx/9eZ8alzE4I8vYKOLxT0FvRuQ==} - engines: {node: 10.* || >= 12} - ember-destroyable-polyfill@2.0.3: resolution: {integrity: sha512-TovtNqCumzyAiW0/OisSkkVK93xnVF4NRU6+FN0ubpfwEOpRrmM2RqDwXI6YAChCgSHON1cz0DfQStpA1Gjuuw==} engines: {node: 10.* || >= 12} @@ -5450,10 +5440,6 @@ packages: resolution: {integrity: sha512-CYR+U/wRxLbrfYN3dh+0Tb6mFaxJKfdyz+wNql6cqTrA0BBi9k6J3AaKXj273TqvEpyyXegQFFkZEiuZdYtgJw==} engines: {node: 6.* || 8.* || >= 10.*} - ember-local-storage@2.0.7: - resolution: {integrity: sha512-EPvxH/27mIzrX/EEgng+FG6HD0ri/God9OH/9mhmgPSXrgMNq/614Z3NMnooM4QKIEBAvr0p+p1UL2DgrTTMNg==} - engines: {node: 12.* || 14.* || >= 16} - ember-math-helpers@4.2.1: resolution: {integrity: sha512-/pOFz6tQ67mh0faiD7nzOCYRXHElg2d/SvQnYB8vdYoj7BLCkNHLjdo3F0oa5Qz/6J/+k3ie5ZGBjMumvlOeIw==} engines: {node: '>= 18'} @@ -13884,8 +13870,6 @@ snapshots: blank-object@1.0.2: {} - blob-polyfill@7.0.20220408: {} - bluebird@3.7.2: {} bn.js@4.12.1: {} @@ -16249,12 +16233,6 @@ snapshots: transitivePeerDependencies: - supports-color - ember-copy@2.0.1: - dependencies: - ember-cli-babel: 7.26.11 - transitivePeerDependencies: - - supports-color - ember-destroyable-polyfill@2.0.3(@babel/core@7.26.0): dependencies: ember-cli-babel: 7.26.11 @@ -16458,21 +16436,6 @@ snapshots: - '@babel/core' - supports-color - ember-local-storage@2.0.7(@babel/core@7.26.0): - dependencies: - blob-polyfill: 7.0.20220408 - broccoli-funnel: 3.0.8 - broccoli-merge-trees: 4.2.0 - broccoli-stew: 3.0.0 - ember-cli-babel: 7.26.11 - ember-cli-string-utils: 1.1.0 - ember-cli-version-checker: 5.1.2 - ember-copy: 2.0.1 - ember-destroyable-polyfill: 2.0.3(@babel/core@7.26.0) - transitivePeerDependencies: - - '@babel/core' - - supports-color - ember-math-helpers@4.2.1(ember-source@5.11.1(@glimmer/component@1.1.2(@babel/core@7.26.0))(rsvp@4.8.5)(webpack@5.97.1)): dependencies: '@embroider/addon-shim': 1.9.0 From 9f3ab6f82d62020bf2fe737794bacf81bb2e8669 Mon Sep 17 00:00:00 2001 From: Stefan Topfstedt Date: Tue, 5 Nov 2024 09:07:53 -0800 Subject: [PATCH 3/3] rm test helper usage from removed ember-local-storage package. --- .../frontend/tests/acceptance/dashboard/calendar-test.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/frontend/tests/acceptance/dashboard/calendar-test.js b/packages/frontend/tests/acceptance/dashboard/calendar-test.js index 2a535f7e3a..16109eda97 100644 --- a/packages/frontend/tests/acceptance/dashboard/calendar-test.js +++ b/packages/frontend/tests/acceptance/dashboard/calendar-test.js @@ -4,7 +4,6 @@ import { module, test } from 'qunit'; import { setupAuthentication, freezeDateAt, unfreezeDate } from 'ilios-common'; import { setupApplicationTest } from 'frontend/tests/helpers'; import page from 'ilios-common/page-objects/dashboard-calendar'; -import resetStorages from 'ember-local-storage/test-support/reset-storage'; import percySnapshot from '@percy/ember'; module('Acceptance | Dashboard Calendar', function (hooks) { @@ -80,10 +79,6 @@ module('Acceptance | Dashboard Calendar', function (hooks) { hooks.afterEach(() => { unfreezeDate(); - if (window.localStorage) { - window.localStorage.clear(); - } - resetStorages(); }); test('load month calendar', async function (assert) {