-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #747 from geonetwork/DH/add-contact-to-news-page
Add contact block to news page and improve buttons
- Loading branch information
Showing
16 changed files
with
113 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
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 |
---|---|---|
@@ -1,14 +1,31 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing' | ||
import { NewsPageComponent } from './news-page.component' | ||
import { NO_ERRORS_SCHEMA } from '@angular/core' | ||
import { getGlobalConfig } from '@geonetwork-ui/util/app-config' | ||
import { TranslateTestingModule } from '@geonetwork-ui/util/i18n' | ||
import { TranslateMessageFormatCompiler } from 'ngx-translate-messageformat-compiler' | ||
|
||
jest.mock('@geonetwork-ui/util/app-config', () => ({ | ||
getGlobalConfig: jest.fn(() => ({ | ||
CONTACT_EMAIL: '[email protected]', | ||
})), | ||
})) | ||
describe('NewsPageComponent', () => { | ||
let component: NewsPageComponent | ||
let fixture: ComponentFixture<NewsPageComponent> | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [NewsPageComponent], | ||
imports: [ | ||
TranslateTestingModule.withTranslations({ | ||
en: { | ||
'datahub.news.contact.html': '<p>line1</p><p>line2</p>', | ||
}, | ||
}) | ||
.withDefaultLanguage('en') | ||
.withCompiler(new TranslateMessageFormatCompiler()), | ||
], | ||
schemas: [NO_ERRORS_SCHEMA], | ||
}).compileComponents() | ||
|
||
|
@@ -20,4 +37,8 @@ describe('NewsPageComponent', () => { | |
it('should create', () => { | ||
expect(component).toBeTruthy() | ||
}) | ||
|
||
it('should return email', () => { | ||
expect(getGlobalConfig().CONTACT_EMAIL).toEqual('[email protected]') | ||
}) | ||
}) |
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 |
---|---|---|
@@ -1,9 +1,14 @@ | ||
import { ChangeDetectionStrategy, Component } from '@angular/core' | ||
import { getGlobalConfig } from '@geonetwork-ui/util/app-config' | ||
|
||
@Component({ | ||
selector: 'datahub-news-page', | ||
templateUrl: './news-page.component.html', | ||
styleUrls: ['./news-page.component.css'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class NewsPageComponent {} | ||
export class NewsPageComponent { | ||
getContactMail(): string { | ||
return getGlobalConfig().CONTACT_EMAIL | ||
} | ||
} |
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 |
---|---|---|
|
@@ -34,6 +34,8 @@ proxy_path = "" | |
# More information about the translation can be found in the docs (https://geonetwork.github.io/geonetwork-ui/main/docs/reference/i18n.html) | ||
# languages = ['en', 'fr', 'de'] | ||
|
||
# Enables displaying a "contact block" wherever relevant in applications | ||
# contact_email = "[email protected]" | ||
|
||
### VISUAL THEME | ||
|
||
|
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
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