Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
57 changes: 57 additions & 0 deletions .github/workflows/docker-ksul.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# DSpace Docker image build for hub.docker.com
name: Docker images

# Run this Build for all pushes to 'main' or maintenance branches, or tagged releases.
# Also run for PRs to ensure PR doesn't break Docker build process
# NOTE: uses "reusable-docker-build.yml" in kstatelibraries/kstatelibraries to
# actually build each of the Docker images
# https://github.com/kstatelibraries/kstatelibraries/blob/main/.github/workflows/reusable-docker-build.yml
#
on:
push:
branches:
- 'ksul_dspace-**'
tags:
- 'ksul_dspace-**'
pull_request:

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
#############################################################
# Build/Push the 'kstatelibraries/krex-dspace-angular' image
#############################################################
krex-dspace-angular:
# Ensure this job never runs on forked repos. It's only executed for 'kstatelibraries/dspace-angular'
if: github.repository == 'kstatelibraries/dspace-angular'
# Use the reusable-docker-build.yml script from kstatelibraries/kstatelibraries repo to build our Docker image
uses: kstatelibraries/.github/.github/workflows/reusable-docker-build.yml@main
with:
build_id: dspace-dspace-angular-dev
image_name: kstatelibraries/krex-dspace-angular
dockerfile_path: ./Dockerfile
arch_matrix: "[ 'linux/amd64' ]"
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }}

#############################################################
# Build/Push the 'kstatelibraries/krex-dspace-angular' image ('-dist' tag)
#############################################################
krex-dspace-angular-dist:
# Ensure this job never runs on forked repos. It's only executed for 'kstatelibraries/dspace-angular'
if: github.repository == 'kstatelibraries/dspace-angular'
# Use the reusable-docker-build.yml script from kstatelibraries/kstatelibraries repo to build our Docker image
uses: kstatelibraries/.github/.github/workflows/reusable-docker-build.yml@main
with:
build_id: krex-dspace-angular-dist
image_name: kstatelibraries/krex-dspace-angular
dockerfile_path: ./Dockerfile.dist
arch_matrix: "[ 'linux/amd64' ]"
# As this is a "dist" image, its tags are all suffixed with "-dist". Otherwise, it uses the same
# tagging logic as the primary 'kstatelibraries/krex-dspace-angular' image above.
tags_flavor: suffix=-dist
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }}
File renamed without changes.
10 changes: 10 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@
"inject": false,
"bundleName": "dspace-theme"
},
{
"input": "src/themes/krex/styles/theme.scss",
"inject": false,
"bundleName": "krex-theme"
},
{
"input": "src/themes/etdr/styles/theme.scss",
"inject": false,
"bundleName": "etdr-theme"
},
"node_modules/leaflet/dist/leaflet.css",
"node_modules/leaflet.markercluster/dist/MarkerCluster.Default.css",
"node_modules/leaflet.markercluster/dist/MarkerCluster.css"
Expand Down
4 changes: 4 additions & 0 deletions config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ rest:
host: sandbox.dspace.org
port: 443
nameSpace: /server

themes:
- name: krex
extends: dspace
8 changes: 4 additions & 4 deletions src/app/item-page/full/full-item-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<div class="item-page" @fadeInOut>
@if (itemRD?.payload; as item) {
<div>
<ds-item-alerts [item]="item"></ds-item-alerts>
<ds-item-versions-notice [item]="item"></ds-item-versions-notice>
<!-- <ds-item-alerts [item]="item"></ds-item-alerts> -->
<!-- <ds-item-versions-notice [item]="item"></ds-item-versions-notice> -->
@if (!item.isWithdrawn || (isAdmin$|async)) {
<div class="full-item-info">
<div class="d-flex flex-row">
<ds-item-page-title-field class="me-auto" [item]="item"></ds-item-page-title-field>
<ds-dso-edit-menu></ds-dso-edit-menu>
<!-- <ds-item-page-title-field class="me-auto" [item]="item"></ds-item-page-title-field> -->
<!-- <ds-dso-edit-menu></ds-dso-edit-menu> -->
</div>
@if (!fromSubmissionObject) {
<div class="simple-view-link my-3">
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/auth-nav-menu/auth-nav-menu.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
role="dialog"
aria-modal="true"
[attr.aria-label]="'nav.login' | translate">
<ds-log-in
<ds-log-in [allowedAuthMethods]="allowedAuthMethods"
[isStandalonePage]="false"></ds-log-in>
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/app/shared/auth-nav-menu/auth-nav-menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import { HostWindowService } from '../host-window.service';
import { ThemedLogInComponent } from '../log-in/themed-log-in.component';
import { BrowserOnlyPipe } from '../utils/browser-only.pipe';
import { ThemedUserMenuComponent } from './user-menu/themed-user-menu.component';
import { AuthMethodType } from 'src/app/core/auth/models/auth.method-type';

@Component({
selector: 'ds-base-auth-nav-menu',
Expand All @@ -75,6 +76,8 @@ export class AuthNavMenuComponent implements OnInit {
*/
public isAuthenticated$: Observable<boolean>;

public allowedAuthMethods: AuthMethodType[] = [AuthMethodType.Shibboleth];

/**
* True if the authentication is loading.
* @type {boolean}
Expand Down
22 changes: 15 additions & 7 deletions src/app/shared/log-in/log-in.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ import {
Store,
} from '@ngrx/store';
import { Observable } from 'rxjs';

import { map } from 'rxjs/operators'; // Imported map operator
import { AuthService } from '../../core/auth/auth.service';
import { AuthMethodsService } from '../../core/auth/auth-methods.service';
import { AuthMethod } from '../../core/auth/models/auth.method';
import { AuthMethodType } from '../../core/auth/models/auth.method-type';
import {
getAuthenticationError,
import { getAuthenticationError,
isAuthenticated,
isAuthenticationLoading,
} from '../../core/auth/selectors';
import { CoreState } from '../../core/core-state.model';
import { hasValue } from '../empty.util';
import { hasValue, isEmpty } from '../empty.util';
import { ThemedLoadingComponent } from '../loading/themed-loading.component';
import { LogInContainerComponent } from './container/log-in-container.component';
import { AUTH_METHOD_FOR_DECORATOR_MAP } from './methods/log-in.methods-decorator';
Expand All @@ -38,7 +37,6 @@ import { AUTH_METHOD_FOR_DECORATOR_MAP } from './methods/log-in.methods-decorato
],
})
export class LogInComponent implements OnInit {

/**
* A boolean representing if LogInComponent is in a standalone page
* @type {boolean}
Expand All @@ -54,9 +52,14 @@ export class LogInComponent implements OnInit {
*/
@Input() showRegisterLink = true;

/**
* Specific methods allowed to be rendered (empty array allows all)
*/
@Input() allowedAuthMethods: AuthMethodType[] = [];

/**
* The list of authentication methods available
* @type {AuthMethod[]}
* @type {Observable<AuthMethod[]>}
*/
public authMethods: Observable<AuthMethod[]>;

Expand All @@ -79,7 +82,12 @@ export class LogInComponent implements OnInit {
}

ngOnInit(): void {
this.authMethods = this.authMethodsService.getAuthMethods(AUTH_METHOD_FOR_DECORATOR_MAP, this.excludedAuthMethod);
// KSUl-MODIFICATION Fetch backend methods and map-filter them based on allowedAuthMethods rules
this.authMethods = this.authMethodsService.getAuthMethods(AUTH_METHOD_FOR_DECORATOR_MAP, this.excludedAuthMethod).pipe(
map((methods: AuthMethod[]) => methods.filter((authMethod: AuthMethod) =>
isEmpty(this.allowedAuthMethods) || this.allowedAuthMethods.includes(authMethod.authMethodType)
))
);

// set loading
this.loading = this.store.pipe(select(isAuthenticationLoading));
Expand Down
7 changes: 4 additions & 3 deletions src/app/shared/log-in/themed-log-in.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import {
Component,
Input,
} from '@angular/core';
Expand All @@ -15,15 +15,16 @@ import { LogInComponent } from './log-in.component';
templateUrl: './../theme-support/themed.component.html',
})
export class ThemedLogInComponent extends ThemedComponent<LogInComponent> {

@Input() isStandalonePage: boolean;

@Input() excludedAuthMethod: AuthMethodType;

@Input() allowedAuthMethods: AuthMethodType[] = []; // Added allowed array input

@Input() showRegisterLink: boolean;

protected inAndOutputNames: (keyof LogInComponent & keyof this)[] = [
'isStandalonePage', 'excludedAuthMethod', 'showRegisterLink',
'isStandalonePage', 'excludedAuthMethod', 'allowedAuthMethods', 'showRegisterLink',
];

protected getComponentName(): string {
Expand Down
Loading
Loading