Skip to content
New issue

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

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

Already on GitHub? # to your account

[AIDAPP-466]: Indicate contact's name when that task is related to a contact in the resulting notification. #424

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

amit-canyon
Copy link
Contributor

Ticket(s) or GitHub Issue

Technical Description

Indicate contact's name when that task is related to a contact in the resulting notification.

Any deployment steps required?

No

Are any Feature Flags and/or Data Migrations that can eventually be removed Added?

No


Before contributing and submitting this PR, make sure you have Read, agree, and are compliant with the contributing guidelines.

@amit-canyon amit-canyon requested a review from a team as a code owner February 18, 2025 13:54
@amit-canyon amit-canyon added the Change Type | Content or Styling Update Changes which don't affect functionality label Feb 18, 2025
@amit-canyon
Copy link
Contributor Author

amit-canyon commented Feb 18, 2025

@Orrison This branch is from AIDAPP-470.
Thanks!

Base automatically changed from AIDAPP-470 to main February 19, 2025 19:02
Comment on lines 81 to 86
$message = match (true) {
is_null($this->task->concern->organization) => "You have been assigned a new Task: <a href='{$url}' target='_blank' class='underline'>{$title}</a> related to Contact <a href='" . ContactResource::getUrl('view', ['record' => $this->task->concern]) . "' target='_blank' class='underline'>{$this->task->concern?->full_name}</a>",

! is_null($this->task->concern->organization) => "You have been assigned a new Task: <a href='{$url}' target='_blank' class='underline'>{$title}</a> related to Contact <a href='" . ContactResource::getUrl('view', ['record' => $this->task->concern]) . "' target='_blank' class='underline'>{$this->task->concern?->full_name}</a><a href='" . OrganizationResource::getUrl('view', ['record' => $this->task->concern->organization]) . "' target='_blank' class='underline'>({$this->task->concern->organization?->name})</a>",

default => "You have been assigned a new Task: <a href='{$url}' target='_blank' class='underline'>{$title}</a>",
Copy link
Contributor

Choose a reason for hiding this comment

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

A problem here is that the task->concern can be null which I think would cause trouble here both from a logic perspective and also perhaps throw an error is some of your checks here.

You should check

  1. If there is not a concern
  2. If there is a concern but no organization then display the new message with the name but no org in parenthesis
  3. if there is a concern with an org then display the new message with the name and org in parenthesis

@amit-canyon amit-canyon requested a review from Orrison February 21, 2025 05:14
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Change Type | Content or Styling Update Changes which don't affect functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants