Skip to content

Commit

Permalink
Merge branch 'main' into feat/predefined-search-config
Browse files Browse the repository at this point in the history
  • Loading branch information
anninowak committed Dec 13, 2023
2 parents e5cbef7 + 5082bea commit 67e52a6
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 12 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## [3.6.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v3.5.2...v3.6.0) (2023-12-07)

### Bug Fixes


## [3.5.2](https://github.com/onecx/onecx-portal-ui-libs/compare/v3.5.1...v3.5.2) (2023-12-05)


### Bug Fixes

* diagram color range fix ([487f671](https://github.com/onecx/onecx-portal-ui-libs/commit/487f67180cfa473b8d554cd7149d7b90967db79d))
* theme logo ([e8ebc0e](https://github.com/onecx/onecx-portal-ui-libs/commit/e8ebc0ebcd69364a9e000929f32380573858f7b3))

## [3.5.1](https://github.com/onecx/onecx-portal-ui-libs/compare/v3.5.0...v3.5.1) (2023-11-21)


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": "3.5.1",
"version": "3.6.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": "3.5.1",
"version": "3.6.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": "3.5.1",
"version": "3.6.0",
"peerDependencies": {
"@angular/common": ">=15.2.7",
"@angular/core": ">=15.2.7",
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": "3.5.1",
"version": "3.6.0",
"peerDependencies": {
"@angular-architects/module-federation": "15.0.0",
"@angular/common": "^15.2.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ export class PortalViewportComponent implements OnInit, AfterViewInit, OnDestroy

this.themeService.currentTheme$.pipe(untilDestroyed(this)).subscribe((theme: any) => {
this.logoUrl = theme.logoUrl || this.portalDefinition.logoUrl
if (this.logoUrl && !this.logoUrl.startsWith('/portal-api')) {
this.logoUrl = '/portal-api' + this.logoUrl
}
document.getElementById('favicon')?.setAttribute('href', theme.faviconUrl)
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@ import {
import { IAuthService } from '../../api/iauth.service'
import { AUTH_SERVICE } from '../../api/injection-tokens'

@Directive({ selector: '[ocxIfPermission]' })
@Directive({ selector: '[ocxIfPermission], [ocxIfNotPermission]' })
export class IfPermissionDirective implements OnInit {
@Input('ocxIfPermission') permission: string | undefined
@Input('ocxIfNotPermission') set notPermission(value: string | undefined) {
this.permission = value
this.negate = true
}

@Input() onMissingPermission: 'hide' | 'disable' = 'hide'
negate = false

constructor(
private renderer: Renderer2,
Expand All @@ -27,8 +33,7 @@ export class IfPermissionDirective implements OnInit {

ngOnInit() {
if (this.permission) {
if (!this.authService.hasPermission(this.permission)) {
console.log(`Permission check failed: ${this.permission}`)
if (this.negate === this.authService.hasPermission(this.permission)) {
if (this.onMissingPermission === 'disable') {
this.renderer.setAttribute(this.el.nativeElement, 'disabled', 'disabled')
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ export class ThemeService implements OnDestroy {
return this.http.get<Theme>(`${this.baseUrlV1}/internal/themes/${encodeURI(themeName)}`).pipe(
tap((theme) => {
this.apply(theme)
this.currentTheme$.publish(theme)
})
)
}

public apply(theme: Theme) {
console.log(`🎨 Applying theme: ${theme.name}`)
this.currentTheme$.publish(theme)
if (theme.properties) {
Object.values(theme.properties).forEach((group) => {
for (const [key, value] of Object.entries(group)) {
Expand Down
2 changes: 1 addition & 1 deletion libs/portal-layout-styles/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onecx/portal-layout-styles",
"version": "3.5.1",
"version": "3.6.0",
"peerDependencies": {
"tslib": "^2.5.0"
},
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onecx/onecx-portal-ui-libs",
"version": "3.5.1",
"version": "3.6.0",
"license": "Apache-2.0",
"scripts": {},
"private": true,
Expand Down

0 comments on commit 67e52a6

Please sign in to comment.