mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
intermediate theming commit
This commit is contained in:
@@ -94,6 +94,7 @@
|
|||||||
"compression": "1.7.1",
|
"compression": "1.7.1",
|
||||||
"cookie-parser": "1.4.3",
|
"cookie-parser": "1.4.3",
|
||||||
"core-js": "^2.5.7",
|
"core-js": "^2.5.7",
|
||||||
|
"debug-loader": "^0.0.1",
|
||||||
"express": "4.16.2",
|
"express": "4.16.2",
|
||||||
"express-session": "1.15.6",
|
"express-session": "1.15.6",
|
||||||
"fast-json-patch": "^2.0.7",
|
"fast-json-patch": "^2.0.7",
|
||||||
|
@@ -24,6 +24,7 @@ import { isAuthenticated } from './core/auth/selectors';
|
|||||||
import { AuthService } from './core/auth/auth.service';
|
import { AuthService } from './core/auth/auth.service';
|
||||||
import { Angulartics2GoogleAnalytics } from 'angulartics2/ga';
|
import { Angulartics2GoogleAnalytics } from 'angulartics2/ga';
|
||||||
import { RouteService } from './shared/services/route.service';
|
import { RouteService } from './shared/services/route.service';
|
||||||
|
import global from '../styles/_variables.scss';
|
||||||
import variables from '../styles/_exposed_variables.scss';
|
import variables from '../styles/_exposed_variables.scss';
|
||||||
import { CSSVariableService } from './shared/sass-helper/sass-helper.service';
|
import { CSSVariableService } from './shared/sass-helper/sass-helper.service';
|
||||||
import { MenuService } from './shared/menu/menu.service';
|
import { MenuService } from './shared/menu/menu.service';
|
||||||
@@ -48,7 +49,7 @@ export class AppComponent implements OnInit, AfterViewInit {
|
|||||||
slideSidebarOver: Observable<boolean>;
|
slideSidebarOver: Observable<boolean>;
|
||||||
collapsedSidebarWidth: Observable<string>;
|
collapsedSidebarWidth: Observable<string>;
|
||||||
totalSidebarWidth: Observable<string>;
|
totalSidebarWidth: Observable<string>;
|
||||||
theme: Observable<Theme>= of({} as any);
|
theme: Observable<Theme> = of({} as any);
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(GLOBAL_CONFIG) public config: GlobalConfig,
|
@Inject(GLOBAL_CONFIG) public config: GlobalConfig,
|
||||||
@@ -64,7 +65,7 @@ export class AppComponent implements OnInit, AfterViewInit {
|
|||||||
private menuService: MenuService,
|
private menuService: MenuService,
|
||||||
private windowService: HostWindowService,
|
private windowService: HostWindowService,
|
||||||
) {
|
) {
|
||||||
|
console.log(global);
|
||||||
// Load all the languages that are defined as active from the config file
|
// Load all the languages that are defined as active from the config file
|
||||||
translate.addLangs(config.languages.filter((LangConfig) => LangConfig.active === true).map((a) => a.code));
|
translate.addLangs(config.languages.filter((LangConfig) => LangConfig.active === true).map((a) => a.code));
|
||||||
|
|
||||||
|
@@ -5,10 +5,10 @@ const {
|
|||||||
join
|
join
|
||||||
} = require('./helpers');
|
} = require('./helpers');
|
||||||
|
|
||||||
const theme = '';
|
// const theme = '';
|
||||||
const themeFolder = '';
|
// const themeFolder = '';
|
||||||
// const theme = 'mantis';
|
const theme = 'mantis';
|
||||||
// const themeFolder = 'themes';
|
const themeFolder = 'themes';
|
||||||
|
|
||||||
|
|
||||||
const themeReplaceOptions =
|
const themeReplaceOptions =
|
||||||
@@ -16,12 +16,24 @@ const themeReplaceOptions =
|
|||||||
multiple: [
|
multiple: [
|
||||||
{
|
{
|
||||||
search: '$theme$.',
|
search: '$theme$.',
|
||||||
replace: theme + (themeFolder.length ? '.' : '')
|
replace: theme + (theme.length ? '.' : ''),
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
search: '$themePath$/',
|
search: '$themePath$/',
|
||||||
replace: themeFolder + (themeFolder.length ? '/' : '')
|
replace: themeFolder + (themeFolder.length ? '/' : ''),
|
||||||
}]
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
search: '$theme$.',
|
||||||
|
replace: theme + (theme.length ? '.' : ''),
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
search: '$themePath$/',
|
||||||
|
replace: themeFolder + (themeFolder.length ? '/' : ''),
|
||||||
|
}
|
||||||
|
]
|
||||||
};
|
};
|
||||||
module.exports = {
|
module.exports = {
|
||||||
mode: 'development',
|
mode: 'development',
|
||||||
@@ -46,11 +58,28 @@ module.exports = {
|
|||||||
loader: 'string-replace-loader',
|
loader: 'string-replace-loader',
|
||||||
options: themeReplaceOptions
|
options: themeReplaceOptions
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// test: /styles\/_variables.scss$/,
|
test: /styles\/_variables_imports.scss$/,
|
||||||
// loader: 'string-replace-loader',
|
enforce: 'pre',
|
||||||
// options: themeReplaceOptions
|
use: [
|
||||||
// },
|
'debug-loader',
|
||||||
|
{
|
||||||
|
loader: 'string-replace-loader',
|
||||||
|
options: themeReplaceOptions
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.scss$/,
|
||||||
|
use: [
|
||||||
|
{
|
||||||
|
loader: 'string-replace-loader',
|
||||||
|
options: themeReplaceOptions
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
},
|
||||||
{
|
{
|
||||||
test: /\.ts$/,
|
test: /\.ts$/,
|
||||||
loader: '@ngtools/webpack'
|
loader: '@ngtools/webpack'
|
||||||
@@ -85,11 +114,14 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
use: [
|
use: [
|
||||||
{
|
{
|
||||||
loader: 'to-string-loader',
|
loader: 'string-replace-loader',
|
||||||
options: {
|
options:
|
||||||
sourceMap: true
|
{
|
||||||
}
|
search: 'theme\.',
|
||||||
}, {
|
replace: theme + (theme.length ? '\.' : ''),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
loader: 'raw-loader',
|
loader: 'raw-loader',
|
||||||
options: {
|
options: {
|
||||||
sourceMap: true
|
sourceMap: true
|
||||||
@@ -107,6 +139,7 @@ module.exports = {
|
|||||||
sourceMap: true
|
sourceMap: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
'debug-loader',
|
||||||
'webpack-import-glob-loader'
|
'webpack-import-glob-loader'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -135,6 +168,9 @@ module.exports = {
|
|||||||
}, {
|
}, {
|
||||||
from: join(__dirname, '..', 'resources', 'i18n'),
|
from: join(__dirname, '..', 'resources', 'i18n'),
|
||||||
to: join('assets', 'i18n')
|
to: join('assets', 'i18n')
|
||||||
|
}, {
|
||||||
|
from: join(__dirname, '..', 'src', 'styles', '_variables_imports.scss'),
|
||||||
|
to: join(__dirname, '..', 'src', 'styles', '_variables.scss')
|
||||||
}])
|
}])
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@@ -2812,6 +2812,12 @@ dateformat@^1.0.11, dateformat@^1.0.6:
|
|||||||
get-stdin "^4.0.1"
|
get-stdin "^4.0.1"
|
||||||
meow "^3.3.0"
|
meow "^3.3.0"
|
||||||
|
|
||||||
|
debug-loader@^0.0.1:
|
||||||
|
version "0.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/debug-loader/-/debug-loader-0.0.1.tgz#44dc37e09e3c39e6af334681960f70a534a9d056"
|
||||||
|
dependencies:
|
||||||
|
loader-utils "^0.2.12"
|
||||||
|
|
||||||
debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.6, debug@^2.6.8:
|
debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.6, debug@^2.6.8:
|
||||||
version "2.6.9"
|
version "2.6.9"
|
||||||
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
|
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
|
||||||
@@ -5853,7 +5859,7 @@ loader-runner@^2.3.0:
|
|||||||
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2"
|
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2"
|
||||||
integrity sha1-9IKuqC1UPgeSFwDVpG7yb9rGuKI=
|
integrity sha1-9IKuqC1UPgeSFwDVpG7yb9rGuKI=
|
||||||
|
|
||||||
loader-utils@^0.2.15, loader-utils@^0.2.16:
|
loader-utils@^0.2.12, loader-utils@^0.2.15, loader-utils@^0.2.16:
|
||||||
version "0.2.17"
|
version "0.2.17"
|
||||||
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.17.tgz#f86e6374d43205a6e6c60e9196f17c0299bfb348"
|
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.17.tgz#f86e6374d43205a6e6c60e9196f17c0299bfb348"
|
||||||
integrity sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=
|
integrity sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=
|
||||||
|
Reference in New Issue
Block a user