From 85b6b8c386d4800f9c27bf6c2dda16085a7d31a1 Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Thu, 10 Oct 2019 15:17:43 +0000 Subject: [PATCH] [Admin|Trunk] Deploy: update script Customization: keep 3 status of customizationOptions published, applied, draft - change the variable used accordingly enable check for comunity add back and exit warning modals put reset actions in functions add more previews add route, menu/ dashboard links hide side menu update color picker css Delete unused files src/app/pages/subjects/subjects-edit-form/subjects-edit-form.service.ts src/app/pages/subscribers/remove-subscriber.component.html src/app/pages/subscribers/remove-subscriber.component.ts apply git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-admin-portal/trunk@57338 d315682c-612b-4755-9ff5-7f18f6832af3 --- deploy/prepareDeploy.sh | 9 + package.json | 2 +- src/app/app.component.html | 8 +- src/app/app.component.ts | 9 +- src/app/app.routing.ts | 5 + .../customization-routing.module.ts | 2 +- .../customization.component.html | 395 ++++++++++-------- .../customization/customization.component.ts | 240 ++++++++--- .../customization/customization.module.ts | 4 +- .../pages/dashboard/dashboard.component.html | 8 +- .../subjects-edit-form.service.ts | 0 .../remove-subscriber.component.html | 0 .../remove-subscriber.component.ts | 0 src/assets/css/connect-custom.css | 21 + src/assets/env-properties.json | 2 +- 15 files changed, 481 insertions(+), 224 deletions(-) delete mode 100644 src/app/pages/subjects/subjects-edit-form/subjects-edit-form.service.ts delete mode 100644 src/app/pages/subscribers/remove-subscriber.component.html delete mode 100644 src/app/pages/subscribers/remove-subscriber.component.ts diff --git a/deploy/prepareDeploy.sh b/deploy/prepareDeploy.sh index f52ae6d..04c8d5b 100755 --- a/deploy/prepareDeploy.sh +++ b/deploy/prepareDeploy.sh @@ -14,6 +14,15 @@ # echo -n "Press key:"; # read -n1 ans # pico ../src/assets/env-properties.json; +# printf '\nCheck the properties file version'; +# echo -n "Press key:"; +# read -n1 ans +# pico ../src/app/openaireLibrary/utils/properties/environment-specific.service.ts; +# printf '\n\nUpdate css/ js files version!'; +# echo -n "Press key:"; +# read -n1 ans +# echo -n "Pressed"; +# pico ../src/index.html; # echo -n 'Check Robots.txt: always add "Diasallow /"'; # echo -n "Press key:"; # read -n1 ans diff --git a/package.json b/package.json index 4b7bc94..33f80a2 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "jquery": "^3.4.1", "ng2-ckeditor": "1.1.9", "ngx-bootstrap": "^1.6.6", - "ngx-color-picker": "^8.0.1", + "ngx-color-picker": "^8.1.0", "ngx-json-ld": "0.1.6", "ts-md5": "^1.2.0", "tslib": "^1.9.0", diff --git a/src/app/app.component.html b/src/app/app.component.html index ac6a76c..1f0404d 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -4,8 +4,12 @@
- -
+
diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 39e20dc..583edb9 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -240,10 +240,17 @@ export class AppComponent implements OnInit { items: [] }); community.items.push({ - rootItem: new MenuItem('communityAffiliations', 'Community Organizations', '/organizations', + rootItem: new MenuItem('communityAffiliations', 'Organizations', '/organizations', '/organizations', false, [], [], {communityId: this.communityId}), items: [] }); + if(this.properties.environment == 'development') { + community.items.push({ + rootItem: new MenuItem('layout', 'Customize Layout', '/customize-layout', + '/customize-layout', false, [], [], {communityId: this.communityId}), + items: [] + }); + } /*community.items.push({ rootItem: new MenuItem('communityLayout', 'Community Layout', '/community-layout', '/community-layout', false, [], [], {communityId: this.communityId}), diff --git a/src/app/app.routing.ts b/src/app/app.routing.ts index 95f9950..dfb2fb7 100644 --- a/src/app/app.routing.ts +++ b/src/app/app.routing.ts @@ -144,6 +144,11 @@ const appRoutes: Routes = [ loadChildren: './pages/community/content-providers/communityContentProviders.module#CommunityContentProvidersModule', resolve: { envSpecific: EnvironmentSpecificResolver } }, + { + path: 'customize-layout', + loadChildren: './pages/customization/customization.module#CustomizationModule', + resolve: { envSpecific: EnvironmentSpecificResolver } + }, { path: 'manage-content-providers/criteria', loadChildren: './pages/community/content-providers/criteria/criteria.module#CriteriaModule', diff --git a/src/app/pages/customization/customization-routing.module.ts b/src/app/pages/customization/customization-routing.module.ts index 38ace2d..0bbc52a 100644 --- a/src/app/pages/customization/customization-routing.module.ts +++ b/src/app/pages/customization/customization-routing.module.ts @@ -7,7 +7,7 @@ import {ConnectAdminLoginGuard} from '../../openaireLibrary/connect/communityGua @NgModule({ imports: [ RouterModule.forChild([ - { path: '', canActivate: [/*IsCommunity, ConnectAdminLoginGuard*/], component: CustomizationComponent} + { path: '', canActivate: [IsCommunity, ConnectAdminLoginGuard], component: CustomizationComponent} ]) ] }) diff --git a/src/app/pages/customization/customization.component.html b/src/app/pages/customization/customization.component.html index be274a6..db6573b 100644 --- a/src/app/pages/customization/customization.component.html +++ b/src/app/pages/customization/customization.component.html @@ -1,28 +1,25 @@
-
-
+
+
- +
@@ -66,7 +63,7 @@
--> - + " draftCustomizationOptions.panel.background.color = $event;">
BUTTONS & LINKS
QUICK LOOK - +
-
Banner Big Text + [style.background-color]="draftCustomizationOptions.panel.background.color"> +
Banner Big Text
-
Banner Small Text +
Banner Small Text
-
+
Link + (mouseover)="linkDarkBackgroundPreview=changeFontsStyle(draftCustomizationOptions.links.darkBackground, draftCustomizationOptions.links.darkBackground.onHover.color);" + (mouseout)="linkDarkBackgroundPreview=changeFontsStyle(draftCustomizationOptions.links.darkBackground, draftCustomizationOptions.links.darkBackground.color);">Link
Button + (mouseover)="buttonDarkBackgroundPreview=changeStyle(draftCustomizationOptions.buttons.darkBackground.onHover, draftCustomizationOptions.buttons.darkBackground);" + (mouseout)="buttonDarkBackgroundPreview=changeStyle(draftCustomizationOptions.buttons.darkBackground);">Button
-
+
Link + (mouseover)="linkLightBackgroundPreview=changeFontsStyle(draftCustomizationOptions.links.lightBackground, + draftCustomizationOptions.links.lightBackground.onHover.color);" + (mouseout)="linkLightBackgroundPreview=changeFontsStyle(draftCustomizationOptions.links.lightBackground, draftCustomizationOptions.links.lightBackground.color);">Link
+ (mouseover)="buttonLightBackgroundPreview=changeStyle(draftCustomizationOptions.buttons.lightBackground.onHover, draftCustomizationOptions.buttons.lightBackground);" + (mouseout)="buttonLightBackgroundPreview=changeStyle(draftCustomizationOptions.buttons.lightBackground);"> Button
@@ -161,7 +156,7 @@
- + Banner Big Text
- - + + " draftCustomizationOptions.panel.title.color = $event;" [addMargin]="true">
QUICK LOOK - +
-
Banner Big Text + [style.background-color]="draftCustomizationOptions.panel.background.color"> +
Banner Big Text
@@ -215,19 +210,18 @@
- - + " draftCustomizationOptions.panel.fonts.color = $event;" [addMargin]="true">
QUICK LOOK - +
-
Banner Small Text + [style.background-color]="draftCustomizationOptions.panel.background.color"> +
Banner Small Text
@@ -260,23 +254,22 @@
  • - - +
    ON HOVER
    - +
    QUICK LOOK - +
    Link + (mouseover)="linkDarkBackgroundPreview=changeFontsStyle(draftCustomizationOptions.links.darkBackground, draftCustomizationOptions.links.darkBackground.onHover.color);" + (mouseout)="linkDarkBackgroundPreview=changeFontsStyle(draftCustomizationOptions.links.darkBackground, draftCustomizationOptions.links.darkBackground.color);">Link
  • - +
    ON HOVER
    - +
    QUICK LOOK - +
    Link + (mouseover)="linkLightBackgroundPreview=changeFontsStyle(draftCustomizationOptions.links.lightBackground, + draftCustomizationOptions.links.lightBackground.onHover.color);" + (mouseout)="linkLightBackgroundPreview=changeFontsStyle(draftCustomizationOptions.links.lightBackground, draftCustomizationOptions.links.lightBackground.color);">Link
@@ -324,7 +316,7 @@
- + Subject tags & Statistics cubes
-
FONTS
- +
QUICK LOOK - +
+ [style.background-color]="draftCustomizationOptions.panel.background.color">
Statistics cube + [style.background-color]="draftCustomizationOptions.panel.panelElements.backgroundColor" + [style.color]="draftCustomizationOptions.panel.panelElements.color">Statistics cube
Subject tag + [style.background-color]="draftCustomizationOptions.panel.panelElements.backgroundColor" + [style.color]="draftCustomizationOptions.panel.panelElements.color">Subject tag
@@ -377,7 +368,7 @@
- + -
Tooltip ....
+
Identity colors are used in several + points (e.g paging, accordions, tabs, etc) in your community RCD.
Hint: it can't be white! +
  • - Identity Color + Identity Colors
    - + - +
    QUICK LOOK - +
    +
    - TODO + +
    +
      +
    • Item + 1 + +
    • +
    • Item + 2 +
      +

      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco.

      +
      +
    • +
    • Item 3 + +
    • +
    +
    + +
    Text in primary + color +
    +
    Text in secondary + color +
    +
@@ -422,7 +483,7 @@
- +
  • - - + - -
    ON HOVER
    - - -
    QUICK LOOK - +
    Button + (mouseover)="buttonDarkBackgroundPreview=changeStyle(draftCustomizationOptions.buttons.darkBackground.onHover, draftCustomizationOptions.buttons.darkBackground);" + (mouseout)="buttonDarkBackgroundPreview=changeStyle(draftCustomizationOptions.buttons.darkBackground);">Button
  • - - + - -
    ON HOVER
    - - -
  • @@ -552,9 +611,19 @@ Publish
    -
    - +
    +
    + +
    If you leave that Page without applying or publishing, changes will be lost.
    +
    Are you sure that you want to proceed?
    +
    + + +
    If you leave that Page without applying or publishing, changes will be lost.
    +
    Are you sure that you want to proceed?
    +
    + diff --git a/src/app/pages/customization/customization.component.ts b/src/app/pages/customization/customization.component.ts index 202d5c6..2444e77 100644 --- a/src/app/pages/customization/customization.component.ts +++ b/src/app/pages/customization/customization.component.ts @@ -1,4 +1,4 @@ -import {Component, ElementRef, OnInit} from '@angular/core'; +import {Component, ElementRef, OnInit, ViewChild} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties'; @@ -9,7 +9,8 @@ import {Curator} from '../../openaireLibrary/utils/entities/CuratorInfo'; import {DomSanitizer} from '@angular/platform-browser'; import {CustomizationOptions} from '../../openaireLibrary/connect/community/CustomizationOptions'; import {StringUtils} from '../../openaireLibrary/utils/string-utils.class'; -import {LayoutService} from "../../openaireLibrary/services/layout.service"; +import {LayoutService} from '../../openaireLibrary/services/layout.service'; +import {AlertModal} from '../../openaireLibrary/utils/modal/alert'; @Component({ selector: 'customization', @@ -20,35 +21,32 @@ export class CustomizationComponent implements OnInit { menuSelected = 'main'; color = 'white'; - communityUrl = 'http://mpagasas.di.uoa.gr:4200/?communityId=ee'; - customizationOptions: CustomizationOptions = new CustomizationOptions(); - appliedCustomizationOptions: CustomizationOptions = this.copyObject(this.customizationOptions); - previewUrl = this.getCommunityUrlSatinized(this.appliedCustomizationOptions); + communityUrl = 'http://scoobydoo.di.uoa.gr:4200/?communityId=ee'; + publishedCustomizationOptions: CustomizationOptions = null; + draftCustomizationOptions: CustomizationOptions = null; + appliedCustomizationOptions: CustomizationOptions = null; + previewUrl = null; + previewCustomization = null; buttonDarkBackgroundPreview; buttonLightBackgroundPreview; linkDarkBackgroundPreview; linkLightBackgroundPreview; + hoveredText; public showLoading = true; public updateErrorMessage = ''; public successfulSaveMessage = ''; - public curatorsEnabled; - public newCurator; public communityId = null; - public affiliationsChanged = false; public hasChanged = false; - public curatorId = null; - public curator: Curator = null; - public photo: any = null; public properties: EnvProperties = null; private file: File = null; private maxsize: number = 200 * 1024; public enabled = true; - private deletePhoto = false; - + @ViewChild('backAlert') backAlert: AlertModal; + @ViewChild('exitAlert') exitAlert: AlertModal; constructor(private element: ElementRef, private route: ActivatedRoute, @@ -59,8 +57,6 @@ export class CustomizationComponent implements OnInit { ngOnInit() { - this.initializeCustomizationOptions(); - console.log(this.customizationOptions); this.route.data.subscribe((data: { envSpecific: EnvProperties }) => { this.properties = data.envSpecific; if (!Session.isLoggedIn()) { @@ -73,11 +69,11 @@ export class CustomizationComponent implements OnInit { this.showLoading = true; this.updateErrorMessage = ''; this.layoutService.getLayout(this.communityId, this.properties.adminToolsAPIURL + 'community/').subscribe(layout => { - this.customizationOptions = layout; - this.appliedCustomizationOptions = this.copyObject(this.customizationOptions); - this.communityUrl = 'http://mpagasas.di.uoa.gr:4200/?communityId=' + this.communityId; - this.initializeCustomizationOptions(); - this.previewUrl = this.getCommunityUrlSatinized(this.appliedCustomizationOptions); + this.publishedCustomizationOptions = layout; + this.initializeCustomizationOptions(true); + }, error => { + this.publishedCustomizationOptions = new CustomizationOptions(); + this.initializeCustomizationOptions(true); }); }); } @@ -86,21 +82,131 @@ export class CustomizationComponent implements OnInit { } saveLayout() { - this.layoutService. - saveLayout(this.communityId, this.properties.adminToolsAPIURL + 'community/', this.appliedCustomizationOptions).subscribe(layout => { - this.customizationOptions = layout; - this.appliedCustomizationOptions = this.copyObject(this.customizationOptions); - this.initializeCustomizationOptions(); - this.previewUrl = this.getCommunityUrlSatinized(this.appliedCustomizationOptions); + this.layoutService.saveLayout(this.communityId, this.properties.adminToolsAPIURL + 'community/', this.draftCustomizationOptions).subscribe(layout => { + this.publishedCustomizationOptions = layout; + this.initializeCustomizationOptions(JSON.stringify(this.publishedCustomizationOptions) != this.previewCustomization); + }); } - initializeCustomizationOptions() { - this.buttonDarkBackgroundPreview = this.changeStyle(this.appliedCustomizationOptions.buttons.darkBackground); - this.buttonLightBackgroundPreview = this.changeStyle(this.appliedCustomizationOptions.buttons.lightBackground); - this.linkDarkBackgroundPreview = this.changeFontsStyle(this.appliedCustomizationOptions.links.darkBackground, this.appliedCustomizationOptions.links.darkBackground.color); - this.linkLightBackgroundPreview = this.changeStyle(this.appliedCustomizationOptions.links.lightBackground, this.appliedCustomizationOptions.links.lightBackground.color); - // this.previewUrl = this.getCommunityUrlSatinized(this.appliedCustomizationOptions); + initializeCustomizationOptions(updatePreviewUrl) { + this.draftCustomizationOptions = this.copyObject(this.publishedCustomizationOptions); + this.appliedCustomizationOptions = this.copyObject(this.publishedCustomizationOptions); + + if(updatePreviewUrl){ + this.previewUrl = this.getCommunityUrlSatinized(JSON.stringify(this.appliedCustomizationOptions)); + } + + + this.buttonDarkBackgroundPreview = this.changeStyle(this.draftCustomizationOptions.buttons.darkBackground); + this.buttonLightBackgroundPreview = this.changeStyle(this.draftCustomizationOptions.buttons.lightBackground); + this.linkDarkBackgroundPreview = this.changeFontsStyle(this.draftCustomizationOptions.links.darkBackground, this.draftCustomizationOptions.links.darkBackground.color); + this.linkLightBackgroundPreview = this.changeStyle(this.draftCustomizationOptions.links.lightBackground, this.draftCustomizationOptions.links.lightBackground.color); + } + + applyLayout() { + this.appliedCustomizationOptions = this.copyObject(this.draftCustomizationOptions); + if(JSON.stringify(this.appliedCustomizationOptions) != this.previewCustomization){ + this.previewUrl = this.getCommunityUrlSatinized(JSON.stringify(this.appliedCustomizationOptions)); + } + } + + resetLayout() { + + if (this.menuSelected == 'backgrounds') { + this.resetBackgrounds(); + } else if (this.menuSelected == 'fonts') { + this.resetFonts(); + } else if (this.menuSelected == 'elements') { + this.resetElements(); + } else if (this.menuSelected == 'buttons') { + this.resetButtons(); + } else if (this.menuSelected == 'identity') { + this.resetIdentity(); + } else { + this.draftCustomizationOptions = this.copyObject(this.publishedCustomizationOptions); + + this.appliedCustomizationOptions = this.copyObject(this.publishedCustomizationOptions); + } + // console.log(JSON.stringify(this.appliedCustomizationOptions)) + // console.log(this.previewCustomization) + this.initializeCustomizationOptions(JSON.stringify(this.appliedCustomizationOptions) != this.previewCustomization); + + } + + resetBackgrounds() { + this.draftCustomizationOptions.panel.onDarkBackground = this.publishedCustomizationOptions.panel.onDarkBackground; + this.draftCustomizationOptions.panel.background.color = this.publishedCustomizationOptions.panel.background.color; + + this.appliedCustomizationOptions.panel.onDarkBackground = this.publishedCustomizationOptions.panel.onDarkBackground; + this.appliedCustomizationOptions.panel.background.color = this.publishedCustomizationOptions.panel.background.color; + } + + resetFonts() { + this.resetFontsBig(); + this.resetFontsSmall(); + this.resetFontsLinksDark(); + this.resetFontsLinksLight(); + + } + + resetFontsBig() { + this.draftCustomizationOptions.panel.title = this.copyObject(this.publishedCustomizationOptions.panel.title); + + this.appliedCustomizationOptions.panel.title = this.copyObject(this.publishedCustomizationOptions.panel.title); + } + + resetFontsSmall() { + this.draftCustomizationOptions.panel.fonts = this.copyObject(this.publishedCustomizationOptions.panel.fonts); + + this.appliedCustomizationOptions.panel.fonts = this.copyObject(this.publishedCustomizationOptions.panel.fonts); + + + } + + resetFontsLinksDark() { + this.draftCustomizationOptions.links.darkBackground = this.copyObject(this.publishedCustomizationOptions.links.darkBackground); + + this.appliedCustomizationOptions.links.darkBackground = this.copyObject(this.publishedCustomizationOptions.links.darkBackground); + } + + resetFontsLinksLight() { + this.draftCustomizationOptions.panel.title = this.copyObject(this.publishedCustomizationOptions.panel.title); + this.draftCustomizationOptions.links.lightBackground = this.copyObject(this.publishedCustomizationOptions.links.lightBackground); + + this.appliedCustomizationOptions.panel.title = this.copyObject(this.publishedCustomizationOptions.panel.title); + this.appliedCustomizationOptions.links.lightBackground = this.copyObject(this.publishedCustomizationOptions.links.lightBackground); + } + + resetElements() { + this.draftCustomizationOptions.panel.panelElements = this.copyObject(this.publishedCustomizationOptions.panel.panelElements); + + this.appliedCustomizationOptions.panel.panelElements = this.copyObject(this.publishedCustomizationOptions.panel.panelElements); + } + + resetButtons() { + this.resetButtonsDark(); + this.resetButtonsLight(); + } + + resetButtonsDark() { + this.draftCustomizationOptions.buttons.darkBackground = this.copyObject(this.publishedCustomizationOptions.buttons.darkBackground); + + this.appliedCustomizationOptions.buttons.darkBackground = this.copyObject(this.publishedCustomizationOptions.buttons.darkBackground); + } + + resetButtonsLight() { + this.draftCustomizationOptions.buttons.lightBackground = this.copyObject(this.publishedCustomizationOptions.buttons.lightBackground); + + this.appliedCustomizationOptions.buttons.lightBackground = this.copyObject(this.publishedCustomizationOptions.buttons.lightBackground); + } + + resetIdentity() { + this.draftCustomizationOptions.mainColor = this.publishedCustomizationOptions.mainColor; + this.draftCustomizationOptions.secondaryColor = this.publishedCustomizationOptions.secondaryColor; + + this.appliedCustomizationOptions.mainColor = this.publishedCustomizationOptions.mainColor; + this.appliedCustomizationOptions.secondaryColor = this.publishedCustomizationOptions.secondaryColor; } changeStyle(colorOptions, borderOptions = null) { @@ -109,22 +215,22 @@ export class CustomizationComponent implements OnInit { borderOptions = colorOptions; } if (colorOptions.color) { - style += '; color:' + colorOptions.color; + style = style.concat('; color:' + colorOptions.color); } if (colorOptions.backgroundColor) { - style += '; background-color:' + colorOptions.backgroundColor; + style = style.concat( '; background-color:' + colorOptions.backgroundColor); } if (colorOptions.borderColor) { - style += '; border-color:' + colorOptions.borderColor; + style = style.concat('; border-color:' + colorOptions.borderColor); } if (borderOptions.borderStyle) { - style += '; border-style:' + borderOptions.borderStyle; + style = style.concat('; border-style:' + borderOptions.borderStyle); } if (borderOptions.borderWidth) { - style += '; border-width:' + borderOptions.borderWidth + 'px'; + style = style.concat( '; border-width:' + borderOptions.borderWidth + 'px'); } if (borderOptions.borderRadius) { - style += '; border-radius:' + borderOptions.borderRadius + 'px'; + style = style.concat('; border-radius:' + borderOptions.borderRadius + 'px'); } return this.sanitizer.bypassSecurityTrustStyle(style); @@ -136,32 +242,30 @@ export class CustomizationComponent implements OnInit { if (options.family) { - style += '; font-family:' + options.family; + style = style.concat('; font-family:' + options.family); } if (options.size) { - style += '; font-size:' + options.size + 'px'; + style = style.concat('; font-size:' + options.size + 'px'); } if (options.weight) { - style += '; font-weight:' + options.weight; + style = style.concat('; font-weight:' + options.weight); } if (color) { - style += '; color:' + color; + style = style.concat('; color:' + color); } return this.sanitizer.bypassSecurityTrustStyle(style); } - getCommunityUrlSatinized(customization: CustomizationOptions) { - return this.sanitizer.bypassSecurityTrustResourceUrl(this.getCommunityUrlNewLayout(customization)); + getCommunityUrlSatinized(layout: string) { + return this.sanitizer.bypassSecurityTrustResourceUrl(this.getCommunityUrlNewLayout(layout)); } - getCommunityUrlNewLayout(customization: CustomizationOptions) { - // console.log("here!"); - let layout = JSON.stringify(customization); - // console.log(layout); + getCommunityUrlNewLayout(layout: string) { + this.previewCustomization = layout; return this.communityUrl + '&layout=' + StringUtils.URIEncode(layout); } @@ -169,9 +273,41 @@ export class CustomizationComponent implements OnInit { return JSON.parse(JSON.stringify(obj)); } - resetBackgroundsBanners() { - this.appliedCustomizationOptions.panel.onDarkBackground = this.customizationOptions.panel.onDarkBackground; - this.appliedCustomizationOptions.panel.background.color = this.customizationOptions.panel.background.color; + back() { + if (JSON.stringify(this.draftCustomizationOptions) == JSON.stringify(this.publishedCustomizationOptions) || + JSON.stringify(this.draftCustomizationOptions) == JSON.stringify(this.appliedCustomizationOptions)) { + this.menuSelected = 'main'; + } else { + this.backAlert.okButtonText = 'Yes'; + this.backAlert.cancelButtonText = 'No'; + this.backAlert.alertTitle = ''; + this.backAlert.okButtonLeft = true; + this.backAlert.open(); + } + } + resetToAppliedOptions() { + this.draftCustomizationOptions = this.copyObject(this.appliedCustomizationOptions); + this.menuSelected = 'main'; + } + + exit() { + if (JSON.stringify(this.appliedCustomizationOptions) == JSON.stringify(this.publishedCustomizationOptions)) { + this.exitCustomization(); + } else { + this.exitAlert.okButtonText = 'Yes'; + this.exitAlert.cancelButtonText = 'No'; + this.exitAlert.alertTitle = ''; + this.exitAlert.okButtonLeft = true; + this.exitAlert.open(); + } + + } + + exitCustomization() { + this._router.navigate(['/dashboard'], { + queryParams: {'communityId': this.communityId} + }); + } } diff --git a/src/app/pages/customization/customization.module.ts b/src/app/pages/customization/customization.module.ts index 2d313a4..67ca774 100644 --- a/src/app/pages/customization/customization.module.ts +++ b/src/app/pages/customization/customization.module.ts @@ -11,11 +11,13 @@ import {FontSizeComponent} from './FontSize.component'; import {ColorComponent} from './Color.component'; import {BorderComponent} from './Border.component'; import {LayoutService} from '../../openaireLibrary/services/layout.service'; +import {AlertModalModule} from '../../openaireLibrary/utils/modal/alertModal.module'; + // import {IsCommunity} from '../../openaireLibrary/connect/communityGuard/isCommunity.guard'; // import {ConnectAdminLoginGuard} from '../../openaireLibrary/connect/communityGuard/connectAdminLoginGuard.guard'; @NgModule({ imports: [ - CustomizationRoutingModule, CommonModule, FormsModule, RouterModule, ColorPickerModule + CustomizationRoutingModule, CommonModule, FormsModule, RouterModule, ColorPickerModule, AlertModalModule ], declarations: [ CustomizationComponent, FontSizeComponent, ColorComponent, BorderComponent diff --git a/src/app/pages/dashboard/dashboard.component.html b/src/app/pages/dashboard/dashboard.component.html index eb15630..91f08b1 100644 --- a/src/app/pages/dashboard/dashboard.component.html +++ b/src/app/pages/dashboard/dashboard.component.html @@ -9,11 +9,15 @@ Profile
    - Edit community information, change logo url, add community managers or organizations related to community. + Edit community information, change logo url, add community managers or organizations related to + community and customize css layout.
    diff --git a/src/app/pages/subjects/subjects-edit-form/subjects-edit-form.service.ts b/src/app/pages/subjects/subjects-edit-form/subjects-edit-form.service.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/pages/subscribers/remove-subscriber.component.html b/src/app/pages/subscribers/remove-subscriber.component.html deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/pages/subscribers/remove-subscriber.component.ts b/src/app/pages/subscribers/remove-subscriber.component.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/assets/css/connect-custom.css b/src/assets/css/connect-custom.css index 3b31c5a..5b4c98f 100644 --- a/src/assets/css/connect-custom.css +++ b/src/assets/css/connect-custom.css @@ -124,3 +124,24 @@ height:100%; border:0; } + +/*Customization*/ + +.customizationMenuPanel{ + background-color: #999999; +} + +.customizationMenuPanel .customizationMenuItems{ + background-color: white; + border: white solid 1px; + border-radius: 14px; +} + + +.colorPicker input{ + width:35px; + height: 15px; + border: 1px solid #707070; + border-radius: 2px; + opacity: 1; +} diff --git a/src/assets/env-properties.json b/src/assets/env-properties.json index af4d224..e91fa84 100644 --- a/src/assets/env-properties.json +++ b/src/assets/env-properties.json @@ -34,7 +34,7 @@ "piwikBaseUrl" :" https://analytics.openaire.eu/piwik.php?idsite=6", "loginUrl" :"http://rudie.di.uoa.gr:8080/dnet-login/openid_connect_login", - "userInfoUrl" : "http://scoobydoo.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/api/users/getUserInfo?accessToken=", + "userInfoUrl" : "http://rudie.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/api/users/getUserInfo?accessToken=", "logoutUrl" :"https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=",