Skip to content

Commit

Permalink
Merge branch 'alpha' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
odinr committed Mar 22, 2023
2 parents 12e7a69 + b2a4a9d commit ccb62d1
Show file tree
Hide file tree
Showing 8 changed files with 622 additions and 334 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/alpha.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release Alpha Version

on:
push:
branches:
- alpha

jobs:
release-pkg:
name: Create release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '14'
registry-url: https://registry.npmjs.org

- name: Install Node Dependencies
run: |
npm ci --legacy-peer-deps
npm run build
- name: Config git user
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Bump version
run: npm version prerelease --preid alpha
env:
GH_TOKEN: ${{ github.token }}

- name: Push version
run: git push --follow-tags
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}

- name: Release packages
run: npm publish --access public --tag alpha
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
862 changes: 553 additions & 309 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@babel/preset-react": "^7.14.5",
"@babel/preset-typescript": "^7.15.0",
"@babel/runtime": "^7.15.4",
"@equinor/fusion-framework-legacy-interopt": "^2.1.14",
"@equinor/fusion-react-context-selector": "^0.4.2",
"@equinor/fusion-react-person": "^0.1.3",
"@equinor/fusion-react-progress-indicator": "0.1.6",
Expand Down Expand Up @@ -111,16 +112,15 @@
},
"devDependencies": {
"@babel/plugin-transform-runtime": "^7.16.0",
"@equinor/eslint-config-fusion": "^2.0.0",
"@equinor/fusion": "^3.4.9",
"@equinor/fusion-components": "^2.10.5",
"@equinor/fusion-framework-app": "^6.0.8",
"@equinor/fusion-framework-legacy-interopt": "^2.1.13",
"@equinor/fusion-framework-module-app": "^4.0.7",
"@equinor/fusion-framework-module-navigation": "^1.0.6",
"@equinor/fusion-framework-module-navigation": "^1.0.7",
"@equinor/fusion-framework-react": "^4.0.5",
"@equinor/fusion-framework-react-app": "^3.0.13",
"@equinor/fusion-observable": "^7.0.2",
"@equinor/eslint-config-fusion": "^2.0.0",
"@equinor/fusion-components": "^2.10.5",
"@equinor/fusion-framework-react": "^4.0.5",
"@oclif/dev-cli": "^1.26.0",
"@oclif/test": "^1.2.8",
"@oclif/tslint": "^3.1.1",
Expand Down
1 change: 1 addition & 0 deletions src/start-app/HotAppWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const HotAppWrapper: FunctionComponent = () => {
} = useFusionContext();

const {value: currentApp} = useObservableState(useMemo(() => framework.modules.app.current$, [framework]));

const sendNotification = useNotificationCenter();

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const ContextSelector = (props: ContextSearchProps): JSX.Element | null =

const manifest = appManifest as AppManifestWithContext;
const p = previousContext?.id ?? urlContext(manifest.key);
const url = p ? navigator.location.pathname.replace(p, nextContext?.id) : `/apps/${nextContext?.id}`;
const url = p ? navigator.location.pathname.replace(p, nextContext?.id) : `/${nextContext?.id}`;

const reqId = requestAnimationFrame(() => navigator.replace(url));
return () => cancelAnimationFrame(reqId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ import { AppModulesInstance } from '@equinor/fusion-framework-app';
* @param src context query result
* @returns src mapped to ContextResult type
*/
const mapper = (src: Array<ContextItem>): ContextResult => {
export const mapper = (src: Array<ContextItem>): ContextResult => {
return src.map((i) => {
return {
const item = {
id: i.id,
title: i.title,
subTitle: i.type.id,
graphic: i.type.id === 'OrgChart' ? 'list' : undefined,
};
return item;
});
};

Expand Down Expand Up @@ -60,6 +61,7 @@ export const useContextResolver = (): { resolver: ContextResolver | null; provid
const preselected: ContextResult = useMemo(() => {
return currentContext ? mapper([currentContext]) : [];
}, [currentContext]);


/** App module collection instance */
const instance$ = useMemo(() => currentApp?.instance$ || EMPTY, [currentApp]);
Expand Down
1 change: 0 additions & 1 deletion src/start-app/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ module.exports = {
},
},
},

{
test: require.resolve('react-dom'),
loader: 'expose-loader',
Expand Down
28 changes: 12 additions & 16 deletions src/templates/app/src/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,18 @@ export const Router = (): JSX.Element | null => {
const fusionHistory = useHistory();
const navigate = useNavigate();
const { basename, isAppPath } = useNavHack();
useEffect(
() =>
{
return fusionHistory.listen((e) => {
const { pathname } = e as Update & { pathname?: string; };
/** hack since app is unloaded after navigation outside app */
if (pathname && isAppPath(pathname)) {
/** hack to remove app prefix from path */
navigate(e.location, { replace: e.action === 'REPLACE' });
} else {
navigate(e.location, { replace: e.action === 'REPLACE' });
}
});
},
[fusionHistory, isAppPath, basename]
);
useEffect(() => {
return fusionHistory.listen((e) => {
const { pathname } = e as Update & { pathname?: string };
/** hack since app is unloaded after navigation outside app */
if (pathname && isAppPath(pathname)) {
/** hack to remove app prefix from path */
navigate(e.location, { replace: e.action === 'REPLACE' });
} else {
navigate(e.location, { replace: e.action === 'REPLACE' });
}
});
}, [fusionHistory, isAppPath, basename]);
return useRoutes([{ path: '/:contextId?/', element: <Layout />, children: pages }]);
};

Expand Down

0 comments on commit ccb62d1

Please sign in to comment.