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

Add HTML support to notification summary #15607

Merged
merged 10 commits into from
Apr 1, 2024
Merged

Conversation

MikeAlhayek
Copy link
Member

Fix #15606

@MikeAlhayek MikeAlhayek requested a review from agriffard as a code owner March 28, 2024 20:01
@hyzx86
Copy link
Contributor

hyzx86 commented Apr 1, 2024

Can we specify UrlTemplate for notifications?
It is convenient for users to jump directly to the corresponding content after clicking

@MikeAlhayek
Copy link
Member Author

MikeAlhayek commented Apr 1, 2024

Can we specify UrlTemplate for notifications?

When you create notification, you can generate a link. For example, in the workflow, you can create a clickable notification by using something like this

<a href="{{ Workflow.Input.ContentItem | display_url }}">{{ Workflow.Input.ContentItem | display_text }}</a>

You can create any HTML you want.

@MikeAlhayek MikeAlhayek enabled auto-merge (squash) April 1, 2024 19:12
@MikeAlhayek MikeAlhayek merged commit 88a61bd into main Apr 1, 2024
5 checks passed
@MikeAlhayek MikeAlhayek deleted the ma/support-html-notification branch April 1, 2024 19:19
updater.ModelState.AddModelError(Prefix, nameof(viewModel.HtmlBody), S["HTML Body field does not contain a valid Liquid expression. Details: {0}", string.Join(' ', htmlBodyErrors)]);
}

if (updater.ModelState.IsValid)
Copy link
Contributor

@Skrypt Skrypt Apr 4, 2024

Choose a reason for hiding this comment

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

We should not do this at all in the UpdateAsync. Just update the model and send it back to the EditAsync with an UpdateEditorContext. You need to have the values updated to display on that form on validation error. Else, these user values are lost unless you use an asp-for on the input. Also, as long as the ModelState is not valid it should simply not persist the data in DB.

Copy link
Member Author

Choose a reason for hiding this comment

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

@Skrypt This is done in an abstract class which call a virtual method UpdateActivityAsync only if the model is valid. We do similar logic in other base drivers like ActivityDisplayDriver

Why should we not do this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Going to sleep will try to explain tomorrow. See my display driver pr.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I will just wait for next triage meeting and explain this. Or I should do a video that explains it all.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good. I suggest opening an issue and explain it with video. Maybe a good topic for Tuesday as well. If this should not be done here, then we should change it in other places too since it is a behavior that we use in other places.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was hoping to follow up on this today on meeting but it will be more likely for next time..

Copy link
Member Author

Choose a reason for hiding this comment

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

No meeting today

Copy link
Contributor

Choose a reason for hiding this comment

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

I saw on Gitter 👍🏼

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.

Add HTML Support in the Notification Summary
3 participants