ui-soxo-bootstrap-core 2.6.32-dev.1 → 2.6.32-dev.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,3 @@
1
- # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
- # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
-
4
1
  name: Node.js Package
5
2
 
6
3
  on:
@@ -8,26 +5,55 @@ on:
8
5
  types: [created]
9
6
 
10
7
  jobs:
11
- build:
12
- runs-on: ubuntu-latest
13
- steps:
14
- - uses: actions/checkout@v3
15
- - uses: actions/setup-node@v3
16
- with:
17
- node-version: 16
18
- - run: npm i
19
- # - run: npm test
20
-
21
8
  publish-npm:
22
- needs: build
23
9
  runs-on: ubuntu-latest
10
+ permissions:
11
+ contents: read
12
+ id-token: write
24
13
  steps:
25
- - uses: actions/checkout@v3
26
- - uses: actions/setup-node@v3
14
+ - uses: actions/checkout@v4
15
+ - uses: actions/setup-node@v4
27
16
  with:
28
- node-version: 16
17
+ node-version: 20
29
18
  registry-url: https://registry.npmjs.org/
30
- - run: npm i
31
- - run: npm publish
32
- env:
33
- NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
19
+ - run: npm install -g npm@latest
20
+ - run: npm install
21
+
22
+ - name: Determine npm dist-tag
23
+ id: dist_tag
24
+ shell: bash
25
+ run: |
26
+ VERSION=$(node -p "require('./package.json').version")
27
+ echo "package.json version: $VERSION"
28
+ echo "release tag: ${GITHUB_REF_NAME}"
29
+ if [[ "v${VERSION}" != "${GITHUB_REF_NAME}" ]]; then
30
+ echo "::error::Release tag '${GITHUB_REF_NAME}' does not match package.json version 'v${VERSION}'."
31
+ echo "::error::Bump the version with 'npm version' and re-create the release."
32
+ exit 1
33
+ fi
34
+ if [[ "$VERSION" == *-dev* ]]; then
35
+ echo "tag=dev" >> "$GITHUB_OUTPUT"
36
+ echo "Will publish with dist-tag: dev"
37
+ else
38
+ echo "tag=latest" >> "$GITHUB_OUTPUT"
39
+ echo "Will publish with dist-tag: latest"
40
+ fi
41
+
42
+ - name: Diagnose npm + OIDC environment
43
+ shell: bash
44
+ run: |
45
+ echo "--- versions ---"
46
+ node --version
47
+ npm --version
48
+ echo "--- OIDC env presence (must both be 'yes' for trusted publishing) ---"
49
+ echo "ACTIONS_ID_TOKEN_REQUEST_URL set: ${ACTIONS_ID_TOKEN_REQUEST_URL:+yes}"
50
+ echo "ACTIONS_ID_TOKEN_REQUEST_TOKEN set: ${ACTIONS_ID_TOKEN_REQUEST_TOKEN:+yes}"
51
+ echo "--- effective .npmrc (user) ---"
52
+ cat ~/.npmrc 2>/dev/null || echo "(none)"
53
+ echo "--- effective .npmrc (project) ---"
54
+ cat .npmrc 2>/dev/null || echo "(none)"
55
+ echo "--- npm config (auth-related) ---"
56
+ npm config get registry
57
+ npm config get //registry.npmjs.org/:_authToken || true
58
+
59
+ - run: npm publish --provenance --access public --tag ${{ steps.dist_tag.outputs.tag }} --loglevel=verbose
@@ -17,6 +17,7 @@ Incorrect versioning or incorrect tags will break the publish pipeline — follo
17
17
  - Publishing via GitHub Release UI
18
18
  - How GitHub Action Detects Release Type
19
19
  - Summary Table
20
+ - CI/CD Authentication (Trusted Publishing)
20
21
  - Common Mistakes & Fixes
21
22
 
22
23
  ---
@@ -255,17 +256,14 @@ npm publish --tag dev
255
256
 
256
257
  # ⚙️ How GitHub Action Detects Release Type
257
258
 
258
- If version contains `dev`:
259
+ The workflow reads the `version` field from `package.json` at publish time:
259
260
 
260
- ```
261
- npm publish --tag dev
262
- ```
261
+ | Condition | Command | Result |
262
+ | ---------------------------- | ------------------------------------------------------- | ---------------------------------- |
263
+ | Version contains `-dev` | `npm publish --provenance --access public --tag dev` | Publishes to the `dev` dist-tag |
264
+ | Version has no `-dev` suffix | `npm publish --provenance --access public --tag latest` | Publishes to the `latest` dist-tag |
263
265
 
264
- Otherwise:
265
-
266
- ```
267
- npm publish
268
- ```
266
+ The workflow also enforces that the GitHub release tag matches `v<version>` from `package.json` and fails the run immediately if they diverge — this prevents the most common publish failure described below.
269
267
 
270
268
  ---
271
269
 
@@ -283,6 +281,37 @@ npm publish
283
281
 
284
282
  ---
285
283
 
284
+ # 🔐 CI/CD Authentication (Trusted Publishing)
285
+
286
+ As of npm's 2025 policy changes, classic automation tokens (`NPM_TOKEN`) are deprecated. This repo now authenticates to npm via **OIDC Trusted Publishing** — GitHub Actions exchanges a short-lived OIDC token for a publish token at run time, so **no secret is stored in the repository**.
287
+
288
+ ## What this means for developers
289
+
290
+ Nothing. You still follow the same flow: `npm version` → push tag → create GitHub Release. The auth happens transparently in CI.
291
+
292
+ ## What this means for maintainers
293
+
294
+ The first-time setup on npmjs.com must be done once per package:
295
+
296
+ 1. Log in to [npmjs.com](https://www.npmjs.com) → open the package (`ui-soxo-bootstrap-core`) → **Settings**.
297
+ 2. Under **Trusted Publisher**, click **Add trusted publisher** and fill in:
298
+ - Publisher: **GitHub Actions**
299
+ - Organization or user: `soxo-tech`
300
+ - Repository: `bootstrap-core`
301
+ - Workflow filename: `npm-publish.yml`
302
+ - Environment name: *(leave blank)*
303
+ 3. Save. Any old `NPM_TOKEN` repository secret can be removed.
304
+
305
+ ## Runtime requirements
306
+
307
+ The workflow runs on Node 20 and upgrades npm to the latest CLI (`npm install -g npm@latest`) because OIDC trusted publishing requires **npm ≥ 11.5.1**. The `--provenance` flag attaches a verifiable build attestation to every published version, visible on the npmjs.com package page.
308
+
309
+ ## If publish fails with `403 Forbidden` or `ENEEDAUTH`
310
+
311
+ The trusted publisher config on npmjs.com no longer matches the workflow. Check that org, repo, and workflow filename match exactly — including case.
312
+
313
+ ---
314
+
286
315
  # ⚠️ Common Mistakes & Fixes
287
316
 
288
317
  | Mistake | Issue | Fix |
@@ -243,7 +243,7 @@ function GlobalHeaderContent({ loading, appSettings, children, isConnected, hist
243
243
  marginTop: '3rem',
244
244
  right: '2%',
245
245
  position: 'absolute',
246
- zIndex: 1001,
246
+ zIndex: 1008,
247
247
  }}
248
248
  >
249
249
  <LicenseAlert data={licenseData} />
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  import React, { useEffect, useRef } from 'react';
11
- import { Html5Qrcode } from 'html5-qrcode';
11
+ import { Html5Qrcode } from 'html5-qrcode/cjs/index.js';
12
12
 
13
13
  /**
14
14
  * QrScanner Component
@@ -161,6 +161,10 @@ const UserAdd = ({ model, callback, edit, history, formContent, match, additiona
161
161
 
162
162
  setDisabled(true);
163
163
  }
164
+ /** If user has FA set to false , then disable authentication */
165
+ if (formContent?.FA === false) {
166
+ setAuthentication(false);
167
+ }
164
168
  }
165
169
  }, []);
166
170
 
@@ -68,7 +68,7 @@ export default function UserEdit(record) {
68
68
  doctor_code: apiData.doctor_code,
69
69
  staff_code: apiData.staff_id,
70
70
  auth_type: apiData.auth_type,
71
- FA: apiData.FA,
71
+ FA: otherDetails.FA,
72
72
  active: apiData.active ? true : false,
73
73
  };
74
74
  // Set form data state
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ui-soxo-bootstrap-core",
3
- "version": "2.6.32-dev.1",
3
+ "version": "2.6.32-dev.5",
4
4
  "description": "All the Core Components for you to start",
5
5
  "keywords": [
6
6
  "all in one"