Moved showAccessStatus from UI to item config

Renamed item-page to item to make it generic
This commit is contained in:
nibou230
2022-05-04 11:17:25 -04:00
parent 9f50b4997c
commit 2b77e4a90d
10 changed files with 28 additions and 29 deletions

View File

@@ -13,8 +13,6 @@ ui:
rateLimiter: rateLimiter:
windowMs: 60000 # 1 minute windowMs: 60000 # 1 minute
max: 500 # limit each IP to 500 requests per windowMs max: 500 # limit each IP to 500 requests per windowMs
# Show the file access status in items lists
showAccessStatuses: false
# The REST API server settings # The REST API server settings
# NOTE: these must be 'synced' with the 'dspace.server.url' setting in your backend's local.cfg. # NOTE: these must be 'synced' with the 'dspace.server.url' setting in your backend's local.cfg.
@@ -163,10 +161,12 @@ browseBy:
# The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items) # The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items)
defaultLowerLimit: 1900 defaultLowerLimit: 1900
# Item Page Config # Item Config
item: item:
edit: edit:
undoTimeout: 10000 # 10 seconds undoTimeout: 10000 # 10 seconds
# Show the item access status label in items lists
showAccessStatuses: false
# Collection Page Config # Collection Page Config
collection: collection:

View File

@@ -32,6 +32,6 @@ export class ItemSearchResultGridElementComponent extends SearchResultGridElemen
ngOnInit(): void { ngOnInit(): void {
super.ngOnInit(); super.ngOnInit();
this.itemPageRoute = getItemPageRoute(this.dso); this.itemPageRoute = getItemPageRoute(this.dso);
this.showAccessStatus = environment.ui.showAccessStatuses; this.showAccessStatus = environment.item.showAccessStatuses;
} }
} }

View File

@@ -43,6 +43,6 @@ export class ItemListPreviewComponent {
showAccessStatus: boolean; showAccessStatus: boolean;
ngOnInit(): void { ngOnInit(): void {
this.showAccessStatus = environment.ui.showAccessStatuses; this.showAccessStatus = environment.item.showAccessStatuses;
} }
} }

View File

@@ -30,6 +30,6 @@ export class ItemSearchResultListElementComponent extends SearchResultListElemen
ngOnInit(): void { ngOnInit(): void {
super.ngOnInit(); super.ngOnInit();
this.itemPageRoute = getItemPageRoute(this.dso); this.itemPageRoute = getItemPageRoute(this.dso);
this.showAccessStatus = environment.ui.showAccessStatuses; this.showAccessStatus = environment.item.showAccessStatuses;
} }
} }

View File

@@ -7,7 +7,7 @@ import { INotificationBoardOptions } from './notifications-config.interfaces';
import { SubmissionConfig } from './submission-config.interface'; import { SubmissionConfig } from './submission-config.interface';
import { FormConfig } from './form-config.interfaces'; import { FormConfig } from './form-config.interfaces';
import { LangConfig } from './lang-config.interface'; import { LangConfig } from './lang-config.interface';
import { ItemPageConfig } from './item-page-config.interface'; import { ItemConfig } from './item-config.interface';
import { CollectionPageConfig } from './collection-page-config.interface'; import { CollectionPageConfig } from './collection-page-config.interface';
import { ThemeConfig } from './theme.model'; import { ThemeConfig } from './theme.model';
import { AuthConfig } from './auth-config.interfaces'; import { AuthConfig } from './auth-config.interfaces';
@@ -28,7 +28,7 @@ interface AppConfig extends Config {
defaultLanguage: string; defaultLanguage: string;
languages: LangConfig[]; languages: LangConfig[];
browseBy: BrowseByConfig; browseBy: BrowseByConfig;
item: ItemPageConfig; item: ItemConfig;
collection: CollectionPageConfig; collection: CollectionPageConfig;
themes: ThemeConfig[]; themes: ThemeConfig[];
mediaViewer: MediaViewerConfig; mediaViewer: MediaViewerConfig;

View File

@@ -6,7 +6,7 @@ import { BrowseByConfig } from './browse-by-config.interface';
import { CacheConfig } from './cache-config.interface'; import { CacheConfig } from './cache-config.interface';
import { CollectionPageConfig } from './collection-page-config.interface'; import { CollectionPageConfig } from './collection-page-config.interface';
import { FormConfig } from './form-config.interfaces'; import { FormConfig } from './form-config.interfaces';
import { ItemPageConfig } from './item-page-config.interface'; import { ItemConfig } from './item-config.interface';
import { LangConfig } from './lang-config.interface'; import { LangConfig } from './lang-config.interface';
import { MediaViewerConfig } from './media-viewer-config.interface'; import { MediaViewerConfig } from './media-viewer-config.interface';
import { INotificationBoardOptions } from './notifications-config.interfaces'; import { INotificationBoardOptions } from './notifications-config.interfaces';
@@ -34,10 +34,7 @@ export class DefaultAppConfig implements AppConfig {
rateLimiter: { rateLimiter: {
windowMs: 1 * 60 * 1000, // 1 minute windowMs: 1 * 60 * 1000, // 1 minute
max: 500 // limit each IP to 500 requests per windowMs max: 500 // limit each IP to 500 requests per windowMs
}, }
// Show the file access status in items lists
showAccessStatuses: false
}; };
// The REST API server settings // The REST API server settings
@@ -199,11 +196,13 @@ export class DefaultAppConfig implements AppConfig {
defaultLowerLimit: 1900 defaultLowerLimit: 1900
}; };
// Item Page Config // Item Config
item: ItemPageConfig = { item: ItemConfig = {
edit: { edit: {
undoTimeout: 10000 // 10 seconds undoTimeout: 10000 // 10 seconds
} },
// Show the item access status label in items lists
showAccessStatuses: false
}; };
// Collection Page Config // Collection Page Config

View File

@@ -0,0 +1,9 @@
import { Config } from './config.interface';
export interface ItemConfig extends Config {
edit: {
undoTimeout: number;
};
// This is used to show the access status label of items in results lists
showAccessStatuses: boolean;
}

View File

@@ -1,7 +0,0 @@
import { Config } from './config.interface';
export interface ItemPageConfig extends Config {
edit: {
undoTimeout: number;
};
}

View File

@@ -10,7 +10,5 @@ export class UIServerConfig extends ServerConfig {
windowMs: number; windowMs: number;
max: number; max: number;
}; };
// This section is used to show the access status of items in results lists
showAccessStatuses: boolean;
} }

View File

@@ -25,9 +25,7 @@ export const environment: BuildConfig = {
rateLimiter: { rateLimiter: {
windowMs: 1 * 60 * 1000, // 1 minute windowMs: 1 * 60 * 1000, // 1 minute
max: 500 // limit each IP to 500 requests per windowMs max: 500 // limit each IP to 500 requests per windowMs
}, }
// Show the file access status in items lists
showAccessStatuses: false
}, },
// The REST API server settings. // The REST API server settings.
@@ -198,7 +196,9 @@ export const environment: BuildConfig = {
item: { item: {
edit: { edit: {
undoTimeout: 10000 // 10 seconds undoTimeout: 10000 // 10 seconds
} },
// Show the item access status label in items lists
showAccessStatuses: false
}, },
collection: { collection: {
edit: { edit: {