Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(announcements): Adding Vanity URLs #27515

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ $number-link-icon-size: 2.28rem;
font-size: $font-size-md;
height: 100%;
overflow: auto;
background-color: $white;

hr {
border-top: 1px solid $color-palette-gray-300;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@
}

.announcements__about {
display: flex;
display: grid;
flex-direction: column;
gap: $spacing-3;
margin: $spacing-3 0;
margin: $spacing-3;
grid-template-columns: 1fr 1fr;
}

.announcements__link {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ describe('DotToolbarAnnouncementsComponent', () => {
'announcements.knowledge.contact.us': 'Contact Us',
'announcements.contact.customer.support': 'Customer Support',
'announcements.contact.professional.services': 'Professional Services',
'announcements.contact.request.feature': 'Request a Feature',
'announcements.contact.report.bug': 'Report a Bug',
'announcements.knowledge.center.documentation': 'Documentation',
'announcements.knowledge.center.blog': 'Blog',
'announcements.knowledge.center.forum': 'User Forums'
'announcements.knowledge.center.github': 'GitHub Repository',
'announcements.knowledge.center.training': 'Online Training',
'announcements.knowledge.center.forum': 'Forum'
});
const siteServiceMock = new SiteServiceMock();
const createComponent = createComponentFactory({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('AnnouncementsStore', () => {
announcementDateAsISO8601: '2024-01-31T17:51',
identifier: 'test-announcement-id',
inode: '123',
url: 'https://www.example.com?utm_source=platform&utm_medium=demo.dotcms.com&utm_campaign=announcement'
url: 'https://www.example.com?utm_source=platform&utm_medium=announcement&utm_campaign=demo.dotcms.com'
}
];
spectator.service.load();
Expand Down Expand Up @@ -86,7 +86,7 @@ describe('AnnouncementsStore', () => {
spectator.service.load();
spectator.service.state$.subscribe((state) => {
expect(state.announcements[0].url).toBe(
'https://www.example.com?utm_source=platform&utm_medium=demo.dotcms.com&utm_campaign=announcement'
'https://www.example.com?utm_source=platform&utm_medium=announcement&utm_campaign=demo.dotcms.com'
);
done();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,28 @@ export class AnnouncementsStore extends ComponentStore<DotAnnouncementsState> {
return [
{
id: '1',
url: `https://www.dotcms.com/docs/latest/table-of-contents?${state.utmParameters}`,
url: `https://www.dotcms.com/announcement-menu-documentation?${state.utmParameters}`,
label: this.dotMessageService.get('announcements.knowledge.center.documentation')
},
{
url: `https://www.dotcms.com/announcement-menu-user-forum?${state.utmParameters}`,
id: '2',
label: this.dotMessageService.get('announcements.knowledge.center.blog'),
url: `https://www.dotcms.com/blog/?${state.utmParameters}`
label: this.dotMessageService.get('announcements.knowledge.center.forum')
},
{
url: 'https://groups.google.com/g/dotcms',
url: `https://www.dotcms.com/announcement-menu-online-training?${state.utmParameters}`,
id: '3',
label: this.dotMessageService.get('announcements.knowledge.center.forum')
label: this.dotMessageService.get('announcements.knowledge.center.training')
},
{
id: '4',
label: this.dotMessageService.get('announcements.knowledge.center.blog'),
url: `https://www.dotcms.com/announcement-menu-dotcms-blog?${state.utmParameters}`
},
{
url: `https://www.dotcms.com/announcement-menu-github-repository?${state.utmParameters}`,
id: '5',
label: this.dotMessageService.get('announcements.knowledge.center.github')
}
];
});
Expand All @@ -104,19 +114,29 @@ export class AnnouncementsStore extends ComponentStore<DotAnnouncementsState> {
return [
{
label: this.dotMessageService.get('announcements.contact.customer.support'),
url: `https://www.dotcms.com/services/support/?${state.utmParameters}`,
url: `https://www.dotcms.com/announcement-menu-customer-support?${state.utmParameters}`,
id: '1'
},
{
id: '2',
label: this.dotMessageService.get('announcements.contact.professional.services'),
url: `https://www.dotcms.com/services/professional-services/?${state.utmParameters}`
url: `https://www.dotcms.com/announcement-menu-professional-services?${state.utmParameters}`
},
{
label: this.dotMessageService.get('announcements.contact.request.feature'),
url: `https://www.dotcms.com/announcement-menu-request-a-feature?${state.utmParameters}`,
id: '3'
},
{
id: '4',
label: this.dotMessageService.get('announcements.contact.report.bug'),
url: `https://www.dotcms.com/announcement-menu-report-a-bug?${state.utmParameters}`
}
];
});

readonly selectLinkToDotCms: Signal<string> = this.selectSignal((state) => {
return `https://dotcms.com/?${state.utmParameters}`;
return `https://www.dotcms.com/announcement-menu-show-all?${state.utmParameters}`;
});

readonly markAnnouncementsAsRead = this.updater((state) => {
Expand All @@ -139,7 +159,7 @@ export class AnnouncementsStore extends ComponentStore<DotAnnouncementsState> {
});

private generateUtmQueryString(): string {
return `utm_source=platform&utm_medium=${this.siteService.currentSite.hostname}&utm_campaign=announcement`;
return `utm_source=platform&utm_medium=announcement&utm_campaign=${this.siteService.currentSite.hostname}`;
}

private appendUtmParameters(announcements: Announcement[]): Announcement[] {
Expand Down
6 changes: 5 additions & 1 deletion dotCMS/src/main/webapp/WEB-INF/messages/Language.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2969,9 +2969,13 @@ announcements.knowledge.center=Knowledge Center
announcements.knowledge.contact.us=Contact Us
announcements.contact.customer.support=Customer Support
announcements.contact.professional.services=Professional Services
announcements.contact.request.feature=Request a Feature
announcements.contact.report.bug=Report a Bug
announcements.knowledge.center.documentation=Documentation
announcements.knowledge.center.blog=Blog
announcements.knowledge.center.forum=User Forums
announcements.knowledge.center.github=GitHub Repository
announcements.knowledge.center.training=Online Training
announcements.knowledge.center.forum=Forum
November=November
num-of-hits=# of Hits
num-of-votes=# of Votes
Expand Down
Loading