Skip to content

Commit

Permalink
Resolves conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
walmazacn committed Nov 13, 2024
2 parents 466f88d + 57b6118 commit 07c986a
Show file tree
Hide file tree
Showing 112 changed files with 11,173 additions and 8,757 deletions.
9 changes: 0 additions & 9 deletions .eslintrc

This file was deleted.

13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ The lerna-changelog tool detects changes based on PR labels and maps them to sec
-->


## [v2.18.0] (2024-11-05)

#### :rocket: Added
* [#4008](https://github.com/SAP/luigi/pull/4008) Adds document attribute for disable tcpcheck ([@walmazacn](https://github.com/walmazacn))
* [#3983](https://github.com/SAP/luigi/pull/3983) Disable tpc via client ([@JohannesDoberer](https://github.com/JohannesDoberer))





## [v2.17.0] (2024-10-02)

#### :rocket: Added
Expand Down Expand Up @@ -1882,4 +1892,5 @@ The lerna-changelog tool detects changes based on PR labels and maps them to sec
[v2.14.3]: https://github.com/SAP/luigi/compare/v2.14.2...v2.14.3
[v2.15.0]: https://github.com/SAP/luigi/compare/v2.14.3...v2.15.0
[v2.16.0]: https://github.com/SAP/luigi/compare/v2.15.0...v2.16.0
[v2.17.0]: https://github.com/SAP/luigi/compare/v2.16.0...v2.17.0
[v2.17.0]: https://github.com/SAP/luigi/compare/v2.16.0...v2.17.0
[v2.18.0]: https://github.com/SAP/luigi/compare/v2.17.0...v2.18.0
49 changes: 41 additions & 8 deletions client-frameworks-support/client-support-angular/package-lock.json

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

Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"engine.io": "~6.5.5",
"engine.io": "~6.6.2",
"jasmine-core": "~3.8.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.3.16",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
"@luigi-project/client": "^2.0.0",
"@luigi-project/testing-utilities": "^2.0.0"
},
"version": "2.17.0"
"version": "2.18.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"microfrontends",
"testing"
],
"version": "2.17.0",
"version": "2.18.0",
"engines": {
"node": ">=18.19.1"
}
Expand Down
4 changes: 2 additions & 2 deletions client-frameworks-support/testing-utilities/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 client-frameworks-support/testing-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"microfrontends",
"testing"
],
"version": "2.17.0",
"version": "2.18.0",
"engines": {
"node": ">=18.19.1"
}
Expand Down
2 changes: 1 addition & 1 deletion client/public/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"micro-frontends",
"microfrontends"
],
"version": "2.17.0"
"version": "2.18.0"
}
22 changes: 17 additions & 5 deletions client/src/lifecycleManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class LifecycleManager extends LuigiClientBase {
currentContext!: Context;
private authData: AuthData;
private defaultContextKeys: string[];
private disableTpcCheck: boolean;
private luigiInitialized: boolean;
private _onContextUpdatedFns: Record<any, any>;
private _onInactiveFns: Record<any, any>;
Expand All @@ -28,8 +27,6 @@ class LifecycleManager extends LuigiClientBase {
/** @private */
constructor() {
super();

this.disableTpcCheck = false;
this.luigiInitialized = false;
this.defaultContextKeys = ['context', 'internal', 'nodeParams', 'pathParams', 'searchParams'];

Expand Down Expand Up @@ -60,6 +57,18 @@ class LifecycleManager extends LuigiClientBase {
return window.document.head.hasAttribute('defer-luigi-init');
}

/**
* Check if the html head element contains the attribute "disable-tpc-check"
* @private
* @memberof Lifecycle
*/
_isTpcCheckDisabled(): boolean {
return !!(
window.document.head.hasAttribute('disable-tpc-check') ||
(this.currentContext.internal as Record<string, any>)['thirdPartyCookieCheck']?.disabled
);
}

/**
* Check if LuigiClient is initialized
* @returns {boolean} client initialized state
Expand Down Expand Up @@ -172,7 +181,7 @@ class LifecycleManager extends LuigiClientBase {
}

_tpcCheck(): void {
if ((this.currentContext.internal as Record<string, any>)['thirdPartyCookieCheck']?.disabled || this.disableTpcCheck) {
if (this._isTpcCheckDisabled()) {
return;
}

Expand Down Expand Up @@ -271,9 +280,12 @@ class LifecycleManager extends LuigiClientBase {
addInitListener(initFn: (context: Context, origin?: string) => void, disableTpcCheck: boolean): number {
const id: number = helpers.getRandomId();

this.disableTpcCheck = disableTpcCheck;
this._onInitFns[`${id}`] = initFn;

if (disableTpcCheck) {
document.head.setAttribute('disable-tpc-check', 'true');
}

if (this.luigiInitialized && helpers.isFunction(initFn)) {
initFn(this.currentContext.context as Record<string, any>, helpers.getLuigiCoreDomain());
}
Expand Down
8 changes: 4 additions & 4 deletions client/src/linkManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,8 @@ class linkManager extends LuigiClientBase {
const pathExistsPromises = this.getPromise('pathExistsPromises') || {};

pathExistsPromises[currentId] = {
resolveFn: function() {},
then: function(resolveFn: () => void) {
resolveFn: function () {},
then: function (resolveFn: () => void) {
this.resolveFn = resolveFn;
}
};
Expand Down Expand Up @@ -562,8 +562,8 @@ class linkManager extends LuigiClientBase {
const currentRoutePromise = this.getPromise('getCurrentRoute') || {};

currentRoutePromise[currentId] = {
resolveFn: function() {},
then: function(resolveFn: () => void) {
resolveFn: function () {},
then: function (resolveFn: () => void) {
this.resolveFn = resolveFn;
}
};
Expand Down
10 changes: 5 additions & 5 deletions client/src/uxManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class UxManager extends LuigiClientBase {
* });
*/
showConfirmationModal(settings: ConfirmationModalSettings): Promise<void> {
helpers.addEventListener('luigi.ux.confirmationModal.hide', (event, listenerId) => {
helpers.addEventListener('luigi.ux.confirmationModal.hide', (event: any, listenerId: string) => {
this.hideConfirmationModal(event.data.data);
helpers.removeEventListener(listenerId);
});
Expand Down Expand Up @@ -174,7 +174,7 @@ class UxManager extends LuigiClientBase {
// generate random ID
settings.id = helpers.getRandomId().toString();

helpers.addEventListener('luigi.ux.alert.hide', (event, listenerId) => {
helpers.addEventListener('luigi.ux.alert.hide', (event: any, listenerId: string) => {
if (event.data.id === settings.id) {
this.hideAlert(event.data);
helpers.removeEventListener(listenerId);
Expand All @@ -194,7 +194,7 @@ class UxManager extends LuigiClientBase {
const alertPromises = this.getPromise('alerts') || {};

alertPromises[settings.id] = {};
alertPromises[settings.id].promise = new Promise(resolve => {
alertPromises[settings.id].promise = new Promise((resolve) => {
alertPromises[settings.id].resolveFn = resolve;
});
this.setPromise('alerts', alertPromises);
Expand Down Expand Up @@ -310,7 +310,7 @@ class UxManager extends LuigiClientBase {
* @example LuigiClient.uxManager().applyCSS();
*/
applyCSS(): void {
document.querySelectorAll('head style[luigi-injected]').forEach(luigiInjectedStyleTag => {
document.querySelectorAll('head style[luigi-injected]').forEach((luigiInjectedStyleTag) => {
luigiInjectedStyleTag.remove();
});

Expand All @@ -319,7 +319,7 @@ class UxManager extends LuigiClientBase {
if (vars) {
let cssString = ':root {\n';

Object.keys(vars).forEach(key => {
Object.keys(vars).forEach((key) => {
const val = vars[key];

cssString += (key.startsWith('--') ? '' : '--') + key + ':' + val + ';\n';
Expand Down
Loading

0 comments on commit 07c986a

Please sign in to comment.