Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXUI-2595 - Add spinner to event dropdown #1828

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

Conversation

Josh-HMCTS
Copy link
Contributor

JIRA link (if applicable)

https://tools.hmcts.net/jira/browse/EXUI-2595

Change description

Add spinner when user triggers event from event dropdown

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[ ] No

RiteshHMCTS and others added 11 commits November 18, 2024 14:51
* Add the fix and tests

* version updated
* checking for the availability of Other type reason

* version updated

* cve

* version updated

* version updated
* Add readCookieService and language information to client context

* Add version

* Add additional language setting on clientcontext

Event guard also sets it

* Make sonar advised change

* Add sonar suggested change

* Update npmpublish.yml

* Add change to make client context always appear with language

* version updated

* release notes updated

* version updated

* version updated

---------

Co-authored-by: Ritesh Dsouza <ritesh.dsouza@HMCTS.net>
* Update event-start.guard.ts

Fix regression issue that overwrites user_task

* Change version

* Update event-start.guard.ts

Add 'en' even if no cookie
Add language to existing client_context object, not just object with user_task

* Add version

* Update event-start.guard.spec.ts

Add helpful test

* update to rel name

---------

Co-authored-by: Josh <josh.glasgow@hmcts.net>
@olusegz07 olusegz07 force-pushed the branch_frm_d80548e_before_QM branch from 1ba5a5b to b22fa0f Compare December 12, 2024 14:50
@Josh-HMCTS Josh-HMCTS changed the base branch from branch_frm_d80548e_before_QM to master January 2, 2025 09:43
RiteshHMCTS
RiteshHMCTS previously approved these changes Jan 15, 2025
Copy link
Contributor

@andywilkinshmcts andywilkinshmcts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On reflection I don't like this approach. Let's discuss after the standup tomorrow

) {
}

public ngOnInit(): void {
if (this.loadingService.storedSpinner){
this.loadingService.unregisterStoredSpinner();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good, but I don't like the public variable in loadingService

@@ -6,6 +6,7 @@ import { distinctUntilChanged } from 'rxjs/operators';
export class LoadingService {
private readonly registered = new Map<string, string>();
private readonly loading = new BehaviorSubject<boolean>(false);
public storedSpinner;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand why you need to do this. It seems like a hack. I certainly frown on using a public variable to store state. The spinner token is already in the registered map somewhere. This is a shared service, so your hack probably only works until some other component starts to mess with your state.

I think you need to analyse this a bit more carefully and think about adding behaviour to the loading service that can be called at the appropriate place in the calling component that will ensure that that the spinner is taken down.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have reworked the approach and used private array to store any shared loading spinners

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants