Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: standalone mode #614

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b27bf05
feat: initial version of standalone mode
bastianjakobi Nov 19, 2024
376a1b3
feat: initial version of standalone mode
bastianjakobi Nov 19, 2024
107aa14
fix: fix linter
bastianjakobi Nov 19, 2024
300e06b
fix: add graceful fallback for empty env.json load
bastianjakobi Dec 3, 2024
5aa5d9e
feat: move translation loaders to angular-integration-interface, impr…
bastianjakobi Dec 5, 2024
ccebe33
Merge branch 'main' into feat/standalone-mode
bastianjakobi Dec 5, 2024
fa79ade
feat: ensure unique translations in new create-translate-loader
bastianjakobi Dec 6, 2024
755b7b3
feat: migrate standalone shell to a module containing shell-viewport …
bastianjakobi Dec 6, 2024
2bec04c
fix: fix CI
bastianjakobi Dec 6, 2024
6f78745
fix: disable oneCXShellLayout by default in standalone-shell
bastianjakobi Dec 6, 2024
070a8d0
fix: fix ci
bastianjakobi Dec 6, 2024
060680a
refactor: provide PIA TRANSLATION_PATH from within PIA
bastianjakobi Dec 9, 2024
b6d9087
refactor: provide TRANSLATION_PATH from within angular accelerator
bastianjakobi Dec 9, 2024
03f24ed
feat: inject translation paths in libs and remove dependency between …
bastianjakobi Dec 9, 2024
c5bfde4
refactor: move permission checker utils to angular-integration-interf…
bastianjakobi Dec 9, 2024
abf8485
refactor: remove dependency between shell-core and angular-accelerator
bastianjakobi Dec 9, 2024
c714f39
refactor: move utils to new lib, fix peer deps and peer dep linting
bastianjakobi Dec 19, 2024
d47d890
fix: fix storybook imports
bastianjakobi Dec 19, 2024
d177a04
Merge branch 'main' into feat/standalone-mode
bastianjakobi Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: move permission checker utils to angular-integration-interf…
…ace and remove redundant dependency in standalone-shell
bastianjakobi committed Dec 9, 2024
commit c5bfde44a23dc5af16aff34ee14f9cff33c3de51
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ import { SearchHeaderComponent } from './components/search-header/search-header.
import { AdvancedDirective } from './directives/advanced.directive'
import { IfBreakpointDirective } from './directives/if-breakpoint.directive'
import { IfPermissionDirective } from './directives/if-permission.directive'
import { HAS_PERMISSION_CHECKER, HasPermissionChecker } from './injection-tokens/has-permission-checker'
import { HAS_PERMISSION_CHECKER, HasPermissionChecker } from '@onecx/angular-integration-interface'
import { SrcDirective } from './directives/src.directive'
import { TooltipOnOverflowDirective } from './directives/tooltipOnOverflow.directive'
import { DynamicPipe } from './pipes/dynamic.pipe'
Original file line number Diff line number Diff line change
@@ -7,14 +7,13 @@ import { ButtonModule } from 'primeng/button'
import { MultiSelectModule } from 'primeng/multiselect'
import { DataViewModule } from 'primeng/dataview'
import { MenuModule } from 'primeng/menu'
import { UserService } from '@onecx/angular-integration-interface'
import { UserService, HAS_PERMISSION_CHECKER } from '@onecx/angular-integration-interface'
import { MockUserService } from '@onecx/angular-integration-interface/mocks'
import { StorybookTranslateModule } from './../../storybook-translate.module'
import { DataListGridComponent } from './data-list-grid.component'
import { IfPermissionDirective } from '../../directives/if-permission.directive'
import { TooltipOnOverflowDirective } from '../../directives/tooltipOnOverflow.directive'
import { MockAuthModule } from '../../mock-auth/mock-auth.module'
import { HAS_PERMISSION_CHECKER } from '../../injection-tokens/has-permission-checker'

const DataListGridComponentSBConfig: Meta<DataListGridComponent> = {
title: 'Components/DataListGridComponent',
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import { Meta, moduleMetadata, applicationConfig, StoryFn } from '@storybook/ang
import { TableModule } from 'primeng/table'
import { ButtonModule } from 'primeng/button'
import { MultiSelectModule } from 'primeng/multiselect'
import { UserService } from '@onecx/angular-integration-interface'
import { UserService, HAS_PERMISSION_CHECKER } from '@onecx/angular-integration-interface'
import { MockUserService } from '@onecx/angular-integration-interface/mocks'
import { DataTableComponent } from './data-table.component'
import { StorybookTranslateModule } from './../../storybook-translate.module'
@@ -16,7 +16,6 @@ import { MenuModule } from 'primeng/menu'
import { DynamicLocaleId } from '../../utils/dynamic-locale-id'
import { CheckboxModule } from 'primeng/checkbox'
import { FormsModule } from '@angular/forms'
import { HAS_PERMISSION_CHECKER } from '../../injection-tokens/has-permission-checker'

type DataTableInputTypes = Pick<DataTableComponent, 'rows' | 'columns' | 'emptyResultsMessage' | 'selectedRows'>

Original file line number Diff line number Diff line change
@@ -9,8 +9,7 @@ import {
TemplateRef,
ViewContainerRef,
} from '@angular/core'
import { UserService } from '@onecx/angular-integration-interface'
import { HAS_PERMISSION_CHECKER, HasPermissionChecker } from '../injection-tokens/has-permission-checker'
import { UserService, HAS_PERMISSION_CHECKER, HasPermissionChecker } from '@onecx/angular-integration-interface'

@Directive({ selector: '[ocxIfPermission], [ocxIfNotPermission]' })
export class IfPermissionDirective implements OnInit {
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import {InjectionToken} from '@angular/core'
/**
* @deprecated Please import from `@onecx/angular-integration-interface` instead.
*/
export { HasPermissionChecker } from '@onecx/angular-integration-interface'

export interface HasPermissionChecker {
hasPermission(permissionKey: string): boolean
}

/**
* This checker always returns true, basically disabling the permission system on the UI side
*/
export class AlwaysGrantPermissionChecker implements HasPermissionChecker {
hasPermission(_permissionKey: string): boolean {
return true
}
}

export const HAS_PERMISSION_CHECKER = new InjectionToken<HasPermissionChecker>('hasPermission')
/**
* This checker always returns true, basically disabling the permission system on the UI side
* @deprecated Please import from `@onecx/angular-integration-interface` instead.
*/
export { AlwaysGrantPermissionChecker } from '@onecx/angular-integration-interface'

/**
* @deprecated Please import from `@onecx/angular-integration-interface` instead.
*/
export { HAS_PERMISSION_CHECKER } from '@onecx/angular-integration-interface'
1 change: 1 addition & 0 deletions libs/angular-integration-interface/src/index.ts
Original file line number Diff line number Diff line change
@@ -24,5 +24,6 @@ export * from './lib/utils/caching-translate-loader.utils'
export * from './lib/utils/create-translate-loader.utils'
export * from './lib/utils/translate.combined.loader'
export * from './lib/utils/translation-path-factory.utils'
export * from './lib/utils/has-permission-checker'

export { MfeInfo, Theme } from '@onecx/integration-interface'
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {InjectionToken} from '@angular/core'

export interface HasPermissionChecker {
hasPermission(permissionKey: string): boolean
}

/**
* This checker always returns true, basically disabling the permission system on the UI side
*/
export class AlwaysGrantPermissionChecker implements HasPermissionChecker {
hasPermission(_permissionKey: string): boolean {
return true
}
}

export const HAS_PERMISSION_CHECKER = new InjectionToken<HasPermissionChecker>('hasPermission')
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, Inject, Input, OnInit, Optional } from '@angular/core'
import { HAS_PERMISSION_CHECKER, HasPermissionChecker } from '@onecx/angular-accelerator'
import { HAS_PERMISSION_CHECKER, HasPermissionChecker } from '@onecx/angular-integration-interface'
import { AppStateService } from '@onecx/angular-integration-interface'
import { UserService } from '@onecx/angular-integration-interface'

1 change: 0 additions & 1 deletion libs/standalone-shell/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@
"@angular/core": "^18.0.5",
"@angular/router": "^18.0.5",
"@ngx-translate/core": "^15.0.0",
"@onecx/angular-accelerator": "^5.27.0",
"@onecx/angular-integration-interface": "^5.27.0",
"@onecx/angular-webcomponents": "^5.27.0",
"@onecx/integration-interface": "^5.27.0",
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { APP_INITIALIZER, InjectionToken } from "@angular/core";

import { AppStateService, ConfigurationService, MfeInfo, ThemeService, TRANSLATION_PATH, UserService } from '@onecx/angular-integration-interface'
import { AppStateService, ConfigurationService, MfeInfo, ThemeService, TRANSLATION_PATH, UserService, AlwaysGrantPermissionChecker, HAS_PERMISSION_CHECKER } from '@onecx/angular-integration-interface'
import { TranslateService } from '@ngx-translate/core'
import { firstValueFrom } from 'rxjs'
import { initializeRouter } from '@onecx/angular-webcomponents'
import { Router } from '@angular/router'
// TODO: Should we move permission checker?
import { AlwaysGrantPermissionChecker, HAS_PERMISSION_CHECKER } from '@onecx/angular-accelerator'
import { Theme, UserProfile, Workspace } from "@onecx/integration-interface";

const appInitializer = (