mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: action_code_path not being loaded for user-stream-item (#18577)
This commit fixes an issue where we had a typo in the UserAction.stream query which meant that action_code_path was not loaded correctly. Once that was fixed, we were also not actually using the action_code_path in the user-stream-item, so that has been fixed here too. The bug this caused was that, when the link for the action was clicked within the user-stream-item, the user would be redirected to a URL ending with `[missing%20%%7Bpath%7D%20value]` because the I18n call did not have the path present.
This commit is contained in:
@@ -28,7 +28,8 @@ export default Component.extend({
|
||||
actionDescription: actionDescription(
|
||||
"item.action_code",
|
||||
"item.created_at",
|
||||
"item.action_code_who"
|
||||
"item.action_code_who",
|
||||
"item.action_code_path"
|
||||
),
|
||||
|
||||
@discourseComputed("item.draft_username", "item.username")
|
||||
|
||||
@@ -26,11 +26,21 @@ export function actionDescriptionHtml(actionCode, createdAt, username, path) {
|
||||
return htmlSafe(I18n.t(`action_codes.${actionCode}`, { who, when, path }));
|
||||
}
|
||||
|
||||
export function actionDescription(actionCode, createdAt, username) {
|
||||
export function actionDescription(
|
||||
actionCode,
|
||||
createdAt,
|
||||
username,
|
||||
path = null
|
||||
) {
|
||||
return computed(actionCode, createdAt, function () {
|
||||
const ac = this.get(actionCode);
|
||||
if (ac) {
|
||||
return actionDescriptionHtml(ac, this.get(createdAt), this.get(username));
|
||||
return actionDescriptionHtml(
|
||||
ac,
|
||||
this.get(createdAt),
|
||||
this.get(username),
|
||||
path ? this.get(path) : null
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user