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

[NHUB-611] fix: Exception raised when selecting all products when value is currently null #1208

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

MarkLark86
Copy link
Contributor

@MarkLark86 MarkLark86 commented Dec 16, 2024

Purpose

In front-end code we're assuming User.products always has a value, which is not always the case, it may sometimes be null. This causes an issue with the Select All button in Company Admin -> EditUser form.

Notes:

  • This is not caused by the async changes, but discovered during testing of.
  • I know this can be solved on the backend, but it was causing multiple tests to fail by defaulting to an empty list, so I decided to fix it in the front-end where it is used.

What has changed

  • Update typescript IUser interface to reflect optional value for products field
  • Fix user util to check if User occupies seat for a Product

Checklist

  • This pull request is not adding new forms that use redux
  • This pull request is adding missing TypeScript types to modified code segments where it's easy to do so with confidence
  • This pull request is replacing lodash.get with optional chaining for modified code segments

Resolves: NHUB-611

@MarkLark86 MarkLark86 added this to the v3.0 milestone Dec 16, 2024
@MarkLark86 MarkLark86 requested a review from eos87 December 16, 2024 05:48
Copy link
Contributor

@eos87 eos87 left a comment

Choose a reason for hiding this comment

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

Looks good to me

@MarkLark86 MarkLark86 merged commit 781b5d7 into superdesk:async Dec 16, 2024
8 checks passed
devketanpro added a commit that referenced this pull request Dec 17, 2024
* [NHUB-570] fix(types): Make MonitoringProfile schedule optional (#1171)

* [NHUB-550] Upgrade NewsApiAudit resource to async (#1170)

* [NHUB-550] Upgrade NewsApiAudit resource to async

* fix api_audit resource registration

* [NHUB-595] fix(celery): Dont use async for task.apply_async in celery beat (#1174)

* [NHUB 549] Implement new formatters registration, convert to async (#1172)

* [NHUB-550] Upgrade NewsApiAudit resource to async

* fix api_audit resource registration

* [NHUB-549] Implement new formatters registration, convert to async

* Remove `download_formatters` from app

* fix typo in feature product description

* [NHUB-564] fix(ws): topic_matches message not including topic ids (#1176)

* [NHUB-594] fix(dashboard): Remove validation for card_item requests (#1181)

* [NHUB-598] fix(push): Support unknown fields for Wire & Agenda (#1180)

* [NHUB-598] fix(push): Support unknown fields for Wire & Agenda

* fix type error

* remove unused import

* FINALLY fix notification length test being flaky

* fix update products, use Pydantic models instead of dicts

* improve(login): Remove email validation and incorrect login error (#1177)

* improve: Use new async signal system (#1182)

* improve: Use new async signal system

* remove comment in test code

* [NHUB-595] fix(command): Get User ID from ResourceModel (#1186)

* [NHUB-595] fix(command): Get User ID from ResourceModel

* fix lint issue

* remove checking lint in unit tests job

* [NHUB-550|NHUB-549] fix: NewsAPI audit report & time limit setting (#1189)

* fix(reports): Invalid elastic query for NewsAPI audit report

* fix(newsapi): Ignore NewsAPI time limit days if 0

* Fix tests (#1200)

* update dev-requirements.txt

* Remove dataclass wrapper from Dataclass models

* [NHUB-600] fix(search): Exclude SectionFilters that are disabled (#1198)

* [NHUB-600] fix(search): Exclude SectionFilters that are disabled

* update dev-requirements.txt

* Remove dataclass wrapper from Dataclass models

* [NHUB-587] fix(events): Make sure to store dates with timezone info (#1201)

* [NHUB-587] fix(events): Make sure to store dates with timezone info

* fix tests

* [NHUB-592] fix: User profile not showing if user has no product permissions (#1199)

* [NHUB-611] fix: Exception raised when selecting all products when value is currently null (#1208)

* fix: Exception raised with agenda push notifications (#1209)

* update dev-requirement.txt

---------

Co-authored-by: MarkLark86 <[email protected]>
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.

2 participants