mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 07:23:03 +00:00
Merge branch 'main' into w2p-92701_issue-1506-gdpr-privacy-config
# Conflicts: # src/app/info/info-routing.module.ts # src/config/app-config.interface.ts # src/config/default-app-config.ts # src/environments/environment.test.ts
This commit is contained in:
5
src/environments/.gitignore
vendored
Normal file
5
src/environments/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
environment.*.ts
|
||||
|
||||
!environment.production.ts
|
||||
!environment.test.ts
|
||||
!environment.ts
|
@@ -1,292 +0,0 @@
|
||||
import { GlobalConfig } from '../config/global-config.interface';
|
||||
import { NotificationAnimationsType } from '../app/shared/notifications/models/notification-animations-type';
|
||||
import { BrowseByType } from '../app/browse-by/browse-by-switcher/browse-by-decorator';
|
||||
import { RestRequestMethod } from '../app/core/data/rest-request-method';
|
||||
|
||||
export const environment: GlobalConfig = {
|
||||
production: true,
|
||||
// Angular Universal server settings.
|
||||
// NOTE: these must be "synced" with the 'dspace.ui.url' setting in your backend's local.cfg.
|
||||
ui: {
|
||||
ssl: false,
|
||||
host: 'localhost',
|
||||
port: 4000,
|
||||
// NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
|
||||
nameSpace: '/',
|
||||
// The rateLimiter settings limit each IP to a "max" of 500 requests per "windowMs" (1 minute).
|
||||
rateLimiter: {
|
||||
windowMs: 1 * 60 * 1000, // 1 minute
|
||||
max: 500 // limit each IP to 500 requests per windowMs
|
||||
}
|
||||
},
|
||||
// The REST API server settings.
|
||||
// NOTE: these must be "synced" with the 'dspace.server.url' setting in your backend's local.cfg.
|
||||
rest: {
|
||||
ssl: true,
|
||||
host: 'api7.dspace.org',
|
||||
port: 443,
|
||||
// NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
|
||||
nameSpace: '/server',
|
||||
},
|
||||
// Caching settings
|
||||
cache: {
|
||||
// NOTE: how long should objects be cached for by default
|
||||
msToLive: {
|
||||
default: 15 * 60 * 1000, // 15 minutes
|
||||
},
|
||||
// msToLive: 1000, // 15 minutes
|
||||
control: 'max-age=60', // revalidate browser
|
||||
autoSync: {
|
||||
defaultTime: 0,
|
||||
maxBufferSize: 100,
|
||||
timePerMethod: {[RestRequestMethod.PATCH]: 3} as any // time in seconds
|
||||
}
|
||||
},
|
||||
// Authentication settings
|
||||
auth: {
|
||||
// Authentication UI settings
|
||||
ui: {
|
||||
// the amount of time before the idle warning is shown
|
||||
timeUntilIdle: 15 * 60 * 1000, // 15 minutes
|
||||
// the amount of time the user has to react after the idle warning is shown before they are logged out.
|
||||
idleGracePeriod: 5 * 60 * 1000, // 5 minutes
|
||||
},
|
||||
// Authentication REST settings
|
||||
rest: {
|
||||
// If the rest token expires in less than this amount of time, it will be refreshed automatically.
|
||||
// This is independent from the idle warning.
|
||||
timeLeftBeforeTokenRefresh: 2 * 60 * 1000, // 2 minutes
|
||||
},
|
||||
},
|
||||
// Form settings
|
||||
form: {
|
||||
// NOTE: Map server-side validators to comparative Angular form validators
|
||||
validatorMap: {
|
||||
required: 'required',
|
||||
regex: 'pattern'
|
||||
}
|
||||
},
|
||||
// Notifications
|
||||
notifications: {
|
||||
rtl: false,
|
||||
position: ['top', 'right'],
|
||||
maxStack: 8,
|
||||
// NOTE: after how many seconds notification is closed automatically. If set to zero notifications are not closed automatically
|
||||
timeOut: 5000, // 5 second
|
||||
clickToClose: true,
|
||||
// NOTE: 'fade' | 'fromTop' | 'fromRight' | 'fromBottom' | 'fromLeft' | 'rotate' | 'scale'
|
||||
animate: NotificationAnimationsType.Scale
|
||||
},
|
||||
// Submission settings
|
||||
submission: {
|
||||
autosave: {
|
||||
// NOTE: which metadata trigger an autosave
|
||||
metadata: [],
|
||||
/**
|
||||
* NOTE: after how many time (milliseconds) submission is saved automatically
|
||||
* eg. timer: 5 * (1000 * 60); // 5 minutes
|
||||
*/
|
||||
timer: 0
|
||||
},
|
||||
icons: {
|
||||
metadata: [
|
||||
/**
|
||||
* NOTE: example of configuration
|
||||
* {
|
||||
* // NOTE: metadata name
|
||||
* name: 'dc.author',
|
||||
* // NOTE: fontawesome (v5.x) icon classes and bootstrap utility classes can be used
|
||||
* style: 'fa-user'
|
||||
* }
|
||||
*/
|
||||
{
|
||||
name: 'dc.author',
|
||||
style: 'fas fa-user'
|
||||
},
|
||||
// default configuration
|
||||
{
|
||||
name: 'default',
|
||||
style: ''
|
||||
}
|
||||
],
|
||||
authority: {
|
||||
confidence: [
|
||||
/**
|
||||
* NOTE: example of configuration
|
||||
* {
|
||||
* // NOTE: confidence value
|
||||
* value: 'dc.author',
|
||||
* // NOTE: fontawesome (v4.x) icon classes and bootstrap utility classes can be used
|
||||
* style: 'fa-user'
|
||||
* }
|
||||
*/
|
||||
{
|
||||
value: 600,
|
||||
style: 'text-success'
|
||||
},
|
||||
{
|
||||
value: 500,
|
||||
style: 'text-info'
|
||||
},
|
||||
{
|
||||
value: 400,
|
||||
style: 'text-warning'
|
||||
},
|
||||
// default configuration
|
||||
{
|
||||
value: 'default',
|
||||
style: 'text-muted'
|
||||
},
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
// Angular Universal settings
|
||||
universal: {
|
||||
preboot: true,
|
||||
async: true,
|
||||
time: false
|
||||
},
|
||||
// NOTE: will log all redux actions and transfers in console
|
||||
debug: false,
|
||||
// Default Language in which the UI will be rendered if the user's browser language is not an active language
|
||||
defaultLanguage: 'en',
|
||||
// Languages. DSpace Angular holds a message catalog for each of the following languages.
|
||||
// When set to active, users will be able to switch to the use of this language in the user interface.
|
||||
languages: [{
|
||||
code: 'en',
|
||||
label: 'English',
|
||||
active: true,
|
||||
}, {
|
||||
code: 'de',
|
||||
label: 'Deutsch',
|
||||
active: true,
|
||||
}, {
|
||||
code: 'cs',
|
||||
label: 'Čeština',
|
||||
active: true,
|
||||
}, {
|
||||
code: 'nl',
|
||||
label: 'Nederlands',
|
||||
active: true,
|
||||
},{
|
||||
code: 'pt-BR',
|
||||
label: 'Português do Brasil',
|
||||
active: true,
|
||||
},{
|
||||
code: 'pt-PT',
|
||||
label: 'Português',
|
||||
active: true,
|
||||
}, {
|
||||
code: 'fr',
|
||||
label: 'Français',
|
||||
active: true,
|
||||
}, {
|
||||
code: 'lv',
|
||||
label: 'Latviešu',
|
||||
active: true,
|
||||
},{
|
||||
code: 'fi',
|
||||
label: 'Suomi',
|
||||
active: true,
|
||||
},{
|
||||
code: 'hu',
|
||||
label: 'magyar',
|
||||
active: true,
|
||||
}],
|
||||
// Browse-By Pages
|
||||
browseBy: {
|
||||
// Amount of years to display using jumps of one year (current year - oneYearLimit)
|
||||
oneYearLimit: 10,
|
||||
// Limit for years to display using jumps of five years (current year - fiveYearLimit)
|
||||
fiveYearLimit: 30,
|
||||
// The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items)
|
||||
defaultLowerLimit: 1900,
|
||||
// List of all the active Browse-By types
|
||||
// Adding a type will activate their Browse-By page and add them to the global navigation menu,
|
||||
// as well as community and collection pages
|
||||
// Allowed fields and their purpose:
|
||||
// id: The browse id to use for fetching info from the rest api
|
||||
// type: The type of Browse-By page to display
|
||||
// metadataField: The metadata-field used to create starts-with options (only necessary when the type is set to 'date')
|
||||
types: [
|
||||
{
|
||||
id: 'title',
|
||||
type: BrowseByType.Title,
|
||||
},
|
||||
{
|
||||
id: 'dateissued',
|
||||
type: BrowseByType.Date,
|
||||
metadataField: 'dc.date.issued'
|
||||
},
|
||||
{
|
||||
id: 'author',
|
||||
type: BrowseByType.Metadata
|
||||
},
|
||||
{
|
||||
id: 'subject',
|
||||
type: BrowseByType.Metadata
|
||||
}
|
||||
]
|
||||
},
|
||||
item: {
|
||||
edit: {
|
||||
undoTimeout: 10000 // 10 seconds
|
||||
}
|
||||
},
|
||||
collection: {
|
||||
edit: {
|
||||
undoTimeout: 10000 // 10 seconds
|
||||
}
|
||||
},
|
||||
themes: [
|
||||
// Add additional themes here. In the case where multiple themes match a route, the first one
|
||||
// in this list will get priority. It is advisable to always have a theme that matches
|
||||
// every route as the last one
|
||||
|
||||
// {
|
||||
// // A theme with a handle property will match the community, collection or item with the given
|
||||
// // handle, and all collections and/or items within it
|
||||
// name: 'custom',
|
||||
// handle: '10673/1233'
|
||||
// },
|
||||
// {
|
||||
// // A theme with a regex property will match the route using a regular expression. If it
|
||||
// // matches the route for a community or collection it will also apply to all collections
|
||||
// // and/or items within it
|
||||
// name: 'custom',
|
||||
// regex: 'collections\/e8043bc2.*'
|
||||
// },
|
||||
// {
|
||||
// // A theme with a uuid property will match the community, collection or item with the given
|
||||
// // ID, and all collections and/or items within it
|
||||
// name: 'custom',
|
||||
// uuid: '0958c910-2037-42a9-81c7-dca80e3892b4'
|
||||
// },
|
||||
// {
|
||||
// // A theme with only a name will match every route
|
||||
// name: 'custom'
|
||||
// },
|
||||
// {
|
||||
// // This theme will use the default bootstrap styling for DSpace components
|
||||
// name: BASE_THEME_NAME
|
||||
// },
|
||||
|
||||
{
|
||||
// The default dspace theme
|
||||
name: 'dspace'
|
||||
},
|
||||
],
|
||||
// Whether to enable media viewer for image and/or video Bitstreams (i.e. Bitstreams whose MIME type starts with "image" or "video").
|
||||
// For images, this enables a gallery viewer where you can zoom or page through images.
|
||||
// For videos, this enables embedded video streaming
|
||||
mediaViewer: {
|
||||
image: false,
|
||||
video: false,
|
||||
},
|
||||
info: {
|
||||
enableEndUserAgreement: false,
|
||||
enablePrivacyStatement: false
|
||||
},
|
||||
};
|
12
src/environments/environment.production.ts
Normal file
12
src/environments/environment.production.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { BuildConfig } from '../config/build-config.interface';
|
||||
|
||||
export const environment: Partial<BuildConfig> = {
|
||||
production: true,
|
||||
|
||||
// Angular Universal settings
|
||||
universal: {
|
||||
preboot: true,
|
||||
async: true,
|
||||
time: false
|
||||
}
|
||||
};
|
@@ -1,10 +0,0 @@
|
||||
export const environment = {
|
||||
/**
|
||||
* TODO add the sections from environment.common.ts you want to override here
|
||||
* e.g.
|
||||
* rest: {
|
||||
* host: 'rest.api',
|
||||
* nameSpace: '/rest',
|
||||
* }
|
||||
*/
|
||||
};
|
@@ -1,46 +1,69 @@
|
||||
// This configuration is only used for unit tests, end-to-end tests use environment.prod.ts
|
||||
import { BrowseByType } from '../app/browse-by/browse-by-switcher/browse-by-decorator';
|
||||
// This configuration is only used for unit tests, end-to-end tests use environment.production.ts
|
||||
import { BuildConfig } from 'src/config/build-config.interface';
|
||||
import { RestRequestMethod } from '../app/core/data/rest-request-method';
|
||||
import { NotificationAnimationsType } from '../app/shared/notifications/models/notification-animations-type';
|
||||
import { GlobalConfig } from '../config/global-config.interface';
|
||||
|
||||
export const environment: Partial<GlobalConfig> = {
|
||||
rest: {
|
||||
ssl: true,
|
||||
host: 'rest.com',
|
||||
port: 443,
|
||||
// NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
|
||||
nameSpace: '/api',
|
||||
baseUrl: 'https://rest.api/'
|
||||
export const environment: BuildConfig = {
|
||||
production: false,
|
||||
|
||||
// Angular Universal settings
|
||||
universal: {
|
||||
preboot: true,
|
||||
async: true,
|
||||
time: false
|
||||
},
|
||||
|
||||
// Angular Universal server settings.
|
||||
ui: {
|
||||
ssl: false,
|
||||
host: 'dspace.com',
|
||||
port: 80,
|
||||
// NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
|
||||
nameSpace: '/angular-dspace',
|
||||
rateLimiter: undefined
|
||||
baseUrl: 'http://dspace.com/angular-dspace',
|
||||
// The rateLimiter settings limit each IP to a 'max' of 500 requests per 'windowMs' (1 minute).
|
||||
rateLimiter: {
|
||||
windowMs: 1 * 60 * 1000, // 1 minute
|
||||
max: 500 // limit each IP to 500 requests per windowMs
|
||||
}
|
||||
},
|
||||
// Caching settings
|
||||
|
||||
// The REST API server settings.
|
||||
rest: {
|
||||
ssl: true,
|
||||
host: 'rest.com',
|
||||
port: 443,
|
||||
// NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
|
||||
nameSpace: '/api',
|
||||
baseUrl: 'https://rest.com/api'
|
||||
},
|
||||
|
||||
actuators: {
|
||||
endpointPath: '/actuator/health'
|
||||
},
|
||||
|
||||
// Caching settings
|
||||
cache: {
|
||||
// NOTE: how long should objects be cached for by default
|
||||
msToLive: {
|
||||
default: 15 * 60 * 1000, // 15 minutes
|
||||
},
|
||||
// msToLive: 1000, // 15 minutes
|
||||
control: 'max-age=60', // revalidate browser
|
||||
control: 'max-age=60',
|
||||
autoSync: {
|
||||
defaultTime: 0,
|
||||
maxBufferSize: 100,
|
||||
timePerMethod: {[RestRequestMethod.PATCH]: 3} as any // time in seconds
|
||||
timePerMethod: { [RestRequestMethod.PATCH]: 3 } as any // time in seconds
|
||||
}
|
||||
},
|
||||
|
||||
// Authentication settings
|
||||
auth: {
|
||||
// Authentication UI settings
|
||||
ui: {
|
||||
// the amount of time before the idle warning is shown
|
||||
timeUntilIdle: 20000, // 20 sec
|
||||
timeUntilIdle: 20000,
|
||||
|
||||
// the amount of time the user has to react after the idle warning is shown before they are logged out.
|
||||
idleGracePeriod: 20000, // 20 sec
|
||||
},
|
||||
@@ -51,6 +74,7 @@ export const environment: Partial<GlobalConfig> = {
|
||||
timeLeftBeforeTokenRefresh: 20000, // 20 sec
|
||||
},
|
||||
},
|
||||
|
||||
// Form settings
|
||||
form: {
|
||||
// NOTE: Map server-side validators to comparative Angular form validators
|
||||
@@ -59,17 +83,19 @@ export const environment: Partial<GlobalConfig> = {
|
||||
regex: 'pattern'
|
||||
}
|
||||
},
|
||||
|
||||
// Notifications
|
||||
notifications: {
|
||||
rtl: false,
|
||||
position: ['top', 'right'],
|
||||
maxStack: 8,
|
||||
// NOTE: after how many seconds notification is closed automatically. If set to zero notifications are not closed automatically
|
||||
timeOut: 5000, // 5 second
|
||||
timeOut: 5000,
|
||||
clickToClose: true,
|
||||
// NOTE: 'fade' | 'fromTop' | 'fromRight' | 'fromBottom' | 'fromLeft' | 'rotate' | 'scale'
|
||||
animate: NotificationAnimationsType.Scale
|
||||
},
|
||||
|
||||
// Submission settings
|
||||
submission: {
|
||||
autosave: {
|
||||
@@ -78,6 +104,9 @@ export const environment: Partial<GlobalConfig> = {
|
||||
// NOTE: every how many minutes submission is saved automatically
|
||||
timer: 5
|
||||
},
|
||||
typeBind: {
|
||||
field: 'dc.type'
|
||||
},
|
||||
icons: {
|
||||
metadata: [
|
||||
{
|
||||
@@ -115,21 +144,17 @@ export const environment: Partial<GlobalConfig> = {
|
||||
value: 'default',
|
||||
style: 'text-muted'
|
||||
},
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
// Angular Universal settings
|
||||
universal: {
|
||||
preboot: true,
|
||||
async: true,
|
||||
time: false
|
||||
},
|
||||
|
||||
// NOTE: will log all redux actions and transfers in console
|
||||
debug: false,
|
||||
|
||||
// Default Language in which the UI will be rendered if the user's browser language is not an active language
|
||||
defaultLanguage: 'en',
|
||||
|
||||
// Languages. DSpace Angular holds a message catalog for each of the following languages.
|
||||
// When set to active, users will be able to switch to the use of this language in the user interface.
|
||||
languages: [{
|
||||
@@ -160,7 +185,12 @@ export const environment: Partial<GlobalConfig> = {
|
||||
code: 'lv',
|
||||
label: 'Latviešu',
|
||||
active: true,
|
||||
}, {
|
||||
code: 'bn',
|
||||
label: 'বাংলা',
|
||||
active: true,
|
||||
}],
|
||||
|
||||
// Browse-By Pages
|
||||
browseBy: {
|
||||
// Amount of years to display using jumps of one year (current year - oneYearLimit)
|
||||
@@ -169,37 +199,13 @@ export const environment: Partial<GlobalConfig> = {
|
||||
fiveYearLimit: 30,
|
||||
// The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items)
|
||||
defaultLowerLimit: 1900,
|
||||
// List of all the active Browse-By types
|
||||
// Adding a type will activate their Browse-By page and add them to the global navigation menu,
|
||||
// as well as community and collection pages
|
||||
// Allowed fields and their purpose:
|
||||
// id: The browse id to use for fetching info from the rest api
|
||||
// type: The type of Browse-By page to display
|
||||
// metadataField: The metadata-field used to create starts-with options (only necessary when the type is set to 'date')
|
||||
types: [
|
||||
{
|
||||
id: 'title',
|
||||
type: BrowseByType.Title,
|
||||
},
|
||||
{
|
||||
id: 'dateissued',
|
||||
type: BrowseByType.Date,
|
||||
metadataField: 'dc.date.issued'
|
||||
},
|
||||
{
|
||||
id: 'author',
|
||||
type: BrowseByType.Metadata
|
||||
},
|
||||
{
|
||||
id: 'subject',
|
||||
type: BrowseByType.Metadata
|
||||
}
|
||||
]
|
||||
},
|
||||
item: {
|
||||
edit: {
|
||||
undoTimeout: 10000 // 10 seconds
|
||||
}
|
||||
},
|
||||
// Show the item access status label in items lists
|
||||
showAccessStatuses: false
|
||||
},
|
||||
collection: {
|
||||
edit: {
|
||||
@@ -231,6 +237,9 @@ export const environment: Partial<GlobalConfig> = {
|
||||
name: 'base',
|
||||
},
|
||||
],
|
||||
bundle: {
|
||||
standardBundles: ['ORIGINAL', 'THUMBNAIL', 'LICENSE'],
|
||||
},
|
||||
mediaViewer: {
|
||||
image: true,
|
||||
video: true
|
26
src/environments/environment.ts
Normal file
26
src/environments/environment.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
// This file can be replaced during build by using the `fileReplacements` array.
|
||||
// `ng build --configuration production` replaces `environment.ts` with `environment.production.ts`.
|
||||
// `ng test --configuration test` replaces `environment.ts` with `environment.test.ts`.
|
||||
// The list of file replacements can be found in `angular.json`.
|
||||
|
||||
import { BuildConfig } from '../config/build-config.interface';
|
||||
|
||||
export const environment: Partial<BuildConfig> = {
|
||||
production: false,
|
||||
|
||||
// Angular Universal settings
|
||||
universal: {
|
||||
preboot: false,
|
||||
async: true,
|
||||
time: false
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* For easier debugging in development mode, you can import the following file
|
||||
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
|
||||
*
|
||||
* This import should be commented out in production mode because it will have a negative impact
|
||||
* on performance if an error is thrown.
|
||||
*/
|
||||
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
|
Reference in New Issue
Block a user