From d33dbb602917ea52bf5ae52cc44d94405890588c Mon Sep 17 00:00:00 2001 From: tibing Date: Wed, 6 Sep 2017 16:18:17 +0300 Subject: [PATCH] fix(app): remove immutable from the project, use basic arrays instead --- package-lock.json | 5 - package.json | 1 - .../@theme/layouts/sample/sample.layout.ts | 87 +++--- src/app/pages/pages-menu.ts | 272 ++++++++++-------- src/tsconfig.app.json | 3 - 5 files changed, 198 insertions(+), 170 deletions(-) diff --git a/package-lock.json b/package-lock.json index c6bf24e5..36814dd9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4225,11 +4225,6 @@ "xmldom": "0.1.27" } }, - "immutable": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-3.8.1.tgz", - "integrity": "sha1-IAgH8Rqw9ycQ6khVQt4IgHX2jNI=" - }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", diff --git a/package.json b/package.json index 8b618dd6..ac62af05 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,6 @@ "d3": "4.8.0", "echarts": "3.5.4", "font-awesome": "4.7.0", - "immutable": "3.8.1", "intl": "1.2.5", "ionicons": "2.0.1", "leaflet": "1.0.3", diff --git a/src/app/@theme/layouts/sample/sample.layout.ts b/src/app/@theme/layouts/sample/sample.layout.ts index 092c2524..46a4498b 100644 --- a/src/app/@theme/layouts/sample/sample.layout.ts +++ b/src/app/@theme/layouts/sample/sample.layout.ts @@ -1,5 +1,4 @@ -import { Component, Input, OnDestroy } from '@angular/core'; -import { List } from 'immutable'; +import { Component, OnDestroy } from '@angular/core'; import { NbMenuItem } from '@nebular/theme'; import { Subscription } from 'rxjs/Subscription'; @@ -55,49 +54,47 @@ import { StateService } from '../../../@core/data/state.service'; }) export class SampleLayoutComponent implements OnDestroy { - subMenu: List = List( - [ - { - title: 'PAGE LEVEL MENU', - group: true, - }, - { - title: 'Buttons', - icon: 'ion ion-android-radio-button-off', - link: '/pages/ui-features/buttons', - }, - { - title: 'Grid', - icon: 'ion ion-android-radio-button-off', - link: '/pages/ui-features/grid', - }, - { - title: 'Icons', - icon: 'ion ion-android-radio-button-off', - link: '/pages/ui-features/icons', - }, - { - title: 'Modals', - icon: 'ion ion-android-radio-button-off', - link: '/pages/ui-features/modals', - }, - { - title: 'Typography', - icon: 'ion ion-android-radio-button-off', - link: '/pages/ui-features/typography', - }, - { - title: 'Animated Searches', - icon: 'ion ion-android-radio-button-off', - link: '/pages/ui-features/search-fields', - }, - { - title: 'Tabs', - icon: 'ion ion-android-radio-button-off', - link: '/pages/ui-features/tabs', - }, - ], - ); + subMenu: NbMenuItem[] = [ + { + title: 'PAGE LEVEL MENU', + group: true, + }, + { + title: 'Buttons', + icon: 'ion ion-android-radio-button-off', + link: '/pages/ui-features/buttons', + }, + { + title: 'Grid', + icon: 'ion ion-android-radio-button-off', + link: '/pages/ui-features/grid', + }, + { + title: 'Icons', + icon: 'ion ion-android-radio-button-off', + link: '/pages/ui-features/icons', + }, + { + title: 'Modals', + icon: 'ion ion-android-radio-button-off', + link: '/pages/ui-features/modals', + }, + { + title: 'Typography', + icon: 'ion ion-android-radio-button-off', + link: '/pages/ui-features/typography', + }, + { + title: 'Animated Searches', + icon: 'ion ion-android-radio-button-off', + link: '/pages/ui-features/search-fields', + }, + { + title: 'Tabs', + icon: 'ion ion-android-radio-button-off', + link: '/pages/ui-features/tabs', + }, + ]; layout: any = {}; sidebar: any = {}; diff --git a/src/app/pages/pages-menu.ts b/src/app/pages/pages-menu.ts index 32ec13b5..a8bac96f 100644 --- a/src/app/pages/pages-menu.ts +++ b/src/app/pages/pages-menu.ts @@ -1,118 +1,158 @@ import { NbMenuItem } from '@nebular/theme'; -import { List } from 'immutable'; - -export const MENU_ITEMS: List = List([{ - title: 'Dashboard', - icon: 'nb-home', - link: '/pages/dashboard', - home: true, -}, { - title: 'FEATURES', - group: true, -}, { - title: 'UI Features', - icon: 'nb-keypad', - link: '/pages/ui-features', - children: List([{ - title: 'Buttons', - link: '/pages/ui-features/buttons', - }, { - title: 'Grid', - link: '/pages/ui-features/grid', - }, { - title: 'Icons', - link: '/pages/ui-features/icons', - }, { - title: 'Modals', - link: '/pages/ui-features/modals', - }, { - title: 'Typography', - link: '/pages/ui-features/typography', - }, { - title: 'Animated Searches', - link: '/pages/ui-features/search-fields', - }, { - title: 'Tabs', - link: '/pages/ui-features/tabs', - }]), -}, { - title: 'Forms', - icon: 'nb-compose', - children: List([{ - title: 'Form Inputs', - link: '/pages/forms/inputs', - }, { - title: 'Form Layouts', - link: '/pages/forms/layouts', - }]), -}, { - title: 'Components', - icon: 'nb-gear', - children: List([{ - title: 'Tree', - link: '/pages/components/tree', - }, { - title: 'Notifications', - link: '/pages/components/notifications', - }]), -}, { - title: 'Maps', - icon: 'nb-location', - children: List([{ - title: 'Google Maps', - link: '/pages/maps/gmaps', - }, { - title: 'Leaflet Maps', - link: '/pages/maps/leaflet', - }, { - title: 'Bubble Maps', - link: '/pages/maps/bubble', - }]), -}, { - title: 'Charts', - icon: 'nb-bar-chart', - children: List([{ - title: 'Echarts', - link: '/pages/charts/echarts', - }, { - title: 'Charts.js', - link: '/pages/charts/chartjs', - }, { - title: 'D3', - link: '/pages/charts/d3', - }]), -}, { - title: 'Editors', - icon: 'nb-title', - children: List([{ - title: 'TinyMCE', - link: '/pages/editors/tinymce', - }, { - title: 'CKEditor', - link: '/pages/editors/ckeditor', - }]), -}, { - title: 'Tables', - icon: 'nb-tables', - children: List([{ - title: 'Smart Table', - link: '/pages/tables/smart-table', - }]), -}, { - title: 'Auth', - icon: 'nb-locked', - children: List([{ - title: 'Login', - link: '/auth/login', - }, { - title: 'Register', - link: '/auth/register', - }, { - title: 'Request Password', - link: '/auth/request-password', - }, { - title: 'Reset Password', - link: '/auth/reset-password', - }]), -}]); +export const MENU_ITEMS: NbMenuItem[] = [ + { + title: 'Dashboard', + icon: 'nb-home', + link: '/pages/dashboard', + home: true, + }, + { + title: 'FEATURES', + group: true, + }, + { + title: 'UI Features', + icon: 'nb-keypad', + link: '/pages/ui-features', + children: [ + { + title: 'Buttons', + link: '/pages/ui-features/buttons', + }, + { + title: 'Grid', + link: '/pages/ui-features/grid', + }, + { + title: 'Icons', + link: '/pages/ui-features/icons', + }, + { + title: 'Modals', + link: '/pages/ui-features/modals', + }, + { + title: 'Typography', + link: '/pages/ui-features/typography', + }, + { + title: 'Animated Searches', + link: '/pages/ui-features/search-fields', + }, + { + title: 'Tabs', + link: '/pages/ui-features/tabs', + }, + ], + }, + { + title: 'Forms', + icon: 'nb-compose', + children: [ + { + title: 'Form Inputs', + link: '/pages/forms/inputs', + }, + { + title: 'Form Layouts', + link: '/pages/forms/layouts', + }, + ], + }, + { + title: 'Components', + icon: 'nb-gear', + children: [ + { + title: 'Tree', + link: '/pages/components/tree', + }, { + title: 'Notifications', + link: '/pages/components/notifications', + }, + ], + }, + { + title: 'Maps', + icon: 'nb-location', + children: [ + { + title: 'Google Maps', + link: '/pages/maps/gmaps', + }, + { + title: 'Leaflet Maps', + link: '/pages/maps/leaflet', + }, + { + title: 'Bubble Maps', + link: '/pages/maps/bubble', + }, + ], + }, + { + title: 'Charts', + icon: 'nb-bar-chart', + children: [ + { + title: 'Echarts', + link: '/pages/charts/echarts', + }, + { + title: 'Charts.js', + link: '/pages/charts/chartjs', + }, + { + title: 'D3', + link: '/pages/charts/d3', + }, + ], + }, + { + title: 'Editors', + icon: 'nb-title', + children: [ + { + title: 'TinyMCE', + link: '/pages/editors/tinymce', + }, + { + title: 'CKEditor', + link: '/pages/editors/ckeditor', + }, + ], + }, + { + title: 'Tables', + icon: 'nb-tables', + children: [ + { + title: 'Smart Table', + link: '/pages/tables/smart-table', + }, + ], + }, + { + title: 'Auth', + icon: 'nb-locked', + children: [ + { + title: 'Login', + link: '/auth/login', + }, + { + title: 'Register', + link: '/auth/register', + }, + { + title: 'Request Password', + link: '/auth/request-password', + }, + { + title: 'Reset Password', + link: '/auth/reset-password', + }, + ], + }, +]; diff --git a/src/tsconfig.app.json b/src/tsconfig.app.json index 3c671745..569f154c 100644 --- a/src/tsconfig.app.json +++ b/src/tsconfig.app.json @@ -11,9 +11,6 @@ ], "@nebular/*": [ "../node_modules/@nebular/*" - ], - "immutable/*": [ - "../node_modules/immutable/*" ] } },