Skip to content

Commit

Permalink
Resolves conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
walmazacn committed Jul 29, 2024
2 parents 0507d53 + ee9239f commit 00568f4
Show file tree
Hide file tree
Showing 35 changed files with 423 additions and 421 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ node_modules
.angulardoc.json
.vscode/diff
.vscode/settings.json
.vs

.changelog

Expand Down
2 changes: 1 addition & 1 deletion client/luigi-client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export declare interface UxManager {
* @example
* import LuigiClient from '@luigi-project/client';
* const settings = {
* text: "Ut enim ad minim veniam, {goToHome} quis nostrud exercitation ullamco {relativePath}. Duis aute irure dolor {goToOtherProject}",
* text: "Ut enim ad minim veniam, {goToHome} quis nostrud exercitation ullamco {relativePath}. Duis aute irure dolor {goToOtherProject} or {neverShowItAgain}",
* type: 'info',
* links: {
* goToHome: { text: 'homepage', url: '/overview' },
Expand Down
2 changes: 1 addition & 1 deletion client/luigi-element.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export declare interface UxManager {
* @example
* import LuigiClient from '@luigi-project/client';
* const settings = {
* text: "Ut enim ad minim veniam, {goToHome} quis nostrud exercitation ullamco {relativePath}. Duis aute irure dolor {goToOtherProject}",
* text: "Ut enim ad minim veniam, {goToHome} quis nostrud exercitation ullamco {relativePath}. Duis aute irure dolor {goToOtherProject} or {neverShowItAgain}",
* type: 'info',
* links: {
* goToHome: { text: 'homepage', url: '/overview' },
Expand Down
3 changes: 1 addition & 2 deletions client/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ class Helpers {
* @returns {number}
*/
getRandomId(): number {
// window.msCrypto for IE 11
return (window.crypto || (window as any).msCrypto).getRandomValues(new Uint32Array(1))[0];
return window.crypto.getRandomValues(new Uint32Array(1))[0];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion client/src/uxManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class UxManager extends LuigiClientBase {
* @example
* import LuigiClient from '@luigi-project/client';
* const settings = {
* text: "Ut enim ad minim veniam, {goToHome} quis nostrud exercitation ullamco {relativePath}. Duis aute irure dolor {goToOtherProject}",
* text: "Ut enim ad minim veniam, {goToHome} quis nostrud exercitation ullamco {relativePath}. Duis aute irure dolor {goToOtherProject} or {neverShowItAgain}",
* type: 'info',
* links: {
* goToHome: { text: 'homepage', url: '/overview' },
Expand Down
1 change: 0 additions & 1 deletion core/examples/luigi-example-react/public/sampleapp.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Luigi Simple React App</title>
</head>
Expand Down
1 change: 0 additions & 1 deletion core/examples/luigi-example-vue/public/sampleapp.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>luigi-example-vue</title>
</head>
Expand Down
1 change: 0 additions & 1 deletion core/examples/luigi-example-vue/sampleapp.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>luigi-example-vue</title>
</head>
Expand Down
3 changes: 3 additions & 0 deletions core/src/Alerts.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
function addClickListener(link, alertId) {
try {
const linkElem = document.getElementById(link.elemId);
if (!linkElem) {
return;
}
if (linkElem.dismissListener) {
linkElem.removeEventListener('click', linkElem.dismissListener);
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/core-api/ux.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class LuigiUX {
* @since 0.6.4
* @example
* const settings = {
* text: "Ut enim ad minim veniam, {goToHome} quis nostrud exercitation ullamco {relativePath}. Duis aute irure dolor {goToOtherProject}",
* text: "Ut enim ad minim veniam, {goToHome} quis nostrud exercitation ullamco {relativePath}. Duis aute irure dolor {goToOtherProject} or {neverShowItAgain}",
* type: 'info',
* links: {
* goToHome: { text: 'homepage', url: '/overview' },
Expand Down
1 change: 0 additions & 1 deletion core/src/navigation/GlobalNav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@
width: 0; /* chrome, safari */
}
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none; /* IE 10+ */
.fd-side-nav__utility {
margin-top: 0;
Expand Down
1 change: 0 additions & 1 deletion core/src/navigation/LeftNav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,6 @@
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
:global(html.luigi-app-in-custom-container) {
Expand Down
1 change: 0 additions & 1 deletion core/src/navigation/LeftNavGroup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
.fd-navigation__link {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
Expand Down
1 change: 0 additions & 1 deletion core/src/styles/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@mixin transition($args...) {
-webkit-transition: $args;
-moz-transition: $args;
-ms-transition: $args;
-o-transition: $args;
transition: $args;
}
Expand Down
3 changes: 1 addition & 2 deletions core/src/utilities/helpers/generic-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ class GenericHelpersClass {
* @private
*/
getRandomId /* istanbul ignore next */() {
// window.msCrypto for IE 11
return (window.crypto || window.msCrypto).getRandomValues(new Uint32Array(1))[0];
return window.crypto.getRandomValues(new Uint32Array(1))[0];
}

/**
Expand Down
1 change: 0 additions & 1 deletion cra-template/template/public/sampleapp.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Luigi Simple React App</title>
</head>
Expand Down
2 changes: 1 addition & 1 deletion docs/luigi-client-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ Shows an alert.
```javascript
import LuigiClient from '@luigi-project/client';
const settings = {
text: "Ut enim ad minim veniam, {goToHome} quis nostrud exercitation ullamco {relativePath}. Duis aute irure dolor {goToOtherProject}",
text: "Ut enim ad minim veniam, {goToHome} quis nostrud exercitation ullamco {relativePath}. Duis aute irure dolor {goToOtherProject} or {neverShowItAgain}",
type: 'info',
links: {
goToHome: { text: 'homepage', url: '/overview' },
Expand Down
2 changes: 1 addition & 1 deletion docs/luigi-core-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ Shows an alert.

```javascript
const settings = {
text: "Ut enim ad minim veniam, {goToHome} quis nostrud exercitation ullamco {relativePath}. Duis aute irure dolor {goToOtherProject}",
text: "Ut enim ad minim veniam, {goToHome} quis nostrud exercitation ullamco {relativePath}. Duis aute irure dolor {goToOtherProject} or {neverShowItAgain}",
type: 'info',
links: {
goToHome: { text: 'homepage', url: '/overview' },
Expand Down
51 changes: 14 additions & 37 deletions plugins/auth/src/auth-oauth2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ export default class oAuth2ImplicitGrant {
constructor(settings = {}) {
const defaultSettings = {
oAuthData: {
redirect_uri:
window.location.origin + '/assets/auth-oauth2/callback.html',
redirect_uri: window.location.origin + '/assets/auth-oauth2/callback.html',
response_type: 'id_token token',
scope: ''
},
Expand Down Expand Up @@ -48,8 +47,7 @@ export default class oAuth2ImplicitGrant {
login() {
return new Promise((resolve, reject) => {
const settings = this.settings;
const generatedNonce =
(settings.nonceFn && settings.nonceFn()) || this.generateNonce();
const generatedNonce = (settings.nonceFn && settings.nonceFn()) || this.generateNonce();
sessionStorage.setItem('luigi.nonceValue', generatedNonce);
if (!settings.oAuthData.nonce) {
settings.oAuthData.nonce = generatedNonce;
Expand All @@ -75,9 +73,7 @@ export default class oAuth2ImplicitGrant {
settings.oAuthData.redirect_uri = `${Helpers.prependOrigin(
settings.oAuthData.redirect_uri
)}?storageType=${Luigi.auth().store.getStorageType()}`;
settings.oAuthData.state = btoa(
encodeURI(window.location.href) + '_luigiNonce=' + generatedNonce
);
settings.oAuthData.state = btoa(encodeURI(window.location.href) + '_luigiNonce=' + generatedNonce);

for (const name in settings.oAuthData) {
const node = createInputElement(name, settings.oAuthData[name]);
Expand All @@ -100,13 +96,9 @@ export default class oAuth2ImplicitGrant {

logout(authData, authEventLogoutFn) {
const settings = this.settings;
const logouturl = `${settings.logoutUrl}?id_token_hint=${
authData.idToken
}&client_id=${
const logouturl = `${settings.logoutUrl}?id_token_hint=${authData.idToken}&client_id=${
settings.oAuthData.client_id
}&post_logout_redirect_uri=${Helpers.prependOrigin(
settings.post_logout_redirect_uri
)}`;
}&post_logout_redirect_uri=${Helpers.prependOrigin(settings.post_logout_redirect_uri)}`;
authEventLogoutFn && authEventLogoutFn();

setTimeout(() => {
Expand All @@ -122,43 +114,29 @@ export default class oAuth2ImplicitGrant {
return clearInterval(this.expirationCheckIntervalInstance);
}

const tokenExpirationDate =
(authData && authData.accessTokenExpirationDate) || 0;
const tokenExpirationDate = (authData && authData.accessTokenExpirationDate) || 0;
const currentDate = new Date();
if (tokenExpirationDate - currentDate < expirationCheckInterval) {
clearInterval(this.expirationCheckIntervalInstance);
Luigi.auth().store.removeAuthData();
// TODO: check if valid (mock-auth requires it), post_logout_redirect_uri is an assumption, might not be available for all auth providers
const redirectUrl = `${
this.settings.logoutUrl
}?error=tokenExpired&post_logout_redirect_uri=${Helpers.prependOrigin(
this.settings.post_logout_redirect_uri
)}`;
Luigi.auth().handleAuthEvent(
'onAuthExpired',
this.settings,
undefined,
redirectUrl
);
}?error=tokenExpired&post_logout_redirect_uri=${Helpers.prependOrigin(this.settings.post_logout_redirect_uri)}`;
Luigi.auth().handleAuthEvent('onAuthExpired', this.settings, undefined, redirectUrl);
}
}, expirationCheckInterval);
}

setTokenExpireSoonAction() {
const accessTokenExpiringNotificationTime =
this.settings.accessTokenExpiringNotificationTime * 1000;
const expirationCheckInterval =
this.settings.expirationCheckInterval * 1000;
const accessTokenExpiringNotificationTime = this.settings.accessTokenExpiringNotificationTime * 1000;
const expirationCheckInterval = this.settings.expirationCheckInterval * 1000;
let authData = this.getAuthData();
if (authData) {
this.expirationSoonCheckIntervalInstance = setInterval(() => {
const tokenExpirationDate =
(authData && authData.accessTokenExpirationDate) || 0;
const tokenExpirationDate = (authData && authData.accessTokenExpirationDate) || 0;
const currentDate = new Date();
if (
tokenExpirationDate - currentDate.getTime() <
accessTokenExpiringNotificationTime
) {
if (tokenExpirationDate - currentDate.getTime() < accessTokenExpiringNotificationTime) {
Luigi.auth().handleAuthEvent('onAuthExpireSoon', this.settings);
clearInterval(this.expirationSoonCheckIntervalInstance);
}
Expand All @@ -167,9 +145,8 @@ export default class oAuth2ImplicitGrant {
}

generateNonce() {
const validChars =
'0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz';
const crypto = window.crypto || window.msCrypto;
const validChars = '0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz';
const crypto = window.crypto;
const random = Array.from(crypto.getRandomValues(new Uint8Array(20)));

return random.map(x => validChars[x % validChars.length]).join('');
Expand Down
11 changes: 1 addition & 10 deletions plugins/auth/src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ class HelpersClass {
* @private
*/
getRandomId() {
// window.msCrypto for IE 11
return (window.crypto || window.msCrypto).getRandomValues(
new Uint32Array(1)
)[0];
return window.crypto.getRandomValues(new Uint32Array(1))[0];
}

isFunction(anyParam) {
Expand All @@ -21,12 +18,6 @@ class HelpersClass {
return anyParam && this.isFunction(anyParam.then);
}

isIE() {
const ua = navigator.userAgent;
/* MSIE used to detect old browsers and Trident used to newer ones*/
return Boolean(ua.includes('MSIE ') || ua.includes('Trident/'));
}

/**
* Simple object check.
* @param item mixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Luigi Mock Identity Provider</title>
<link
Expand Down
1 change: 0 additions & 1 deletion test/e2e-js-test-application/public/auth/logout.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="" />
<meta name="keywords" content="logout" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Luigi Mock Identity Provider</title>
<link rel="stylesheet" href="../../fundamental-styles/fundamental-styles.css" />
Expand Down
1 change: 0 additions & 1 deletion test/e2e-test-application/src/logout.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<title>Logout successful</title>
Expand Down
10 changes: 0 additions & 10 deletions website/docs/static/public/docsearch.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,6 @@
color: #aaa
}

.searchbox__input:-ms-input-placeholder {
color: #aaa
}

.searchbox__input::-ms-input-placeholder {
color: #aaa
}

.searchbox__input::placeholder {
color: #aaa
}
Expand All @@ -89,7 +81,6 @@
font-size: inherit;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
right: inherit;
left: 0
Expand Down Expand Up @@ -132,7 +123,6 @@
font-size: inherit;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
fill: rgba(0, 0, 0, .5)
}
Expand Down
Loading

0 comments on commit 00568f4

Please sign in to comment.