Skip to content

Commit 8cc3783

Browse files
fix: Show social media names properly (#5554)
1 parent a5ee487 commit 8cc3783

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

app/models/social-link.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import attr from 'ember-data/attr';
44
import ModelBase from 'open-event-frontend/models/base';
55
import { belongsTo } from 'ember-data/relationships';
66
import { computedSegmentedLink } from 'open-event-frontend/utils/computed-helpers';
7-
import { socialMediaIdentifiers } from 'open-event-frontend/utils/dictionary/social-media';
7+
import { socialMediaIdentifiers, socialMediaMap } from 'open-event-frontend/utils/dictionary/social-media';
88

99
export default ModelBase.extend({
1010
name : attr('string'),
@@ -36,5 +36,9 @@ export default ModelBase.extend({
3636
return !this.isCustom;
3737
}),
3838

39+
displayName: computed('normalizedName', function() {
40+
return socialMediaMap[this.normalizedName]?.name ?? this.name;
41+
}),
42+
3943
segmentedLink: computedSegmentedLink.bind(this)('link')
4044
});

app/templates/components/events/view/overview/general-info.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<td>
4949
{{#if this.data.socialLinks}}
5050
{{#each this.data.socialLinks as |socialLink index|~}}
51-
{{if (not-eq index 0) ','}} <a href="{{socialLink.link}}" target="_blank" rel="noopener noreferrer">{{socialLink.name}}</a>
51+
{{if (not-eq index 0) ','}} <a href="{{socialLink.link}}" target="_blank" rel="noopener noreferrer">{{socialLink.displayName}}</a>
5252
{{~/each}}
5353
{{else}}
5454
{{t 'No social links present. '}} <a href="{{href-to 'events.view.edit.basic-details'}}#social-links">{{t 'Click here to add'}}</a>

app/templates/components/public/social-links.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<div class="item">
1212
<i class="fitted {{socialLink.normalizedName}} disabled icon"></i>
1313
<div class="content">
14-
<a href="{{socialLink.link}}" target="_blank" rel="noopener nofollow">{{socialLink.name}}</a>
14+
<a href="{{socialLink.link}}" target="_blank" rel="noopener nofollow">{{socialLink.displayName}}</a>
1515
</div>
1616
</div>
1717
{{/each}}

0 commit comments

Comments
 (0)