diff --git a/ui-ngx/src/app/core/services/menu.service.ts b/ui-ngx/src/app/core/services/menu.service.ts index f1f286ca16..07a6d8f237 100644 --- a/ui-ngx/src/app/core/services/menu.service.ts +++ b/ui-ngx/src/app/core/services/menu.service.ts @@ -103,19 +103,12 @@ export class MenuService { path: '/widgets-bundles', icon: 'now_widgets' }, - { - id: guid(), - name: 'resource.resources-library', - type: 'link', - path: '/resources-library', - icon: 'folder' - }, { id: guid(), name: 'admin.system-settings', type: 'toggle', path: '/settings', - height: '200px', + height: '240px', icon: 'settings', pages: [ { @@ -152,6 +145,13 @@ export class MenuService { type: 'link', path: '/settings/oauth2', icon: 'security' + }, + { + id: guid(), + name: 'resource.resources-library', + type: 'link', + path: '/settings/resources-library', + icon: 'folder' } ] } @@ -188,16 +188,6 @@ export class MenuService { } ] }, - { - name: 'resource.management', - places: [ - { - name: 'resource.resources-library', - icon: 'folder', - path: '/resources-library' - } - ] - }, { name: 'admin.system-settings', places: [ @@ -225,6 +215,11 @@ export class MenuService { name: 'admin.oauth2.oauth2', icon: 'security', path: '/settings/oauth2' + }, + { + name: 'resource.resources-library', + icon: 'folder', + path: '/resources-library' } ] } @@ -337,20 +332,6 @@ export class MenuService { path: '/dashboards', icon: 'dashboards' }, - { - id: guid(), - name: 'resource.resources-library', - type: 'link', - path: '/resources-library', - icon: 'folder' - }, - { - id: guid(), - name: 'admin.home-settings', - type: 'link', - path: '/settings/home', - icon: 'settings_applications' - }, { id: guid(), name: 'audit-log.audit-logs', @@ -365,6 +346,30 @@ export class MenuService { path: '/usage', icon: 'insert_chart', notExact: true + }, + { + id: guid(), + name: 'admin.system-settings', + type: 'toggle', + path: '/settings', + height: '80px', + icon: 'settings', + pages: [ + { + id: guid(), + name: 'admin.home-settings', + type: 'link', + path: '/settings/home', + icon: 'settings_applications' + }, + { + id: guid(), + name: 'resource.resources-library', + type: 'link', + path: '/settings/resources-library', + icon: 'folder' + } + ] } ); return sections; @@ -455,16 +460,6 @@ export class MenuService { ); } homeSections.push( - { - name: 'resource.management', - places: [ - { - name: 'resource.resources-library', - icon: 'folder', - path: '/resources-library' - } - ] - }, { name: 'dashboard.management', places: [ @@ -494,6 +489,21 @@ export class MenuService { path: '/usage' } ] + }, + { + name: 'admin.system-settings', + places: [ + { + name: 'admin.home-settings', + icon: 'settings_applications', + path: '/settings/home' + }, + { + name: 'resource.resources-library', + icon: 'folder', + path: '/settings/resources-library' + } + ] } ); return homeSections; diff --git a/ui-ngx/src/app/modules/home/pages/admin/admin-routing.module.ts b/ui-ngx/src/app/modules/home/pages/admin/admin-routing.module.ts index 1928a1f404..8de41af9c2 100644 --- a/ui-ngx/src/app/modules/home/pages/admin/admin-routing.module.ts +++ b/ui-ngx/src/app/modules/home/pages/admin/admin-routing.module.ts @@ -23,16 +23,12 @@ import { Authority } from '@shared/models/authority.enum'; import { GeneralSettingsComponent } from '@modules/home/pages/admin/general-settings.component'; import { SecuritySettingsComponent } from '@modules/home/pages/admin/security-settings.component'; import { OAuth2SettingsComponent } from '@home/pages/admin/oauth2-settings.component'; -import { User } from '@shared/models/user.model'; -import { Store } from '@ngrx/store'; -import { AppState } from '@core/core.state'; -import { UserService } from '@core/http/user.service'; import { Observable } from 'rxjs'; -import { getCurrentAuthUser } from '@core/auth/auth.selectors'; import { OAuth2Service } from '@core/http/oauth2.service'; -import { UserProfileResolver } from '@home/pages/profile/profile-routing.module'; import { SmsProviderComponent } from '@home/pages/admin/sms-provider.component'; import { HomeSettingsComponent } from '@home/pages/admin/home-settings.component'; +import { EntitiesTableComponent } from '@home/components/entity/entities-table.component'; +import { ResourcesLibraryTableConfigResolver } from '@home/pages/admin/resource/resources-library-table-config.resolve'; @Injectable() export class OAuth2LoginProcessingUrlResolver implements Resolve { @@ -146,6 +142,21 @@ const routes: Routes = [ icon: 'settings_applications' } } + }, + { + path: 'resources-library', + component: EntitiesTableComponent, + data: { + auth: [Authority.TENANT_ADMIN, Authority.SYS_ADMIN], + title: 'resource.resources-library', + breadcrumb: { + label: 'resource.resources-library', + icon: 'folder' + } + }, + resolve: { + entitiesTableConfig: ResourcesLibraryTableConfigResolver + } } ] } @@ -155,7 +166,8 @@ const routes: Routes = [ imports: [RouterModule.forChild(routes)], exports: [RouterModule], providers: [ - OAuth2LoginProcessingUrlResolver + OAuth2LoginProcessingUrlResolver, + ResourcesLibraryTableConfigResolver ] }) export class AdminRoutingModule { } diff --git a/ui-ngx/src/app/modules/home/pages/admin/admin.module.ts b/ui-ngx/src/app/modules/home/pages/admin/admin.module.ts index 1671220cfe..d97471a2a0 100644 --- a/ui-ngx/src/app/modules/home/pages/admin/admin.module.ts +++ b/ui-ngx/src/app/modules/home/pages/admin/admin.module.ts @@ -27,6 +27,7 @@ import { OAuth2SettingsComponent } from '@modules/home/pages/admin/oauth2-settin import { SmsProviderComponent } from '@home/pages/admin/sms-provider.component'; import { SendTestSmsDialogComponent } from '@home/pages/admin/send-test-sms-dialog.component'; import { HomeSettingsComponent } from '@home/pages/admin/home-settings.component'; +import { ResourcesLibraryComponent } from '@home/pages/admin/resource/resources-library.component'; @NgModule({ declarations: @@ -37,7 +38,8 @@ import { HomeSettingsComponent } from '@home/pages/admin/home-settings.component SendTestSmsDialogComponent, SecuritySettingsComponent, OAuth2SettingsComponent, - HomeSettingsComponent + HomeSettingsComponent, + ResourcesLibraryComponent ], imports: [ CommonModule, diff --git a/ui-ngx/src/app/modules/home/pages/resource/resources-library-table-config.resolve.ts b/ui-ngx/src/app/modules/home/pages/admin/resource/resources-library-table-config.resolve.ts similarity index 98% rename from ui-ngx/src/app/modules/home/pages/resource/resources-library-table-config.resolve.ts rename to ui-ngx/src/app/modules/home/pages/admin/resource/resources-library-table-config.resolve.ts index d6759310ac..089d4b3d82 100644 --- a/ui-ngx/src/app/modules/home/pages/resource/resources-library-table-config.resolve.ts +++ b/ui-ngx/src/app/modules/home/pages/admin/resource/resources-library-table-config.resolve.ts @@ -32,7 +32,7 @@ import { getCurrentAuthUser } from '@core/auth/auth.selectors'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; import { Authority } from '@shared/models/authority.enum'; -import { ResourcesLibraryComponent } from '@home/pages/resource/resources-library.component'; +import { ResourcesLibraryComponent } from '@home/pages/admin/resource/resources-library.component'; import { PageLink } from '@shared/models/page/page-link'; import { EntityAction } from '@home/models/entity/entity-component.models'; import { map } from 'rxjs/operators'; diff --git a/ui-ngx/src/app/modules/home/pages/resource/resources-library.component.html b/ui-ngx/src/app/modules/home/pages/admin/resource/resources-library.component.html similarity index 100% rename from ui-ngx/src/app/modules/home/pages/resource/resources-library.component.html rename to ui-ngx/src/app/modules/home/pages/admin/resource/resources-library.component.html diff --git a/ui-ngx/src/app/modules/home/pages/resource/resources-library.component.ts b/ui-ngx/src/app/modules/home/pages/admin/resource/resources-library.component.ts similarity index 100% rename from ui-ngx/src/app/modules/home/pages/resource/resources-library.component.ts rename to ui-ngx/src/app/modules/home/pages/admin/resource/resources-library.component.ts diff --git a/ui-ngx/src/app/modules/home/pages/home-pages.module.ts b/ui-ngx/src/app/modules/home/pages/home-pages.module.ts index 774eccf62f..050b71db83 100644 --- a/ui-ngx/src/app/modules/home/pages/home-pages.module.ts +++ b/ui-ngx/src/app/modules/home/pages/home-pages.module.ts @@ -35,7 +35,6 @@ import { modulesMap } from '../../common/modules-map'; import { DeviceProfileModule } from './device-profile/device-profile.module'; import { ApiUsageModule } from '@home/pages/api-usage/api-usage.module'; import { EdgeModule } from '@home/pages/edge/edge.module'; -import { ResourceModule } from '@home/pages/resource/resource.module'; import { FirmwareModule } from '@home/pages/firmware/firmware.module'; @NgModule({ @@ -56,7 +55,6 @@ import { FirmwareModule } from '@home/pages/firmware/firmware.module'; DashboardModule, AuditLogModule, ApiUsageModule, - ResourceModule, FirmwareModule, UserModule ], diff --git a/ui-ngx/src/app/modules/home/pages/resource/resource-routing.module.ts b/ui-ngx/src/app/modules/home/pages/resource/resource-routing.module.ts deleted file mode 100644 index 4eab81e2f2..0000000000 --- a/ui-ngx/src/app/modules/home/pages/resource/resource-routing.module.ts +++ /dev/null @@ -1,48 +0,0 @@ -/// -/// Copyright © 2016-2021 The Thingsboard Authors -/// -/// Licensed under the Apache License, Version 2.0 (the "License"); -/// you may not use this file except in compliance with the License. -/// You may obtain a copy of the License at -/// -/// http://www.apache.org/licenses/LICENSE-2.0 -/// -/// Unless required by applicable law or agreed to in writing, software -/// distributed under the License is distributed on an "AS IS" BASIS, -/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -/// See the License for the specific language governing permissions and -/// limitations under the License. -/// - -import { RouterModule, Routes } from '@angular/router'; -import { EntitiesTableComponent } from '@home/components/entity/entities-table.component'; -import { Authority } from '@shared/models/authority.enum'; -import { NgModule } from '@angular/core'; -import { ResourcesLibraryTableConfigResolver } from './resources-library-table-config.resolve'; - -const routes: Routes = [ - { - path: 'resources-library', - component: EntitiesTableComponent, - data: { - auth: [Authority.TENANT_ADMIN, Authority.SYS_ADMIN], - title: 'resource.resources-library', - breadcrumb: { - label: 'resource.resources-library', - icon: 'folder' - } - }, - resolve: { - entitiesTableConfig: ResourcesLibraryTableConfigResolver - } - } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule], - providers: [ - ResourcesLibraryTableConfigResolver - ] -}) -export class ResourcesLibraryRoutingModule{ } diff --git a/ui-ngx/src/app/modules/home/pages/resource/resource.module.ts b/ui-ngx/src/app/modules/home/pages/resource/resource.module.ts deleted file mode 100644 index 4cf31af12c..0000000000 --- a/ui-ngx/src/app/modules/home/pages/resource/resource.module.ts +++ /dev/null @@ -1,33 +0,0 @@ -/// -/// Copyright © 2016-2021 The Thingsboard Authors -/// -/// Licensed under the Apache License, Version 2.0 (the "License"); -/// you may not use this file except in compliance with the License. -/// You may obtain a copy of the License at -/// -/// http://www.apache.org/licenses/LICENSE-2.0 -/// -/// Unless required by applicable law or agreed to in writing, software -/// distributed under the License is distributed on an "AS IS" BASIS, -/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -/// See the License for the specific language governing permissions and -/// limitations under the License. -/// - -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { ResourcesLibraryRoutingModule } from '@home/pages/resource/resource-routing.module'; -import { SharedModule } from '@shared/shared.module'; -import { HomeComponentsModule } from '@home/components/home-components.module'; -import { ResourcesLibraryComponent } from './resources-library.component'; - -@NgModule({ - declarations: [ResourcesLibraryComponent], - imports: [ - CommonModule, - SharedModule, - HomeComponentsModule, - ResourcesLibraryRoutingModule - ] -}) -export class ResourceModule { } diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json index 9c2253d0ab..1f8e5e05d8 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -2247,7 +2247,6 @@ "drop-file": "Drop a resource file or click to select a file to upload.", "empty": "Resource is empty", "export": "Export resource", - "management": "Resource management", "no-resource-matching": "No resource matching '{{widgetsBundle}}' were found.", "no-resource-text": "No resources found", "open-widgets-bundle": "Open widgets bundle",