From cd5c7b72c2eef1cc9b7c0cd27cf49c6b0e82f5bc Mon Sep 17 00:00:00 2001 From: lotte Date: Fri, 16 Nov 2018 17:00:06 +0100 Subject: [PATCH] 57053: progress menu bar --- .../admin-sidebar/admin-sidebar.actions.ts | 55 +++++++++--- .../admin-sidebar.component.html | 47 +++++----- .../admin-sidebar.component.scss | 39 +++++--- .../admin-sidebar/admin-sidebar.component.ts | 50 +++++++---- .../admin-sidebar/admin-sidebar.reducer.ts | 90 ++++++++++++++----- .../home-news/home-news.component.scss | 3 + src/app/app.component.scss | 2 +- src/app/app.component.ts | 13 ++- src/app/app.reducer.ts | 24 +++-- src/app/core/core.module.ts | 2 + src/app/navbar/navbar.component.ts | 2 +- src/app/shared/animations/focus.ts | 12 +-- src/app/shared/animations/slide.ts | 16 +++- src/app/shared/host-window.service.spec.ts | 8 +- src/app/shared/host-window.service.ts | 30 ++++--- .../shared/sass-helper/sass-helper.actions.ts | 29 ++++++ .../shared/sass-helper/sass-helper.reducer.ts | 20 +++++ .../shared/sass-helper/sass-helper.service.ts | 33 +++++++ src/app/typings.d.ts | 5 ++ src/styles/_exposed_variables.scss | 9 ++ .../_font_awesome_imports.scss} | 0 webpack/webpack.common.js | 24 +++-- 22 files changed, 386 insertions(+), 127 deletions(-) create mode 100644 src/app/shared/sass-helper/sass-helper.actions.ts create mode 100644 src/app/shared/sass-helper/sass-helper.reducer.ts create mode 100644 src/app/shared/sass-helper/sass-helper.service.ts create mode 100644 src/styles/_exposed_variables.scss rename src/styles/{_font-awesome-imports.scss => helpers/_font_awesome_imports.scss} (100%) diff --git a/src/app/+admin/admin-sidebar/admin-sidebar.actions.ts b/src/app/+admin/admin-sidebar/admin-sidebar.actions.ts index a9dfa341bf..f349b0010a 100644 --- a/src/app/+admin/admin-sidebar/admin-sidebar.actions.ts +++ b/src/app/+admin/admin-sidebar/admin-sidebar.actions.ts @@ -10,52 +10,81 @@ import { type } from '../../shared/ngrx/type'; * literal types and runs a simple check to guarantee all * action types in the application are unique. */ -export const AdminSidebarSectionActionTypes = { - COLLAPSE: type('dspace/admin-sidebar-section/COLLAPSE'), - EXPAND: type('dspace/admin-sidebar-sectio/EXPAND'), - TOGGLE: type('dspace/admin-sidebar-sectio/TOGGLE'), +export const AdminSidebarActionTypes = { + SECTION_COLLAPSE: type('dspace/admin-sidebar/SECTION_COLLAPSE'), + SECTION_EXPAND: type('dspace/admin-sidebar/SECTION_EXPAND'), + SECTION_TOGGLE: type('dspace/admin-sidebar/SECTION_TOGGLE'), + COLLAPSE: type('dspace/admin-sidebar/COLLAPSE'), + EXPAND: type('dspace/admin-sidebar/EXPAND'), + TOGGLE: type('dspace/admin-sidebar/TOGGLE'), }; -export class AdminSidebarSectionAction implements Action { +/* tslint:disable:max-classes-per-file */ +export class AdminSidebarAction implements Action { + + /** + * Type of action that will be performed + */ + type; +} + +export class AdminSidebarSectionAction extends AdminSidebarAction { /** * Name of the section the action is performed on, used to identify the section */ sectionName: string; - /** - * Type of action that will be performed - */ - type; - /** * Initialize with the section's name * @param {string} name of the section */ constructor(name: string) { + super(); this.sectionName = name; } } /* tslint:disable:max-classes-per-file */ +/** + * Used to collapse the sidebar + */ +export class AdminSidebarCollapseAction extends AdminSidebarAction { + type = AdminSidebarActionTypes.COLLAPSE; +} + +/** + * Used to expand the sidebar + */ +export class AdminSidebarExpandAction extends AdminSidebarAction { + type = AdminSidebarActionTypes.EXPAND; +} + +/** + * Used to collapse the sidebar when it's expanded and expand it when it's collapsed + */ +export class AdminSidebarToggleAction extends AdminSidebarAction { + type = AdminSidebarActionTypes.TOGGLE; +} + /** * Used to collapse a section */ export class AdminSidebarSectionCollapseAction extends AdminSidebarSectionAction { - type = AdminSidebarSectionActionTypes.COLLAPSE; + type = AdminSidebarActionTypes.SECTION_COLLAPSE; } /** * Used to expand a section */ export class AdminSidebarSectionExpandAction extends AdminSidebarSectionAction { - type = AdminSidebarSectionActionTypes.EXPAND; + type = AdminSidebarActionTypes.SECTION_EXPAND; } /** * Used to collapse a section when it's expanded and expand it when it's collapsed */ export class AdminSidebarSectionToggleAction extends AdminSidebarSectionAction { - type = AdminSidebarSectionActionTypes.TOGGLE; + type = AdminSidebarActionTypes.SECTION_TOGGLE; } /* tslint:enable:max-classes-per-file */ diff --git a/src/app/+admin/admin-sidebar/admin-sidebar.component.html b/src/app/+admin/admin-sidebar/admin-sidebar.component.html index 69cb7d6cbb..b2d8d94a93 100644 --- a/src/app/+admin/admin-sidebar/admin-sidebar.component.html +++ b/src/app/+admin/admin-sidebar/admin-sidebar.component.html @@ -1,17 +1,21 @@ -