-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: create new libs * feat: init new shell libraries * fix: PrimeIcons not assignable to string for button * fix: change selector prefix to ocx * fix: minor change * feat: added topic for remote-components * fix: fixed error in model of remote-component topic * feat: moved slot component to angular-remote-components * feat: SlotService returns config and type * fix: fixed build error * fix: fixed build error * feat: provided SLOT_SERVICE in AngularStandaloneShellModule * feat: added standalone module to PIA * feat: added permissions to slot.component * fix: renamed basePath ot baseUrl * feat: add shell-portal-viewport, -portal-header, -portal-footer * feat: added image in header * fix: fixed name of AngularRemoteComponentsModule * feat: appConfig- and permissionsCache-service * feat: eventsTopic, topicPublisher, create remote translate loader, bffurl removed * feat: rename currentPortal to currentWorkspace, deprecate some variables * feat: provide translate service for root * feat: fix issue with auth, set favicon, fix slot component * fix: remove buildCopy script * feat: move advanced directive, fix lint issues * fix: npm i * feat: delete angular standalone shell, permision directive, some fixes * fix: permission directive * fix: clientSideSorting * fix: shell bff prefix in uppercase * fix: remove try catch block * fix: lint issues * feat: remove tests for shell header, footer, portal viewport * fix: change from portal to workspace --------- Co-authored-by: kim.tran <[email protected]> Co-authored-by: Jan-Gerrit Schettler-Köhler <[email protected]>
- Loading branch information
1 parent
ad0ebb4
commit 4a8a127
Showing
85 changed files
with
28,387 additions
and
18,747 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './lib/topic/topic' | ||
export * from './lib/topic/syncable-topic' | ||
export * from './lib/topic/topic-publisher' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { TopicDataMessage } from './topic-data-message' | ||
import { TopicMessageType } from './topic-message-type' | ||
|
||
export class TopicPublisher<T> { | ||
protected publishPromiseResolver: Record<number, () => void> = {} | ||
|
||
constructor(public name: string, public version: number) {} | ||
|
||
public publish(value: T): Promise<void> { | ||
const message = new TopicDataMessage<T>(TopicMessageType.TopicNext, this.name, this.version, value) | ||
const promise = new Promise<void>((resolve) => { | ||
this.publishPromiseResolver[message.timestamp] = resolve | ||
}) | ||
window.postMessage(message, '*') | ||
return promise | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...lib/core/directives/advanced.directive.ts → .../src/lib/directives/advanced.directive.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
libs/angular-accelerator/src/lib/services/app-config-service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { HttpClient } from '@angular/common/http' | ||
import { Injectable } from '@angular/core' | ||
import { Config } from '@onecx/integration-interface' | ||
import { BehaviorSubject, firstValueFrom } from 'rxjs' | ||
|
||
@Injectable() | ||
export class AppConfigService { | ||
config$ = new BehaviorSubject<{ [key: string]: string }>({}) | ||
|
||
constructor(private http: HttpClient) {} | ||
|
||
public init(baseUrl: string): Promise<void> { | ||
return new Promise((resolve, reject) => { | ||
const loadConfigPromise: Promise<Config> = firstValueFrom(this.http.get<Config>(baseUrl + 'assets/env.json')) | ||
|
||
loadConfigPromise | ||
.then(async (config) => { | ||
if (config) { | ||
this.config$.next(config) | ||
resolve() | ||
} | ||
}) | ||
.catch((e) => { | ||
console.log(`Failed to load env configuration`) | ||
reject(e) | ||
}) | ||
}) | ||
} | ||
|
||
public getProperty(key: string): string | undefined { | ||
return this.config$.getValue()?.[key] | ||
} | ||
|
||
public setProperty(key: string, val: string) { | ||
this.config$.next({ ...this.config$.value, [key]: val }) | ||
} | ||
|
||
public getConfig(): { [key: string]: string } { | ||
return this.config$.getValue() | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
libs/angular-accelerator/src/lib/utils/create-remote-component-translate-loader.utils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { Location } from '@angular/common' | ||
import { HttpClient } from '@angular/common/http' | ||
import { inject } from '@angular/core' | ||
import { TranslateLoader } from '@ngx-translate/core' | ||
import { map, ReplaySubject, tap } from 'rxjs' | ||
import { TranslationCacheService } from '../services/translation-cache.service' | ||
import { AsyncTranslateLoader } from './async-translate-loader.utils' | ||
import { CachingTranslateLoader } from './caching-translate-loader.utils' | ||
import { TranslateCombinedLoader } from './translate.combined.loader' | ||
|
||
let lastTranslateLoaderTimerId = 0 | ||
|
||
export function createRemoteComponentTranslateLoader( | ||
http: HttpClient, | ||
baseUrlReplaySubject$: ReplaySubject<string>, | ||
translationCacheService?: TranslationCacheService | ||
): TranslateLoader { | ||
const ts = translationCacheService ?? inject(TranslationCacheService) | ||
const timerId = lastTranslateLoaderTimerId++ | ||
|
||
console.time('createRemoteComponentTranslateLoader_' + timerId) | ||
return new AsyncTranslateLoader( | ||
baseUrlReplaySubject$.pipe( | ||
map((baseUrl) => { | ||
return new TranslateCombinedLoader( | ||
// translations of shell or of app in standalone mode | ||
new CachingTranslateLoader(ts, http, `./assets/i18n/`, '.json'), | ||
// translations of portal-integration-angular of app | ||
new CachingTranslateLoader( | ||
ts, | ||
http, | ||
Location.joinWithSlash(baseUrl, `onecx-portal-lib/assets/i18n/`), | ||
'.json' | ||
), | ||
// translations of the app | ||
new CachingTranslateLoader(ts, http, Location.joinWithSlash(baseUrl, `assets/i18n/`), '.json') | ||
) | ||
}), | ||
tap(() => console.timeEnd('createRemoteComponentTranslateLoader_' + timerId)) | ||
) | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
libs/angular-integration-interface/src/lib/api/iauth.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
/** | ||
* @deprecated | ||
*/ | ||
export interface IAuthService { | ||
logout(): void | ||
|
||
|
Oops, something went wrong.