0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Cleaning up and formalizing how events show across all activity feeds

- There was some formatting problems on the Dashboard with certain events
- There was inconsitencies with how we formatted some events over others
- Removed 'on' and just using '-' for all

refs https://github.com/TryGhost/Team/issues/2243
This commit is contained in:
James Morris 2022-11-11 15:17:55 +00:00
parent 718657a8f4
commit 42bf847142
5 changed files with 17 additions and 30 deletions

View file

@ -102,11 +102,14 @@
<span class="gh-members-activity-description {{if (feature "memberAttribution") 'feature-memberAttribution'}}">
<span class="gh-members-activity-event-text">{{capitalize-first-letter parsedEvent.action}}</span>
{{#if parsedEvent.info}}
<span class="highlight">{{parsedEvent.info}}</span>
<span class="highlight">({{parsedEvent.info}})</span>
{{/if}}
{{#if parsedEvent.url}}
<span class="gh-members-activity-event-join">{{parsedEvent.join}}</span>
<a class="ghost-members-activity-object-link" href="{{parsedEvent.url}}" target="_blank" rel="noopener noreferrer">{{parsedEvent.object}}</a>
{{else if parsedEvent.email}}
<span class="gh-members-activity-event-join">{{parsedEvent.join}}</span>
<GhEmailPreviewLink @data={{event.email}} />
{{/if}}
</span>
</span>

View file

@ -27,15 +27,13 @@
<span class="gh-members-activity-description {{if (feature "memberAttribution") 'feature-memberAttribution'}}">
<span class="gh-members-activity-event-text">{{capitalize-first-letter event.action}}</span>
{{#if event.info}}
<span class="highlight">{{event.info}}</span>
<span class="highlight">({{event.info}})</span>
{{/if}}
{{#if event.url}}
<span class="gh-members-activity-event-join">{{event.join}}</span>
<span class="gh-members-activity-event-dash"></span>
<a class="ghost-members-activity-object-link" href="{{event.url}}" target="_blank" rel="noopener noreferrer">{{event.object}}</a>
{{/if}}
{{#if event.email}}
<span class="gh-members-activity-event-dash"></span>
{{else if event.email}}
<span class="gh-members-activity-event-join">{{event.join}}</span>
<GhEmailPreviewLink @data={{event.email}} />
{{/if}}
</span>

View file

@ -22,14 +22,12 @@
<span class="gh-members-activity-description {{if (feature "memberAttribution") 'feature-memberAttribution'}}">
<span class="gh-members-activity-event-text">{{capitalize-first-letter event.action}}</span>
{{#if event.info}}
<span class="highlight">{{event.info}}</span>
<span class="highlight">({{event.info}})</span>
{{/if}}
{{#if event.url}}
<span class="gh-members-activity-event-join">{{event.join}}</span>
<span class="gh-members-activity-event-dash"></span>
<a class="ghost-members-activity-object-link" href="{{event.url}}" target="_blank" rel="noopener noreferrer">{{event.object}}</a>
{{/if}}
{{#if event.email}}
{{else if event.email}}
<span class="gh-members-activity-event-dash"></span>
<GhEmailPreviewLink @data={{event.email}} />
{{/if}}

View file

@ -196,20 +196,8 @@ export default class ParseMemberEventHelper extends Helper {
* -> do this by returning 'on' in getJoin()
* This string is not added when action and object are in a separete table column, or when the getObject/getURL is empty
*/
getJoin(event) {
if (event.type === 'signup_event' || event.type === 'subscription_event') {
if (event.data.attribution?.title) {
return 'on';
}
}
if (event.type === 'comment_event') {
if (event.data.post) {
return 'on';
}
}
return '';
getJoin() {
return '';
}
/**
@ -261,11 +249,11 @@ export default class ParseMemberEventHelper extends Helper {
if (event.data.type === 'created') {
const sign = mrrDelta > 0 ? '' : '-';
const tierName = this.membersUtils.hasMultipleTiers ? (event.data.tierName ?? 'paid') : 'paid';
return `${tierName} - ${sign}${symbol}${Math.abs(mrrDelta)}/month`;
const tierName = this.membersUtils.hasMultipleTiers ? (event.data.tierName ?? 'Paid') : 'Paid';
return `${tierName} ${sign}${symbol}${Math.abs(mrrDelta)}/month`;
}
const sign = mrrDelta > 0 ? '+' : '-';
return `MRR - ${sign}${symbol}${Math.abs(mrrDelta)}`;
return `MRR ${sign}${symbol}${Math.abs(mrrDelta)}`;
}
if (event.type === 'signup_event' && this.membersUtils.paidMembersEnabled) {

View file

@ -1255,20 +1255,20 @@
}
}
.gh-dashboard-list-item-sub .gh-members-activity-description {
.gh-post-activity-feed .gh-dashboard-list-item-sub .gh-members-activity-description {
display: flex;
flex-direction: row;
align-items: center;
}
.gh-dashboard-list-item-sub .gh-members-activity-description svg {
.gh-post-activity-feed .gh-dashboard-list-item-sub .gh-members-activity-description svg {
width: 18px;
min-width: 18px;
height: 16px;
margin: 0 0.4em 0 0;
}
.gh-dashboard-list-item-sub .gh-members-activity-description svg path {
.gh-post-activity-feed .gh-dashboard-list-item-sub .gh-members-activity-description svg path {
stroke: var(--midgrey);
}