Skip to content

Commit

Permalink
Merge branch 'master' into tigger-pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
frontegg-david committed Nov 20, 2023
2 parents 17f0cbe + d39ac4d commit 2340422
Show file tree
Hide file tree
Showing 11 changed files with 125 additions and 55 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/trigger-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
repo: ${{ inputs.repo }}
sha: ${{ inputs.sha }}
with:
github-token: ${{ secrets.GH_REPOSITORY_ADMIN_TOKEN }}
github-token: ${{ secrets.E2E_WORKFLOW_TOKEN }}
script: |
const {repo, sha, version} = process.env;
const owner = context.payload.repository.organization
Expand Down
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Change Log

## [6.0.8](https://github.com/frontegg/frontegg-react/compare/v6.0.7...v6.0.8) (2023-11-6)

- FR-14102 - Fixed entitlements Frontegg user-id attribute usage
- FR-13123 - Added support to provide scopes for social logins

# Change Log

## [6.0.7](https://github.com/frontegg/frontegg-react/compare/v6.0.6...v6.0.7) (2023-11-1)

- FR-13327 - Update modern theme grey palette
- FR-13834 - Added Rule based entitlements
- FR-13508 - Mobile native module bridge
- FR-13772 - Fixed issue on edit user roles modal - at least 1 role is required
- FR-13808 - Support Login with SMS
- FR-13786 - Support tab per tenant

# Change Log

## [6.0.6](https://github.com/frontegg/frontegg-react/compare/v6.0.5...v6.0.6) (2023-10-24)

- FR-13772 - Fixed issue on edit user roles modal - at least 1 role is required
- FR-13808 - Support Login with SMS
- FR-13786 - Support tab per tenant


### React Wrapper 6.0.6:
- Remove duplicated step in trigger e2e test
- trigger e2e pipeline test
# Change Log

## [6.0.5](https://github.com/frontegg/frontegg-react/compare/v6.0.4...v6.0.5) (2023-10-11)

- FR-13798 - Added support for login with SMS
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packages": [
"packages/*"
],
"version": "6.0.5",
"version": "6.0.8",
"npmClient": "yarn",
"useWorkspaces": true,
"publishConfig": {
Expand Down
4 changes: 2 additions & 2 deletions packages/demo-saas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@frontegg/demo-saas",
"version": "6.0.5",
"version": "6.0.8",
"private": true,
"author": "Frontegg LTD",
"scripts": {
Expand All @@ -10,7 +10,7 @@
"test": "echo 'No Unit Tests'"
},
"dependencies": {
"@frontegg/react": "^6.0.5",
"@frontegg/react": "^6.0.8",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-router-dom": "^5.3.3"
Expand Down
6 changes: 3 additions & 3 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@frontegg/react",
"libName": "FronteggReact",
"version": "6.0.5",
"version": "6.0.8",
"author": "Frontegg LTD",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -10,8 +10,8 @@
"build:watch": "rm -rf dist && mkdir dist && rollup -w -c ./rollup.config.js"
},
"dependencies": {
"@frontegg/js": "6.146.0",
"@frontegg/react-hooks": "6.146.0"
"@frontegg/js": "6.154.0",
"@frontegg/react-hooks": "6.154.0"
},
"peerDependencies": {
"react": ">16.9.0",
Expand Down
1 change: 1 addition & 0 deletions packages/react/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const cjsPlugins = [
const isExternal = (id) => {
return (
id !== './FronteggProvider' &&
id !== './AlwaysRenderInProvider' &&
id !== './AuthorizedContent' &&
id !== './sdkVersion' &&
id !== './routerProxy' &&
Expand Down
41 changes: 41 additions & 0 deletions packages/react/src/AlwaysRenderInProvider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React, { FC } from 'react';
import { useAuthRoutes, CustomComponentRegister } from '@frontegg/react-hooks';
import { useQueryKeeper } from './queryKeeper';
import { FronteggApp } from '@frontegg/js';
import { FronteggThemeOptions } from '@frontegg/types';

export type HistoryObject = {
push: (path: string) => void;
replace: (path: string) => void;
};

type QueryKeeperWrapperProps = {
history: HistoryObject;
};

export const QueryKeeperWrapper: FC<QueryKeeperWrapperProps> = ({ history }) => {
const { signUpUrl } = useAuthRoutes();
useQueryKeeper({ routes: { signUpUrl }, history });
return <></>;
};

type AlwaysRenderInProviderProps = {
isExternalHistory: boolean;
app: FronteggApp;
themeOptions?: FronteggThemeOptions;
history: HistoryObject;
};

export const AlwaysRenderInProvider = ({
isExternalHistory,
app,
themeOptions,
history,
}: AlwaysRenderInProviderProps) => {
return (
<>
<CustomComponentRegister app={app} themeOptions={themeOptions} />
{!isExternalHistory && <QueryKeeperWrapper history={history} />}
</>
);
};
33 changes: 12 additions & 21 deletions packages/react/src/FronteggProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,46 +1,31 @@
import React, { FC, ReactNode, useCallback, useEffect, useMemo, useRef } from 'react';
import { initialize } from '@frontegg/js';
import { FronteggAppOptions } from '@frontegg/types';
import { FronteggStoreProvider, useAuthRoutes, CustomComponentRegister } from '@frontegg/react-hooks';
import { FronteggStoreProvider } from '@frontegg/react-hooks';
import { BrowserRouter, useHistory, UseHistory } from './routerProxy';
import { ContextHolder, RedirectOptions, FronteggFrameworks } from '@frontegg/rest-api';
import { AppHolder } from '@frontegg/js/AppHolder';
import { useQueryKeeper } from './queryKeeper';
import { isAuthRoute } from '@frontegg/redux-store';
import sdkVersion from './sdkVersion';
import ReactPkg from 'react/package.json'
import ReactPkg from 'react/package.json';
import { AlwaysRenderInProvider, HistoryObject } from './AlwaysRenderInProvider';

export type FronteggProviderProps = FronteggAppOptions & {
appName?: string;
history?: UseHistory;
children?: ReactNode;
};

type HistoryObject = {
push: (path: string) => void;
replace: (path: string) => void;
};

type ConnectorProps = Omit<FronteggProviderProps, 'history'> & {
history: HistoryObject;
isExternalHistory?: boolean;
};

type QueryKeeperWrapperProps = {
history: HistoryObject;
};

export const ConnectorHistory: FC<Omit<ConnectorProps, 'history'>> = (props) => {
const history = useHistory();
return <Connector history={history} {...props} />;
};

export const QueryKeeperWrapper: FC<QueryKeeperWrapperProps> = ({ history }) => {
const { signUpUrl } = useAuthRoutes();
useQueryKeeper({ routes: { signUpUrl }, history });
return <></>;
};

export const Connector: FC<ConnectorProps> = ({ history, appName, isExternalHistory = false, ...props }) => {
const isSSR = typeof window === 'undefined';
const version = `@frontegg/react@${sdkVersion.version}`;
Expand Down Expand Up @@ -99,7 +84,14 @@ export const Connector: FC<ConnectorProps> = ({ history, appName, isExternalHist
return (
<FronteggStoreProvider
{...({ ...props, app } as any)}
alwaysVisibleChildren={<CustomComponentRegister app={app} themeOptions={props.themeOptions} />}
alwaysVisibleChildren={
<AlwaysRenderInProvider
app={app}
themeOptions={props.themeOptions}
history={history}
isExternalHistory={isExternalHistory}
/>
}
/>
);
};
Expand All @@ -109,8 +101,7 @@ export const FronteggProvider: FC<FronteggProviderProps> = (props) => {

if (props.history || history) {
return (
<Connector history={props.history || history} {...props}>
{!props.history && <QueryKeeperWrapper history={history} />}
<Connector history={props.history || history} isExternalHistory={!!props.history} {...props}>
{props.children}
</Connector>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/sdkVersion.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default { version: '6.0.5' };
export default { version: '6.0.8' };
2 changes: 1 addition & 1 deletion packages/sanity-check/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "frontegg-react-sanity-check",
"private": true,
"version": "6.0.5",
"version": "6.0.8",
"scripts": {
"build": "docker-compose build test",
"build:dev": "docker-compose build test --no-cache",
Expand Down
57 changes: 32 additions & 25 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1465,52 +1465,59 @@
minimatch "^3.1.2"
strip-json-comments "^3.1.1"

"@frontegg/[email protected]":
version "6.146.0"
resolved "https://registry.yarnpkg.com/@frontegg/js/-/js-6.146.0.tgz#49ed4e3b6d7e943a6db0bd325759a63d52233ba1"
integrity sha512-p85yWiugMWqrbC7xFtUN67BAkJpeXxTXRuAmnWV9mA3e4PYuCq0AEp92vVJNLMrVoKAzZt0M5boLpW7GN+t59A==
"@frontegg/[email protected]":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@frontegg/entitlements-javascript-commons/-/entitlements-javascript-commons-1.0.1.tgz#038a5b86166bd00cfd3afa942de361434c34ea04"
integrity sha512-Ny9M9wLcA6/p9OD09plK3ETy5zyTWpgFoIorAYYYxk4J3S6ardsUOai2MlBmXqbG9J1uxD66rdFF5qr4bwqgyw==

"@frontegg/[email protected]":
version "6.154.0"
resolved "https://registry.yarnpkg.com/@frontegg/js/-/js-6.154.0.tgz#4978814871f8138d9bfb93f061d220dbb5ded0a5"
integrity sha512-qUnDwIX/+yNalssgKn+Da3qG5l+iwJ6bHeY5O7xF5DFe7iiTRUeSUenV7fROmR2dS3BtBOhEPwa3kVo1WEyzRw==
dependencies:
"@babel/runtime" "^7.18.6"
"@frontegg/types" "6.146.0"
"@frontegg/types" "6.154.0"

"@frontegg/react-hooks@6.146.0":
version "6.146.0"
resolved "https://registry.yarnpkg.com/@frontegg/react-hooks/-/react-hooks-6.146.0.tgz#e14358c1224edd971504b390a8d39ed49bb07dd8"
integrity sha512-YnuWx+/A4HJ/+a5Xyk0EbPNSY3JeI7RHlAP09HB5uC0EzuS/i8nS0nX5rdY1w371osrmmNznK/69wqo//WXQvA==
"@frontegg/react-hooks@6.154.0":
version "6.154.0"
resolved "https://registry.yarnpkg.com/@frontegg/react-hooks/-/react-hooks-6.154.0.tgz#dfd0c9d651cf456b4360748994845e733cd65f19"
integrity sha512-NLdj8IkZ6fi8vuqlyoesh4bYlaUlan3hAvCaDSC09eB7HjlSqBHHU67hCovUAvebL+UDye0+P79ptIV99J9Yow==
dependencies:
"@babel/runtime" "^7.18.6"
"@frontegg/redux-store" "6.146.0"
"@frontegg/types" "6.146.0"
"@frontegg/redux-store" "6.154.0"
"@frontegg/types" "6.154.0"
"@types/react" "*"
get-value "^3.0.1"
react-redux "^7.x"

"@frontegg/redux-store@6.146.0":
version "6.146.0"
resolved "https://registry.yarnpkg.com/@frontegg/redux-store/-/redux-store-6.146.0.tgz#a99b7e3df24cdba34aa44ed75914bde17fe8ea7d"
integrity sha512-MhpSrUXJWetTLpJCXOXFe/d/WRkz81aa01ngdpBilvdIZCbrG9Gv3XGFHygQoOkItyUqrr9tgNc6AlKi5uQNPw==
"@frontegg/redux-store@6.154.0":
version "6.154.0"
resolved "https://registry.yarnpkg.com/@frontegg/redux-store/-/redux-store-6.154.0.tgz#dd17d22c6f3bbf78733d87080b711eaaa16f1977"
integrity sha512-qFVtZfxehl5TzNrsCcdYvL3xiuPuMC+C64H7fIdBBJO7d75G4wp4zZvteBIUJu7IQWLSwmBRbDyjJ++l3ojbGA==
dependencies:
"@babel/runtime" "^7.18.6"
"@frontegg/rest-api" "3.1.28"
"@frontegg/entitlements-javascript-commons" "1.0.1"
"@frontegg/rest-api" "3.1.48"
"@reduxjs/toolkit" "1.8.5"
fast-deep-equal "3.1.3"
redux-saga "^1.2.1"
uuid "^8.3.2"

"@frontegg/[email protected].28":
version "3.1.28"
resolved "https://registry.yarnpkg.com/@frontegg/rest-api/-/rest-api-3.1.28.tgz#cd129db44866135d342c3f71f6e2c20fe1d6228d"
integrity sha512-L302tzOcN0qYgzPxoIxsjO86YDHSyjl0q+s30E2fOuRfnyCgLnU/YWOnHxwtX15yd4msy1NMFansWtdWp+6jGQ==
"@frontegg/[email protected].48":
version "3.1.48"
resolved "https://registry.yarnpkg.com/@frontegg/rest-api/-/rest-api-3.1.48.tgz#78947faa40dca6a7aac27928e7ef3a62a8f29159"
integrity sha512-/fcBufYuGL1zOeC9q2dGvXaNPxwff4Ppol7aHZDR3cYSTli6iaOAk+h1qNBTYWR3s20oRGMRR4UR8epROGyU/g==
dependencies:
"@babel/runtime" "^7.17.2"
"@frontegg/entitlements-javascript-commons" "1.0.1"

"@frontegg/types@6.146.0":
version "6.146.0"
resolved "https://registry.yarnpkg.com/@frontegg/types/-/types-6.146.0.tgz#c5e8f324986f5c76d040c87e0d462b60a84cf251"
integrity sha512-cnAv6mPjmTM8+TZnY8BMWXGvwY5OLlRTJsUZy6EiPUGLJtmHGzoMRCMAr2+Iavfq2haK1s86QsB45QHprt0Nvg==
"@frontegg/types@6.154.0":
version "6.154.0"
resolved "https://registry.yarnpkg.com/@frontegg/types/-/types-6.154.0.tgz#69889a510aa55c92f529003605eb655aa53bd896"
integrity sha512-X2AFVcE+W8BpvMe/utLhfOHNZxoH6myifih9QYmbAsy37DbnoLd8hv+tHNrmzj2iBe17JgKpGr3BiVvoh1l3hQ==
dependencies:
"@babel/runtime" "^7.18.6"
"@frontegg/redux-store" "6.146.0"
"@frontegg/redux-store" "6.154.0"
csstype "^3.0.9"
deepmerge "^4.2.2"

Expand Down

0 comments on commit 2340422

Please sign in to comment.