diff --git a/angular.json b/angular.json index aa3721f..71801a2 100644 --- a/angular.json +++ b/angular.json @@ -46,11 +46,14 @@ "src/robots.txt" ], "styles": [ - "src/material.scss", "src/mining.scss", - "src/styles.css" + "src/styles.less", + "src/deprecated.css", + "src/assets/common-assets/library-css/material.scss" ], "scripts": [ + "node_modules/uikit/dist/js/uikit.min.js", + "node_modules/uikit/dist/js/uikit-icons.min.js", "node_modules/jquery/dist/jquery.js", "node_modules/interactiveminingv3/assets/js/ResizeSensor.js", "node_modules/interactiveminingv3/assets/js/jquery.sticky-sidebar.js" diff --git a/package.json b/package.json index 53ccacc..eb5fdd2 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "scripts": { "ng": "ng", - "start": "ng serve --host 0.0.0.0 --disable-host-check --port=5000", + "start": "ng serve --host 0.0.0.0 --disable-host-check --port=5001", "build": "ng build", "build-dev": "ng build --configuration=development", "build-beta": "ng build --configuration=beta", @@ -36,10 +36,11 @@ "ng2-ckeditor": "1.3.1", "ngx-color-picker": "^8.1.0", "rxjs": "^6.5.1", + "sass-loader": "7.3.1", "ts-md5": "^1.2.0", "tslib": "^2.0.0", - "zone.js": "~0.10.2", - "sass-loader": "7.3.1" + "uikit": "^3.12.0", + "zone.js": "~0.10.2" }, "devDependencies": { "@angular-devkit/build-angular": "~0.1102.14", @@ -47,9 +48,9 @@ "@angular/compiler-cli": "~11.2.14", "@angular/language-service": "~11.2.14", "@types/express": "^4.17.0", - "@types/node": "^12.11.1", "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.3", + "@types/node": "^12.11.1", "codelyzer": "^6.0.0", "jasmine-core": "~3.8.0", "jasmine-spec-reporter": "~5.0.0", diff --git a/src/app/app.component.html b/src/app/app.component.html index 3bf4cff..882c55f 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -2,14 +2,16 @@
- diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 7416df4..fe78800 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -10,7 +10,6 @@ import {properties} from "../environments/environment"; import {BehaviorSubject, Subscriber} from "rxjs"; import {CommunityInfo} from "./openaireLibrary/connect/community/communityInfo"; import {CommunityService} from "./openaireLibrary/connect/community/community.service"; -import {arrow_left} from "./openaireLibrary/utils/icons/icons"; import {SmoothScroll} from "./openaireLibrary/utils/smooth-scroll"; import {ConnectHelper} from './openaireLibrary/connect/connectHelper'; import {ConfigurationService} from './openaireLibrary/utils/configuration/configuration.service'; @@ -30,7 +29,6 @@ export class AppComponent implements OnInit { hasHeader: boolean = false; hasAdminMenu: boolean = false; isFrontPage: boolean = false; - isDashboard: boolean = false; sideBarItems: MenuItem[] = []; specialSideBarMenuItem: MenuItem = null; menuItems: RootMenuItem[] = []; @@ -94,12 +92,8 @@ export class AppComponent implements OnInit { this.isFrontPage = isFrontPage; this.cdr.detectChanges(); })); - this.subscriptions.push(this.layoutService.isDashboard.subscribe(isDashboard => { - this.isDashboard = isDashboard; - this.cdr.detectChanges(); - })); - this.layoutService.setSmallScreen((this.innerWidth && this.innerWidth < 1219)); - this.layoutService.setOpen(!(this.innerWidth && this.innerWidth < 1219)); + this.layoutService.setSmallScreen((this.innerWidth && this.innerWidth <= 640)); + this.layoutService.setOpen(!(this.innerWidth && this.innerWidth <= 640)); this.subscriptions.push(this.params.subscribe(params => { if (this.paramsResolved) { this.loading = true; @@ -220,9 +214,7 @@ export class AppComponent implements OnInit { if (this.community.type === 'ri') { this.sideBarItems.push(new MenuItem("mining", "Mining", "", "/" + this.community.communityId + "/mining/manage-profiles", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/mining")); } - this.specialSideBarMenuItem = new MenuItem("back", "Manage communities", "", "/", false, [], null, {}); - this.specialSideBarMenuItem.icon = '' + arrow_left.data + ''; - this.specialSideBarMenuItem.customClass = 'uk-text-uppercase uk-text-bold uk-text-secondary'; + this.specialSideBarMenuItem = new MenuItem("back", "Manage communities", "", "/", false, [], null, {}, {name: 'search', class: 'uk-text-secondary'}); } else { this.headerLogoUrl = null; this.headerUrl = 'https://' + ((properties.environment !== 'production')?'beta.':'') + 'connect.openaire.eu'; @@ -236,7 +228,12 @@ export class AppComponent implements OnInit { badge: false, stickyAnimation: false }; - this.sideBarItems.push(new MenuItem("communities", "Manage Communities", "", "/", false, [], [], {})); + this.sideBarItems.push(new MenuItem("communities", "Manage Communities", "", "/", false, [], [], {}, {name: 'settings'})); + if (Session.isPortalAdministrator(this.user)) { + this.sideBarItems.push(new MenuItem("super_admin", "Super Admin Options", "", "/admin-tools/portals", false, [], [], {}, {name: 'settings'}, null, null, 'admin/admin-tools')); + this.sideBarItems.push(new MenuItem("connect", "Connect Options", "", "/connect/admin-tools/pages", false, [], [], {}, {name: 'settings'}, null, null, 'admin/monitor/admin-tools')); + this.sideBarItems.push(new MenuItem("explore", "Explore Options", "", "/openaire/admin-tools/pages", false, [], [], {}, {name: 'settings'}, null, null, 'admin/monitor/admin-tools')); + } this.specialSideBarMenuItem = null; } } diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index b88c65a..4966a1d 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit b88c65a3430a3689770e40e1e6f34d8bb10b86c3 +Subproject commit 4966a1d342ae711a1a84ee924ab23e2f79271ec9 diff --git a/src/app/pages/manage-communities/manage-communities.component.css b/src/app/pages/manage-communities/manage-communities.component.css deleted file mode 100644 index 28a56a3..0000000 --- a/src/app/pages/manage-communities/manage-communities.component.css +++ /dev/null @@ -1,25 +0,0 @@ -.uk-card { - min-height: 230px; -} - -.uk-card-body { - padding-top: 75px; -} - -.uk-card-default .name { - margin-left: auto; - margin-right: auto; -} - -.uk-card-default .uk-card-title .logo { - display: inline-block; - max-width: 80%; -} - -.uk-card-default .uk-card-title .logo > img { - max-height: 60px; -} - -.uk-card-no-height { - min-height: unset !important; -} \ No newline at end of file diff --git a/src/app/pages/manage-communities/manage-communities.component.ts b/src/app/pages/manage-communities/manage-communities.component.ts index f3a9ed6..ec6b730 100644 --- a/src/app/pages/manage-communities/manage-communities.component.ts +++ b/src/app/pages/manage-communities/manage-communities.component.ts @@ -18,57 +18,63 @@ type Tab = 'all' | 'communities' | 'ris'; @Component({ selector: 'manage-communities', template: ` -
+
-
+
+
+
+
-
-
-
Research Communities
-
- - - +
+
+
+

Research Communities

+
+ + + +
+
+ No communities found +
-
- No communities found -
-
-
-

- No communities to manage yet -

-
-
-
Research Initiatives
-
- - - +
+

+ No communities to manage yet +

+
+
+

Research Initiatives

+
+ + + +
+
+ No initiatives found +
-
- No initiatives found -
@@ -76,66 +82,70 @@ type Tab = 'all' | 'communities' | 'ris';
- -
- - - - + - `, - styleUrls: ['manage-communities.component.css'] + ` }) export class ManageCommunitiesComponent implements OnInit, OnDestroy { public properties: EnvProperties = properties; public communities: CommunityInfo[] = []; - public filteredCommunities: CommunityInfo[] = []; + public filteredCommunities: CommunityInfo[] = []; public ris: CommunityInfo[] = []; - public filteredRis: CommunityInfo[] = []; + public filteredRis: CommunityInfo[] = []; public loading: boolean; public user: User; + public stickyPageHeader: boolean = false; public tab: Tab = "all"; private subscriptions: any[] = []; - public communitySearchUtils: SearchUtilsClass = new SearchUtilsClass(); - public errorCodes: ErrorCodes; - - // Search - @ViewChild('searchInputComponent') searchInputComponent: SearchInputComponent; - filterForm: FormGroup; - private searchText: string = ''; - public keyword: string = ''; + public communitySearchUtils: SearchUtilsClass = new SearchUtilsClass(); + public errorCodes: ErrorCodes; + // Search + @ViewChild('searchInputComponent') searchInputComponent: SearchInputComponent; + filterForm: FormGroup; + private searchText: string = ''; - constructor(private route: ActivatedRoute, - private _fb: FormBuilder, + constructor(private route: ActivatedRoute, + private _fb: FormBuilder, private communitiesService: CommunitiesService, private title: Title, private userManagementService: UserManagementService) { - this.errorCodes = new ErrorCodes(); + this.errorCodes = new ErrorCodes(); this.communitySearchUtils.status = this.errorCodes.LOADING; } ngOnInit() { - this.communitySearchUtils.keyword = ""; - + this.communitySearchUtils.keyword = ""; + this.filterForm = this._fb.group({ keyword: [''], }); - - this.subscriptions.push(this.filterForm.get('keyword').valueChanges.subscribe(value => { - this.searchText = value.toLowerCase(); - this.applyFilters(); + + this.subscriptions.push(this.filterForm.get('keyword').valueChanges.subscribe(value => { + this.searchText = value ? value.toLowerCase() : ''; + this.applyFilters(); })); - + this.loading = true; this.title.setTitle('Administrator Dashboard | Manage Communities'); this.subscriptions.push(this.route.fragment.subscribe((fragment: Tab) => { @@ -151,22 +161,21 @@ export class ManageCommunitiesComponent implements OnInit, OnDestroy { this.subscriptions.push(this.communitiesService.getCommunities(this.properties, this.properties.communityAPI + 'communities').subscribe( communities => { this.communities = []; - this.filteredCommunities = []; + this.filteredCommunities = []; this.ris = []; - this.filteredRis = []; + this.filteredRis = []; communities.forEach(community => { if (Session.isPortalAdministrator(this.user) || Session.isCommunityCurator(this.user) || Session.isManager('community', community.communityId, this.user)) { if (community.type === 'community') { this.communities.push(community); - this.filteredCommunities.push(community); + this.filteredCommunities.push(community); } else { this.ris.push(community); - this.filteredRis.push(community); + this.filteredRis.push(community); } } }) this.loading = false; - this.keyword = ''; })); } })); @@ -198,16 +207,16 @@ export class ManageCommunitiesComponent implements OnInit, OnDestroy { return false; } } - - public applyFilters() { + + public applyFilters() { this.filteredCommunities = this.communities.filter(community => community.shortTitle.toLowerCase().includes(this.searchText) || community.title.toLowerCase().includes(this.searchText) || community.communityId.toLowerCase().includes(this.searchText)); - this.filteredRis = this.ris.filter(community => community.shortTitle.toLowerCase().includes(this.searchText) || community.title.toLowerCase().includes(this.searchText) || community.communityId.toLowerCase().includes(this.searchText)); + this.filteredRis = this.ris.filter(community => community.shortTitle.toLowerCase().includes(this.searchText) || community.title.toLowerCase().includes(this.searchText) || community.communityId.toLowerCase().includes(this.searchText)); } - - public onSearchClose() { + + public onSearchClose() { this.communitySearchUtils.keyword = this.filterForm.get('keyword').value; } - + public resetInput() { this.communitySearchUtils.keyword = null; this.searchInputComponent.reset() diff --git a/src/assets/common-assets b/src/assets/common-assets index ee3a9a4..752859b 160000 --- a/src/assets/common-assets +++ b/src/assets/common-assets @@ -1 +1 @@ -Subproject commit ee3a9a4868bbdeb26d7a9c5ed15dbf8b2b765b39 +Subproject commit 752859b10d3e110fdc9a4360bb7cb005ef6225ed diff --git a/src/assets/css/connect-custom.css b/src/assets/css/connect-custom.css deleted file mode 100644 index 5a33499..0000000 --- a/src/assets/css/connect-custom.css +++ /dev/null @@ -1,121 +0,0 @@ -:root { - --portal-main-color: #FECA1D; - --portal-main-contrast: #FFFFFF; - --portal-dark-color: #b48536; - --primary-color: var(--theme-secondary-color); - --secondary-color: var(--theme-secondary-color); -} - -.tm-toolbar .uk-subnav-line .custom-connect-li, .tm-toolbar .uk-subnav-line .custom-connect-admin-li { - display: block; - background: #DEAF50 !important; - color: #fff !important; - -} - -.custom-connect-toolbar ul.uk-subnav.uk-subnav-line, .custom-connect-admin-toolbar ul.uk-subnav.uk-subnav-line { - background-color: #FFC700 !important; -} - -.custom-connect-toolbar .inner, .custom-connect-admin-toolbar .inner { - background-color: #FFC700 !important; -} - -.custom-connect-toolbar, .custom-connect-admin-toolbar { - border-top-color: #FFC700 !important; -} - -.red_color { - color: #FF3030; -} - -.red_background_color:hover { - background-color: #FF3030; - border-color: #FF3030; - color: #767779 !important; -} - -.green_color { - color: lightgreen; -} - -.green_background_color:hover { - background-color: lightgreen; - border-color: lightgreen; - color: #767779 !important; -} - -.wellcomePage { - background: transparent linear-gradient(0deg, #FAFAFA 0%, #E2EEFA 100%) 0 0 no-repeat padding-box; - min-height: calc(100vh - 412.767px); -} - -.iframeContainer { - overflow: hidden; - -} - -.iframeContainer iframe { - - width: 100%; - height: 100%; - border: 0; -} - -/*Customization*/ - -.customizationMenuPanel { - /*background-color: #999999;*/ -} - -.customizationMenuPanel .customizationMenuItems { - background-color: white; - border: white solid 1px; - border-radius: 14px; -} -/*#colorPickerInput { - width: 15px; - height: 15px; - border: 1px solid #707070; - border-radius: 50%; - opacity: 1; - cursor:pointer; - -}*/ - -.colorPicker input { - width: 35px; - height: 15px; - border: 1px solid #707070; - border-radius: 2px; - opacity: 1; - cursor:pointer; -} - -/* NEW CSS*/ -.login circle { - fill: var(--primary-color); -} - -.login:hover circle { - fill: var(--secondary-color); -} - -#sidebar_main .sidebar_main_header .portal-logo { - background: url("/assets/common-assets/logo-large-connect.png") no-repeat; - background-size: contain; -} - -.sidebar_mini #sidebar_main .sidebar_main_header .portal-logo { - background: url("/assets/common-assets/logo-small-connect.png") no-repeat; - background-size: contain; -} - -#sidebar_main #sidebar_content { - border-right: 1px solid var(--portal-main-color); -} - -#sidebar_switcher_toggle { - border: 1px solid var(--portal-main-color); - border-left: 0; -} diff --git a/src/assets/dashboard-theme b/src/assets/dashboard-theme index 5d7edb0..635d56f 160000 --- a/src/assets/dashboard-theme +++ b/src/assets/dashboard-theme @@ -1 +1 @@ -Subproject commit 5d7edb030d589492011316208ee45a1d2c54e764 +Subproject commit 635d56f198026c2d24a923ad58b813254591fa33 diff --git a/src/assets/openaire-theme b/src/assets/openaire-theme index b2911ee..ec73c67 160000 --- a/src/assets/openaire-theme +++ b/src/assets/openaire-theme @@ -1 +1 @@ -Subproject commit b2911eeaaf5f1a04a55353a3df5bf4d42a5fa7ca +Subproject commit ec73c67c591eca9fe68f7a6c6f65ce4332852b2f diff --git a/src/deprecated.css b/src/deprecated.css new file mode 100644 index 0000000..84ce55b --- /dev/null +++ b/src/deprecated.css @@ -0,0 +1,4 @@ +@import "assets/openaire-theme/css/structure/variables.css"; +@import "assets/openaire-theme/css/openaire.css"; +@import "assets/common-assets/library.css"; +@import "assets/dashboard-theme/main.css"; diff --git a/src/environments/environment.beta.ts b/src/environments/environment.beta.ts index be0e788..622a654 100644 --- a/src/environments/environment.beta.ts +++ b/src/environments/environment.beta.ts @@ -6,7 +6,6 @@ export let properties: EnvProperties = { adminToolsPortalType: "community", enablePiwikTrack: false, useCache: false, - metricsAPIURL: "https://beta.services.openaire.eu/usagestats/", framesAPIURL: "https://beta.openaire.eu/stats3/", claimsAPIURL: "https://beta.services.openaire.eu/claims/rest/claimsService/", statisticsAPIURL: "https://beta.services.openaire.eu/stats-api/", diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 3059466..afcfe95 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -6,7 +6,6 @@ export let properties: EnvProperties = { adminToolsPortalType: "community", enablePiwikTrack: false, useCache: false, - metricsAPIURL: "https://services.openaire.eu/usagestats/", framesAPIURL: "https://www.openaire.eu/stats3/", claimsAPIURL: "https://services.openaire.eu/claims/rest/claimsService/", statisticsAPIURL: "https://beta.services.openaire.eu/stats-api/", diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 641e667..fc7dfe2 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -11,7 +11,6 @@ export let properties: EnvProperties = { adminToolsPortalType: "community", enablePiwikTrack: false, useCache: false, - metricsAPIURL: 'https://beta.services.openaire.eu/usagestats/', framesAPIURL: 'https://beta.openaire.eu/stats3/', claimsAPIURL: 'http://scoobydoo.di.uoa.gr:8080/dnet-claims-service-2.0.0-SNAPSHOT/rest/claimsService/', statisticsAPIURL: 'https://beta.services.openaire.eu/stats-api/', diff --git a/src/index.html b/src/index.html index 62500c7..02ef4da 100644 --- a/src/index.html +++ b/src/index.html @@ -22,9 +22,6 @@ - - - diff --git a/src/material.scss b/src/material.scss deleted file mode 100644 index b5fe85b..0000000 --- a/src/material.scss +++ /dev/null @@ -1,23 +0,0 @@ -@import '~@angular/material/theming'; -@include mat-core(); -$primary-color: ( - 0: var(--primary-color), - contrast: ( - 50: var(--contrast-color) - ) -); -$secondary-color: ( - 0: var(--secondary-color), - contrast: ( - 50: var(--contrast-color) - ) -); -$my-app-primary: mat-palette($primary-color, 0); -$my-app-accent: mat-palette($secondary-color, 0); -$my-app-theme: mat-light-theme($my-app-primary, $my-app-accent); - -@include angular-material-theme($my-app-theme); - -.cdk-global-overlay-wrapper, .cdk-overlay-container { - z-index: 9999!important; -} diff --git a/src/styles.css b/src/styles.css deleted file mode 100644 index b435524..0000000 --- a/src/styles.css +++ /dev/null @@ -1,6 +0,0 @@ -/* You can add global styles to this file, and also import other style files */ -@import "assets/common-assets/common/theme.css"; -@import "assets/common-assets/common/custom.css"; -@import "assets/common-assets/library.css"; -@import "assets/dashboard-theme/main.css"; -@import "assets/css/connect-custom.css"; diff --git a/src/styles.less b/src/styles.less new file mode 100644 index 0000000..9cf5f1d --- /dev/null +++ b/src/styles.less @@ -0,0 +1,2 @@ +/* You can add global styles to this file, and also import other style files */ +@import "~src/assets/openaire-theme/less/_import";