Skip to content

Commit

Permalink
Merge branch 'main' into feat/basic-search-to-simple-search-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
markuczy committed Feb 28, 2024
2 parents 122bf3f + f2e7606 commit cd5fd08
Show file tree
Hide file tree
Showing 41 changed files with 371 additions and 145 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## [4.9.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v4.8.0...v4.9.0) (2024-02-28)


### Features

* column group floating label displayed ([#148](https://github.com/onecx/onecx-portal-ui-libs/issues/148)) ([70cf90e](https://github.com/onecx/onecx-portal-ui-libs/commit/70cf90ed8f906d640ea7280ec850a377b6b7f785))
* lifecycle component ([#153](https://github.com/onecx/onecx-portal-ui-libs/issues/153)) ([c9c8cdf](https://github.com/onecx/onecx-portal-ui-libs/commit/c9c8cdfbc2071d65e21d3f809d97355e1201e079))
* search header allows to provide subheader now ([#147](https://github.com/onecx/onecx-portal-ui-libs/issues/147)) ([d4bf6c5](https://github.com/onecx/onecx-portal-ui-libs/commit/d4bf6c5edb15f49f293290ddd2fdd4639e44fcd8))


### Bug Fixes

* adapt SearchConfig interface and use the type PrimeIcon for icons ([#152](https://github.com/onecx/onecx-portal-ui-libs/issues/152)) ([56e09ac](https://github.com/onecx/onecx-portal-ui-libs/commit/56e09acc4d312b9006da378817fa944f3f1eec59))


### Refactoring

* migrate icons in TS to PrimeIcons ([#151](https://github.com/onecx/onecx-portal-ui-libs/issues/151)) ([186fae8](https://github.com/onecx/onecx-portal-ui-libs/commit/186fae874a752f734b87c45d35a9c4c5c0e79bc2))

## [4.8.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v4.7.0...v4.8.0) (2024-02-26)


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": "4.8.0",
"version": "4.9.0",
"peerDependencies": {
"tslib": "^2.3.0",
"rxjs": "7.8.1"
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": "4.8.0",
"version": "4.9.0",
"peerDependencies": {
"tslib": "^2.3.0",
"rxjs": "7.8.1",
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": "4.8.0",
"version": "4.9.0",
"peerDependencies": {
"@angular/common": ">=15.2.7",
"@angular/core": ">=15.2.7",
Expand Down
1 change: 1 addition & 0 deletions libs/portal-integration-angular/assets/i18n/de.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"OCX_CUSTOM_GROUP_COLUMN_SELECTOR": {
"DROPDOWN_LABEL": "Spalten",
"OPEN_BUTTON_TITLE": "Dialog zur Auswahl einer benutzerdefinierten Gruppe öffnen",
"ACTIVE_COLUMNS_LABEL": "Aktive Spalten",
"INACTIVE_COLUMNS_LABEL": "Inaktive Spalten",
Expand Down
1 change: 1 addition & 0 deletions libs/portal-integration-angular/assets/i18n/en.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"OCX_CUSTOM_GROUP_COLUMN_SELECTOR": {
"DROPDOWN_LABEL": "Columns",
"OPEN_BUTTON_TITLE": "Open custom group selection dialog",
"ACTIVE_COLUMNS_LABEL": "Active columns",
"INACTIVE_COLUMNS_LABEL": "Inactive columns",
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": "4.8.0",
"version": "4.9.0",
"peerDependencies": {
"@angular-architects/module-federation": "15.0.0",
"@angular/common": "^15.2.7",
Expand Down
2 changes: 2 additions & 0 deletions libs/portal-integration-angular/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export * from './lib/core/components/loading-indicator/loading-indicator.compone
export * from './lib/core/components/content-container/content-container.component'
export * from './lib/core/components/content/content.component'
export * from './lib/core/components/create-or-edit-search-config-dialog/create-or-edit-search-config-dialog.component'
export * from './lib/core/components/lifecycle/lifecycle.component'

// services
export * from './lib/services/app.menu.service'
Expand Down Expand Up @@ -127,3 +128,4 @@ export * from './lib/core/utils/add-initialize-module-guard.utils'
export * from './lib/core/utils/translate-service-initializer.utils'
export * from './lib/core/utils/portal-api-configuration.utils'
export * from './lib/core/utils/caching-translate-loader.utils'
export * from './lib/core/utils/primeicon.utils'
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<div>
<ng-container #container></ng-container>
<ng-content></ng-content>
<div class="w-full flex justify-content-end mb-3">
<button
id="buttonDialogSecondaryButton"
pButton
*ngIf="dialogData.config.secondaryButtonIncluded"
class="mx-2"
[icon]="dialogData.config.secondaryButtonDetails!.icon !== undefined ? dialogData.config.secondaryButtonDetails!.icon : ''"
(click)="secondaryButtonAction()"
[label]="dialogData.config.secondaryButtonDetails!.key | translate:dialogData.config.secondaryButtonDetails?.parameters"
[disabled]="secondaryButtonDisabled$ | async"
></button>
<button
id="buttonDialogPrimaryButton"
pButton
class="mx-2"
[icon]="dialogData.config.primaryButtonDetails!.icon !== undefined ? dialogData.config.primaryButtonDetails!.icon : ''"
(click)="primaryButtonAction()"
[label]="dialogData.config.primaryButtonDetails!.key | translate:dialogData.config.primaryButtonDetails?.parameters"
[disabled]="primaryButtonDisabled$ | async"
></button>
</div>
</div>
<ng-container #container></ng-container>
<ng-content></ng-content>
<div class="w-full flex justify-content-end mb-3">
<button
id="buttonDialogSecondaryButton"
pButton
*ngIf="dialogData.config.secondaryButtonIncluded"
class="mx-2"
[icon]="dialogData.config.secondaryButtonDetails!.icon !== undefined ? dialogData.config.secondaryButtonDetails!.icon : ''"
(click)="secondaryButtonAction()"
[label]="dialogData.config.secondaryButtonDetails!.key | translate:dialogData.config.secondaryButtonDetails?.parameters"
[disabled]="secondaryButtonDisabled$ | async"
></button>
<button
id="buttonDialogPrimaryButton"
pButton
class="mx-2"
[icon]="dialogData.config.primaryButtonDetails!.icon !== undefined ? dialogData.config.primaryButtonDetails!.icon : ''"
(click)="primaryButtonAction()"
[label]="dialogData.config.primaryButtonDetails!.key | translate:dialogData.config.primaryButtonDetails?.parameters"
[disabled]="primaryButtonDisabled$ | async"
></button>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ButtonDialogComponent } from './button-dialog.component'
import { MockAuthModule } from '../../../mock-auth/mock-auth.module'
import { ButtonDialogHarness, DivHarness } from '../../../../../testing'
import { ButtonDialogConfig } from '../../../model/button-dialog'
import { PrimeIcons } from 'primeng/api'

@Component({
template: `<ocx-button-dialog>
Expand All @@ -20,12 +21,12 @@ class TestBaseHostComponent {}
const config: ButtonDialogConfig = {
primaryButtonDetails: {
key: 'inlineMain',
icon: 'pi pi-plus',
icon: PrimeIcons.PLUS,
},
secondaryButtonIncluded: true,
secondaryButtonDetails: {
key: 'inlineSide',
icon: 'pi pi-times',
icon: PrimeIcons.TIMES,
},
}

Expand Down Expand Up @@ -121,21 +122,21 @@ describe('ButtonDialogComponent', () => {
component.dialogData.config = {
primaryButtonDetails: {
key: 'CustomMain',
icon: 'pi pi-check',
icon: PrimeIcons.CHECK,
},
secondaryButtonIncluded: true,
secondaryButtonDetails: {
key: 'CustomSide',
icon: 'pi pi-times',
icon: PrimeIcons.TIMES,
},
}

// expect correct label
expect(await buttonDialogHarness.getPrimaryButtonLabel()).toBe('CustomMain')
expect(await buttonDialogHarness.getSecondaryButtonLabel()).toBe('CustomSide')
// expect correct icon
expect(await buttonDialogHarness.getPrimaryButtonIcon()).toBe('pi pi-check')
expect(await buttonDialogHarness.getSecondaryButtonIcon()).toBe('pi pi-times')
expect(await buttonDialogHarness.getPrimaryButtonIcon()).toBe(PrimeIcons.CHECK)
expect(await buttonDialogHarness.getSecondaryButtonIcon()).toBe(PrimeIcons.TIMES)
})

it('should translate button keys', async () => {
Expand Down Expand Up @@ -317,9 +318,9 @@ describe('ButtonDialogComponent', () => {
buttonDialogHarness = await harnessLoader.getHarness(ButtonDialogHarness)

expect(await buttonDialogHarness.getPrimaryButtonLabel()).toBe('inlineMain')
expect(await buttonDialogHarness.getPrimaryButtonIcon()).toBe('pi pi-plus')
expect(await buttonDialogHarness.getPrimaryButtonIcon()).toBe(PrimeIcons.PLUS)
expect(await buttonDialogHarness.getSecondaryButtonLabel()).toBe('inlineSide')
expect(await buttonDialogHarness.getSecondaryButtonIcon()).toBe('pi pi-times')
expect(await buttonDialogHarness.getSecondaryButtonIcon()).toBe(PrimeIcons.TIMES)
})

it('should use default emitter inline', async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<p-dropdown
id="columnGroupSelectionDropdown"
*ngIf="(allGroupKeys$ | async)?.length"
(onClear)="clearGroupSelection()"
(onChange)="changeGroupSelection($event)"
[options]="(allGroupKeys$ | async) || []"
[placeholder]="placeholderKey | translate"
[showClear]="selectedGroupKey !== defaultGroupKey"
[(ngModel)]="selectedGroupKey"
>
<ng-template let-item pTemplate="item"> {{ item ? (item | translate) : ''}} </ng-template>
<ng-template let-item pTemplate="selectedItem"> {{ item ? (item | translate) : ''}} </ng-template>
</p-dropdown>
<span class="p-float-label">
<p-dropdown
id="columnGroupSelectionDropdown"
*ngIf="(allGroupKeys$ | async)?.length"
(onClear)="clearGroupSelection()"
(onChange)="changeGroupSelection($event)"
[options]="(allGroupKeys$ | async) || []"
[placeholder]="placeholderKey | translate"
[showClear]="selectedGroupKey !== defaultGroupKey"
[(ngModel)]="selectedGroupKey"
>
<ng-template let-item pTemplate="item"> {{ item ? (item | translate) : ''}} </ng-template>
<ng-template let-item pTemplate="selectedItem"> {{ item ? (item | translate) : ''}} </ng-template>
</p-dropdown>
<label for="columnGroupSelectionDropdown">{{ ("OCX_CUSTOM_GROUP_COLUMN_SELECTOR.DROPDOWN_LABEL" | translate) }}</label>
</span>
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
import { PrimeIcons } from 'primeng/api'
import { PrimeIcon } from '../../utils/primeicon.utils'

interface ViewingLayouts {
icon: string
icon: PrimeIcon
layout: 'grid' | 'list' | 'table'
title?: string
titleKey: string
}

const ALL_VIEW_LAYOUTS: ViewingLayouts[] = [
{ icon: 'pi pi-list', layout: 'list', titleKey: 'OCX_DATA_LAYOUT_SELECTION.LAYOUT.LIST' },
{ icon: 'pi pi-th-large', layout: 'grid', titleKey: 'OCX_DATA_LAYOUT_SELECTION.LAYOUT.GRID' },
{ icon: 'pi pi-table', layout: 'table', titleKey: 'OCX_DATA_LAYOUT_SELECTION.LAYOUT.TABLE' },
{ icon: PrimeIcons.LIST, layout: 'list', titleKey: 'OCX_DATA_LAYOUT_SELECTION.LAYOUT.LIST' },
{ icon: PrimeIcons.TH_LARGE, layout: 'grid', titleKey: 'OCX_DATA_LAYOUT_SELECTION.LAYOUT.GRID' },
{ icon: PrimeIcons.TABLE, layout: 'table', titleKey: 'OCX_DATA_LAYOUT_SELECTION.LAYOUT.TABLE' },
]

@Component({
Expand Down Expand Up @@ -38,7 +40,7 @@ export class DataLayoutSelectionComponent implements OnInit {
this.layout = 'table'
}

onDataViewLayoutChange(event: { icon: string; layout: 'grid' | 'list' | 'table' }): void {
onDataViewLayoutChange(event: { icon: PrimeIcon; layout: 'grid' | 'list' | 'table' }): void {
this.dataViewLayoutChange.emit(event.layout)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from '@angular/core'
import { Router } from '@angular/router'
import { TranslateService } from '@ngx-translate/core'
import { MenuItem } from 'primeng/api'
import { MenuItem, PrimeIcons } from 'primeng/api'
import { BehaviorSubject, Observable, combineLatest, map, mergeMap } from 'rxjs'
import { DataAction } from '../../../model/data-action'
import { DataSortDirection } from '../../../model/data-sort-direction'
Expand Down Expand Up @@ -259,21 +259,21 @@ export class DataListGridComponent extends DataSortBase implements OnInit, DoChe
if (this.viewItem.observed && this.userService.hasPermission(this.viewPermission || '')) {
menuItems.push({
label: translations[this.viewMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.VIEW'],
icon: 'pi pi-eye',
icon: PrimeIcons.EYE,
command: () => this.viewItem.emit(this.selectedItem),
})
}
if (this.editItem.observed && this.userService.hasPermission(this.editPermission || '')) {
menuItems.push({
label: translations[this.editMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.EDIT'],
icon: 'pi pi-pencil',
icon: PrimeIcons.PENCIL,
command: () => this.editItem.emit(this.selectedItem),
})
}
if (this.deleteItem.observed && this.userService.hasPermission(this.deletePermission || '')) {
menuItems.push({
label: translations[this.deleteMenuItemKey || 'OCX_DATA_LIST_GRID.MENU.DELETE'],
icon: 'pi pi-trash',
icon: PrimeIcons.TRASH,
command: () => this.deleteItem.emit(this.selectedItem),
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,26 @@ import { Column } from '../../../model/column'
import { ColumnViewTemplate } from '../../../model/column-view-template'
import { ColumnTogglerComponent } from './column-toggler-component/column-toggler.component'
import { ViewTemplatePickerComponent } from './view-template-picker/view-template-picker.component'
import { PrimeIcons } from 'primeng/api'
import { PrimeIcon } from '../../utils/primeicon.utils'

interface ViewingModes {
icon: string
icon: PrimeIcon
mode: string
title?: string
titleKey?: string
}

const ALL_VIEW_MODES = [
{ icon: 'pi pi-list', mode: 'list', titleKey: 'OCX_DATA_LAYOUT_SELECTION.LAYOUT.LIST' },
{ icon: 'pi pi-th-large', mode: 'grid', titleKey: 'OCX_DATA_LAYOUT_SELECTION.LAYOUT.GRID' },
{ icon: 'pi pi-table', mode: 'table', titleKey: 'OCX_DATA_LAYOUT_SELECTION.LAYOUT.TABLE' },
type ViewMode = {
icon: PrimeIcon
mode: string
titleKey: string
}

const ALL_VIEW_MODES: ViewMode[] = [
{ icon: PrimeIcons.LIST, mode: 'list', titleKey: 'OCX_DATA_LAYOUT_SELECTION.LAYOUT.LIST' },
{ icon: PrimeIcons.TH_LARGE, mode: 'grid', titleKey: 'OCX_DATA_LAYOUT_SELECTION.LAYOUT.GRID' },
{ icon: PrimeIcons.TABLE, mode: 'table', titleKey: 'OCX_DATA_LAYOUT_SELECTION.LAYOUT.TABLE' },
]

interface DefaultColumnDefinition {
Expand Down Expand Up @@ -248,7 +256,7 @@ export class DataViewControlsComponent implements OnInit, OnChanges {
})
}

viewModeChange(event: { icon: string; mode: string }): void {
viewModeChange(event: { icon: PrimeIcon; mode: string }): void {
this.dataViewChange.emit(event.mode)
this.enableToggleColumnButton(event.mode)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,33 @@ import { PrimeIcons } from 'primeng/api'
import { DiagramData } from '../../../model/diagram-data'
import { DiagramType } from '../../../model/diagram-type'
import { ColorUtils } from '../../utils/colorutils'
import { PrimeIcon } from '../../utils/primeicon.utils'

export interface DiagramLayouts {
icon: string
icon: PrimeIcon
layout: DiagramType
title?: string
titleKey: string
}

const allDiagramTypes: DiagramLayouts[] = [
{ icon: PrimeIcons.CHART_PIE, layout: DiagramType.PIE, titleKey: 'OCX_DIAGRAM.SWITCH_DIAGRAM_TYPE.PIE' },
{ icon: PrimeIcons.BARS, layout: DiagramType.HORIZONTAL_BAR, titleKey: 'OCX_DIAGRAM.SWITCH_DIAGRAM_TYPE.HORIZONTAL_BAR' },
{ icon: PrimeIcons.CHART_BAR, layout: DiagramType.VERTICAL_BAR, titleKey: 'OCX_DIAGRAM.SWITCH_DIAGRAM_TYPE.VERTICAL_BAR' },
{
icon: PrimeIcons.BARS,
layout: DiagramType.HORIZONTAL_BAR,
titleKey: 'OCX_DIAGRAM.SWITCH_DIAGRAM_TYPE.HORIZONTAL_BAR',
},
{
icon: PrimeIcons.CHART_BAR,
layout: DiagramType.VERTICAL_BAR,
titleKey: 'OCX_DIAGRAM.SWITCH_DIAGRAM_TYPE.VERTICAL_BAR',
},
]

@Component({
selector: 'ocx-diagram',
templateUrl: './diagram.component.html',
styleUrls: ['./diagram.component.scss']
styleUrls: ['./diagram.component.scss'],
})
export class DiagramComponent implements OnInit, OnChanges {
@Input() data: DiagramData[] | undefined
Expand All @@ -41,7 +50,7 @@ export class DiagramComponent implements OnInit, OnChanges {
this.chartType = this.diagramTypeToChartType(value)
}
private _supportedDiagramTypes: DiagramType[] = []
@Input()
@Input()
get supportedDiagramTypes(): DiagramType[] {
return this._supportedDiagramTypes
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<p-timeline [value]="steps">
<ng-template pTemplate="marker" let-step>
<span class="p-timeline-event-marker" [ngClass]="activeStepId && activeStepId === step.id ? 'bg-primary' : ''"></span>
</ng-template>
<ng-template pTemplate="content" let-step>
<div class="pb-4 h-full">
<div class="card h-full" [ngClass]="activeStepId && activeStepId === step.id ? 'bg-primary' : ''">
<p class="font-bold text-xl" [ngClass]="step.details ? 'mb-2' : ''">{{ step.title }}</p>
<p *ngIf="step.details" [ngClass]="activeStepId && activeStepId === step.id ? '' : 'text-color-secondary'">{{ step.details }}</p>
</div>
</div>
</ng-template>
</p-timeline>
Loading

0 comments on commit cd5fd08

Please sign in to comment.