Skip to content

Commit

Permalink
Merge branch 'main' into feat/filter-chips
Browse files Browse the repository at this point in the history
  • Loading branch information
markuczy committed Nov 5, 2024
2 parents 18b0127 + ed66a84 commit 00b4b3c
Show file tree
Hide file tree
Showing 31 changed files with 190 additions and 42 deletions.
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
## [5.22.2](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.22.1...v5.22.2) (2024-11-04)

### Bug Fixes

* introduce AuthProxyService to reduce token calls ([#577](https://github.com/onecx/onecx-portal-ui-libs/issues/577)) ([b8bfcd9](https://github.com/onecx/onecx-portal-ui-libs/commit/b8bfcd9cc99d5b115a487426cc51507adccb2ad3))

## [5.22.1](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.22.0...v5.22.1) (2024-11-04)

### Bug Fixes

* use replaceUrl for first navigate in router connector ([#576](https://github.com/onecx/onecx-portal-ui-libs/issues/576)) ([affdd8c](https://github.com/onecx/onecx-portal-ui-libs/commit/affdd8c54b794bd45b45e0958c9c400d0a9fd5b5))

## [5.22.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.21.0...v5.22.0) (2024-10-29)

### Features

* new menu-inline-border-color variable ([#567](https://github.com/onecx/onecx-portal-ui-libs/issues/567)) ([d1ec231](https://github.com/onecx/onecx-portal-ui-libs/commit/d1ec23169bf4ae63f55715136627fa113ffc411a))

### Bug Fixes

* fixed styling that maximizes dialogs on mobiles ([#561](https://github.com/onecx/onecx-portal-ui-libs/issues/561)) ([48ba214](https://github.com/onecx/onecx-portal-ui-libs/commit/48ba214316bd4719a33adbaeacc9eb8e6f9eeff7))

## [5.21.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.20.1...v5.21.0) (2024-10-29)

### Features

* dialog buttons can receive custom id ([#566](https://github.com/onecx/onecx-portal-ui-libs/issues/566)) ([eb78d52](https://github.com/onecx/onecx-portal-ui-libs/commit/eb78d5230aa9ba270463ff548af510607830e3e5))

### Bug Fixes

* calendar month and date items focusable ([#558](https://github.com/onecx/onecx-portal-ui-libs/issues/558)) ([f624545](https://github.com/onecx/onecx-portal-ui-libs/commit/f62454507182ca84b3bb21d9c0b0ce9311be6040))
* custom group selection saved, displaying correct columns on page reload, remove clear column group selection ([#562](https://github.com/onecx/onecx-portal-ui-libs/issues/562)) ([0a8d9c1](https://github.com/onecx/onecx-portal-ui-libs/commit/0a8d9c1c3a61fa5a4aff0d7b085c8834ac824580))
* data-view-controls translations ([#563](https://github.com/onecx/onecx-portal-ui-libs/issues/563)) ([fc25ec2](https://github.com/onecx/onecx-portal-ui-libs/commit/fc25ec214da27c48820340751fda4c548305f397))
* dialog service right aligned buttons pushed to right ([#565](https://github.com/onecx/onecx-portal-ui-libs/issues/565)) ([9e61f05](https://github.com/onecx/onecx-portal-ui-libs/commit/9e61f055add7aadb737c4ae9ea06533e3e0022fb))
* panel icon focus visible ([#557](https://github.com/onecx/onecx-portal-ui-libs/issues/557)) ([6b0d34f](https://github.com/onecx/onecx-portal-ui-libs/commit/6b0d34f0125427783892481b60d7cf3d937c31ff))
* shell translations for MFEs and RCs ([#564](https://github.com/onecx/onecx-portal-ui-libs/issues/564)) ([f5f3ff6](https://github.com/onecx/onecx-portal-ui-libs/commit/f5f3ff64c2a876e4274dc7ed9b0757fe1c1f8684))

## [5.20.1](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.20.0...v5.20.1) (2024-10-24)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion libs/accelerator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onecx/accelerator",
"version": "5.20.1",
"version": "5.22.2",
"license": "Apache-2.0",
"peerDependencies": {
"tslib": "^2.6.3",
Expand Down
2 changes: 1 addition & 1 deletion libs/angular-accelerator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onecx/angular-accelerator",
"version": "5.20.1",
"version": "5.22.2",
"license": "Apache-2.0",
"peerDependencies": {
"@angular/common": "^18.0.5",
Expand Down
2 changes: 1 addition & 1 deletion libs/angular-auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onecx/angular-auth",
"version": "5.20.1",
"version": "5.22.2",
"license": "Apache-2.0",
"peerDependencies": {
"@angular-architects/module-federation": "^18.0.4",
Expand Down
34 changes: 27 additions & 7 deletions libs/angular-auth/src/lib/angular-auth.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { TokenInterceptor } from './token.interceptor'
import { AuthService } from './auth.service'
import { AuthServiceWrapper } from './auth-service-wrapper'
import { KeycloakAuthService } from './auth_services/keycloak-auth.service'
import { AuthProxyService } from './auth-proxy.service'
import { KeycloakService } from 'keycloak-angular'

function appInitializer(configService: ConfigurationService, authService: AuthService) {
Expand All @@ -15,19 +16,38 @@ function appInitializer(configService: ConfigurationService, authService: AuthSe
}
}

@NgModule({
imports: [CommonModule],
providers: [
AuthServiceWrapper,
{ provide: HTTP_INTERCEPTORS, useClass: TokenInterceptor, multi: true },
function provideAuthServices() {
return [AuthServiceWrapper, KeycloakAuthService, KeycloakService]
}

export function provideAuthService() {
return [
provideAuthServices(),
{
provide: APP_INITIALIZER,
useFactory: appInitializer,
deps: [ConfigurationService, AuthServiceWrapper],
multi: true,
},
KeycloakAuthService,
KeycloakService,
]
}

export function provideTokenInterceptor() {
return [
AuthProxyService,
{
provide: HTTP_INTERCEPTORS,
useClass: TokenInterceptor,
multi: true,
},
]
}

@NgModule({
imports: [CommonModule],
providers: [
provideTokenInterceptor(),
provideAuthServices(), // Only needed as fallback if shell uses lib version without new auth mechanism
],
})
export class AngularAuthModule {}
29 changes: 29 additions & 0 deletions libs/angular-auth/src/lib/auth-proxy.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Injectable, inject } from '@angular/core'
import './declarations'
import { AuthServiceWrapper } from './auth-service-wrapper'

@Injectable()
export class AuthProxyService {
authServiceWrapper?: AuthServiceWrapper | null

getHeaderValues(): Record<string, string> {
return (
window.onecxAngularAuth?.authServiceProxy?.v1?.getHeaderValues() ??
this.authServiceWrapper?.getHeaderValues() ??
{}
)
}

async updateTokenIfNeeded(): Promise<boolean> {
if (!window.onecxAngularAuth?.authServiceProxy?.v1?.updateTokenIfNeeded) {
console.info('AuthProxyService uses injected fallback.')
this.authServiceWrapper = inject(AuthServiceWrapper, { optional: true })
await this.authServiceWrapper?.init()
}
return (
window.onecxAngularAuth?.authServiceProxy?.v1?.updateTokenIfNeeded() ??
this.authServiceWrapper?.updateTokenIfNeeded() ??
Promise.reject('No authServiceWrapper provided.')
)
}
}
11 changes: 11 additions & 0 deletions libs/angular-auth/src/lib/auth-service-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Injectable, Injector } from '@angular/core'
import { KeycloakAuthService } from './auth_services/keycloak-auth.service'
import { loadRemoteModule } from '@angular-architects/module-federation'
import { Config } from '@onecx/integration-interface'
import './declarations'

@Injectable()
export class AuthServiceWrapper {
Expand All @@ -20,6 +21,16 @@ export class AuthServiceWrapper {
this.eventsTopic$
.pipe(filter((e) => e.type === 'authentication#logoutButtonClicked'))
.subscribe(() => this.authService?.logout())
window.onecxAngularAuth ??= {}
window.onecxAngularAuth.authServiceProxy ??= {}
window.onecxAngularAuth.authServiceProxy.v1 ??= {
updateTokenIfNeeded: (): Promise<boolean> => {
return this.updateTokenIfNeeded()
},
getHeaderValues: (): Record<string, string> => {
return this.getHeaderValues()
},
}
}
async init(): Promise<boolean | undefined> {
await this.configService.isInitialized
Expand Down
14 changes: 14 additions & 0 deletions libs/angular-auth/src/lib/declarations.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
declare global {
interface Window {
onecxAngularAuth?: {
authServiceProxy?: {
v1?: {
getHeaderValues: () => Record<string, string>,
updateTokenIfNeeded: () => Promise<boolean>
}
}
}
}
}

export default globalThis
4 changes: 2 additions & 2 deletions libs/angular-auth/src/lib/token.interceptor.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'
import { Injectable } from '@angular/core'
import { Observable, from, mergeMap } from 'rxjs'
import { AuthServiceWrapper } from './auth-service-wrapper'
import { AuthProxyService } from './auth-proxy.service'

const WHITELIST = ['assets']

@Injectable()
export class TokenInterceptor implements HttpInterceptor {
constructor(private authService: AuthServiceWrapper) {}
constructor(private authService: AuthProxyService) {}

intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
const skip = WHITELIST.some((str) => request.url.includes(str))
Expand Down
2 changes: 1 addition & 1 deletion libs/angular-integration-interface/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onecx/angular-integration-interface",
"version": "5.20.1",
"version": "5.22.2",
"license": "Apache-2.0",
"peerDependencies": {
"@angular/core": "^18.0.5",
Expand Down
2 changes: 1 addition & 1 deletion libs/angular-remote-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onecx/angular-remote-components",
"version": "5.20.1",
"version": "5.22.2",
"license": "Apache-2.0",
"peerDependencies": {
"@angular/common": "^18.0.5",
Expand Down
2 changes: 1 addition & 1 deletion libs/angular-testing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onecx/angular-testing",
"version": "5.20.1",
"version": "5.22.2",
"license": "Apache-2.0",
"peerDependencies": {
"@angular/cdk": "^18.0.5",
Expand Down
2 changes: 1 addition & 1 deletion libs/angular-webcomponents/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onecx/angular-webcomponents",
"version": "5.20.1",
"version": "5.22.2",
"license": "Apache-2.0",
"peerDependencies": {
"@angular/core": "^18.0.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ function connectMicroFrontendRouter(injector: Injector, warn = true): Subscripti

function connectRouter(router: Router): Subscription {
const initialUrl = `${location.pathname.substring(getLocation().deploymentPath.length)}${location.search}${location.hash}`
router.navigateByUrl(initialUrl)
router.navigateByUrl(initialUrl, {
replaceUrl: true,
})
let lastUrl = initialUrl
const observer = new EventsTopic()
return observer.pipe(filter((e) => e.type === 'navigated')).subscribe(() => {
Expand Down
2 changes: 1 addition & 1 deletion libs/integration-interface/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onecx/integration-interface",
"version": "5.20.1",
"version": "5.22.2",
"license": "Apache-2.0",
"peerDependencies": {
"tslib": "^2.6.3",
Expand Down
2 changes: 1 addition & 1 deletion libs/keycloak-auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onecx/keycloak-auth",
"version": "5.20.1",
"version": "5.22.2",
"license": "Apache-2.0",
"peerDependencies": {
"@angular/common": "^18.0.5",
Expand Down
2 changes: 1 addition & 1 deletion libs/ngrx-accelerator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onecx/ngrx-accelerator",
"version": "5.20.1",
"version": "5.22.2",
"peerDependencies": {
"@angular/core": "^18.0.5",
"@angular/router": "^18.0.5",
Expand Down
17 changes: 17 additions & 0 deletions libs/portal-integration-angular/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,23 @@
"TABLE": "Tabelle"
}
},
"OCX_DATA_VIEW_CONTROLS" : {
"NO_GROUP_SELECTED": "Keine Gruppe ausgewählt",
"OPEN_BUTTON_DETAIL": "Dialog zur Auswahl einer benutzerdefinierten Gruppe öffnen",
"DROPDOWN": {
"ARIA_LABEL": "Sortieren nach"
},
"TOGGLE_BUTTON": {
"ASCENDING_TOOLTIP": "Aufsteigend",
"DESCENDING_TOOLTIP": "Absteigend"
},
"LAYOUT": {
"LIST": "Liste",
"GRID": "Raster",
"TABLE": "Tabelle"
},
"DIALOG_TITLE": "Spalten für benutzerdefinierte Gruppe auswählen"
},
"OCX_INTERACTIVE_DATA_VIEW": {
"DEFAULT_GROUP": "Standardgruppe",
"CUSTOM_GROUP": "Benutzerdefinierte Gruppe",
Expand Down
17 changes: 17 additions & 0 deletions libs/portal-integration-angular/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,23 @@
"TABLE": "Table"
}
},
"OCX_DATA_VIEW_CONTROLS" : {
"NO_GROUP_SELECTED": "No group selected",
"OPEN_BUTTON_DETAIL": "Open custom group selection dialog",
"DROPDOWN": {
"ARIA_LABEL": "Sort by"
},
"TOGGLE_BUTTON": {
"ASCENDING_TOOLTIP": "Ascending",
"DESCENDING_TOOLTIP": "Descending"
},
"LAYOUT": {
"LIST": "List",
"GRID": "Grid",
"TABLE": "Table"
},
"DIALOG_TITLE": "Custom group column selection"
},
"OCX_INTERACTIVE_DATA_VIEW": {
"DEFAULT_GROUP": "Default group",
"CUSTOM_GROUP": "Custom group",
Expand Down
2 changes: 1 addition & 1 deletion libs/portal-integration-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onecx/portal-integration-angular",
"version": "5.20.1",
"version": "5.22.2",
"license": "Apache-2.0",
"peerDependencies": {
"@angular/common": "^18.0.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
<ng-container #container></ng-container>
<ng-content></ng-content>
</div>
<div
class="w-full flex-column sm:flex-row align-content-end sm:align-content-start flex flex-wrap row-gap-2 column-gap-2"
>
<div class="w-full flex-row justify-content-end flex flex-wrap gap-2">
<ng-container *ngFor="let button of leftCustomButtons; index as i">
<div [ngStyle]="{'margin-right': (i === leftCustomButtons.length - 1) ? 'auto' : 0}">
<ng-container *ngTemplateOutlet="customButton; context: {button: button}"> </ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
*ngIf="columnTemplates.length > 0 && toggleColumnActive"
(templateChanged)="handleTemplateChange($event)"
(templateReset)="handleTemplateReset()"
[placeholder]="translations?.templatePickerDropdownPlaceholder || dropdownPlaceholderText || ('OCX_INTERACTIVE_DATA_VIEW.NO_GROUP_SELECTED' | translate)"
[placeholder]="translations?.templatePickerDropdownPlaceholder || dropdownPlaceholderText || ('OCX_DATA_VIEW_CONTROLS.NO_GROUP_SELECTED' | translate)"
>
</ocx-data-view-template-picker>
<button
*ngIf="toggleColumnActive"
type="button"
(click)="toggleColumns()"
pButton
[pTooltip]="translations?.toggleColumnButtonTooltip || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.OPEN_BUTTON_DETAIL' | translate)"
[pTooltip]="translations?.toggleColumnButtonTooltip || ('OCX_DATA_VIEW_CONTROLS.OPEN_BUTTON_DETAIL' | translate)"
tooltipPosition="top"
[attr.aria-label]="translations?.toggleColumnButtonTooltip || ('OCX_CUSTOM_GROUP_COLUMN_SELECTOR.OPEN_BUTTON_DETAIL' | translate)"
[attr.aria-label]="translations?.toggleColumnButtonTooltip || ('OCX_DATA_VIEW_CONTROLS.OPEN_BUTTON_DETAIL' | translate)"
icon="pi pi-cog"
></button>
</div>
Expand Down Expand Up @@ -73,7 +73,7 @@
styleClass="data-view-control-border min-w-min w-7rem"
[options]="sortingOptions"
(onChange)="selectSorting($event)"
[ariaLabel]="('OCX_LIST_GRID_SORT.DROPDOWN.ARIA_LABEL' | translate)"
[ariaLabel]="('OCX_DATA_VIEW_CONTROLS.DROPDOWN.ARIA_LABEL' | translate)"
></p-dropdown>
<label for="data-view-control-sortby" class="white-space-nowrap"
>{{ translations?.sortDropdownTooltip || 'Sort by' }}</label
Expand All @@ -84,9 +84,9 @@
onIcon="pi pi-sort-amount-up"
offIcon="pi pi-sort-amount-down"
(onChange)="sortDirection($event)"
[pTooltip]="!selectedSortDirection ? (translations?.sortOrderTooltips?.ascending || ('OCX_LIST_GRID_SORT.TOGGLE_BUTTON.ASCENDING_TITLE' | translate)) : (translations?.sortOrderTooltips?.descending || ('OCX_LIST_GRID_SORT.TOGGLE_BUTTON.DESCENDING_TITLE' | translate))"
[pTooltip]="!selectedSortDirection ? (translations?.sortOrderTooltips?.ascending || ('OCX_DATA_VIEW_CONTROLS.TOGGLE_BUTTON.ASCENDING_TOOLTIP' | translate)) : (translations?.sortOrderTooltips?.descending || ('OCX_DATA_VIEW_CONTROLS.TOGGLE_BUTTON.DESCENDING_TOOLTIP' | translate))"
tooltipPosition="top"
[ariaLabel]="!selectedSortDirection ? (translations?.sortOrderTooltips?.ascending || ('OCX_LIST_GRID_SORT.TOGGLE_BUTTON.ASCENDING_TITLE' | translate)) : (translations?.sortOrderTooltips?.descending || ('OCX_LIST_GRID_SORT.TOGGLE_BUTTON.DESCENDING_TITLE' | translate))"
[ariaLabel]="!selectedSortDirection ? (translations?.sortOrderTooltips?.ascending || ('OCX_DATA_VIEW_CONTROLS.TOGGLE_BUTTON.ASCENDING_TOOLTIP' | translate)) : (translations?.sortOrderTooltips?.descending || ('OCX_DATA_VIEW_CONTROLS.TOGGLE_BUTTON.DESCENDING_TOOLTIP' | translate))"
></p-toggleButton>
</div>
</div>
Loading

0 comments on commit 00b4b3c

Please sign in to comment.