mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
removed custom environment files and fixed config build
This commit is contained in:
@@ -7,7 +7,6 @@
|
|||||||
"config:prod": "ts-node --project ./tsconfig.ts-node.json scripts/set-env.ts --prod",
|
"config:prod": "ts-node --project ./tsconfig.ts-node.json scripts/set-env.ts --prod",
|
||||||
"config:test": "ts-node --project ./tsconfig.ts-node.json scripts/set-env.ts --test",
|
"config:test": "ts-node --project ./tsconfig.ts-node.json scripts/set-env.ts --test",
|
||||||
"prestart:dev": "yarn run config:dev",
|
"prestart:dev": "yarn run config:dev",
|
||||||
"prestart:prod": "yarn run config:prod",
|
|
||||||
"prebuild": "yarn run config:dev",
|
"prebuild": "yarn run config:dev",
|
||||||
"pretest": "yarn run config:test",
|
"pretest": "yarn run config:test",
|
||||||
"pretest:headless": "yarn run config:test",
|
"pretest:headless": "yarn run config:test",
|
||||||
|
@@ -43,6 +43,7 @@ import(environmentFilePath)
|
|||||||
.catch(() => generateEnvironmentFile(merge(commonEnv, processEnv)));
|
.catch(() => generateEnvironmentFile(merge(commonEnv, processEnv)));
|
||||||
|
|
||||||
function generateEnvironmentFile(file: GlobalConfig): void {
|
function generateEnvironmentFile(file: GlobalConfig): void {
|
||||||
|
console.log(file);
|
||||||
buildBaseUrls(file);
|
buildBaseUrls(file);
|
||||||
const contents = `export const environment = ` + JSON.stringify(file);
|
const contents = `export const environment = ` + JSON.stringify(file);
|
||||||
console.log(colors.magenta('The file `environment.ts` will be written with the following content: \n'));
|
console.log(colors.magenta('The file `environment.ts` will be written with the following content: \n'));
|
||||||
@@ -54,12 +55,18 @@ function generateEnvironmentFile(file: GlobalConfig): void {
|
|||||||
console.log(colors.magenta(`Angular environment.ts file generated correctly at ${targetPath} \n`));
|
console.log(colors.magenta(`Angular environment.ts file generated correctly at ${targetPath} \n`));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log(file);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// allow to override a few important options by environment variables
|
// allow to override a few important options by environment variables
|
||||||
function createServerConfig(host?: string, port?: string, nameSpace?: string, ssl?: string): ServerConfig {
|
function createServerConfig(host?: string, port?: string, nameSpace?: string, ssl?: string): ServerConfig {
|
||||||
const result = { host, nameSpace } as any;
|
const result = {} as any;
|
||||||
|
if (hasValue(host)) {
|
||||||
|
result.host = host;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasValue(nameSpace)) {
|
||||||
|
result.host = nameSpace;
|
||||||
|
}
|
||||||
|
|
||||||
if (hasValue(port)) {
|
if (hasValue(port)) {
|
||||||
result.port = Number(port);
|
result.port = Number(port);
|
||||||
@@ -75,6 +82,8 @@ function createServerConfig(host?: string, port?: string, nameSpace?: string, s
|
|||||||
function buildBaseUrls(config: GlobalConfig): void {
|
function buildBaseUrls(config: GlobalConfig): void {
|
||||||
for (const key in config) {
|
for (const key in config) {
|
||||||
if (config.hasOwnProperty(key) && config[key].host) {
|
if (config.hasOwnProperty(key) && config[key].host) {
|
||||||
|
console.log(key);
|
||||||
|
console.log(config[key]);
|
||||||
config[key].baseUrl = [
|
config[key].baseUrl = [
|
||||||
getProtocol(config[key].ssl),
|
getProtocol(config[key].ssl),
|
||||||
getHost(config[key].host),
|
getHost(config[key].host),
|
||||||
|
@@ -3,7 +3,7 @@ import { NotificationAnimationsType } from './notification-animations-type';
|
|||||||
export interface INotificationOptions {
|
export interface INotificationOptions {
|
||||||
timeOut: number;
|
timeOut: number;
|
||||||
clickToClose: boolean;
|
clickToClose: boolean;
|
||||||
animate: NotificationAnimationsType;
|
animate: NotificationAnimationsType | string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class NotificationOptions implements INotificationOptions {
|
export class NotificationOptions implements INotificationOptions {
|
||||||
@@ -13,7 +13,7 @@ export class NotificationOptions implements INotificationOptions {
|
|||||||
|
|
||||||
constructor(timeOut = 5000,
|
constructor(timeOut = 5000,
|
||||||
clickToClose = true,
|
clickToClose = true,
|
||||||
animate = NotificationAnimationsType.Scale) {
|
animate: NotificationAnimationsType | string = NotificationAnimationsType.Scale) {
|
||||||
|
|
||||||
this.timeOut = timeOut;
|
this.timeOut = timeOut;
|
||||||
this.clickToClose = clickToClose;
|
this.clickToClose = clickToClose;
|
||||||
|
@@ -14,7 +14,7 @@ export interface BrowseByTypeConfig extends Config {
|
|||||||
/**
|
/**
|
||||||
* The type of Browse-By page to render
|
* The type of Browse-By page to render
|
||||||
*/
|
*/
|
||||||
type: BrowseByType;
|
type: BrowseByType | string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The metadata field to use for rendering starts-with options (only necessary when type is set to BrowseByType.Date)
|
* The metadata field to use for rendering starts-with options (only necessary when type is set to BrowseByType.Date)
|
||||||
|
@@ -1,5 +0,0 @@
|
|||||||
import { GlobalConfig } from '../config/global-config.interface';
|
|
||||||
|
|
||||||
export const environment: Partial<GlobalConfig> = {
|
|
||||||
production: false
|
|
||||||
};
|
|
@@ -1,4 +0,0 @@
|
|||||||
import { GlobalConfig } from '../config/global-config.interface';
|
|
||||||
|
|
||||||
export const environment: Partial<GlobalConfig> = {
|
|
||||||
};
|
|
@@ -1 +1 @@
|
|||||||
export const environment = {"production":true,"ui":{"ssl":false,"port":4000},"rest":{"ssl":true,"port":443},"cache":{"msToLive":{"default":900000},"control":"max-age=60","autoSync":{"defaultTime":0,"maxBufferSize":100,"timePerMethod":{"PATCH":3}}},"form":{"validatorMap":{"required":"required","regex":"pattern"}},"notifications":{"rtl":false,"position":["top","right"],"maxStack":8,"timeOut":5000,"clickToClose":true,"animate":"scale"},"submission":{"autosave":{"metadata":["dc.title","dc.identifier.doi","dc.identifier.pmid","dc.identifier.arxiv"],"timer":5},"icons":{"metadata":[{"name":"dc.author","style":"fas fa-user"},{"name":"default","style":""}],"authority":{"confidence":[{"value":600,"style":"text-success"},{"value":500,"style":"text-info"},{"value":400,"style":"text-warning"},{"value":"default","style":"text-muted"}]}}},"universal":{"preboot":true,"async":true,"time":false},"gaTrackingId":"","logDirectory":".","debug":false,"defaultLanguage":"en","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","label":"Português","active":true}],"browseBy":{"oneYearLimit":10,"fiveYearLimit":30,"defaultLowerLimit":1900,"types":[{"id":"title","type":"title"},{"id":"dateissued","type":"date","metadataField":"dc.date.issued"},{"id":"author","type":"metadata"},{"id":"subject","type":"metadata"}]},"item":{"edit":{"undoTimeout":10000}},"collection":{"edit":{"undoTimeout":10000}},"theme":{"name":"default"}}
|
export const environment = {"production":true,"ui":{"ssl":false,"host":"localhost","port":4000,"nameSpace":"/","baseUrl":"http://localhost:4000/"},"rest":{"ssl":true,"host":"dspace7.4science.cloud","port":443,"nameSpace":"/server/api","baseUrl":"https://dspace7.4science.cloud/server/api"},"cache":{"msToLive":{"default":900000},"control":"max-age=60","autoSync":{"defaultTime":0,"maxBufferSize":100,"timePerMethod":{"PATCH":3}}},"form":{"validatorMap":{"required":"required","regex":"pattern"}},"notifications":{"rtl":false,"position":["top","right"],"maxStack":8,"timeOut":5000,"clickToClose":true,"animate":"scale"},"submission":{"autosave":{"metadata":["dc.title","dc.identifier.doi","dc.identifier.pmid","dc.identifier.arxiv"],"timer":5},"icons":{"metadata":[{"name":"dc.author","style":"fas fa-user"},{"name":"default","style":""}],"authority":{"confidence":[{"value":600,"style":"text-success"},{"value":500,"style":"text-info"},{"value":400,"style":"text-warning"},{"value":"default","style":"text-muted"}]}}},"universal":{"preboot":true,"async":true,"time":false},"gaTrackingId":"","logDirectory":".","debug":false,"defaultLanguage":"en","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","label":"Português","active":true}],"browseBy":{"oneYearLimit":10,"fiveYearLimit":30,"defaultLowerLimit":1900,"types":[{"id":"title","type":"title"},{"id":"dateissued","type":"date","metadataField":"dc.date.issued"},{"id":"author","type":"metadata"},{"id":"subject","type":"metadata"}]},"item":{"edit":{"undoTimeout":10000}},"collection":{"edit":{"undoTimeout":10000}},"theme":{"name":"default"}}
|
Reference in New Issue
Block a user