Skip to content

Commit 13d8ccb

Browse files
author
Clement Mwimo
committed
Merge branch 'master' into cmwimo/CT-1460
2 parents ed6a030 + 94d57fa commit 13d8ccb

File tree

21 files changed

+291
-22
lines changed

21 files changed

+291
-22
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @ash-wright123 @codingLogan @mwclemy @Jameson13B @wesrisenmay-mx
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Changelog updated
2+
3+
on: pull_request
4+
5+
jobs:
6+
check-changelog:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v4
12+
13+
- name: Fetch master branch
14+
run: |
15+
git fetch origin master:master
16+
17+
- name: Install jq for JSON processing
18+
run: sudo apt-get install -y jq
19+
20+
- name: Check that changelog is updated
21+
run: |
22+
if ! git diff --name-only master | grep -q '^CHANGELOG.md$'; then
23+
echo "Error: CHANGELOG.md has not been updated."
24+
exit 1
25+
fi

.github/workflows/lint.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Lint
2+
3+
on: pull_request
4+
5+
jobs:
6+
run-linters:
7+
name: Run linters
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Check out Git repository
12+
uses: actions/checkout@v3
13+
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 'lts/*'
17+
check-latest: true
18+
19+
- name: Install Node.js dependencies
20+
run: npm ci
21+
22+
- name: Run eslint
23+
run: npm run lint
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: 'NPM Version Check'
2+
3+
on: pull_request
4+
5+
jobs:
6+
push_to_registry:
7+
name: 'NPM Version Check'
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: 'Check out the repo'
12+
uses: actions/checkout@v4
13+
14+
- name: 'Set up Node'
15+
uses: actions/setup-node@v4
16+
with:
17+
registry-url: 'https://registry.npmjs.org'
18+
node-version: 'lts/*'
19+
check-latest: true
20+
21+
- name: 'Check if version is published'
22+
run: |
23+
PACKAGE_VERSION=$(npm pkg get version --workspaces=false | tr -d \")
24+
PACKAGE_NAME=$(npm pkg get name --workspaces=false | tr -d \")
25+
26+
# Run npm view and capture the exit code (success or failure)
27+
npm view "$PACKAGE_NAME@$PACKAGE_VERSION" --json > result.json 2>&1 || true
28+
29+
# Check the exit code to determine if the version exists
30+
if grep -q "is not in this registry." result.json; then
31+
echo "Version $PACKAGE_VERSION does not exist for $PACKAGE_NAME on npmjs.com. 🎉"
32+
exit 0
33+
else
34+
echo "Version $PACKAGE_VERSION already exists for $PACKAGE_NAME on npmjs.com. 😬🫠"
35+
echo "Please update the 'version' property in package.json and try again."
36+
exit 1
37+
fi
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: 'Tag and NPM publish'
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
push_to_registry:
10+
name: 'Setup, and publish'
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: 'Check out the repo'
15+
uses: actions/checkout@v4
16+
17+
- name: 'Set up Node'
18+
uses: actions/setup-node@v4
19+
with:
20+
registry-url: 'https://registry.npmjs.org'
21+
node-version: 'lts/*'
22+
check-latest: true
23+
24+
- name: 'Build'
25+
run: |
26+
npm ci
27+
npm run build
28+
29+
- name: 'Publish to NPM'
30+
uses: JS-DevTools/npm-publish@v3
31+
with:
32+
token: ${{ secrets.NPM_TOKEN }}
33+
34+
- name: Configure Git
35+
run: |
36+
git config user.name "GitHub Actions"
37+
git config user.email "[email protected]"
38+
39+
- name: Create tag
40+
run: |
41+
version=$(jq -r '.version' package.json)
42+
tag="v$version"
43+
echo "Creating tag: $tag"
44+
45+
git tag "$tag"
46+
git push origin "$tag"

.github/workflows/unitTest.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Unit/Integration tests
2+
3+
on: pull_request
4+
5+
jobs:
6+
run-unit-tests:
7+
name: Unit tests
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
14+
- name: Set up NodeJS
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: 'lts/Iron'
18+
check-latest: true
19+
20+
- name: Install all dependencies
21+
run: |
22+
npm ci
23+
24+
- name: Run unit tests
25+
run: |
26+
npm run test

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# Changelog
22

3+
## v.0.9.3
4+
5+
### Added
6+
7+
- Adding a UCP specific variable to the connection success event
8+
9+
## v.0.9.2
10+
11+
### Added
12+
13+
- Adding a github workflow for tagging and linting
14+
15+
## v.0.9.1
16+
17+
### Added
18+
19+
- Adding github workflows for a new publishing process
20+
321
## v.0.9.0
422

523
### Added

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@mxenabled/connect-widget",
33
"description": "A simple ui library for React",
4-
"version": "0.9.0",
4+
"version": "0.9.3",
55
"module": "dist/index.es.js",
66
"types": "dist/index.d.ts",
77
"type": "module",

src/components/RenderConnectStep.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { useTokens } from '@kyper/tokenprovider'
1010
import * as connectActions from 'src/redux/actions/Connect'
1111

1212
import { getSize } from 'src/redux/selectors/Browser'
13-
import { getCurrentMember, getMembers } from 'src/redux/selectors/Connect'
13+
import { getCurrentMember, getMembers, getSelectedInstitution } from 'src/redux/selectors/Connect'
1414
import {
1515
selectConnectConfig,
1616
selectIsMobileWebView,
@@ -57,7 +57,7 @@ const RenderConnectStep = (props) => {
5757
)
5858
const connectedMembers = useSelector(getMembers)
5959
const currentMember = useSelector(getCurrentMember)
60-
const selectedInstitution = useSelector((state) => state.connect.selectedInstitution)
60+
const selectedInstitution = useSelector(getSelectedInstitution)
6161
const updateCredentials = useSelector((state) => state.connect.updateCredentials)
6262
const verifyMemberError = useSelector((state) => state.connect.error)
6363

0 commit comments

Comments
 (0)