-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into issue-26556-verify-ai-plugin
- Loading branch information
Showing
16 changed files
with
342 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
color: $black; | ||
overflow: hidden; | ||
position: absolute; | ||
top: 25px; | ||
top: $spacing-7; | ||
z-index: 100; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...dot-toolbar/components/dot-toolbar-announcements/dot-toolbar-announcements.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<h5 class="announcements__title">{{ 'announcements' | dm }}</h5> | ||
<ul class="announcements__list"> | ||
<li class="announcements__list-item" *ngFor="let announcement of announcementsData"> | ||
<span class="announcements__image pi" [ngClass]="announcement.iconClass"></span> | ||
<div class="announcements__content"> | ||
<span class="announcements__label">{{ announcement.label }}</span> | ||
<span class="announcements__date">{{ announcement.date }}</span> | ||
</div> | ||
</li> | ||
</ul> | ||
|
||
<div class="announcements__container"> | ||
<a class="announcements__link" data-testId="announcement_link" href="#/starter">{{ | ||
'announcements_show_all' | dm | ||
}}</a> | ||
</div> | ||
|
||
<h5 class="announcements__title">{{ 'announcements_knowledge_center' | dm }}</h5> | ||
<div class="announcements__about"> | ||
<a *ngFor="let link of knowledgeCenterLinks" [href]="link.url" target="_blank">{{ | ||
link.label | ||
}}</a> | ||
</div> | ||
|
||
<h5 class="announcements__title">{{ 'announcements_knowledge_contact_us' | dm }}</h5> | ||
<div class="announcements__about"> | ||
<a *ngFor="let link of contactLinks" [href]="link.url" target="_blank">{{ link.label }}</a> | ||
</div> |
76 changes: 76 additions & 0 deletions
76
...dot-toolbar/components/dot-toolbar-announcements/dot-toolbar-announcements.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
@use "variables" as *; | ||
|
||
:host { | ||
max-height: 37rem; | ||
overflow: scroll; | ||
display: block; | ||
} | ||
|
||
.announcements__list { | ||
list-style: none; | ||
padding: 0; | ||
} | ||
|
||
.announcements__container { | ||
display: flex; | ||
justify-content: flex-end; | ||
} | ||
|
||
.announcements__list-item { | ||
display: flex; | ||
flex-direction: row; | ||
gap: $spacing-3; | ||
padding: $spacing-3 $spacing-1; | ||
|
||
&:hover { | ||
border-radius: $spacing-0; | ||
background-color: $color-palette-primary-100; | ||
} | ||
} | ||
|
||
.announcements__title { | ||
margin: 0; | ||
padding-bottom: $spacing-1; | ||
border-bottom: 1px solid $color-palette-gray-300; | ||
font-size: $font-size-xl; | ||
} | ||
|
||
.announcements__content { | ||
display: flex; | ||
flex-direction: column; | ||
gap: $spacing-0; | ||
} | ||
|
||
.announcements__date { | ||
color: $color-palette-gray-800; | ||
font-size: $font-size-sm; | ||
} | ||
|
||
.announcements__image { | ||
height: 2.5rem; | ||
width: 2.5rem; | ||
background-color: var(--color-palette-secondary-200); | ||
color: var(--color-palette-secondary-500); | ||
border-radius: 50%; | ||
} | ||
|
||
.announcements__label { | ||
font-weight: $font-weight-semi-bold; | ||
} | ||
|
||
.announcements__about { | ||
display: flex; | ||
flex-direction: column; | ||
gap: $spacing-3; | ||
margin: $spacing-3 0; | ||
} | ||
|
||
.announcements__link { | ||
color: $color-palette-primary; | ||
padding: $spacing-1; | ||
border-radius: $border-radius-lg; | ||
text-decoration: none; | ||
&:hover { | ||
background-color: $color-palette-primary-100; | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
...-toolbar/components/dot-toolbar-announcements/dot-toolbar-announcements.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { Spectator, byTestId, createComponentFactory } from '@ngneat/spectator'; | ||
|
||
import { NgClass, NgForOf } from '@angular/common'; | ||
import { HttpClientTestingModule } from '@angular/common/http/testing'; | ||
|
||
import { DotMessageService } from '@dotcms/data-access'; | ||
import { DotMessagePipe } from '@dotcms/ui'; | ||
import { MockDotMessageService } from '@dotcms/utils-testing'; | ||
|
||
import { DotToolbarAnnouncementsComponent } from './dot-toolbar-announcements.component'; | ||
|
||
describe('DotToolbarAnnouncementsComponent', () => { | ||
let spectator: Spectator<DotToolbarAnnouncementsComponent>; | ||
|
||
const messageServiceMock = new MockDotMessageService({ | ||
announcements: 'Announcements', | ||
announcements_show_all: 'Show All', | ||
announcements_knowledge_center: 'Knowledge Center', | ||
announcements_knowledge_contact_us: 'Contact Us' | ||
}); | ||
|
||
const createComponent = createComponentFactory({ | ||
component: DotToolbarAnnouncementsComponent, | ||
providers: [ | ||
HttpClientTestingModule, | ||
DotMessagePipe, | ||
{ provide: DotMessageService, useValue: messageServiceMock } | ||
], | ||
imports: [NgForOf, NgClass, DotMessagePipe] | ||
}); | ||
beforeEach(() => { | ||
spectator = createComponent(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(spectator.component).toBeTruthy(); | ||
}); | ||
|
||
it('should display announcements', () => { | ||
spectator.detectChanges(); | ||
const announcements = spectator.queryAll('.announcements__list-item'); | ||
expect(announcements.length).toBe(spectator.component.announcementsData.length); | ||
}); | ||
|
||
it('should have a "Show All" link', () => { | ||
spectator.detectChanges(); | ||
const showAllLink = spectator.query(byTestId('announcement_link')); | ||
expect(showAllLink).toBeTruthy(); | ||
}); | ||
}); |
60 changes: 60 additions & 0 deletions
60
...s/dot-toolbar/components/dot-toolbar-announcements/dot-toolbar-announcements.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { NgClass, NgForOf } from '@angular/common'; | ||
import { Component } from '@angular/core'; | ||
|
||
import { DotMessagePipe } from '@dotcms/ui'; | ||
|
||
@Component({ | ||
selector: 'dot-toolbar-announcements', | ||
templateUrl: './dot-toolbar-announcements.component.html', | ||
styleUrls: ['./dot-toolbar-announcements.component.scss'], | ||
standalone: true, | ||
imports: [NgForOf, NgClass, DotMessagePipe] | ||
}) | ||
export class DotToolbarAnnouncementsComponent { | ||
announcementsData = [ | ||
{ | ||
iconClass: 'pi pi-comment', | ||
label: 'Get more out of the Block Editor', | ||
date: '20 Jul 2023' | ||
}, | ||
{ | ||
iconClass: 'pi pi-book', | ||
label: '12 Reasons You Should Migrate to dotCMS Cloud.', | ||
date: '27 Jul 2023' | ||
}, | ||
{ | ||
iconClass: 'pi pi-megaphone', | ||
label: 'Release 22.03 Designated as LTS Release', | ||
date: '17 Jul 2023' | ||
}, | ||
{ | ||
iconClass: 'pi pi-comment', | ||
label: 'Which page rendering strategy is right for you?', | ||
date: '10 Feb 2023' | ||
}, | ||
{ iconClass: 'pi pi-megaphone', label: 'New in Release 22.01', date: '07 Jan 2023' } | ||
]; | ||
|
||
knowledgeCenterLinks = [ | ||
{ | ||
label: 'Documentation', | ||
url: 'https://www.dotcms.com/docs/latest/table-of-contents?utm_source=dotcms&utm_medium=application&utm_campaign=announcement_menu' | ||
}, | ||
{ | ||
label: 'Blog', | ||
url: 'https://www.dotcms.com/blog/?utm_source=dotcms&utm_medium=application&utm_campaign=announcement_menu' | ||
}, | ||
{ label: 'User Forums', url: 'https://groups.google.com/g/dotcms' } | ||
]; | ||
|
||
contactLinks = [ | ||
{ | ||
label: 'Customer Support', | ||
url: 'https://www.dotcms.com/services/support/?utm_source=dotcms&utm_medium=application&utm_campaign=announcement_menu' | ||
}, | ||
{ | ||
label: 'Professional Services', | ||
url: 'https://www.dotcms.com/services/professional-services/?utm_source=dotcms&utm_medium=application&utm_campaign=announcement_menu' | ||
} | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.