Skip to content

Commit

Permalink
Merge pull request #8214 from stopfstedt/frontend_5725_localstorage_c…
Browse files Browse the repository at this point in the history
…alendar_filters

removes persistance of user-context selections from calendar filters
  • Loading branch information
jrjohnson authored Dec 19, 2024
2 parents 35e928c + 9f3ab6f commit 857c555
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 58 deletions.
5 changes: 0 additions & 5 deletions packages/frontend/tests/acceptance/dashboard/calendar-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions packages/ilios-common/addon/components/dashboard/calendar.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
{{#if @mySchedule}}
{{#if this.showUserContextFilters}}
<div class="calendar-options-control toggle-user-context-filters" data-test-usercontexts>
<Dashboard::UserContextFilter @setUserContext={{this.setUserContext}} @userContext={{this.userContext}}/>
<Dashboard::UserContextFilter @setUserContext={{set this "userContext"}} @userContext={{this.userContext}}/>
</div>
{{/if}}
{{else}}
Expand Down Expand Up @@ -110,4 +110,4 @@
/>
</section>
</div>
</div>
</div>
15 changes: 2 additions & 13 deletions packages/ilios-common/addon/components/dashboard/calendar.js
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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() {
Expand Down
1 change: 0 additions & 1 deletion packages/ilios-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
37 changes: 0 additions & 37 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 857c555

Please sign in to comment.