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-description {{if (feature "memberAttribution") 'feature-memberAttribution'}}">
<span class="gh-members-activity-event-text">{{capitalize-first-letter parsedEvent.action}}</span> <span class="gh-members-activity-event-text">{{capitalize-first-letter parsedEvent.action}}</span>
{{#if parsedEvent.info}} {{#if parsedEvent.info}}
<span class="highlight">{{parsedEvent.info}}</span> <span class="highlight">({{parsedEvent.info}})</span>
{{/if}} {{/if}}
{{#if parsedEvent.url}} {{#if parsedEvent.url}}
<span class="gh-members-activity-event-join">{{parsedEvent.join}}</span> <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> <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}} {{/if}}
</span> </span>
</span> </span>

View file

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

View file

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

View file

@ -196,20 +196,8 @@ export default class ParseMemberEventHelper extends Helper {
* -> do this by returning 'on' in getJoin() * -> 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 * This string is not added when action and object are in a separete table column, or when the getObject/getURL is empty
*/ */
getJoin(event) { getJoin() {
if (event.type === 'signup_event' || event.type === 'subscription_event') { return '';
if (event.data.attribution?.title) {
return 'on';
}
}
if (event.type === 'comment_event') {
if (event.data.post) {
return 'on';
}
}
return '';
} }
/** /**
@ -261,11 +249,11 @@ export default class ParseMemberEventHelper extends Helper {
if (event.data.type === 'created') { if (event.data.type === 'created') {
const sign = mrrDelta > 0 ? '' : '-'; const sign = mrrDelta > 0 ? '' : '-';
const tierName = this.membersUtils.hasMultipleTiers ? (event.data.tierName ?? 'paid') : 'paid'; const tierName = this.membersUtils.hasMultipleTiers ? (event.data.tierName ?? 'Paid') : 'Paid';
return `${tierName} - ${sign}${symbol}${Math.abs(mrrDelta)}/month`; return `${tierName} ${sign}${symbol}${Math.abs(mrrDelta)}/month`;
} }
const sign = mrrDelta > 0 ? '+' : '-'; 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) { 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; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; 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; width: 18px;
min-width: 18px; min-width: 18px;
height: 16px; height: 16px;
margin: 0 0.4em 0 0; 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); stroke: var(--midgrey);
} }