Skip to content

Commit

Permalink
Merge pull request #2272 from daostack/feature/CW-2237-change-system-…
Browse files Browse the repository at this point in the history
…message-text

change system message text on new stream & new space #2237
  • Loading branch information
andreymikhadyuk authored Oct 30, 2023
2 parents e61eb74 + 0fd3b3e commit 5c3a84c
Showing 1 changed file with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
CommonCreatedSystemMessage,
CommonEditedSystemMessage,
CommonFeedItemCreatedSystemMessage,
CommonFeedType,
CommonMemberAddedSystemMessage,
SystemMessageCommonType,
User,
Expand Down Expand Up @@ -73,8 +72,8 @@ const getCommonCreatedSystemMessageText = async (

if (isThisCommonCreated) {
return [
`This ${getCommonTypeText(systemMessageData.commonType)} was created by `,
userEl,
` created this ${getCommonTypeText(systemMessageData.commonType)}`,
];
}

Expand All @@ -91,7 +90,7 @@ const getCommonCreatedSystemMessageText = async (
""
);

return [userEl, " created the space", commonEl].filter(Boolean);
return ["The ", commonEl, " space was created by ", userEl].filter(Boolean);
};

const getCommonEditedSystemMessageText = async (
Expand All @@ -102,14 +101,15 @@ const getCommonEditedSystemMessageText = async (
const userEl = renderUserMention(user, data);

return [
userEl,
` edited this ${getCommonTypeText(systemMessageData.commonType)}’s `,
`This ${getCommonTypeText(systemMessageData.commonType)}’s `,
renderLink(
(data.getCommonPageAboutTabPath || getCommonPageAboutTabPath)(
systemMessageData.commonId,
),
"info",
),
" was edited by ",
userEl,
];
};

Expand Down Expand Up @@ -156,15 +156,7 @@ const getFeedItemCreatedSystemMessageText = async (
""
);

return [
userEl,
` created the ${
systemMessageData.feedItemType === CommonFeedType.Discussion
? "discussion"
: "proposal"
}`,
titleEl,
].filter(Boolean);
return [titleEl, " was created by ", userEl].filter(Boolean);
};

export const getTextFromSystemMessage = async (
Expand Down

0 comments on commit 5c3a84c

Please sign in to comment.