Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.

Fix test for standalone version and enable Github actions for tests and storybook #38

Merged
merged 8 commits into from
Dec 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Pull Request on Branch Push
on:
push:
branches-ignore:
- staging
jobs:
auto-pull-request:
name: PullRequestAction
runs-on: ubuntu-latest
steps:
- name: pull-request-action
uses: vsoch/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_PREFIX: ""
PULL_REQUEST_BRANCH: "main"
19 changes: 19 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Mark stale issues and pull requests

on:
schedule:
- cron: "30 1 * * *"

jobs:
stale:

runs-on: ubuntu-latest

steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Linting

on: push

jobs:
build:
name: try to make a clean build without lint, yarn, test and compile errors
runs-on: ubuntu-latest
env:
TZ: Europe/Amsterdam
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '14.x'
- run: yarn install --frozen-lockfile
- run: yarn prettier
- run: ./bootstrap.sh
- run: yarn test
- run: yarn build
25 changes: 11 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ The client is a ReactJS user interface. This project was bootstrapped with
[Create React App](https://github.com/facebookincubator/create-react-app).

When you need to work on the theming it's good to know that the theme is split into a separate
package: located in `lib/themes/surfnet_light`. It has its own README.
package: located in `lib/themes`. It has its own README.

### Installing

Depending on the OS there are ways to install yarn with a package manager.

Note: If you need more flexibility, like having the ability to test with multiple Node JS versions, we strongly recommend
to use NVM. More info [here](https://github.com/nvm-sh/nvm#installing-and-updating). You would then install yarn also
from within your Node env.

#### Mac

Using Brew:
Expand All @@ -32,19 +38,9 @@ and then:
yarn install
```

Note: when you use python3 as a default python on mac you will receive an error when yarn tries to install gyp:
stating that it needs python >2.5 < 3.0: you can then still install stuff by pointing yarn to the default python2.7 on
Mac OS:

`yarn install --python /usr/bin/python2.7`

If you need more flexibility, like having the ability to test with multiple Node JS versions, we strongly recommend
to use NVM. More info [here](https://github.com/nvm-sh/nvm#installing-and-updating). You would then install yarn also
from within your Node env.

#### Linux

This project currently only works with Node.js 14 (if you also want to be able to run the tests).
This project currently only works with Node.js 14 (if you also want to be able to run the tests in a deterministic way).

```sh
npm install yarn -g
Expand All @@ -57,6 +53,7 @@ npm install npm-run-all --save-dev -g
To run locally:

```sh
./bootstrap.sh # only needed the first time if you don't use plugins
yarn start
```

Expand Down Expand Up @@ -91,7 +88,7 @@ We are using Prettier as a code formatter. You can run prettier like this:
yarn prettier-fix
```

Similarly you can run other scripts that can be found in the package.json
Similarly, you can run other yarn (sub)commands that can be found in the `package.json`

### Running the tests

Expand Down Expand Up @@ -141,7 +138,7 @@ is done as follows:
)}
```

Basically if allowed returns true the component will be shown.
Basically it boils down to: when a call to `allowed` returns true the component will be shown.

**When no policy is found, the orchestrator-client will allow access to the resource.
Any real access must be enforced by the API. The client only disables features with the `allowed` function**
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"homepage": "https://workfloworchestrator.github.io/orchestrator-core-gui",
"name": "workflow-client",
"version": "1.0.0",
"private": false,
Expand All @@ -15,6 +16,7 @@
"babel-polyfill": "^6.26.0",
"date-fns": "^2.16.1",
"events": "^3.2.0",
"gh-pages": "^3.2.3",
"highlight.js": "^10.7.2",
"i18n-js": "^3.3.0",
"immer": "^9.0.2",
Expand Down Expand Up @@ -133,7 +135,8 @@
"test": "react-scripts test",
"eject": "react-scripts eject",
"storybook": "start-storybook -p 9009 -s ./public",
"build-storybook": "build-storybook -s ./public",
"storybook-build": "build-storybook -s ./public",
"storybook-deploy": "gh-pages -d storybook-static",
"prettier": "prettier -c \"{**/*.{js,jsx,scss,md,ts,tsx,json},public/**/*.html}\"",
"prettier-fix": "prettier --write \"{**/*.{js,jsx,scss,md,ts,tsx,json},public/**/*.html}\"",
"extract": "formatjs extract",
Expand Down
15 changes: 7 additions & 8 deletions src/components/subscriptionDetail/Renderers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ import { applyIdNamingConvention, isEmpty, stop } from "utils/Utils";

import CheckBox from "../CheckBox";

let create_readable_description = function(wf: any): object {
if ("unterminated_parents" in wf)
return {unterminated_parents: wf.unterminated_parents.join(", ")};
return wf as any
let create_readable_description = function (wf: any): object {
if ("unterminated_parents" in wf) return { unterminated_parents: wf.unterminated_parents.join(", ") };
return wf as any;
};

export function RenderActions({
Expand Down Expand Up @@ -98,10 +97,10 @@ export function RenderActions({
<td id={`${index}-v`}>
{wf.reason && wf.reason === "subscription.no_modify_parent_subscription" && (
<em className="error">
<FormattedMessage
id={wf.reason}
values={create_readable_description(wf) as any}
/>
<FormattedMessage
id={wf.reason}
values={create_readable_description(wf) as any}
/>
</em>
)}
{wf.reason && wf.reason !== "subscription.no_modify_parent_subscription" && (
Expand Down
218 changes: 0 additions & 218 deletions src/lib/uniforms-surfnet/__tests__/ContactPersonNameField.tsx

This file was deleted.

Loading