Skip to content

Commit af99ca8

Browse files
authored
MENDELU/UI customization to v9 (#1042)
* enabling the custom theme in config.yml * editing assetes * first UI set-up changes * Revert "first UI set-up changes" This reverts commit d4d654b. * enabling the custom theme in eager-themes.module * header edit based on dspace-theme - to make it oneline * Copy default global styles * Header navbar wrapper edit to make oneline header * Navbar component fix to make header oneline * Render MENDELU logos * Added mendelu specific fonts and colors * Make footer COAR Notify logo white * Hide home-coar and home-news * Hide header-navbar border-bottom * Hide all the languages except cs and en * Adjusting colors to MENDELU design * Adjusting sidebar links to be clickable as full rows, not only text * Adjusted default coloring settings * Made login/logout page logo larger * Added custom/expandable-navbar-section.component * Fixed coloring of navbar sections * Changed config.yml to localhost server * Removed unused css declaration block * Lint fixes * Added missing import * Fixed paddings of search navbar icon * Fixed padding and hover styling in expandable-navbar-section * Fix lint errors * Fix lint errors * Adding the popperjs dependency * Adjusted Unit tests for changes in login and logout page components * Edit of build.yml to remove node_modules and package-lock.json before installing npm dependencies * 2nd edit of build.yml workflow * Revert of build.yml changes * Trying to clean cache before installing dependecies * Fixed garbage from previous commit
1 parent 789934a commit af99ca8

77 files changed

Lines changed: 1377 additions & 77 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ jobs:
8888
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
8989
restore-keys: ${{ runner.os }}-npm-
9090

91+
# Workaround for npm bug with optional dependencies (https://github.com/npm/cli/issues/4828)
92+
# Clean npm cache to avoid corrupted Rollup optional dependencies
93+
- name: Clean npm cache
94+
run: npm cache clean --force
95+
9196
- name: Install NPM dependencies
9297
run: npm clean-install
9398

@@ -331,8 +336,6 @@ jobs:
331336
uses: Wandalen/wretry.action@v1.3.0
332337
with:
333338
action: codecov/codecov-action@v4
334-
# Ensure codecov-action throws an error when it fails to upload
335-
# This allows us to auto-restart the action if an error is thrown
336339
with: |
337340
fail_ci_if_error: true
338341
token: ${{ secrets.CODECOV_TOKEN }}

config/config.yml

Lines changed: 139 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,141 @@
11
rest:
2-
ssl: true
3-
host: sandbox.dspace.org
4-
port: 443
2+
ssl: false
3+
host: localhost
4+
port: 8080
55
nameSpace: /server
6+
7+
8+
# Theme Config
9+
themes:
10+
# Add additional themes here. In the case where multiple themes match a route, the first one
11+
# in this list will get priority. It is advisable to always have a theme that matches
12+
# every route as the last one
13+
#
14+
# # A theme with a handle property will match the community, collection or item with the given
15+
# # handle, and all collections and/or items within it
16+
# - name: custom
17+
# handle: 10673/1233
18+
#
19+
# # A theme with a regex property will match the route using a regular expression. If it
20+
# # matches the route for a community or collection it will also apply to all collections
21+
# # and/or items within it
22+
# - name: custom
23+
# regex: collections\/e8043bc2.*
24+
#
25+
# # A theme with a uuid property will match the community, collection or item with the given
26+
# # ID, and all collections and/or items within it
27+
# - name: custom
28+
# uuid: 0958c910-2037-42a9-81c7-dca80e3892b4
29+
#
30+
# # The extends property specifies an ancestor theme (by name). Whenever a themed component is not found
31+
# # in the current theme, its ancestor theme(s) will be checked recursively before falling back to default.
32+
# - name: custom-A
33+
# extends: custom-B
34+
# # Any of the matching properties above can be used
35+
# handle: 10673/34
36+
#
37+
# - name: custom-B
38+
# extends: custom
39+
# handle: 10673/12
40+
#
41+
# # A theme with only a name will match every route
42+
# name: custom
43+
#
44+
# # This theme will use the default bootstrap styling for DSpace components
45+
# - name: BASE_THEME_NAME
46+
#
47+
- name: custom
48+
headTags:
49+
- tagName: link
50+
attributes:
51+
rel: icon
52+
href: assets/custom/images/favicons/favicon.ico
53+
sizes: any
54+
- tagName: link
55+
attributes:
56+
rel: icon
57+
href: assets/custom/images/favicons/favicon.svg
58+
type: image/svg+xml
59+
- tagName: link
60+
attributes:
61+
rel: apple-touch-icon
62+
href: assets/custom/images/favicons/apple-touch-icon.png
63+
- tagName: link
64+
attributes:
65+
rel: manifest
66+
href: assets/custom/images/favicons/manifest.webmanifest
67+
68+
69+
#info:
70+
# # Whether the end user agreement is required before users may use the repository.
71+
# # If enabled, the user will be required to accept the agreement before they can use the repository.
72+
# # If disabled, the page will not exist and no agreement is required to use the repository
73+
# enableEndUserAgreement: false
74+
# # Whether the privacy statement should exist or not.
75+
# enablePrivacyStatement: false
76+
77+
# Allow only EN and CS languages
78+
languages:
79+
- code: en
80+
label: English
81+
active: true
82+
- code: ca
83+
label: Català
84+
active: false
85+
- code: cs
86+
label: Čeština
87+
active: true
88+
- code: de
89+
label: Deutsch
90+
active: false
91+
- code: es
92+
label: Español
93+
active: false
94+
- code: fr
95+
label: Français
96+
active: false
97+
- code: gd
98+
label: Gàidhlig
99+
active: false
100+
- code: lv
101+
label: Latviešu
102+
active: false
103+
- code: hu
104+
label: Magyar
105+
active: false
106+
- code: nl
107+
label: Nederlands
108+
active: false
109+
- code: pl
110+
label: Polski
111+
active: false
112+
- code: pt-PT
113+
label: Português
114+
active: false
115+
- code: pt-BR
116+
label: Português do Brasil
117+
active: false
118+
- code: fi
119+
label: Suomi
120+
active: false
121+
- code: sv
122+
label: Svenska
123+
active: false
124+
- code: tr
125+
label: Türkçe
126+
active: false
127+
- code: kk
128+
label: Қазақ
129+
active: false
130+
- code: bn
131+
label: বাংলা
132+
active: false
133+
- code: hi
134+
label: हिंदी
135+
active: false
136+
- code: el
137+
label: Ελληνικά
138+
active: false
139+
- code: uk
140+
label: Yкраї́нська
141+
active: false

src/app/admin/admin-sidebar/admin-sidebar.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<div class="sidebar-full-width-container" id="sidebar-header-container" aria-hidden="true">
1414
<div class="sidebar-section-wrapper">
1515
<div class="sidebar-fixed-element-wrapper">
16-
<img id="admin-sidebar-logo" src="assets/images/dspace-logo-mini.svg" [alt]="('menu.header.image.logo') | translate" aria-hidden="true">
16+
<img id="admin-sidebar-logo" src="assets/images/mendelu-symbol-w.svg" [alt]="('menu.header.image.logo') | translate" aria-hidden="true">
1717
</div>
1818
<div class="sidebar-collapsible-element-outer-wrapper">
1919
<div class="sidebar-collapsible-element-inner-wrapper sidebar-item">

src/app/admin/admin-sidebar/admin-sidebar.component.scss

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@
5656
padding-bottom: var(--ds-admin-sidebar-item-padding);
5757
}
5858

59+
// Remove vertical padding from the wrapper and apply it to the anchor
60+
// In case an anchor also has .sidebar-item, reset it to avoid double padding
61+
.sidebar-sub-level-item-list {
62+
.sidebar-item, .ds-menu-item.sidebar-item {
63+
padding-top: 0;
64+
padding-bottom: 0;
65+
}
66+
}
67+
5968
// These classes handle the collapsing behavior
6069
.sidebar-section-wrapper {
6170

@@ -133,8 +142,7 @@
133142
}
134143

135144
div#sidebar-collapse-toggle-container {
136-
.sidebar-collapsible-element-inner-wrapper {
137-
}
145+
background-color: var(--ds-admin-sidebar-header-bg);
138146
}
139147
}
140148
}

src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.scss

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,19 @@
33
list-style: none;
44
margin: 0;
55
padding: 0;
6-
::ng-deep .ds-menu-item {
7-
margin-left: var(--ds-admin-sidebar-section-indent);
6+
/* Make the entire sub-level row clickable by applying padding to the anchor */
7+
::ng-deep {
8+
/* Ensure anchors are full-width blocks */
9+
.ds-menu-item {
10+
display: block;
11+
width: 100%;
12+
padding-left: var(--ds-admin-sidebar-section-indent);
13+
}
14+
15+
.sidebar-item .ds-menu-item {
16+
padding-top: var(--ds-admin-sidebar-item-padding);
17+
padding-bottom: var(--ds-admin-sidebar-item-padding);
18+
}
819
}
920
}
1021

src/app/footer/footer.component.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
.n-coar {
3535
height: var(--ds-footer-n-coar-height);
3636
margin-bottom: 8.5px;
37+
filter: brightness(0) invert(1);
3738
}
3839

3940
@media screen and (min-width: map-get($grid-breakpoints, md)) {

src/app/home-page/home-page.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<ds-home-coar></ds-home-coar>
2-
<ds-home-news></ds-home-news>
1+
<!-- <ds-home-coar></ds-home-coar> -->
2+
<!-- <ds-home-news></ds-home-news> -->
33
@if (showDiscoverFilters) {
44
<ds-configuration-search-page
55
[sideBarWidth]="3"

src/app/login-page/login-page.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="container w-100 h-100">
22
<div class="text-center mt-5 row justify-content-center">
33
<div>
4-
<img class="mb-4 login-logo" src="assets/images/dspace-logo.svg" [alt]="'repository.image.logo' | translate">
4+
<img class="mb-4 login-logo" [src]="logoSrc" [alt]="'repository.image.logo' | translate">
55
<h1 class="h3 mb-0 fw-normal">{{"login.form.header" | translate}}</h1>
66
<ds-log-in
77
[isStandalonePage]="true"></ds-log-in>

src/app/login-page/login-page.component.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { of } from 'rxjs';
1212

1313
import { APP_DATA_SERVICES_MAP } from '../../config/app-config.interface';
1414
import { AuthService } from '../core/auth/auth.service';
15+
import { LocaleService } from '../core/locale/locale.service';
1516
import { XSRFService } from '../core/xsrf/xsrf.service';
1617
import { AuthServiceMock } from '../shared/mocks/auth.service.mock';
1718
import { ActivatedRouteStub } from '../shared/testing/active-router.stub';
@@ -42,6 +43,7 @@ describe('LoginPageComponent', () => {
4243
{ provide: AuthService, useValue: new AuthServiceMock() },
4344
{ provide: XSRFService, useValue: {} },
4445
{ provide: APP_DATA_SERVICES_MAP, useValue: {} },
46+
{ provide: LocaleService, useValue: { getCurrentLanguageCode: () => 'en' } },
4547
provideMockStore({}),
4648
],
4749
schemas: [NO_ERRORS_SCHEMA],

src/app/login-page/login-page.component.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
} from '../core/auth/auth.actions';
2525
import { AuthTokenInfo } from '../core/auth/models/auth-token-info.model';
2626
import { isAuthenticated } from '../core/auth/selectors';
27+
import { LocaleService } from '../core/locale/locale.service';
2728
import {
2829
hasValue,
2930
isNotEmpty,
@@ -51,21 +52,25 @@ export class LoginPageComponent implements OnDestroy, OnInit {
5152
*/
5253
sub: Subscription;
5354

55+
logoSrc: string;
56+
5457
/**
5558
* Initialize instance variables
5659
*
5760
* @param {ActivatedRoute} route
5861
* @param {Store<AppState>} store
5962
*/
6063
constructor(private route: ActivatedRoute,
61-
private store: Store<AppState>) {}
64+
private store: Store<AppState>,
65+
private localeService: LocaleService) {}
6266

6367
/**
6468
* Initialize instance variables
6569
*/
6670
ngOnInit() {
6771
const queryParamsObs = this.route.queryParams;
6872
const authenticated = this.store.select(isAuthenticated);
73+
this.setLogo();
6974
this.sub = observableCombineLatest(queryParamsObs, authenticated).pipe(
7075
filter(([params, auth]) => isNotEmpty(params.token) || isNotEmpty(params.expired)),
7176
take(1),
@@ -87,6 +92,11 @@ export class LoginPageComponent implements OnDestroy, OnInit {
8792
}
8893
});
8994
}
95+
setLogo() {
96+
this.logoSrc = this.localeService.getCurrentLanguageCode() === 'cs'
97+
? '/assets/images/mendel-uni-logo-cs.svg'
98+
: '/assets/images/mendel-uni-logo-en.svg';
99+
}
90100

91101
/**
92102
* Unsubscribe from subscription

0 commit comments

Comments
 (0)