+
@@ -25,7 +51,4 @@
-
+
\ No newline at end of file
diff --git a/dmp-frontend/src/app/app.component.scss b/dmp-frontend/src/app/app.component.scss
index ddc6df33c..fd01ca382 100644
--- a/dmp-frontend/src/app/app.component.scss
+++ b/dmp-frontend/src/app/app.component.scss
@@ -40,3 +40,70 @@
::ng-deep .mat-chip {
height: auto !important;
}
+
+.notification-header {
+ height: 64px;
+ background: var(--unnamed-color-var(--primary-color)) 0% 0% no-repeat padding-box;
+ background: var(--primary-color) 0% 0% no-repeat padding-box;
+ box-shadow: 0px 3px 6px #00000029;
+ padding: 0.6rem;
+ margin: 30px 0px 0px 0px;
+ border-radius: 4px;
+ opacity: 1;
+
+ .info {
+ flex: 2;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+}
+
+.notification-discard-btn {
+ background: transparent;
+ border: 1px solid #ffffff;
+ color: white;
+ border-radius: 30px;
+ opacity: 1;
+ width: 110px;
+ height: 40px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.notification-title {
+ text-align: left;
+ font-weight: 400;
+ font-size: 14px;
+ color: #ffffff;
+ opacity: 0.75;
+}
+
+.notification-subtitle {
+ text-align: left;
+ color: #ffffff;
+ font-weight: 700;
+ font-size: 16px;
+ opacity: 1;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.notification-link {
+ color: #ffffff;
+ text-decoration: underline;
+}
+
+.notification-save-btn {
+ background: #ffffff 0% 0% no-repeat padding-box !important;
+ border-radius: 30px;
+ opacity: 1;
+ width: 110px;
+ height: 40px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-weight: 700;
+ color: var(--primary-color);
+}
\ No newline at end of file
diff --git a/dmp-frontend/src/app/app.component.ts b/dmp-frontend/src/app/app.component.ts
index 8eb8b023f..c35c77e1c 100644
--- a/dmp-frontend/src/app/app.component.ts
+++ b/dmp-frontend/src/app/app.component.ts
@@ -20,6 +20,8 @@ import { MatomoInjector } from 'ngx-matomo';
import { MatomoService } from './core/services/matomo/matomo-service';
import { SideNavService } from './core/services/sidenav/side-nav.sevice';
import { MatSidenav } from '@angular/material/sidenav';
+import { runInThisContext } from 'vm';
+import * as moment from 'moment';
declare const gapi: any;
@@ -38,8 +40,9 @@ export class AppComponent implements OnInit, AfterViewInit {
helpContentEnabled: boolean;
private statusChangeSubscription: Subscription;
onlySplash = true;
+ newReleaseNotificationVisible = false;
- @ViewChild('sidenav') sidenav:MatSidenav;
+ @ViewChild('sidenav') sidenav: MatSidenav;
constructor(
private router: Router,
@@ -52,7 +55,7 @@ export class AppComponent implements OnInit, AfterViewInit {
private cookieService: CookieService,
private ccService: NgcCookieConsentService,
private language: LanguageService,
- private configurationService: ConfigurationService,
+ public configurationService: ConfigurationService,
private location: Location,
private matomoService: MatomoService,
private sidenavService: SideNavService
@@ -63,37 +66,38 @@ export class AppComponent implements OnInit, AfterViewInit {
}
ngAfterViewInit(): void {
setTimeout(() => {
- this.sideNavSubscription = this.sidenavService.status().subscribe(isopen=>{
+ this.sideNavSubscription = this.sidenavService.status().subscribe(isopen => {
const hamburger = document.getElementById('hamburger');
- if(isopen){
+ if (isopen) {
//update value of hamburfer
- if(!hamburger){//try later
+ if (!hamburger) {//try later
setTimeout(() => {
- const hamburger = document.getElementById('hamburger');
- if(hamburger){
- hamburger.classList.add('change');
+ const hamburger = document.getElementById('hamburger');
+ if (hamburger) {
+ hamburger.classList.add('change');
}
}, 300);
- }else{
+ } else {
hamburger.classList.add('change');
}
this.sidenav.open()
- }else{//closed
- if(!hamburger){//try later
+ } else {//closed
+ if (!hamburger) {//try later
setTimeout(() => {
- const hamburger = document.getElementById('hamburger');
- if(hamburger){
+ const hamburger = document.getElementById('hamburger');
+ if (hamburger) {
hamburger.classList.remove('change');
}
}, 300);
- }else{
+ } else {
hamburger.classList.remove('change');
}
this.sidenav.close();
-
+
}
});
});
+ this.newReleaseNotificationVisible = this.isNewReleaseNotificationVisible();
}
onActivate(event: any) {
@@ -120,8 +124,8 @@ export class AppComponent implements OnInit, AfterViewInit {
}
if (!this.cookieService.check("cookiesConsent")) {
// this.cookieService.set("cookiesConsent", "false", 356);
- this.cookieService.set("cookiesConsent", "false", 356,null,null,false, 'Lax');
-
+ this.cookieService.set("cookiesConsent", "false", 356, null, null, false, 'Lax');
+
}
this.hasBreadCrumb = this.router.events.pipe(
@@ -155,7 +159,7 @@ export class AppComponent implements OnInit, AfterViewInit {
this.statusChangeSubscription = this.ccService.statusChange$.subscribe((event: NgcStatusChangeEvent) => {
if (event.status == "dismiss") {
// this.cookieService.set("cookiesConsent", "true", 365);
- this.cookieService.set("cookiesConsent", "true", 356,null,null,false, 'Lax');
+ this.cookieService.set("cookiesConsent", "true", 356, null, null, false, 'Lax');
}
});
@@ -177,7 +181,7 @@ export class AppComponent implements OnInit, AfterViewInit {
}
this.ccService.destroy();
this.ccService.init(this.ccService.getConfig());
- });
+ });
}
translateTitle(ttl: string) {
@@ -196,7 +200,7 @@ export class AppComponent implements OnInit, AfterViewInit {
ngOnDestroy() {
this.statusChangeSubscription.unsubscribe();
- if(this.sideNavSubscription){
+ if (this.sideNavSubscription) {
this.sideNavSubscription.unsubscribe();
}
}
@@ -232,5 +236,27 @@ export class AppComponent implements OnInit, AfterViewInit {
toggleNavbar(event) {
document.getElementById('hamburger').classList.toggle("change");
}
+
+ dismissNewReleaseNotification() {
+ this.cookieService.set('new-release-dismiss-' + this.configurationService.newReleaseNotificationVersionCode, 'true', 5000, null, null, false, 'Lax');
+ this.newReleaseNotificationVisible = false;
+ }
+
+ isNewReleaseNotificationVisible() {
+ if (this.configurationService.newReleaseNotificationVersionCode == null) {
+ return false;
+ }
+ if (this.configurationService.newReleaseNotificationExpires == null && this.configurationService.newReleaseNotificationLink == null) {
+ return false;
+ }
+ if (this.configurationService.newReleaseNotificationExpires != null && moment(this.configurationService.newReleaseNotificationExpires).tz('UTC') < moment.utc()) {
+ return false;
+ }
+ if (this.cookieService.get('new-release-dismiss-' + this.configurationService.newReleaseNotificationVersionCode) === 'true') {
+ return false;
+ }
+
+ return true;
+ }
}
diff --git a/dmp-frontend/src/app/core/services/configuration/configuration.service.ts b/dmp-frontend/src/app/core/services/configuration/configuration.service.ts
index 469f1fce9..8de302ae1 100644
--- a/dmp-frontend/src/app/core/services/configuration/configuration.service.ts
+++ b/dmp-frontend/src/app/core/services/configuration/configuration.service.ts
@@ -101,6 +101,21 @@ export class ConfigurationService extends BaseComponent {
return this._maxFileSizeInMB;
}
+ private _newReleaseNotificationLink: number;
+ get newReleaseNotificationLink(): number {
+ return this._newReleaseNotificationLink;
+ }
+
+ private _newReleaseNotificationExpires: number;
+ get newReleaseNotificationExpires(): number {
+ return this._newReleaseNotificationExpires;
+ }
+
+ private _newReleaseNotificationVersionCode: number;
+ get newReleaseNotificationVersionCode(): number {
+ return this._newReleaseNotificationVersionCode;
+ }
+
public loadConfiguration(): Promise
{
return new Promise((r, e) => {
@@ -146,6 +161,9 @@ export class ConfigurationService extends BaseComponent {
this._matomoSiteId = config.matomo.siteId;
}
this._maxFileSizeInMB = config.maxFileSizeInMB;
+ this._newReleaseNotificationExpires = config.newReleaseNotification?.expires;
+ this._newReleaseNotificationLink = config.newReleaseNotification?.link;
+ this._newReleaseNotificationVersionCode = config.newReleaseNotification?.versionCode;
}
}
diff --git a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts
index 4d0f5e22d..966591076 100644
--- a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts
+++ b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor-blueprint.component.ts
@@ -917,7 +917,7 @@ export class DmpEditorBlueprintComponent extends CheckDeactivateBaseComponent im
}
const templates: Array = new Array();
this.selectedDmpBlueprintDefinition.sections.forEach(section => {
- if (profiles !== undefined) {
+ if (profiles != null) {
profiles.filter(profile => profile.data.dmpSectionIndex.includes(section.ordinal - 1)).forEach(profile => this.sectionTemplates[section.ordinal - 1].push({ id: profile.descriptionTemplateId, label: profile.label, description: "" }));
}
else {
diff --git a/dmp-frontend/src/assets/config/config.json b/dmp-frontend/src/assets/config/config.json
index 17b0c3fa1..11a786479 100644
--- a/dmp-frontend/src/assets/config/config.json
+++ b/dmp-frontend/src/assets/config/config.json
@@ -105,5 +105,10 @@
"allowOrganizationCreator": true,
"useSplash": false,
"orcidPath": "https://orcid.org/",
- "maxFileSizeInMB": 10
+ "maxFileSizeInMB": 10,
+ "newReleaseNotification": {
+ "link": "https://google.com",
+ "versionCode": "0",
+ "expires": "2024-01-28T00:00"
+ }
}
diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json
index 0361a9f8e..5d386694a 100644
--- a/dmp-frontend/src/assets/i18n/en.json
+++ b/dmp-frontend/src/assets/i18n/en.json
@@ -1983,5 +1983,15 @@
"DRAFT": "Draft",
"FINALIZED": "Finalized",
"DELETED": "Deleted"
+ },
+ "NEW-RELEASE-NOTIFICATION": {
+ "TITLE": "New ARGOS Release!",
+ "SUBTITLE": "Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum.",
+ "SUBTITLE-WITH-PRE-LINK": "Check all the new features ",
+ "SUBTITLE-WITH-AFTER-LINK": ".",
+ "SUBTITLE-LINK-TEXT": "here",
+ "ACTIONS": {
+ "DISMISS": "Dismiss"
+ }
}
}