Compare commits

...
36 Commits
Author SHA1 Message Date
semantic-release-bot 79189ef2a4 chore(release): 7.16.0 [skip ci]
# [7.16.0](https://git.datacontroller.io/dc/dc/compare/v7.15.0...v7.16.0) (2026-09-28)

### Bug Fixes

* **ci:** correct server-ci webSourcePath and build frontend before mock deploy ([a4ad4cb](a4ad4cba28))
* **client:** parse iOS browsers in parseUserAgent ([eec3438](eec3438de9))
* **diagnostics:** give the startup service a body for browser_info ([5538e0c](5538e0c575))
* **diagnostics:** treat _debug=128 as debug on ([8de9978](8de9978213))
* **loader:** abort when a post edit hook routes to an unregistered table ([171974b](171974bd41))
* **mocks:** keep the mock hook reader inside the Drive ([7fd8ae4](7fd8ae4629))
* **sas:** drop the duplicated abort in the target re-registration check ([48d45ac](48d45ac7f8))
* **sidebar:** drop the query string from the sub-page label ([d2dd46b](d2dd46bfdf))

### Features

* **client:** report the browser and both versions in browser_info ([a770f36](a770f3695c))
* **client:** send session_info with every service request ([50282f2](50282f2ddb))
* **filters:** make the applied-filter panel expandable ([fdaa249](fdaa249f44))
* **mocks:** emulate the %mpeinit diagnostics dump ([200ee89](200ee8931d))
* **mocks:** run pre/post edit hook programs in the JS mock services ([b5f2283](b5f228351b))
* **mpeinit:** dump session_info to the log when debug is on ([fbd77a5](fbd77a5334))
* **release:** publish SHA256SUMS and verify instructions with each release ([f1ae501](f1ae501d49))
2026-09-28 09:09:36 +00:00
allan d717ecd0c2 Merge pull request 'feat: support diagnostics (browser_info, browser_url_vars) for startup and hook services' (#326) from feat/browser-info into main
Release / Build-production-and-ng-test (push) Successful in 4m38s
Release / Build-and-test-development (push) Successful in 24m16s
Release / release (push) Successful in 9m2s
Reviewed-on: #326
2026-09-28 08:36:44 +00:00
dc 60ddb475d7 ci: run the hook-programs spec in the cypress job
Build / Build-and-ng-test (pull_request) Successful in 5m26s
Lighthouse Checks / lighthouse (pull_request) Successful in 21m5s
Build / Build-and-test-development (pull_request) Successful in 29m17s
hook-programs.cy.ts was in no CI spec list, so it never ran - the only
end-to-end coverage of the new mock hook execution (mockHookSource plus
the PRE/POST_EDIT_HOOK blocks) and of the loader's target re-registration
check was dead weight. Add it to the development job's --spec list.

It goes second, not last: csv-limited.cy.ts asserts the free tier and so
must keep the first slot (before any spec applies a licence key), and test
2 reads the approval queue, which is paged oldest first - a changeset
submitted by an earlier spec pushes its own row off the first page. The
spec header records the constraint. Full list verified locally: 15 specs,
132 tests, all passing.
2026-09-27 23:28:42 +00:00
dc e926649787 test(hooks): anchor the approval assertion on the grid, not a row position
The post-edit-hook spec asserted on the last row of the approval queue.
The queue also holds changesets from earlier specs in the same run, so the
position is not stable - it failed on an estate with rows left over from a
previous run while passing on a fresh one. Search every row instead.
2026-09-27 22:44:54 +00:00
dc 48d45ac7f8 fix(sas): drop the duplicated abort in the target re-registration check
%mpe_loadfail raises the message through its own %mp_abort, so the extra
%mp_abort before %return printed it twice. The newer blocks in this file
(the post-edit-hook syscc check, for instance) use %mpe_loadfail + %return
only; this block now matches them.
2026-09-27 22:44:49 +00:00
dc 7fd8ae4629 fix(mocks): keep the mock hook reader inside the Drive
mockHookSource resolves the hook value against the Drive and eval()s what
it finds. A hook value carrying '..' segments resolved outside files/ -
mock-only, but the value is hand-edited mock config. Refuse anything that
does not resolve under files/.
2026-09-27 22:44:49 +00:00
dc eec3438de9 fix(client): parse iOS browsers in parseUserAgent
CriOS, FxiOS and EdgiOS carry Safari/ as well, and the token order only
tested the desktop names, so every iPhone and iPad client was reported as
Safari with an empty version - and a hook is invited to branch on browser.

Fold the tokens into one ordered table (mobile token before its desktop
twin) so the family and its version always come from the same token, and
add the legacy Edge token (Edge/18.x) which the Edg[A-Z]?/ pattern missed.

Table-driven spec over real user agent strings: desktop Edge (both
tokens), Opera, Firefox, Chrome and Safari, Android Chrome, the three iOS
browsers, a non-browser client and an empty string. Red before the fix:
all three iOS cases returned Safari with an empty version.
2026-09-27 22:44:43 +00:00
dc 200ee8931d feat(mocks): emulate the %mpeinit diagnostics dump
Build / Build-and-ng-test (pull_request) Successful in 5m21s
Lighthouse Checks / lighthouse (pull_request) Successful in 21m19s
Build / Build-and-test-development (pull_request) Successful in 28m58s
The SAS %mpeinit macro dumps work.browser_url_vars and work.browser_info
to the log when _debug is on (2477, fields,log,trace, 131 or 128). The JS
mocks had no equivalent, so a mocked session could not show what the
client sent.

Add mpeinit() to dcMockUtils.js and call it at the bottom of the file -
the same place the SAS services call %mpeinit - so every mock service that
eval()s the utilities dumps the two input tables. console.log output is
returned in the request log, so it lands in Data Controller's SAS Log tab
exactly as the SAS version does.

The tables are read with fetchRaw, so both the JSON body shape and the
multipart _WEBIN_NAME / _WEBIN_FILEREF shape work. Values are dumped with
the same NOTE: prefixes and name=value formatting as the macro.
2026-09-27 22:08:31 +00:00
allan 10122312cb Merge pull request 'fix(ci): correct server-ci webSourcePath and build the frontend before the mock deploy' (#332) from fix/server-ci-streamweb into feat/browser-info
Build / Build-and-ng-test (pull_request) Successful in 5m58s
Lighthouse Checks / lighthouse (pull_request) Successful in 21m46s
Build / Build-and-test-development (pull_request) Successful in 30m0s
Reviewed-on: #332
2026-09-27 19:08:23 +00:00
dc ce1de3d5b4 ci: run the browser-info spec in the cypress job
Build / Build-and-ng-test (pull_request) Successful in 5m58s
Lighthouse Checks / lighthouse (pull_request) Successful in 22m2s
Build / Build-and-test-development (pull_request) Successful in 27m40s
browser-info.cy.ts asserts the diagnostics tables on the adapter payload but was not in the job's explicit --spec list, so it never ran. Append it so the feature is covered by CI.
2026-09-27 19:02:40 +00:00
dc fbbaa0ac5e docs(diagnostics): correct the browser_url_vars collision comment
The comment claimed the hash query string is read first and therefore wins on a name collision. collectBrowserUrlVars actually reads window.location.search first and dedupes with a seen set, so the first occurrence wins and that is the search string value. Describe the behaviour the code has.
2026-09-27 19:02:30 +00:00
dc a4ad4cba28 fix(ci): correct server-ci webSourcePath and build frontend before mock deploy
Build / Build-and-ng-test (pull_request) Successful in 5m42s
Lighthouse Checks / lighthouse (pull_request) Successful in 21m28s
Build / Build-and-test-development (pull_request) Successful in 28m23s
The server-ci target streams the Angular frontend (CONTRIBUTING.md documents
http://localhost:5000/AppStream/clickme/), but webSourcePath was
"`../../../../client/dist". The leading backtick makes the first path segment
literal, so it happened to resolve to <repo>/client/dist by accident; the
correct value relative to the sasjs project root (sas/mocks) is
../../client/dist.

The real problem was that CI job 2 never built the client, so client/dist did
not exist when the mock services were deployed: the deploy logged
"webSourcePath: <repo>/client/dist present in 'streamConfig' doesn't exist"
and streamed no frontend, while the job still passed. Build the production
frontend before deploying the mocks so the streamed app is actually produced.
2026-09-27 18:48:03 +00:00
dc 5538e0c575 fix(diagnostics): give the startup service a body for browser_info
Build / Build-and-ng-test (pull_request) Successful in 6m6s
Lighthouse Checks / lighthouse (pull_request) Successful in 21m55s
Build / Build-and-test-development (pull_request) Successful in 26m43s
Both startupservice call sites pass null, and the attach guard skipped a
null payload, so the service whose log a support ticket is read from
never received browser_info / browser_url_vars.

The e2e test named for the startup service only asserted on getdata, so
the gap was invisible. The name is corrected to what it asserts, its
sibling sweep now excludes the diagnostics services (it must, once the
startup service really does carry them), and the guard itself is covered
by a unit spec - red before the fix, green after.
2026-09-25 15:57:53 +00:00
allan 11b6c23000 Merge pull request 'feat(filters): make the applied-filter panel expandable' (#331) from feat/expandable-filter-panel into feat/browser-info
Build / Build-and-ng-test (pull_request) Successful in 6m8s
Lighthouse Checks / lighthouse (pull_request) Successful in 21m56s
Build / Build-and-test-development (pull_request) Successful in 27m11s
Reviewed-on: #331
2026-09-25 15:16:00 +00:00
dc ba21ff00bc test(filters): wait for the editor before shooting its panel
Build / Build-and-ng-test (pull_request) Successful in 6m14s
Lighthouse Checks / lighthouse (pull_request) Successful in 21m51s
Build / Build-and-test-development (pull_request) Successful in 28m0s
The editor screenshot was taken during the transition from the viewer, so it
captured the viewer's panel - byte-identical to the viewer shot. Wait for the
editor-only chrome (.editor-title, .btnCtrl) before asserting or shooting.
2026-09-25 14:58:14 +00:00
dc 65a96922f6 style(filters): set the filter clause in a monospace face, and shoot the editor panel
Build / Build-and-ng-test (pull_request) Successful in 6m14s
Lighthouse Checks / lighthouse (pull_request) Successful in 22m11s
Build / Build-and-test-development (pull_request) Successful in 27m43s
The panel shows a query, so set it in the monospace face the app already uses
for code-like content (SAS logs, cell text) rather than the UI font.

The spec now also captures the editor's panel - collapsed and expanded - since
the editor is where the clause was previously clamped with an ellipsis.
2026-09-25 14:49:31 +00:00
dc 92bc72f51b ci: run the filter-panel spec in the cypress job
Build / Build-and-ng-test (pull_request) Successful in 5m41s
Lighthouse Checks / lighthouse (pull_request) Successful in 22m26s
Build / Build-and-test-development (pull_request) Successful in 28m15s
2026-09-25 14:30:30 +00:00
dc fdaa249f44 feat(filters): make the applied-filter panel expandable
Build / Build-and-ng-test (pull_request) Successful in 5m45s
Lighthouse Checks / lighthouse (pull_request) Successful in 21m28s
Build / Build-and-test-development (pull_request) Successful in 26m36s
A filter clause is shown in a panel above the grid. The panel was clamped to a
single line - in the editor with an ellipsis, and in the viewer by letting the
clause run the full width of the table - so a long or complex filter could not
be read on screen.

The panel is now collapsed to one line and carries a chevron that expands it to
show the whole clause, wrapped, and collapses it again. The chevron is rendered
only when the clause does not fit the collapsed line, so a short filter looks
exactly as it did before. Whether it fits is measured from the DOM rather than
guessed from the length of the text, since it depends on the rendered width; the
measurement is deferred out of the change-detection cycle, and re-run when the
clause, the available width, or the state changes.

This replaces the editor's hover-only reveal with a real control, which is a
button carrying aria-expanded and an accessible label, and gives the viewer the
same affordance. Both panels share the styling, which was previously duplicated
between the two component blocks.

Tested with `client/cypress/e2e/filter-panel.cy.ts`, at a laptop-sized viewport,
covering the three states:

1. no filter - the panel is not rendered
2. a short filter - shown in full, with no chevron
3. a long filter (an IN over every value of a free-text column, 646 characters)
   - collapsed with a chevron, expands to the whole clause over several lines,
   and collapses again
4. the editor panel behaves the same way for the same clause
2026-09-25 14:27:02 +00:00
allan 9c51fff0ef Merge pull request 'chore(deploy): drop the hardcoded dcPath default from the frontend template' (#330) from chore/drop-dcpath-default into feat/browser-info
Build / Build-and-ng-test (pull_request) Successful in 6m2s
Lighthouse Checks / lighthouse (pull_request) Successful in 22m30s
Build / Build-and-test-development (pull_request) Successful in 26m24s
Reviewed-on: #330
2026-09-25 13:28:46 +00:00
dc 5299e0ba06 chore(deploy): drop the hardcoded dcPath default from the frontend template
Build / Build-and-ng-test (pull_request) Successful in 5m14s
Lighthouse Checks / lighthouse (pull_request) Successful in 22m16s
Build / Build-and-test-development (pull_request) Successful in 26m11s
The `dcPath` attribute in the `<sasjs>` tag of `client/src/index.html` is a
relic of the older deployment approach, where a `viya.json` was shipped inside
the frontend bundle and read the path from the tag.

Nothing depends on the value: the deploy screens take the deployment path from
the user - the SASjs configurator derives a platform-appropriate default from
`SYSSCPL`, the automatic Viya flow sets `/export/viya/homes/<user>`, and both
the automatic and manual screens expose it as an editable DCLOC field.

Leaving `/tmp/dc` in the template is actively misleading: it is a valid-looking
path that a Viya deployment cannot necessarily write to, and because a deploy
re-streams the frontend from this file, the stale value lands in the deployed
`DC.html` where the deploy screen picks it up.

The attribute remains readable via `getAppAttribute('dcPath')` for anyone who
wants to pin it, so this only removes the shipped default.
2026-09-25 13:12:08 +00:00
allan 25077e9ded Merge pull request 'fix(sidebar): drop the query string from the sub-page label' (#329) from fix/sidebar-subpage-query-string into feat/browser-info
Build / Build-and-ng-test (pull_request) Successful in 5m36s
Lighthouse Checks / lighthouse (pull_request) Successful in 21m50s
Build / Build-and-test-development (pull_request) Successful in 26m3s
Reviewed-on: #329
2026-09-25 09:46:21 +00:00
dc d2dd46bfdf fix(sidebar): drop the query string from the sub-page label
Build / Build-and-ng-test (pull_request) Successful in 5m25s
Lighthouse Checks / lighthouse (pull_request) Successful in 21m16s
Build / Build-and-test-development (pull_request) Successful in 26m18s
Router.url carries the query string, so getSubPage() returned e.g.
'tables?embed=va' for a route with any parameter, and the sidebar label
rendered 'TABLES?EMBED=VA'. A VA report embed always adds a parameter, so
that is the case it shows up in.

Take the path part of the segment before splitting. Covered by a spec that
fails without the change.
2026-09-25 09:42:57 +00:00
dc 8de9978213 fix(diagnostics): treat _debug=128 as debug on
Build / Build-and-ng-test (pull_request) Successful in 5m24s
Lighthouse Checks / lighthouse (pull_request) Successful in 20m58s
Build / Build-and-test-development (pull_request) Successful in 25m23s
The adapter sends _debug=128 rather than 131 on the Viya web (JES) path
when runAsTask is enabled - which is the path the frontend uses there -
so the extra mpeinit logging, including the browser_info /
browser_url_vars dump, never fired on those estates. Accept 128
alongside 131 (and the existing 2477 / fields,log,trace values).

Verified on a Viya estate: the same service with _debug=128 logs
'no work.browser_info on this request' with the fix and logs nothing
without it.
2026-09-25 08:22:14 +00:00
dc 293636a5f8 refactor(client): scope browser_info to startup and hook services, add browser_url_vars
Build / Build-and-ng-test (pull_request) Successful in 5m24s
Lighthouse Checks / lighthouse (pull_request) Successful in 21m15s
Build / Build-and-test-development (pull_request) Successful in 25m11s
The diagnostics tables now go only where they can be read: the startup
service, and the services that %include customer-provided code - the
hook scripts (getdata, stagedata, loadfile, restore, postdata) and the
dynamic cell dropdown programs (getdynamiccolvals). Every other service
is spared the payload, so the high-frequency calls stay lean.

The page's URL parameters now also travel as a browser_url_vars table,
one row per parameter (name, value), taken from both the search string
and the hash query string - easier for a SAS developer than parsing the
browser_info url column. The table is sent only when the URL has at
least one parameter, and only to the same services as browser_info.

mpeinit's debug dump covers browser_url_vars alongside browser_info.

The spec asserts both directions on the adapter interface: the viewer's
data services carry no browser_info, getdata does, and a ?labels=true
visit arrives as a browser_url_vars row. Each test boots from the app
root with a guarded evaluation-agreement acceptance, because Cypress
clears cookies between tests and the SASjs Server session drops (the
same flake hook-programs.cy.ts hits on this estate).
2026-09-25 00:26:16 +00:00
allan 1e8a261ada Merge pull request 'feat(release): publish SHA256SUMS and verify instructions with each release' (#327) from ci/release-asset-hashes into feat/browser-info
Build / Build-and-ng-test (pull_request) Successful in 5m27s
Lighthouse Checks / lighthouse (pull_request) Successful in 21m14s
Build / Build-and-test-development (pull_request) Successful in 25m32s
Reviewed-on: #327
2026-09-24 23:07:36 +00:00
dc f1ae501d49 feat(release): publish SHA256SUMS and verify instructions with each release
Build / Build-and-ng-test (pull_request) Successful in 5m20s
Lighthouse Checks / lighthouse (pull_request) Successful in 21m10s
Build / Build-and-test-development (pull_request) Successful in 25m20s
The release job now hashes every asset it uploads (frontend.zip, the SAS 9
and Viya deployment programs, the SASjs Server bundle) into a SHA256SUMS
file with basename-only paths, and attaches it to the release alongside
the assets. The release body gains a "Verifying the download" section -
emitted by .gitea/scripts/verify-section.sh so the YAML scalar stays
clean - with the sha256sum -c command and a note on what a checksum does
and does not prove.

The upload loop is rewritten from an inline list to a bash array shared
by the hashing and upload steps, so the asset set cannot drift between
what is hashed and what is uploaded.

Simulated end to end locally (stubbed curl/jq): 8 uploads fire with
correct paths, SHA256SUMS verifies with sha256sum -c, a tampered file
fails the check, and the assembled release body keeps the existing
notes with the new section and installation footer on their own lines.
2026-09-24 22:30:36 +00:00
allan 9d740f9f47 Merge pull request 'fix(loader): abort when a post edit hook routes to an unregistered table' (#325) from fix/validate-post-edit-hook-target into feat/browser-info
Build / Build-and-ng-test (pull_request) Successful in 5m57s
Lighthouse Checks / lighthouse (pull_request) Successful in 22m20s
Build / Build-and-test-development (pull_request) Successful in 25m54s
Reviewed-on: #325
2026-09-24 21:03:52 +00:00
allan 76dd4bf69a Update sas/sasjs/macros/mpeinit.sas
Build / Build-and-ng-test (pull_request) Successful in 6m1s
Lighthouse Checks / lighthouse (pull_request) Successful in 22m22s
Build / Build-and-test-development (pull_request) Successful in 26m33s
2026-09-24 20:45:43 +00:00
dc fed8c7344e refactor(client): drop the VA fields from browser_info
Build / Build-and-ng-test (pull_request) Successful in 5m16s
Lighthouse Checks / lighthouse (pull_request) Successful in 21m3s
Build / Build-and-test-development (pull_request) Successful in 25m59s
browser_info is support diagnostics: where the request came from and what
client sent it. The VA data-driven content metadata belonged to the embed
feature, not to diagnostics, so the va_ fields and the va_parameters and
va_columns tables go. The editor still reads the VA message for its own
feature work; the diagnostics table no longer does.
2026-09-24 20:28:51 +00:00
dc a770f3695c feat(client): report the browser and both versions in browser_info
Build / Build-and-ng-test (pull_request) Successful in 5m15s
Lighthouse Checks / lighthouse (pull_request) Successful in 21m12s
Build / Build-and-test-development (pull_request) Successful in 25m12s
Adds dc_version, adapter_version, browser, browser_version, platform and the
raw user_agent to the browser_info row, so a support ticket can be read off
the log and a hook can branch on the browser without parsing the user agent
itself. The summary comes from a new parse-user-agent util, following the
existing shared/utils convention.

Also adds a Cypress spec asserting the table reaches the adapter interface,
which is the only place the payload is observable end to end.
2026-09-24 19:31:13 +00:00
dc 7abd260f98 refactor: rename session_info to browser_info
'session' reads as the SAS session in this codebase; the row is what the
browser reports about itself and its context (page URL, referrer,
timezone, locale, client version) plus what Visual Analytics told it.
Checked for collisions: no session_info, browser_info or session_results
anywhere in the repo, and the adapter only reserves the $-prefixed
formats table.
2026-09-24 18:12:55 +00:00
dc fbd77a5334 feat(mpeinit): dump session_info to the log when debug is on
Guard on the table existing, since a service called directly, or by a
client that predates this change, will not send one.
2026-09-24 18:10:07 +00:00
dc 50282f2ddb feat(client): send session_info with every service request
Adds a single-row `session_info` input table to every service call made
through SasService.request, describing where the request came from:

- url - the URL of the Data Controller page itself (the iframe), not the
  document embedding it, so an embedded report and any parameters its
  author added to the embed URL can be told apart
- referrer - the embedding document
- timezone / tz_offset / locale - the browser's, so services and hooks can
  match date logic and labels to what the user sees
- version - the client build, for support and version-aware hooks
- va_result_name / va_row_count / va_available_row_count - VA data-driven
  content metadata, blank and zero when not embedded in VA

When VA is present its parameters and columns are sent too, as
`va_parameters` and `va_columns` tables, so a hook script can branch on
the report's own parameters.

The table is always sent - when the app is standalone the VA fields are
simply empty. Hook scripts read it directly from WORK; no service needs to
change.
2026-09-24 18:05:53 +00:00
allan d61308578c Merge pull request 'feat(mocks): run pre/post edit hook programs in the JS mock services' (#324) from feat/mock-hook-programs into fix/validate-post-edit-hook-target
Build / Build-and-ng-test (pull_request) Successful in 5m44s
Lighthouse Checks / lighthouse (pull_request) Successful in 23m3s
Build / Build-and-test-development (pull_request) Successful in 27m27s
Reviewed-on: #324
2026-09-24 16:11:47 +00:00
dc 171974bd41 fix(loader): abort when a post edit hook routes to an unregistered table
Build / Build-and-ng-test (pull_request) Successful in 5m48s
Lighthouse Checks / lighthouse (pull_request) Successful in 22m13s
Build / Build-and-test-development (pull_request) Successful in 25m15s
A POST_EDIT_HOOK may re-point a changeset at a different table - that is what
lets an empty mirror stand in for a real one. Nothing checked the result, so a
hook pointing at a table with no MPE_TABLES row produced a changeset that could
not be reviewed: mpe_checkrestore resolves the audit table from that row, and
with none found its `select count(*) into: chk from &audtab` collapses to
`from where ...` - ERROR 22-322, syscc=1012, and the approval screen aborts
with a syntax error rather than an explanation.

Validate the target immediately after the hook, while the submitter is still
watching, and fail with a message naming the table and the reason. The target
table must be registered in MPE_TABLES; a hook may only route to a registered
table.

Verified on the test estate against the deployed stagedata service:
- target unregistered -> job cancels with
  'ERROR: target table DCHOOK.ORDERS is not registered in VIYA0846.mpe_tables -
  a post edit hook may only route a changeset to a registered table'
  (MPE_LOADFAIL STATUS 'FAILED - TARGET NOT REGISTERED')
- target registered -> the same submit returns STATUS SUCCESS
2026-09-24 15:45:24 +00:00
dc b5f228351b feat(mocks): run pre/post edit hook programs in the JS mock services
Build / Build-and-ng-test (pull_request) Successful in 5m41s
Lighthouse Checks / lighthouse (pull_request) Successful in 22m52s
Build / Build-and-test-development (pull_request) Successful in 25m48s
The JS mock services carried MPE_TABLES.pre_edit_hook / post_edit_hook values
but never acted on them, so a table configured with hooks behaved differently
in the mock than in production.

Add mockHookSource() to dcMockUtils (resolving a hook program name to the
source of its .js counterpart on the Drive) and run the hook where the SAS
backend does:

- editors/getdata runs the pre-edit hook after filtering, letting it reassign
  visibleRows / visibleColumns (the work.OUT contract) - so an empty mirror can
  display the live rows of the table it points at
- editors/stagedata and editors/loadfile run the post-edit hook before the
  MPE_SUBMIT row is written, letting it reassign libref / dsn (the call
  symputx contract) - so a changeset submitted against a mirror is raised
  against the real table

Seed a demo pair in makedata (TESTDATA.DEMO_ORDERS plus an empty
TESTDATA.DEMO_MIRROR with both hooks) and cover it with a Cypress spec.
2026-09-24 15:17:07 +00:00
30 changed files with 1711 additions and 57 deletions

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# Emits the "Verifying the download" section appended to every release body
# by the "Upload assets to release" step of release.yaml.
# Keep this text in sync with the docs page:
# docs.datacontroller.io/docs/downloads.md
set -euo pipefail
cat <<'EOF'
## Verifying the download
Every asset on this release is covered by the `SHA256SUMS` file. To verify a download, fetch `SHA256SUMS` from the release assets alongside the files you downloaded, then run:
```
sha256sum --check SHA256SUMS --ignore-missing
```
The command reports `OK` for each asset that matches. `--ignore-missing` lets you check just the files you downloaded rather than all of them.
What this protects: a matching checksum confirms the asset is byte-for-byte the file this pipeline uploaded, guarding against corrupted or tampered downloads (mirrors, proxies, interrupted transfers). It is not a signature: the hashes travel in the same release as the files, so a compromise of the forge itself could alter both. Treat it as an integrity check, not a trust anchor.
EOF
+10 -1
View File
@@ -107,6 +107,15 @@ jobs:
echo ${{ secrets.SHEET_PWD }} | gpg --batch --yes --passphrase-fd 0 ./libraries/sheet-crypto.tgz.gpg
npm ci
- name: Build frontend for web streaming
# The server-ci target streams client/dist as the 'clickme' web app (see
# CONTRIBUTING.md), so the production build has to exist before the mock
# services are deployed. Without it the deploy logs
# "webSourcePath: .../client/dist ... doesn't exist" and streams no frontend.
run: |
cd client
npm run build
- name: Setup and start SASjs server
run: |
npm i -g pm2
@@ -154,7 +163,7 @@ jobs:
# Start frontend and run cypress
# timeout 1800: SIGTERM after 30 min so Cypress can flush video/screenshots
# before the outer timeout-minutes hard-kills the step (avoids silent multi-hour hangs)
npx ng serve --host 0.0.0.0 --port 4200 & npx wait-on http://localhost:4200 && timeout 1800 npx cypress run --browser chrome --spec "cypress/e2e/csv-limited.cy.ts,cypress/e2e/liveness.cy.ts,cypress/e2e/editor.cy.ts,cypress/e2e/excel-multi-load.cy.ts,cypress/e2e/excel.cy.ts,cypress/e2e/csv.cy.ts,cypress/e2e/filtering.cy.ts,cypress/e2e/licensing.cy.ts,cypress/e2e/viewer-labels.cy.ts,cypress/e2e/full-table-search.cy.ts,cypress/e2e/viewbox.cy.ts,cypress/e2e/stage.cy.ts"
npx ng serve --host 0.0.0.0 --port 4200 & npx wait-on http://localhost:4200 && timeout 1800 npx cypress run --browser chrome --spec "cypress/e2e/csv-limited.cy.ts,cypress/e2e/hook-programs.cy.ts,cypress/e2e/liveness.cy.ts,cypress/e2e/editor.cy.ts,cypress/e2e/excel-multi-load.cy.ts,cypress/e2e/excel.cy.ts,cypress/e2e/csv.cy.ts,cypress/e2e/filtering.cy.ts,cypress/e2e/filter-panel.cy.ts,cypress/e2e/licensing.cy.ts,cypress/e2e/viewer-labels.cy.ts,cypress/e2e/full-table-search.cy.ts,cypress/e2e/viewbox.cy.ts,cypress/e2e/stage.cy.ts,cypress/e2e/browser-info.cy.ts"
- name: Zip Cypress videos
if: always()
+30 -10
View File
@@ -338,23 +338,43 @@ jobs:
RELEASE_ID=$(echo "$RELEASE_JSON" | jq -r '.id')
RELEASE_BODY=$(echo "$RELEASE_JSON" | jq -r '.body')
# Update body (also confirms the token has contents:write on this repo)
# Generate SHA-256 checksums over the release assets, so downloads can
# be verified. The file uses basename-only paths so that a plain
# "sha256sum -c SHA256SUMS" works in the folder the assets were
# downloaded to (the upload below stores them under their basename).
ASSETS=(frontend.zip
sas/demostream_sas9.sas
sas/viya.sas
sas/sasjs_server.json.zip
sas/sas9.sas
sas/viya_noweb.sas
sas/viya_noweb.json)
: > SHA256SUMS
for f in "${ASSETS[@]}"; do
sum=$(sha256sum "$f" | cut -d' ' -f1)
printf '%s %s\n' "$sum" "${f##*/}" >> SHA256SUMS
done
cat SHA256SUMS
# Update body: keep the existing notes, add a verification section
# ahead of the installation footer. The section text lives in a
# dedicated script below (.gitea/scripts/verify-section.sh) so this
# YAML scalar stays clean.
VERIFY_SECTION=$(./.gitea/scripts/verify-section.sh)
NEW_BODY=$(jq -n --arg body "$RELEASE_BODY" --arg verify "$VERIFY_SECTION" \
'$body + "\n" + $verify + "\n\nFor installation instructions, please visit https://docs.datacontroller.io/"')
curl -k --fail-with-body -sS -X PATCH \
-H "$AUTH_HEADER" \
-H 'Content-Type: application/json' \
--data "$(jq -n --arg body "$RELEASE_BODY"$'\n\nFor installation instructions, please visit https://docs.datacontroller.io/' \
'{draft:false, body:$body}')" \
--data "$(jq -n --arg body "$NEW_BODY" '{draft:false, body:$body}')" \
"$BASE/releases/$RELEASE_ID"
# Upload assets
URL="$BASE/releases/$RELEASE_ID/assets"
for f in frontend.zip \
sas/demostream_sas9.sas \
sas/viya.sas \
sas/sasjs_server.json.zip \
sas/sas9.sas \
sas/viya_noweb.sas \
sas/viya_noweb.json; do
for f in "${ASSETS[@]}"; do
echo "Uploading $f ..."
curl -k --fail-with-body -sS -H "$AUTH_HEADER" "$URL" -F "attachment=@$f"
done
echo "Uploading SHA256SUMS ..."
curl -k --fail-with-body -sS -H "$AUTH_HEADER" "$URL" -F "attachment=@SHA256SUMS"
+25
View File
@@ -1,3 +1,28 @@
# [7.16.0](https://git.datacontroller.io/dc/dc/compare/v7.15.0...v7.16.0) (2026-09-28)
### Bug Fixes
* **ci:** correct server-ci webSourcePath and build frontend before mock deploy ([a4ad4cb](https://git.datacontroller.io/dc/dc/commit/a4ad4cba2861fe76f7ee5ea72ccf8c6e61c888a5))
* **client:** parse iOS browsers in parseUserAgent ([eec3438](https://git.datacontroller.io/dc/dc/commit/eec3438de9735e0feb74c95d0b28128af6677477))
* **diagnostics:** give the startup service a body for browser_info ([5538e0c](https://git.datacontroller.io/dc/dc/commit/5538e0c5752553a7c61903c62e4fdc82b6206826))
* **diagnostics:** treat _debug=128 as debug on ([8de9978](https://git.datacontroller.io/dc/dc/commit/8de99782134e37c5e9c26c3117b083f49fa65189))
* **loader:** abort when a post edit hook routes to an unregistered table ([171974b](https://git.datacontroller.io/dc/dc/commit/171974bd412be3efafd792e6c61c23f2fb442ace))
* **mocks:** keep the mock hook reader inside the Drive ([7fd8ae4](https://git.datacontroller.io/dc/dc/commit/7fd8ae462993f0a1a8a034b5938d309d63920043))
* **sas:** drop the duplicated abort in the target re-registration check ([48d45ac](https://git.datacontroller.io/dc/dc/commit/48d45ac7f8c32e39ff2d0e1ceac50252a49ebadd))
* **sidebar:** drop the query string from the sub-page label ([d2dd46b](https://git.datacontroller.io/dc/dc/commit/d2dd46bfdfddd1695d1b3915d20ce79330cf275b))
### Features
* **client:** report the browser and both versions in browser_info ([a770f36](https://git.datacontroller.io/dc/dc/commit/a770f3695ceac441f48527f606843602c39fcc13))
* **client:** send session_info with every service request ([50282f2](https://git.datacontroller.io/dc/dc/commit/50282f2ddb1250e048c55c04b395b428167142f7))
* **filters:** make the applied-filter panel expandable ([fdaa249](https://git.datacontroller.io/dc/dc/commit/fdaa249f447b3a2c87da4b2aa1e5978c09f53ff8))
* **mocks:** emulate the %mpeinit diagnostics dump ([200ee89](https://git.datacontroller.io/dc/dc/commit/200ee8931d3952624434567b5b95c9e7e53c6508))
* **mocks:** run pre/post edit hook programs in the JS mock services ([b5f2283](https://git.datacontroller.io/dc/dc/commit/b5f228351bca18cbc8a3032e60846d05192668f6))
* **mpeinit:** dump session_info to the log when debug is on ([fbd77a5](https://git.datacontroller.io/dc/dc/commit/fbd77a533417b1c8549a339b94785f7af0a30ca8))
* **release:** publish SHA256SUMS and verify instructions with each release ([f1ae501](https://git.datacontroller.io/dc/dc/commit/f1ae501d49b510a1870f3682bb7d83de7446e061))
# [7.15.0](https://git.datacontroller.io/dc/dc/compare/v7.14.2...v7.15.0) (2026-09-23)
+165
View File
@@ -0,0 +1,165 @@
// Marks this file as an ES module so its top-level consts don't collide with
// other spec files under the TS type-checker.
export {}
//
// The client sends `browser_info` (and `browser_url_vars`, when the page URL
// has parameters) with the startup service and with the services that execute
// customer-provided code - hook scripts and dynamic cell dropdown programs.
// Other services do not receive the tables.
//
// Payloads are keyed by the _program value in the request URL, so the
// assertions can tell one service's payload from another's. Asserted on the
// adapter interface, which is the only place the payload is observable end
// to end.
//
// Each test starts from a plain visit of the app root rather than assuming
// the previous test's session: Cypress clears cookies between tests, the
// SASjs Server session drops, and the app lands back on the evaluation
// agreement card. The acceptance is guarded, so it is a no-op when the
// session survived.
const hostUrl = Cypress.env('hosturl')
/** The services the app sends diagnostics to (see DIAGNOSTICS_SERVICES in
* client/src/app/services/sas.service.ts). */
const DIAGNOSTICS_SERVICES = [
'public/startupservice',
'editors/getdata',
'editors/getdynamiccolvals',
'editors/stagedata',
'editors/loadfile',
'editors/restore',
'auditors/postdata'
]
/** Boots the app at the root, accepting the evaluation agreement if shown. */
const bootApp = () => {
cy.visit(hostUrl, { timeout: 60000 })
cy.get('body').then(($body) => {
if ($body.find('#TCS input[type="checkbox"]').length) {
cy.get('#TCS input[type="checkbox"]').check({ force: true })
cy.wait(4000)
}
})
}
/** Captures each service's payload, keyed by the _program URL parameter. */
const capturePrograms = (): Record<string, string> => {
const programs: Record<string, string> = {}
cy.intercept('**/stp/execute/**', (req) => {
// The handler must never throw: an exception inside an intercept handler
// aborts the request, which breaks the app under test. A lone '%' in the
// URL would make decodeURIComponent throw, hence the guarded parse.
let program = req.url
try {
program = decodeURIComponent(
(req.url.match(/_program=([^&]+)/) || [])[1] || ''
)
} catch (e) {
program = (req.url.match(/_program=([^&]+)/) || [])[1] || req.url
}
if (typeof req.body === 'string') {
programs[program] = req.body
} else {
programs[program] = JSON.stringify(req.body)
}
})
return programs
}
context('browser_info input table: ', function () {
it('1 | services that run no customer code do not receive it', () => {
const programs = capturePrograms()
bootApp()
// The viewer route fires public/viewlibs and a usernav service - plain
// data services with no hook scripts and no customer includes. Taken
// from a fresh boot, before anything caches the library tree.
cy.visit(`${hostUrl}/#/view/data`, { timeout: 60000 })
cy.wait(8000)
cy.then(() => {
const captured = Object.keys(programs)
// The startup service is a diagnostics service by design - it runs on
// every boot, which is the point of it - so it is excluded from this
// sweep. On a real estate it would otherwise appear here carrying
// browser_info and fail the test.
const plain = captured.filter(
(program) => !DIAGNOSTICS_SERVICES.some((s) => program.includes(s))
)
expect(
plain.length,
`non-diagnostics service calls captured (${captured.join(', ')})`
).to.be.greaterThan(0)
plain.forEach((program) => {
expect(
programs[program],
`${program} carries no browser_info`
).not.to.contain('browser_info')
})
})
})
it('2 | hook-running services receive it', () => {
const programs = capturePrograms()
bootApp()
// Opening the editor directly makes the app call editors/getdata, which
// runs the pre-edit hook and so receives the diagnostics tables.
cy.visit(`${hostUrl}/#/editor/DC_JSLIB.MPE_X_TEST`, { timeout: 60000 })
cy.get('#hotTable', { timeout: 60000 }).should('exist')
cy.wait(8000)
cy.then(() => {
const captured = Object.keys(programs)
expect(
captured.length,
`service calls captured (${captured.join(', ')})`
).to.be.greaterThan(0)
// The startup service is the other diagnostics recipient, but it is not
// reachable from a mock estate: `checkSasjsDeploy` finds makedata in
// services/admin and routes to the deploy screen instead, so the app
// never calls it on boot. Its null-payload path is covered by the unit
// spec (src/app/services/sas.service.spec.ts).
const getdata = captured.find((p) => p.includes('editors/getdata'))
expect(getdata, 'editors/getdata captured').to.not.be.undefined
expect(
programs[getdata!],
'getdata payload carries browser_info'
).to.contain('browser_info')
// TIMEZONE is a column of browser_info and of no other input table, so
// this shows the row itself arrived, not just the table name.
expect(
programs[getdata!],
'browser_info row content in the payload'
).to.contain('timezone')
})
})
it('3 | browser_url_vars carries the URL parameters as name/value pairs', () => {
const programs = capturePrograms()
bootApp()
// The labels parameter is read by the editor from the hash query string,
// so the diagnostics tables must carry it as a name/value row.
cy.visit(`${hostUrl}/#/editor/DC_JSLIB.MPE_X_TEST?labels=true`, {
timeout: 60000
})
cy.get('#hotTable', { timeout: 60000 }).should('exist')
cy.wait(8000)
cy.then(() => {
const getdata = Object.keys(programs).find((p) =>
p.includes('editors/getdata')
)
expect(getdata, 'editors/getdata captured').to.not.be.undefined
expect(
programs[getdata!],
'getdata payload carries browser_url_vars'
).to.contain('browser_url_vars')
// the labels parameter, as a name in the name/value table
expect(programs[getdata!], 'labels parameter row').to.contain('labels')
})
})
})
+257
View File
@@ -0,0 +1,257 @@
export {}
//
// The applied-filter panel shows the clause that is in force. A long clause
// does not fit the collapsed single line, so the panel carries a chevron that
// expands it to show the clause in full - in the viewer and in the editor.
//
// The chevron is only rendered when the clause actually overflows, so a short
// filter looks exactly as it did before.
const hostUrl = Cypress.env('hosturl')
const appLocation = Cypress.env('appLocation')
const longerCommandTimeout = Cypress.env('longerCommandTimeout')
context('applied filter panel: ', function () {
this.beforeAll(() => {
cy.visit(`${hostUrl}/SASLogon/logout`, { timeout: longerCommandTimeout })
cy.loginAndUpdateValidKey(true)
})
// the panel behaviour depends on how much room the clause has, so pin a
// laptop-sized window rather than the wider CI viewport
this.beforeEach(() => {
cy.viewport(1280, 800)
bootApp()
})
it('1 | without a filter the panel is not rendered', () => {
openTable('DC_JSLIB.MPE_X_TEST')
cy.get('.infoBar').should('not.exist')
cy.screenshot('filter-panel-1-no-filter', { capture: 'viewport' })
})
it('2 | a short filter is shown in full, with no chevron', () => {
openTable('DC_JSLIB.MPE_X_TEST')
openFilterPopup()
setFilterVariable('SOME_DROPDOWN')
setFilterValue('Option 1')
submitFilter()
cy.get('.infoBar-text').should('contain.text', "SOME_DROPDOWN = 'Option 1'")
// the clause fits the collapsed line, so there is nothing to expand
assertClauseFitsCollapsedLine()
cy.get('.infoBar-toggle').should('not.exist')
cy.screenshot('filter-panel-2-filter', { capture: 'viewport' })
})
it('3 | a long filter is collapsed to a chevron and expands to the full clause', () => {
openTable('DC_JSLIB.MPE_X_TEST')
// SOME_CHAR holds a very long free-text value, so an IN over every value
// produces a clause of several hundred characters
openFilterPopup()
setFilterVariable('SOME_CHAR')
setFilterOperator('IN')
chooseAllFilterValues()
submitFilter()
cy.get('.infoBar-text').should('contain.text', 'SOME_CHAR IN')
assertClauseOverflowsCollapsedLine()
cy.get('.infoBar-toggle')
.should('exist')
.and('have.attr', 'aria-expanded', 'false')
cy.screenshot('filter-panel-3-big-filter-collapsed', {
capture: 'viewport'
})
// expand: the whole clause is rendered, on several lines, unclipped
cy.get('.infoBar-toggle').click()
cy.get('.infoBar').should('have.class', 'expanded')
cy.get('.infoBar-toggle').should('have.attr', 'aria-expanded', 'true')
assertClauseFullyVisible()
assertClauseSpansSeveralLines()
cy.screenshot('filter-panel-3-big-filter-expanded', { capture: 'viewport' })
// collapse again
cy.get('.infoBar-toggle').click()
cy.get('.infoBar').should('not.have.class', 'expanded')
assertClauseOverflowsCollapsedLine()
})
it('4 | the editor panel collapses and expands in the same way', () => {
openTable('DC_JSLIB.MPE_X_TEST')
openFilterPopup()
setFilterVariable('SOME_CHAR')
setFilterOperator('IN')
chooseAllFilterValues()
submitFilter()
// the editor shows the filter the viewer just stored
cy.url().then((url) => {
const filterId = url.split('/').pop()
cy.visit(
`${hostUrl}${appLocation}/#/editor/DC_JSLIB.MPE_X_TEST/${filterId}`,
{ timeout: longerCommandTimeout }
)
})
// wait for the editor itself - .editor-title/.btnCtrl are editor-only, so
// this cannot pass on the viewer the visit came from
cy.get('.editor-title', { timeout: longerCommandTimeout }).should('exist')
cy.get('.btnCtrl', { timeout: longerCommandTimeout }).should('exist')
cy.get('.infoBar-text', { timeout: longerCommandTimeout }).should(
'contain.text',
'SOME_CHAR IN'
)
assertClauseOverflowsCollapsedLine()
cy.screenshot('filter-panel-4-editor-collapsed', { capture: 'viewport' })
cy.get('.infoBar-toggle').click()
cy.get('.infoBar').should('have.class', 'expanded')
assertClauseFullyVisible()
assertClauseSpansSeveralLines()
cy.screenshot('filter-panel-4-editor-expanded', { capture: 'viewport' })
})
})
/**
* Cypress clears cookies between tests, which drops the SASjs Server session
* and lands the app back on the evaluation agreement card. Accept it when it is
* shown - a no-op when the session survived.
*/
const bootApp = () => {
cy.visit(hostUrl, { timeout: longerCommandTimeout })
cy.get('body').then(($body: any) => {
if ($body.find('#TCS input[type="checkbox"]').length) {
cy.get('#TCS input[type="checkbox"]').check({ force: true })
cy.wait(4000)
}
})
}
/** Opens a table in the viewer and waits for its grid to render. */
const openTable = (libMem: string) => {
cy.visit(`${hostUrl}${appLocation}/#/view/data/${libMem}`, {
timeout: longerCommandTimeout
})
cy.get('.filterSide', { timeout: longerCommandTimeout }).should('exist')
cy.wait(2500)
}
const openFilterPopup = () => {
cy.get('.filterSide', { timeout: longerCommandTimeout }).click()
cy.get('clr-dropdown-menu', { timeout: longerCommandTimeout })
.contains('Filter')
.click()
cy.get('.filter-modal', { timeout: longerCommandTimeout }).should(
'be.visible'
)
}
/**
* The soft-select inputs drop a transparent .overlay click-catcher over the
* modal while their suggestion list is open, so they need force.
*/
const setFilterVariable = (column: string) => {
cy.get('#vals_var_id0_0').clear({ force: true }).type(column, { force: true })
cy.get('#datalist_vals_var_id0_0 option').contains(column).click({
force: true
})
cy.get('#vals_var_id0_0').trigger('keyup', { key: 'Escape', force: true })
cy.wait(400)
}
const setFilterValue = (value: string) => {
cy.get('#vals_0_0').clear({ force: true }).type(value, { force: true })
cy.get('#vals_0_0').trigger('keyup', { key: 'Escape', force: true })
cy.wait(400)
}
const setFilterOperator = (operator: string) => {
cy.get('.filter-modal .operator-col select').first().select(operator)
cy.wait(500)
}
/** IN/NOT IN take their values from a modal of checkboxes - take them all. */
const chooseAllFilterValues = () => {
cy.contains('.filter-modal button', 'Choose values').click()
cy.get('.in-values-modal', { timeout: longerCommandTimeout }).should(
'be.visible'
)
cy.get('.in-values-modal input[type=checkbox]').then(($checkboxes: any) => {
for (let i = 0; i < $checkboxes.length; i++) {
cy.get('.in-values-modal input[type=checkbox]')
.eq(i)
.click({ force: true })
}
})
cy.contains('.in-values-modal button', 'Apply').click()
cy.wait(500)
}
const submitFilter = () => {
cy.contains('.filter-modal button', 'Ok').click()
cy.get('.app-loading', { timeout: longerCommandTimeout }).should('not.exist')
cy.wait(2500)
}
/** The clause is wider than the collapsed line, so it is clipped. */
const assertClauseOverflowsCollapsedLine = () => {
cy.get('.infoBar-text').then(($text: any) => {
const el = $text[0] as HTMLElement
expect(
el.scrollWidth,
'the clause is wider than the collapsed line'
).to.be.greaterThan(el.clientWidth)
expect(
el.ownerDocument.defaultView!.getComputedStyle(el).whiteSpace,
'collapsed panel does not wrap'
).to.equal('nowrap')
})
}
/** The clause fits the collapsed line, so nothing is hidden. */
const assertClauseFitsCollapsedLine = () => {
cy.get('.infoBar-text').then(($text: any) => {
const el = $text[0] as HTMLElement
expect(el.scrollWidth, 'the clause fits the collapsed line').to.be.at.most(
el.clientWidth
)
})
}
/** Expanded, the whole clause is rendered and nothing is clipped. */
const assertClauseFullyVisible = () => {
cy.get('.infoBar-text').then(($text: any) => {
const el = $text[0] as HTMLElement
const style = el.ownerDocument.defaultView!.getComputedStyle(el)
expect(style.whiteSpace, 'expanded panel wraps').to.equal('normal')
expect(el.scrollWidth, 'expanded panel clips nothing').to.be.at.most(
el.clientWidth
)
})
}
/** Expanded, the clause occupies several lines rather than one. */
const assertClauseSpansSeveralLines = () => {
cy.get('.infoBar-text').then(($text: any) => {
const el = $text[0] as HTMLElement
const lineHeight =
parseFloat(
el.ownerDocument.defaultView!.getComputedStyle(el).lineHeight
) || 20
expect(
el.clientHeight / lineHeight,
'the clause spans several lines'
).to.be.greaterThan(3)
})
}
+209
View File
@@ -0,0 +1,209 @@
// Marks this file as an ES module (rather than a global script) so its
// top-level consts don't collide, under the TS type-checker, with the same
// names declared in other spec files.
//
// RUN ORDER MATTERS, and build.yaml reflects it: this spec must run after
// csv-limited.cy.ts (which asserts the free tier and so needs the first slot,
// before any spec applies a licence key) and before every spec that submits a
// changeset. Test 2 reads the approval queue, which is paged oldest first, and
// a changeset submitted by an earlier spec pushes this one off the first page.
export {}
const hostUrl = Cypress.env('hosturl')
const appLocation = Cypress.env('appLocation')
const longerCommandTimeout = Cypress.env('longerCommandTimeout')
context('hook program tests: ', function () {
this.beforeAll(() => {
cy.loginAndUpdateValidKey(true)
})
this.beforeEach(() => {
cy.visit(hostUrl + appLocation)
visitPage('home')
})
// TESTDATA.DEMO_MIRROR is an empty mirror of TESTDATA.DEMO_ORDERS, registered
// with a PRE_EDIT_HOOK and a POST_EDIT_HOOK (services/hooks/demo_mirror_*.js).
// The mock services run those hooks the way the SAS backend %includes the
// real hook programs - see dcMockUtils.mockHookSource.
it('1 | PRE_EDIT_HOOK: an empty mirror displays the live rows of its target table', () => {
openTableFromTree('testdata', 'demo_mirror')
// The mirror holds no rows of its own: everything on screen comes from the
// pre-edit hook, which loads TESTDATA.DEMO_ORDERS.
cy.get('#hotTable .ht_master tbody tr', {
timeout: longerCommandTimeout
}).should('have.length', 4)
cy.get('#hotTable .ht_master tbody tr')
.first()
.should('contain.text', 'Acme Corp')
cy.get('#hotTable .ht_master tbody tr')
.last()
.should('contain.text', 'Delta Systems')
// The grid is validated against the MIRROR's own rule set (AMOUNT <= 2000),
// not the real table's (AMOUNT <= 100000) - that is the point of routing
// edits through a mirror.
clickOnEdit(() => {
editCell(0, 'AMOUNT', '5000')
})
cy.get('#hotTable .ht_master tbody tr')
.first()
.find('td.htInvalid')
.should('exist')
})
it('2 | POST_EDIT_HOOK: a change submitted against the mirror is raised against the target', () => {
openTableFromTree('testdata', 'demo_mirror')
clickOnEdit(() => {
editCell(0, 'AMOUNT', '750')
})
submitTable(() => {
cy.get('textarea.submit-reason', { timeout: longerCommandTimeout }).type(
'hook routing test'
)
submitTableMessage()
})
// A successful submit sends the app to the staged-data page; wait for that
// before navigating away, or the app's own redirect wins the race.
cy.url({ timeout: longerCommandTimeout }).should('include', '/stage/')
// The post-edit hook re-points the changeset at TESTDATA.DEMO_ORDERS, so the
// approval queue names the real table rather than the mirror. Search the
// whole grid rather than one row: the queue also holds changesets from
// earlier specs in the same run, so position is not a stable anchor.
visitPage('review/approve')
cy.get('clr-datagrid clr-dg-row', { timeout: longerCommandTimeout }).should(
($rows) => {
const texts = Array.from($rows).map((row: any) =>
row.innerText.trim().replace(/\s+/g, ' ')
)
expect(
texts.some((text) => text.includes('TESTDATA.DEMO_ORDERS')),
`no approval row names TESTDATA.DEMO_ORDERS - rows: ${texts
.slice(0, 5)
.join(' | ')
.slice(0, 400)}`
).to.be.true
}
)
})
})
// ─── helpers (declared at the bottom, per the other specs) ───────────────────
const visitPage = (url: string) => {
cy.visit(`${hostUrl}${appLocation}/#/${url}`)
}
const openTableFromTree = (libNameIncludes: string, tablename: string) => {
cy.get('.app-loading', { timeout: longerCommandTimeout })
.should('not.exist')
.then(() => {
cy.get('.nav-tree clr-tree > clr-tree-node', {
timeout: longerCommandTimeout
}).then((treeNodes: any) => {
let viyaLib
for (let node of treeNodes) {
if (node.innerText.toLowerCase().includes(libNameIncludes)) {
viyaLib = node
break
}
}
cy.get(viyaLib).within(() => {
cy.wait(300)
cy.get(
'.clr-tree-node-content-container .clr-treenode-content p'
).click()
cy.get('.clr-treenode-link').then((innerNodes: any) => {
for (let innerNode of innerNodes) {
if (innerNode.innerText.toLowerCase().includes(tablename)) {
innerNode.click()
break
}
}
})
})
})
})
cy.get('#hotTable .ht_clone_top .htCore thead button.changeType', {
timeout: longerCommandTimeout
}).should('exist')
}
const clickOnEdit = (callback?: any) => {
cy.get('.btnCtrl button.btn-primary', { timeout: longerCommandTimeout })
.click()
.then(() => {
if (callback) callback()
})
}
// Edits a single cell, locating the column by its header label. Handsontable
// renders the frozen header in a separate clone pane (.ht_clone_top) - the
// header row inside .ht_master is kept visibility:hidden - so the labels are
// read from the clone.
const editCell = (rowIndex: number, colName: string, value: string) => {
cy.get('#hotTable .ht_clone_top .htCore thead th', {
timeout: longerCommandTimeout
}).then((headers: any) => {
let colIndex = -1
for (let i = 0; i < headers.length; i++) {
if (
String(headers[i].innerText || '')
.trim()
.toUpperCase() === colName.toUpperCase()
) {
colIndex = i
break
}
}
expect(colIndex, `column ${colName} present`).to.be.greaterThan(-1)
cy.get('#hotTable .ht_master tbody tr')
.eq(rowIndex)
.then((row: any) => {
cy.get(row[0].childNodes[colIndex])
.dblclick({ force: true })
.then(() => {
cy.focused()
.clear()
.type(value + '{enter}')
})
})
})
}
const submitTable = (callback?: any) => {
cy.get('.btnCtrl button.btn-primary', { timeout: longerCommandTimeout })
.click()
.then(() => {
if (callback) callback()
})
}
const submitTableMessage = (callback?: any) => {
cy.get('.modal-footer .btn.btn-sm.btn-success-outline', {
timeout: longerCommandTimeout
})
.click()
.then(() => {
if (callback) callback()
})
}
+21 -2
View File
@@ -369,11 +369,30 @@
</div>
}
@if (!['', ' '].includes(queryText)) {
<div class="clr-col-md-12 infoBar">
<span
<div
#infoBar
class="clr-col-md-12 infoBar"
[class.expanded]="filterExpanded"
>
<span class="infoBar-text"
>FILTER :
<b>{{ queryText }}</b>
</span>
@if (filterOverflows) {
<button
type="button"
class="infoBar-toggle"
[attr.aria-expanded]="filterExpanded"
[attr.aria-label]="
filterExpanded
? 'Collapse the filter clause'
: 'Expand the filter clause'
"
(click)="toggleFilterPanel()"
>
<clr-icon aria-hidden="true" shape="caret down"></clr-icon>
</button>
}
</div>
}
</div>
+59 -1
View File
@@ -1,4 +1,5 @@
import {
AfterViewChecked,
AfterViewInit,
ChangeDetectorRef,
Component,
@@ -112,7 +113,9 @@ import { ParseResult } from '../models/ParseResult.interface'
encapsulation: ViewEncapsulation.None,
standalone: false
})
export class EditorComponent implements OnInit, AfterViewInit, OnDestroy {
export class EditorComponent
implements OnInit, AfterViewInit, AfterViewChecked, OnDestroy
{
@ViewChildren('uploadStater')
uploadStaterCompList: QueryList<UploadStaterComponent> = new QueryList()
@ViewChildren('queryFilter')
@@ -525,6 +528,19 @@ export class EditorComponent implements OnInit, AfterViewInit, OnDestroy {
public tableData: Array<any> = []
public queryText = ''
public queryTextSaved = ''
/**
* The applied-filter panel is collapsed to a single line by default. The
* chevron that expands it is only useful when the clause does not fit that
* line, which depends on the rendered width - so it is measured from the DOM
* rather than guessed from the length of the text.
*/
public filterExpanded = false
public filterOverflows = false
@ViewChild('infoBar') infoBar?: ElementRef<HTMLElement>
private filterMeasuredKey = ''
public showApprovers = false
public pkDups = false
public validationDone = 0
@@ -3547,6 +3563,48 @@ export class EditorComponent implements OnInit, AfterViewInit, OnDestroy {
}
}
ngAfterViewChecked() {
this.scheduleFilterOverflowCheck()
}
/**
* Measures whether the applied-filter clause fits the collapsed single line,
* and shows or hides the chevron accordingly. The measurement is deferred
* because `filterOverflows` and `filterExpanded` are bound in this view -
* setting them inside the change-detection cycle would raise
* ExpressionChangedAfterItHasBeenChecked.
*/
private scheduleFilterOverflowCheck() {
const el = this.infoBar?.nativeElement
if (!el) {
return
}
const text = el.querySelector('.infoBar-text') as HTMLElement | null
if (!text) {
return
}
// re-measure only when the clause, the available width, or the state changes
const key = `${this.queryText}|${text.clientWidth}|${this.filterExpanded}`
if (key === this.filterMeasuredKey) {
return
}
this.filterMeasuredKey = key
setTimeout(() => {
// while expanded the clause wraps, so there is nothing to measure
if (this.filterExpanded) {
return
}
this.filterOverflows = text.scrollWidth > text.clientWidth
})
}
public toggleFilterPanel() {
this.filterExpanded = !this.filterExpanded
}
ngAfterViewInit() {
// Fix ARIA accessibility issues after table initialization
setTimeout(() => {
@@ -0,0 +1,89 @@
import { SasService } from './sas.service'
/**
* SasService's constructor is a plain 8-argument constructor with an empty
* body, and `request()` touches only a handful of collaborators, so this
* stubs exactly that surface - no TestBed/DI needed, same precedent as
* app.service.spec.ts and va-filter.service.spec.ts.
*
* The SASjs adapter is not built by the constructor either (sasServiceInit
* does that), so it is assigned directly - and its `request` spy is where the
* outgoing body is observable, which is the whole point of these tests.
*/
const buildService = () => {
const sasjsAdapter: any = {
request: jasmine.createSpy('request').and.resolveTo({}),
getSasRequests: () => []
}
const loggerService: any = {
logRequestData: jasmine.createSpy('logRequestData')
}
const userService: any = { user: undefined }
const eventService: any = {
showAbortModal: jasmine.createSpy('showAbortModal'),
startupDataLoaded: jasmine.createSpy('startupDataLoaded')
}
const router: any = { navigateByUrl: jasmine.createSpy('navigateByUrl') }
const service = new SasService(
{} as any, // appStoreService
userService,
eventService,
{} as any, // sasjsService
{} as any, // sasViyaService
loggerService,
{} as any, // startupCheckService
router
)
;(service as any).sasjsAdapter = sasjsAdapter
return { service, sasjsAdapter }
}
/** The body the adapter was asked to send for the most recent request. */
const sentBody = (sasjsAdapter: any) =>
sasjsAdapter.request.calls.mostRecent().args[1]
describe('SasService diagnostics payload', () => {
it('gives the startup service a body, so browser_info can ride on it', async () => {
const { service, sasjsAdapter } = buildService()
// Both startup service call sites pass null - there is nothing to send -
// and the service is the one whose log a support ticket is read from.
await service.request('public/startupservice', null)
const body = sentBody(sasjsAdapter)
expect(body).toBeTruthy()
expect(body.browser_info.length).toBe(1)
expect(body.browser_info[0].user_agent).toBe(navigator.userAgent)
expect('timezone' in body.browser_info[0]).toBe(true)
expect('tz_offset' in body.browser_info[0]).toBe(true)
})
it('leaves a non-diagnostics service payload alone', async () => {
const { service, sasjsAdapter } = buildService()
await service.request('public/viewlibs', null)
expect(sentBody(sasjsAdapter)).toBeNull()
})
it('adds browser_info to a body that already carries content', async () => {
const { service, sasjsAdapter } = buildService()
await service.request('editors/getdata', { table: 'MPE_X_TEST' })
const body = sentBody(sasjsAdapter)
expect(body.table).toBe('MPE_X_TEST')
expect(body.browser_info.length).toBe(1)
})
it('does not overwrite a browser_info the caller supplied', async () => {
const { service, sasjsAdapter } = buildService()
const supplied = [{ url: 'supplied by the caller' }]
await service.request('editors/getdata', { browser_info: supplied })
expect(sentBody(sasjsAdapter).browser_info).toBe(supplied)
})
})
+92
View File
@@ -20,6 +20,26 @@ import { RequestWrapperResponse } from '../models/request-wrapper/RequestWrapper
import { SasViyaService } from './sas-viya.service'
import { ViyaApiFolder } from '../viya-api-explorer/models/viya-api-folder.model'
import { ViyaApiFolderMembers } from '../viya-api-explorer/models/viya-api-folder-content.model'
import { parseUserAgent } from '../shared/utils/parse-user-agent'
import { VERSION } from '../../environments/version'
/**
* Services that receive the `browser_info` / `browser_url_vars` diagnostics
* tables: the startup service (so every session logs its context once) and
* every service that executes customer-provided code - hook scripts via
* %mpe_runhook (getdata, stagedata, loadfile, restore, postdata) and the
* dynamic cell dropdown programs (getdynamiccolvals). Other services never
* see the tables, so the payload stays off the high-frequency calls.
*/
const DIAGNOSTICS_SERVICES = [
'services/public/startupservice',
'services/editors/getdata',
'services/editors/getdynamiccolvals',
'services/editors/stagedata',
'services/editors/loadfile',
'services/editors/restore',
'services/auditors/postdata'
]
@Injectable({
providedIn: 'root'
@@ -118,6 +138,50 @@ export class SasService {
if (!wrapperOptions) wrapperOptions = {}
// Support diagnostics: tell the backend where the request came from.
// Sent only to the services that can act on it - the startup service
// (so every session logs its context once) and the services that
// %include customer-provided code (hook scripts, dynamic cell dropdown
// programs). This is the URL of this page - the Data Controller iframe -
// not the document that embeds it, so an embedded report can be
// distinguished. The browser_url_vars table carries the URL parameters
// as name/value pairs, which is easier for a SAS developer to read than
// parsing the url string.
// The startup service is called with a null payload - there is nothing to
// send - so give it one to carry the diagnostics. It is the service whose
// log a support ticket is read from, and without this it never receives
// them.
if (
DIAGNOSTICS_SERVICES.includes(url) &&
(data === null || data === undefined)
) {
data = {}
}
if (data && typeof data === 'object' && !data.browser_info) {
if (DIAGNOSTICS_SERVICES.includes(url)) {
const tz = Intl.DateTimeFormat().resolvedOptions().timeZone
const ua = parseUserAgent(navigator.userAgent)
data.browser_info = [
{
url: window.location.href,
referrer: document.referrer,
timezone: tz || '',
tz_offset: new Date().getTimezoneOffset(),
locale: navigator.language || '',
dc_version: VERSION.semverString,
adapter_version: VERSION.adapterVersion,
browser: ua.browser,
browser_version: ua.browserVersion,
platform: ua.platform,
user_agent: navigator.userAgent || ''
}
]
const urlVars = this.collectBrowserUrlVars()
if (urlVars.length) data.browser_url_vars = urlVars
}
}
// If debug is on it will print what is going inside the adapter
this.loggerService.logRequestData(url, data)
@@ -263,6 +327,34 @@ export class SasService {
})
}
/**
* Collects the page URL parameters as name/value pairs for the
* `browser_url_vars` table. Parameters appear both in the search string
* (before the hash) and in the hash query string (Angular routes carry
* them after the `#`), so both are read - search first, and the first
* occurrence of a name wins, so the search string value beats the hash
* value on a collision.
*/
private collectBrowserUrlVars(): Array<{ name: string; value: string }> {
const vars: { name: string; value: string }[] = []
const seen = new Set<string>()
const collect = (search: string) => {
new URLSearchParams(search).forEach((value, name) => {
if (!seen.has(name)) {
seen.add(name)
vars.push({ name, value })
}
})
}
if (window.location.search) collect(window.location.search.slice(1))
const hashQuery = window.location.hash.split('?')[1]
if (hashQuery) collect(hashQuery)
return vars
}
/**
* Uploads a file to the backend, using the adapter upload function.
*
@@ -0,0 +1,34 @@
import { SidebarComponent } from './sidebar.component'
describe('SidebarComponent', () => {
// getSubPage is a pure read of the router's current URL, and the only other
// dependencies are the two SasService calls in the constructor - so the
// class can be constructed directly, without a TestBed.
const buildComponent = (routerUrl: string) =>
new SidebarComponent(
{ url: routerUrl } as any,
{} as any,
{
getSasjsConfig: () => ({}),
getServerType: () => 'SASVIYA'
} as any
)
describe('getSubPage', () => {
it('returns the sub-page segment of a plain route', () => {
expect(buildComponent('/home/tables').getSubPage()).toEqual('tables')
})
it('excludes the query string - a VA report embed always adds one', () => {
expect(buildComponent('/home/tables?embed=va').getSubPage()).toEqual(
'tables'
)
})
it('excludes the query string on the viewer route', () => {
expect(buildComponent('/view/data?labels=true').getSubPage()).toEqual(
'data'
)
})
})
})
@@ -67,7 +67,10 @@ export class SidebarComponent implements OnInit {
}
public getSubPage() {
let url = this._router.url.split('/')
// `Router.url` carries the query string, so take the path segment only -
// otherwise any route with a parameter renders it as part of the label
// (a VA report embed always adds one, e.g. `?embed=va`).
let url = this._router.url.split('?')[0].split('/')
return url[2]
}
@@ -0,0 +1,119 @@
import { parseUserAgent } from './parse-user-agent'
/**
* Table-driven: the point of the parser is the token ORDER, and the only way
* to pin an order is to feed it real user agent strings that carry several
* tokens at once. Every case below is a verbatim UA from the product named
* (the iOS ones are the ones that used to fall through to Safari).
*/
describe('parseUserAgent', () => {
const cases: Array<{
label: string
ua: string
browser: string
version: string
platform: string
}> = [
{
label: 'desktop Edge (Edg)',
ua: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.2592.87',
browser: 'Edge',
version: '126.0.2592.87',
platform: 'Windows'
},
{
label: 'desktop Edge (legacy EdgeHTML)',
ua: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.17763',
browser: 'Edge',
version: '18.17763',
platform: 'Windows'
},
{
label: 'desktop Opera (OPR)',
ua: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 OPR/111.0.0.0',
browser: 'Opera',
version: '111.0.0.0',
platform: 'Linux'
},
{
label: 'desktop Firefox',
ua: 'Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0',
browser: 'Firefox',
version: '140.0',
platform: 'Linux'
},
{
label: 'desktop Chrome',
ua: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36',
browser: 'Chrome',
version: '126.0.0.0',
platform: 'Linux'
},
{
label: 'desktop Safari',
ua: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15',
browser: 'Safari',
version: '17.5',
platform: 'macOS'
},
{
label: 'Android Chrome',
ua: 'Mozilla/5.0 (Linux; Android 14; Pixel 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Mobile Safari/537.36',
browser: 'Chrome',
version: '126.0.0.0',
platform: 'Android'
},
{
label: 'iOS Chrome (CriOS) - not Safari',
ua: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/126.0.6478.153 Mobile/15E148 Safari/604.1',
browser: 'Chrome',
version: '126.0.6478.153',
platform: 'iOS'
},
{
label: 'iOS Firefox (FxiOS) - not Safari',
ua: 'Mozilla/5.0 (iPad; CPU OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/127.0 Mobile/15E148 Safari/605.1.15',
browser: 'Firefox',
version: '127.0',
platform: 'iOS'
},
{
label: 'iOS Edge (EdgiOS) - not Safari',
ua: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) EdgiOS/126.0.2592.86 Version/17.0 Mobile/15E148 Safari/604.1',
browser: 'Edge',
version: '126.0.2592.86',
platform: 'iOS'
},
{
label: 'iOS Safari',
ua: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1',
browser: 'Safari',
version: '17.5',
platform: 'iOS'
},
{
label: 'a non-browser client',
ua: 'curl/8.5.0',
browser: 'Unknown',
version: '',
platform: 'Unknown'
},
{
label: 'an empty user agent',
ua: '',
browser: 'Unknown',
version: '',
platform: 'Unknown'
}
]
cases.forEach((c) => {
it(`reports ${c.label} as ${c.browser} ${c.version || '(no version)'} on ${c.platform}`, () => {
expect(parseUserAgent(c.ua)).toEqual({
browser: c.browser,
browserVersion: c.version,
platform: c.platform
})
})
})
})
@@ -0,0 +1,77 @@
/**
* Summarises `navigator.userAgent` into the three things worth logging about a
* browser: its family, its version, and the platform it is running on.
*
* The raw user agent is kept alongside these - it is what a support ticket
* actually needs - but a hook is far more likely to want to branch on a name
* than to write its own user agent parsing.
*
* Order matters: Edge and Opera both claim to be Chrome, and Chrome claims to
* be Safari, so the most specific token has to be tested first. The mobile
* tokens are the sharpest case - an iOS browser carries its own token
* (`CriOS`, `FxiOS`, `EdgiOS`) *and* `Safari/`, so without the mobile token
* being tested first every iPhone and iPad client was reported as Safari with
* an empty version.
*/
export interface UserAgentSummary {
browser: string
browserVersion: string
platform: string
}
/**
* Most specific token first. Each entry carries the version pattern for the
* same token, so the family and its version can never be read from different
* products.
*/
const BROWSER_TOKENS: Array<{ name: string; token: RegExp; version: RegExp }> =
[
{
name: 'Edge',
token: /(?:EdgiOS|Edg[A-Z]?|Edge)\//,
version: /(?:EdgiOS|Edg[A-Z]?|Edge)\/([\d.]+)/
},
{
name: 'Opera',
token: /(?:OPiOS|OPR)\//,
version: /(?:OPiOS|OPR)\/([\d.]+)/
},
{
name: 'Firefox',
token: /(?:FxiOS|Firefox)\//,
version: /(?:FxiOS|Firefox)\/([\d.]+)/
},
{
name: 'Chrome',
token: /(?:CriOS|Chrome)\//,
version: /(?:CriOS|Chrome)\/([\d.]+)/
},
// Safari is the fallback token: everything else that reaches here is
// WebKit wearing another product's name.
{ name: 'Safari', token: /Safari\//, version: /Version\/([\d.]+)/ }
]
export function parseUserAgent(userAgent: string): UserAgentSummary {
const ua = userAgent || ''
const match = (re: RegExp) => (ua.match(re) || [])[1] || ''
let browser = 'Unknown'
let browserVersion = ''
for (const entry of BROWSER_TOKENS) {
if (entry.token.test(ua)) {
browser = entry.name
browserVersion = match(entry.version)
break
}
}
let platform = 'Unknown'
if (/Android/.test(ua)) platform = 'Android'
else if (/iPhone|iPad|iPod/.test(ua)) platform = 'iOS'
else if (/Windows/.test(ua)) platform = 'Windows'
else if (/Mac OS X/.test(ua)) platform = 'macOS'
else if (/Linux/.test(ua)) platform = 'Linux'
return { browser, browserVersion, platform }
}
+21 -2
View File
@@ -499,10 +499,29 @@
!['', ' '].includes(queryText) &&
!abortActive
) {
<div class="clr-col-md-12 infoBar">
<span
<div
#infoBar
class="clr-col-md-12 infoBar"
[class.expanded]="filterExpanded"
>
<span class="infoBar-text"
>FILTER : <b>{{ queryText }}</b></span
>
@if (filterOverflows) {
<button
type="button"
class="infoBar-toggle"
[attr.aria-expanded]="filterExpanded"
[attr.aria-label]="
filterExpanded
? 'Collapse the filter clause'
: 'Expand the filter clause'
"
(click)="toggleFilterPanel()"
>
<clr-icon aria-hidden="true" shape="caret down"></clr-icon>
</button>
}
</div>
}
</div>
+58 -1
View File
@@ -3,6 +3,8 @@ import {
AfterContentInit,
ChangeDetectorRef,
AfterViewInit,
AfterViewChecked,
ElementRef,
OnDestroy,
ViewChildren,
QueryList,
@@ -58,7 +60,7 @@ import { buildColInfoHtml } from '../shared/utils/col-info-html'
standalone: false
})
export class ViewerComponent
implements AfterContentInit, AfterViewInit, OnDestroy
implements AfterContentInit, AfterViewInit, AfterViewChecked, OnDestroy
{
@ViewChildren('queryFilter')
queryFilterCompList: QueryList<QueryComponent> = new QueryList()
@@ -96,6 +98,19 @@ export class ViewerComponent
public libTab!: string
public queryText: string = ''
public webQueryText: string = ''
/**
* The applied-filter panel is collapsed to a single line by default. The
* chevron that expands it is only useful when the clause does not fit that
* line, which depends on the rendered width - so it is measured from the DOM
* rather than guessed from the length of the text.
*/
public filterExpanded = false
public filterOverflows = false
@ViewChild('infoBar') infoBar?: ElementRef<HTMLElement>
private filterMeasuredKey = ''
public submitLoading!: boolean
public queryErr: boolean = false
public queryErrMessage!: string
@@ -1445,6 +1460,48 @@ export class ViewerComponent
}
}
ngAfterViewChecked() {
this.scheduleFilterOverflowCheck()
}
/**
* Measures whether the applied-filter clause fits the collapsed single line,
* and shows or hides the chevron accordingly. The measurement is deferred
* because `filterOverflows` and `filterExpanded` are bound in this view -
* setting them inside the change-detection cycle would raise
* ExpressionChangedAfterItHasBeenChecked.
*/
private scheduleFilterOverflowCheck() {
const el = this.infoBar?.nativeElement
if (!el) {
return
}
const text = el.querySelector('.infoBar-text') as HTMLElement | null
if (!text) {
return
}
// re-measure only when the clause, the available width, or the state changes
const key = `${this.queryText}|${text.clientWidth}|${this.filterExpanded}`
if (key === this.filterMeasuredKey) {
return
}
this.filterMeasuredKey = key
setTimeout(() => {
// while expanded the clause wraps, so there is nothing to measure
if (this.filterExpanded) {
return
}
this.filterOverflows = text.scrollWidth > text.clientWidth
})
}
public toggleFilterPanel() {
this.filterExpanded = !this.filterExpanded
}
ngAfterViewInit() {
// Fix ARIA accessibility issues after table initialization
setTimeout(() => {
-1
View File
@@ -59,7 +59,6 @@
runAsTask="true"
contextName="SAS Job Execution compute context"
adminGroup="SASAdministrators"
dcPath="/tmp/dc"
hotLicenceKey="non-commercial-and-evaluation"
>
</sasjs>
+55 -29
View File
@@ -120,30 +120,6 @@ app-editor {
.infoBar {
margin-top: 14px;
background: #495967;
color: white;
text-align: center;
padding: 3px;
font-size: 16px;
height: 30px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
span {
width: 80%;
}
&:hover {
height: unset;
white-space: normal;
span {
width: unset;
}
}
}
.pkHeader {
@@ -1228,11 +1204,6 @@ app-viewer {
.infoBar {
margin-top: 10px;
background: #495967;
color: white;
text-align: center;
padding: 3px;
font-size: 16px;
}
.filterSide {
@@ -5448,3 +5419,58 @@ body[cds-theme='dark'] {
cursor: pointer;
text-decoration: underline;
}
/* The applied-filter panel. Collapsed to a single line by default so that a
long filter does not take over the header; the chevron - rendered only when
the clause does not fit that line - expands the panel to show it in full. */
.infoBar {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
background: #495967;
color: white;
text-align: center;
padding: 3px 8px;
font-size: 16px;
/* the panel shows a query, so set it in the monospace face the app already
uses for code-like content (SAS logs, cell text) */
font-family: 'Lucida Console', Monaco, monospace;
.infoBar-text {
flex: 1;
min-width: 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
&.expanded {
align-items: flex-start;
.infoBar-text {
overflow: visible;
white-space: normal;
text-overflow: clip;
overflow-wrap: anywhere;
}
}
.infoBar-toggle {
flex: none;
background: transparent;
border: 0;
color: inherit;
cursor: pointer;
padding: 0 2px;
line-height: 1;
clr-icon {
transition: transform 0.15s ease-in;
}
}
&.expanded .infoBar-toggle clr-icon {
transform: rotate(180deg);
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "dcfrontend",
"version": "7.15.0",
"version": "7.16.0",
"description": "Data Controller",
"devDependencies": {
"@nogoo9/gitleaks": "8.30.1-post.2",
+1 -1
View File
@@ -14,7 +14,7 @@
"streamConfig": {
"streamWeb": true,
"streamWebFolder": "web9",
"webSourcePath": "`../../../../client/dist",
"webSourcePath": "../../client/dist",
"assetPaths": [],
"streamServiceName": "clickme"
}
+67 -1
View File
@@ -5259,12 +5259,40 @@ const testTables = {
STATUS: 1,
LAST_REVIEWED: 23621
}
]
],
// Hook demo pair: DEMO_MIRROR is an EMPTY mirror of DEMO_ORDERS, registered
// with pre/post edit hooks (services/hooks/demo_mirror_*.js). The pre-edit
// hook shows the live rows of DEMO_ORDERS; the post-edit hook routes a
// changeset submitted against the mirror to DEMO_ORDERS.
DEMO_ORDERS: [
{ ORDER_ID: 1001, CUSTOMER: 'Acme Corp', REGION: 'EU', AMOUNT: 450, STATUS: 'NEW' },
{ ORDER_ID: 1002, CUSTOMER: 'Borealis Ltd', REGION: 'EU', AMOUNT: 980.5, STATUS: 'OPEN' },
{ ORDER_ID: 1003, CUSTOMER: 'Cobalt GmbH', REGION: 'EU', AMOUNT: 620, STATUS: 'CLOSED' },
{ ORDER_ID: 1004, CUSTOMER: 'Delta Systems', REGION: 'US', AMOUNT: 4500, STATUS: 'NEW' }
],
DEMO_MIRROR: []
}
// Schemas for the TESTDATA tables, matching the old inline getdata.js payload
// that the Cypress editor specs were calibrated against.
const testSchema = {
// Hook demo pair (see DEMO_ORDERS / DEMO_MIRROR in testTables). The mirror
// has the same shape as the real table, so the pre-edit hook can hand its rows
// straight to the grid.
DEMO_ORDERS: [
{ name: 'ORDER_ID', type: 'N', length: 8, format: '', label: 'Order Id', notnull: true },
{ name: 'CUSTOMER', type: 'C', length: 20, format: '', label: 'Customer', notnull: false },
{ name: 'REGION', type: 'C', length: 8, format: '', label: 'Region', notnull: false },
{ name: 'AMOUNT', type: 'N', length: 8, format: '', label: 'Amount', notnull: false },
{ name: 'STATUS', type: 'C', length: 12, format: '', label: 'Status', notnull: false }
],
DEMO_MIRROR: [
{ name: 'ORDER_ID', type: 'N', length: 8, format: '', label: 'Order Id', notnull: true },
{ name: 'CUSTOMER', type: 'C', length: 20, format: '', label: 'Customer', notnull: false },
{ name: 'REGION', type: 'C', length: 8, format: '', label: 'Region', notnull: false },
{ name: 'AMOUNT', type: 'N', length: 8, format: '', label: 'Amount', notnull: false },
{ name: 'STATUS', type: 'C', length: 12, format: '', label: 'Status', notnull: false }
],
MPE_X_NEW: [
{
name: 'PRIMARY_KEY_FIELD',
@@ -5631,6 +5659,28 @@ tables.MPE_TABLES.push(
loadtype: 'UPDATE',
buskey: 'ID',
notes: 'Compact rule demo table (eight columns)'
},
{
tx_from: 0,
tx_to: 127490111999,
libref: testDataLibref,
dsn: 'DEMO_ORDERS',
num_of_approvals_required: 1,
loadtype: 'UPDATE',
buskey: 'ORDER_ID',
notes: 'Hook demo - the real table the mirror points at'
},
{
tx_from: 0,
tx_to: 127490111999,
libref: testDataLibref,
dsn: 'DEMO_MIRROR',
num_of_approvals_required: 1,
loadtype: 'UPDATE',
buskey: 'ORDER_ID',
notes: 'Hook demo - an empty mirror whose hooks show and route DEMO_ORDERS',
pre_edit_hook: 'services/hooks/demo_mirror_preedit',
post_edit_hook: 'services/hooks/demo_mirror_postedit'
}
)
@@ -5854,6 +5904,22 @@ const testValidations = [
base_col: 'STATUS',
rule_type: 'SOFTSELECT',
rule_value: testDataLibref + '.DEMO_01.STATUS'
},
// Hook demo: the mirror carries its OWN rule set, separate from the real
// table's - which is the whole point of routing edits through a mirror.
{
base_lib: testDataLibref,
base_ds: 'DEMO_MIRROR',
base_col: 'AMOUNT',
rule_type: 'MAXVAL',
rule_value: '2000'
},
{
base_lib: testDataLibref,
base_ds: 'DEMO_ORDERS',
base_col: 'AMOUNT',
rule_type: 'MAXVAL',
rule_value: '100000'
}
]
for (const v of testValidations) {
+109
View File
@@ -5,6 +5,7 @@
* Provides:
* - fetchTable / fetchRaw / parseCsv : emulate SAS %webout(FETCH)
* - webOutOpen / webOutObj / webOutClose : emulate SAS %webout(OPEN/OBJ/CLOSE)
* - mpeinit : emulate the %mpeinit debug dump
* - formatSasValue : apply a SAS format to a numeric value
* - parseFormattedToSas : convert an ISO string back to a SAS numeric
* - getDdType : derive DATE/DATETIME/TIME/N/C from a column format
@@ -336,6 +337,44 @@ function loadTableSchema(dataDir, tableName) {
return (data && data.columns) ? data.columns : []
}
/**
* Resolves a hook program name to the source of its mock implementation.
*
* MPE_TABLES.pre_edit_hook / post_edit_hook (and the SOFTSELECT_HOOK /
* HARDSELECT_HOOK rule_value in MPE_VALIDATIONS) hold a hook program: either a
* physical .sas path, or a path relative to the appLoc (e.g.
* 'services/hooks/mytable_postedit'). The real backend %includes the program
* into the running service, so the hook shares the service's macro variables
* and work datasets and can modify them.
*
* The mock mirrors that: this returns the source of the hook's .js counterpart,
* which the calling service eval()s in its OWN scope so the hook can read and
* modify the service's variables. Returns null when the hook has no mock
* implementation, so callers can fall back to an inline emulation or ignore it.
*
* Requires nodePath, driveRoot and appLoc in the caller's scope.
*/
function mockHookSource(hookValue) {
if (!hookValue) return null
let hook = String(hookValue).trim()
if (!hook) return null
// Reduce to the services-relative form, dropping any drive path or appLoc
// prefix the config may carry.
const idx = hook.indexOf('services/')
if (idx > -1) hook = hook.slice(idx)
// A physical hook is a .sas program on the server; its mock is a .js file
// sitting in the same place on the Drive.
hook = hook.replace(/\.sas$/i, '')
const hookFile = nodePath.resolve(driveRoot, 'files', appLoc, hook + '.js')
// The hook value is hand-edited mock config, and a value carrying '..'
// segments would otherwise resolve outside the Drive and be eval()'d
// in-service. Keep it inside the Drive's files tree.
const filesRoot = nodePath.resolve(driveRoot, 'files')
if (!hookFile.startsWith(filesRoot + nodePath.sep)) return null
if (!fs.existsSync(hookFile)) return null
return fs.readFileSync(hookFile, 'utf8')
}
/**
* Synthesises NOTNULL dqrules from the table schema, mirroring the
* dictionary.columns union in getdata.sas:
@@ -1176,3 +1215,73 @@ function webOutSend(tables) {
}
webOutClose()
}
// ─── %mpeinit() emulation ────────────────────────────────────────────────────
/**
* The `_debug` values that mean "debug on", mirroring the test in mpeinit.sas.
*
* 131 is what the adapter sends - SASjsApiClient.executeJob() puts it on every
* server-mode request, and on the multipart form when the payload goes out as
* FormData. 128 is what arrives on the Viya WEB JES path when runAsTask is
* enabled, and 2477 / 'fields,log,trace' are the SASjs debug values.
*/
const MPEINIT_DEBUG_VALUES = ['2477', 'fields,log,trace', '131', '128']
/* Mirrors the &mpeinit=1 guard in the SAS macro: dump once per execution. */
let _mpeinitDone = false
/**
* Dumps the browser_url_vars and browser_info input tables, mirroring the
* debug block of %mpeinit (sas/sasjs/macros/mpeinit.sas).
*
* The SAS macro reads work.browser_url_vars (name/value pairs taken from the
* query string) and work.browser_info (the browser fingerprint). Both arrive
* here as input tables - see fetchRaw() - and are dumped with console.log,
* which SASjs Server returns in the request's log (after its
* SASJS_LOGS_SEPARATOR marker), so the dump shows up in Data Controller's
* SAS Log tab exactly as the SAS version does.
*
* Called at the bottom of this file, so the services that eval() it dump the
* tables at startup - the same place %mpeinit() runs in the SAS services.
* That covers every diagnostics-carrying service (startup, editors, auditors);
* the mocks that do not load this file (lineage, metanav, usernav, a few
* public ones) have no equivalent startup step in the SAS app either.
*
* Difference from the SAS version: the header line is printed once per table,
* where SAS repeats it for every row (its PUTLOG sits inside the SET loop).
*/
function mpeinit() {
if (_mpeinitDone) return
const debugValue = typeof _debug === 'undefined' ? '' : _debug
if (MPEINIT_DEBUG_VALUES.indexOf(String(debugValue)) < 0) return
_mpeinitDone = true
const urlVars = fetchRaw('browser_url_vars')
if (urlVars === null) {
console.log('NOTE: mpeinit: no work.browser_url_vars on this request')
} else {
console.log('NOTE: mpeinit: work.browser_url_vars:')
parseCsv(urlVars).forEach(row => {
console.log(
'name=' + colVal(row, 'name') + ' value=' + colVal(row, 'value')
)
})
}
const browserInfo = fetchRaw('browser_info')
if (browserInfo === null) {
console.log('NOTE: mpeinit: no work.browser_info on this request')
} else {
console.log('NOTE: mpeinit: work.browser_info:')
parseCsv(browserInfo).forEach(row => {
console.log(Object.keys(row).map(col => col + '=' + row[col]).join(' '))
})
}
}
/* Every service that eval()s this file runs %mpeinit() at startup, the same
place the SAS services call it. */
mpeinit()
+19 -2
View File
@@ -204,8 +204,8 @@ if (tableData && tableData.columns && tableData.rows) {
if (tableReg.var_busto) excludeCols.add(tableReg.var_busto.toUpperCase())
}
const visibleColumns = tableData.columns.filter(c => !excludeCols.has(c.name.toUpperCase()))
const visibleRows = tableData.rows
let visibleColumns = tableData.columns.filter(c => !excludeCols.has(c.name.toUpperCase()))
let visibleRows = tableData.rows
.filter(r => filterPredicate(r))
.map(r => {
const copy = {}
@@ -215,6 +215,23 @@ if (tableData && tableData.columns && tableData.rows) {
return copy
})
// ─── PRE_EDIT_HOOK ───────────────────────────────────────────────────────
// Mirrors getdata.sas: %mpe_runhook(PRE_EDIT_HOOK) runs after the filter has
// been applied and the rows sorted, with the data in work.OUT, and may
// replace it. The mock eval()s the hook's .js counterpart in this scope, so
// the hook may reassign visibleRows / visibleColumns - e.g. to show the live
// rows of another table behind an empty mirror.
if (tableReg && tableReg.pre_edit_hook) {
const hookSrc = mockHookSource(tableReg.pre_edit_hook)
if (hookSrc) {
try {
eval(hookSrc)
} catch (err) {
console.log('Error running pre_edit_hook ' + tableReg.pre_edit_hook + ': ' + err.message)
}
}
}
// Augment rows: add delete flag, normalise keys, convert temporal values to ISO
const colLookup = {}
for (const col of visibleColumns) {
+25 -2
View File
@@ -59,8 +59,8 @@ for (let i = 1; i <= 10; i++) {
let libds = ''
if (typeof table !== 'undefined' && table) libds = String(table).toUpperCase()
const libref = libds.split('.')[0] || dcLibref
const dsn = libds.split('.')[1] || ''
let libref = libds.split('.')[0] || dcLibref
let dsn = libds.split('.')[1] || ''
// ─── Validate (mirrors the mp_abort checks in loadfile.sas) ─────────────────
@@ -167,6 +167,29 @@ if (!msg) {
}
if (!msg) {
// ─── POST_EDIT_HOOK ──────────────────────────────────────────────────
// Mirrors mpe_loader.sas: the hook runs before the MPE_SUBMIT record is
// written, while LIBREF / DS are still ordinary macro variables, so it
// can re-point the changeset at a different table. The mock eval()s the
// hook's .js counterpart in this scope so it can reassign libref / dsn.
const hookTables = mpeLoadTableData('MPE_TABLES')
const hookReg = (hookTables && hookTables.rows)
? hookTables.rows.find(r => r.libref === libref && r.dsn === dsn)
: null
if (hookReg && hookReg.post_edit_hook) {
const hookSrc = mockHookSource(hookReg.post_edit_hook)
if (hookSrc) {
try {
eval(hookSrc)
} catch (err) {
console.log(
'post_edit_hook ' + hookReg.post_edit_hook + ' failed: ' + err.message
)
}
libds = libref + '.' + dsn
}
}
tableId = makeTableId()
stageSubmission({
dataDir: libDataDir(libref),
+27 -2
View File
@@ -20,8 +20,8 @@ const _sctRow = fetchTable('SASControlTable')[0] || {}
let action = _sctRow.ACTION || 'LOAD'
let message = _sctRow.MESSAGE || ''
let libds = _sctRow.LIBDS || ''
const libref = libds.split('.')[0] || dcLibref
const dsn = libds.split('.')[1] || ''
let libref = libds.split('.')[0] || dcLibref
let dsn = libds.split('.')[1] || ''
// The base table lives in its own library (DC_JSLIB for control tables,
// TESTDATA for demo user tables); the staging dir stays in the control lib.
@@ -56,6 +56,31 @@ if (schema.length > 0) {
})
}
// ─── POST_EDIT_HOOK ──────────────────────────────────────────────────────────
// Mirrors mpe_loader.sas: %mpe_runhook(POST_EDIT_HOOK) runs before the MPE_SUBMIT
// record is written, while LIBREF / DS are still ordinary macro variables - which
// is what lets a hook re-point a changeset at a different table. The mock
// eval()s the hook's .js counterpart in this scope so it can reassign
// libref / dsn / libds; the submit record then names the new base table, exactly
// as the SAS hook does via call symputx.
const hookTables = makeTableLoader(mpeDataDir)('MPE_TABLES')
const hookReg = (hookTables && hookTables.rows)
? hookTables.rows.find(r => r.libref === libref && r.dsn === dsn)
: null
if (hookReg && hookReg.post_edit_hook) {
const hookSrc = mockHookSource(hookReg.post_edit_hook)
if (hookSrc) {
try {
eval(hookSrc)
} catch (err) {
console.log(
'post_edit_hook ' + hookReg.post_edit_hook + ' failed: ' + err.message
)
}
libds = libref + '.' + dsn
}
}
// ─── Stage the data ──────────────────────────────────────────────────────────
// One subfolder per submission (DSID) under the staging directory, so that the
// staged data can sit alongside related artifacts (submit/approval logs,
@@ -0,0 +1,31 @@
// ─────────────────────────────────────────────────────────────────────────────
// Mock of a POST_EDIT_HOOK program
//
// Registered against TESTDATA.DEMO_MIRROR (MPE_TABLES.post_edit_hook).
//
// This file is eval'd by editors/stagedata.js and editors/loadfile.js
// (mirroring how mpe_loader.sas %includes the hook program via %mpe_runhook),
// so it shares the caller's scope: libref, dsn, libds and every dcMockUtils
// function are available directly.
//
// The real hook runs in mpe_loader BEFORE the submit record is written, while
// LIBREF / DS are still ordinary macro variables - which is what lets it
// re-point a changeset at a different table:
//
// data _null_;
// call symputx('libref','TESTDATA');
// call symputx('ds','DEMO_ORDERS');
// run;
//
// (call symputx reaches the calling service's variable because LIBREF/DS are
// not declared %local in mpe_loader; a %let creates a new variable in the
// hook's own scope and is discarded.)
//
// The mock's equivalent is to reassign libref / dsn, so the MPE_SUBMIT record
// names the real table and the approval is raised against it rather than
// against the empty mirror.
// ─────────────────────────────────────────────────────────────────────────────
libref = 'TESTDATA'
dsn = 'DEMO_ORDERS'
console.log('[HOOK DEBUG] demo_mirror_postedit: routing changeset to ' + libref + '.' + dsn)
@@ -0,0 +1,35 @@
// ─────────────────────────────────────────────────────────────────────────────
// Mock of a PRE_EDIT_HOOK program
//
// Registered against TESTDATA.DEMO_MIRROR (MPE_TABLES.pre_edit_hook), which is
// an EMPTY mirror of TESTDATA.DEMO_ORDERS.
//
// This file is eval'd by editors/getdata.js (mirroring how getdata.sas
// %includes the hook program via %mpe_runhook), so it shares the caller's
// scope: visibleRows, visibleColumns, tableReg, requestedLibref and every
// dcMockUtils function (loadTableAnyLib, makeTableLoader, libDataDir, ...) are
// available directly.
//
// The real hook is a .sas program which runs after the filter has been applied
// and the table sorted, with the editor data in work.OUT:
//
// data work.out;
// set TESTDATA.DEMO_ORDERS;
// run;
//
// The mock's equivalent is to replace visibleRows / visibleColumns with the
// rows and columns of the real table, so an empty mirror still shows live data.
// (A real hook that must honour the user's filter has to re-apply it - the
// filter has already been applied to the empty mirror by the time it runs.)
// ─────────────────────────────────────────────────────────────────────────────
const realTable = loadTableAnyLib('DEMO_ORDERS')
if (realTable && realTable.data) {
visibleRows = realTable.data.rows.map((row) => ({ ...row }))
visibleColumns = realTable.data.columns
console.log(
'[HOOK DEBUG] demo_mirror_preedit: loaded ' +
visibleRows.length +
' rows from DEMO_ORDERS'
)
}
+26
View File
@@ -462,6 +462,32 @@ run;
%return;
%end;
/* The post edit hook may have re-pointed the changeset at a different table -
* that is what lets an empty mirror stand in for a real one. The target must
* itself be registered in MPE_TABLES: the approval screen resolves the table's
* audit settings from that row, and a changeset whose base table has no row
* cannot be reviewed. Fail here, while the submitter is still watching. */
%local target_chk;
proc sql noprint;
select count(*) into: target_chk
from &mpelib..mpe_tables
where tx_from le &now and &now lt tx_to
and upcase(libref)="%upcase(&libref)"
and upcase(dsn)="%upcase(&ds)";
%if &target_chk=0 %then %do;
%let msg=%str(ERR)OR: target table &libref..&ds is not registered in%trim(
) &mpelib..mpe_tables - a post edit hook may only route a changeset to a%trim(
) registered table;
%mpe_loadfail(
status=FAILED - TARGET NOT REGISTERED
,now=&now
,mperef=&mperef
,reason_txt=%quote(&msg)
,dc_dttmtfmt=&dc_dttmtfmt.
)
%return;
%end;
/**
* send to approve process
+25
View File
@@ -115,9 +115,34 @@ run;
,msg=%str(Problem during compilation or with STP precode (&syswarningtext))
)
/* `_debug` is 131 by default, but the adapter sends 128 on the Viya WEB JES
* path when runAsTask is enabled (see WebJobExecutor.getRequestParams), and
* 128 also arrives when a `log` debug value is requested. All of them mean
* "debug on" - so all of them enable the extra logging below. */
%if "&_debug"="2477" or "&_debug"="fields,log,trace" or "&_debug"="131"
or "&_debug"="128"
%then %do;
%let sasjs_mdebug=1;
%end;
%if "&sasjs_mdebug"="1" %then %do;
%if %sysfunc(exist(work.browser_url_vars)) %then %do;
data _null_;
length name value $1024;
set work.browser_url_vars;
putlog "NOTE: &sysmacroname: work.browser_url_vars:";
putlog name= value=;
run;
%end;
%else %put NOTE: &sysmacroname: no work.browser_url_vars on this request;
%if %sysfunc(exist(work.browser_info)) %then %do;
data _null_;
set work.browser_info;
putlog "NOTE: &sysmacroname: work.browser_info:";
putlog (_all_)(=);
run;
%end;
%else %put NOTE: &sysmacroname: no work.browser_info on this request;
%end;
%mend mpeinit;