Repository navigation
fix(plugin-grid): the Import Wizard stops offering the two control opt-outs the import doors refuse (objectui#12985) - #12989
Merged
Conversation
…t-outs the import doors refuse Removes the "run automations" and "treat as historical" options, their state and the request fields they set. Both import doors honour runAutomations: false and treatAsHistorical: true for the system principal only (objectstack-ai/objectstack#24348), so every signed-in user who touched either option had the whole import refused 403. The default import is unchanged: omitting both keys is the server's declared default. Retires the three locale keys only those options read in all ten packs and in the wizard's English fallback map. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XVp19E1MYUTFM3dnkwz8gB
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #12985
Clause-②: no
The Import Wizard no longer offers "Run automations & triggers" or "Import as historical data". Both import doors (
POST /api/v1/data/:object/importand/import/jobs) honourrunAutomations: falseandtreatAsHistorical: truefor the system principal only and refuse every other caller403 PERMISSION_DENIED(objectstack-ai/objectstack#24348, PR objectstack-ai/objectstack#24379, measured there byimport-control-opt-out-gate.test.ts). A browser request is never the system principal, so a user who unticked the first box or ticked the second had the whole import refused.What changed
packages/plugin-grid/src/ImportWizard.tsx: the two checkboxes, theiruseStatepairs, their props onImportOptions, their entries in the dependency lists and the reset, and the two fieldsassembleImportRequestset are removed. The wizard's import, dry-run and background-job requests (all three go throughassembleImportRequest) carry neither key. Omitting both is the server's declared default (readImportControlFlags:runAutomationsis on unless the body sendsfalse;treatAsHistoricalis on only for a literaltrue), so the default import is unchanged: automations run and the state machine is walked. No capability or entitlement is added.packages/i18n/src/locales/*.ts(all ten packs) and the wizard's English fallback mapIMPORT_DEFAULT_TRANSLATIONS: the three keys only those options read,grid.import.optRunAutomations,grid.import.optTreatHistorical,grid.import.optTreatHistoricalHint, are retired. A repo-widegit grepfor the two leaf names is empty after the change (control:optCreateOptionsstill hits every pack).en.tsandmakerEmptyState-v1-scope-8329.test.ts) listeddataImport.optRunAutomationsas a live manual automation surface. That key is retired here, so the name is dropped from both lists..changeset/12985-import-optouts.md:@object-ui/plugin-gridand@object-ui/i18n, patch.Contract note for the seat (Clause-② no, narrowing):
ImportWizardPropsandImportResultare unchanged. The locale objects exported under@object-ui/i18n/locales/*lose three members ofgrid.import. The internal__testables.assembleImportRequestoptions type losesrunAutomationsandtreatAsHistorical.ImportRequestOptionsin@object-ui/typesstill declares both fields, because the server still accepts them from the system principal.Pins
New file
packages/plugin-grid/src/ImportWizard.controlOptOuts-12985.test.tsx, over the real wizard:import-opt-run-automationsnorimport-opt-treat-historicalis drawn, and no text matches automations or historical. CONTROL: theimport-optionspanel andimport-opt-create-optionsare drawn.importRecordshas neither property, and equals the default import's request exactly (format,rows,writeMode: insert,createMissingOptions: false,skipBlankMatchKey: false) as the CONTROL that nothing else moved;onCompletereceives 2 of 2 rows imported.importDryRun.test.tsandimportSavedMapping.test.tsdrop the two option inputs and the assertions that the fields were sent.Ablation (once): with the fix committed,
ablation-replace.mjsput adata-testid="import-opt-run-automations"checkbox labelled "Run automations & triggers" back intoImportOptions(anchor 1 to 0, blob3cdd0e998bafto37f2a414044c), and pin (a) went red:Tests 1 failed | 1 passed (2), failing onqueryByTestId('import-opt-run-automations'). Restore: blob after restore3cdd0e998bafequals the HEAD blob andgit diff HEADis empty. A first attempt was a no-op: its replacement contained its own anchor, so the tool refused it (anchor count 1 to 1) and the test never ran. It was re-run with a new anchor, and that second run is the one quoted here.Verification (at
ac0198b332)All of it ran on the committed tree at
ac0198b332.turbo run build --filter=@object-ui/plugin-grid^...(13 tasks): exit 0.type-checkfor@object-ui/plugin-gridand@object-ui/i18n(tsc --noEmit && tsc -p tsconfig.test.json): exit 0.--listFilesconfirms the new and edited test files are in the test program.--maxWorkers=1: the new and edited files plus the parity test, 4 files and 20 tests, passed. Every test file that namesImportWizard,runAutomationsortreatAsHistorical, in plugin-grid (21 files, 148 tests) and elsewhere, plus the i18n parity and retired-key suites (20 files, 301 tests), passed.packages/plugin-grid/andpackages/i18n/directories.check:phantom-deps,check:self-import,check:unreferenced-sources,check:doc-example-readers,check:handler-key-reads,check:side-effects-array,check:element-data-source-declaration,check:spec-symbols,check:action-forward-parity,check:designer-field-key-parity,check:icon-record-names,check:i18n-keys,check:i18n-dead-keys,check:i18n-drift,check:i18n-designer-parityandcheck:control-bytes. Also exit 0:node scripts/check-hand-rolled-comment-mask.mjs,node scripts/check-changeset-fixed.mjs,node scripts/check-changeset-presence.mjsandcheck:new-line-citations(0 new).eslint --no-inline-configover the 15 changed.ts/.tsxfiles:eslint.config.jsscopes**/*.{ts,tsx}. The JSON output counts 15 files linted, 0 errors and 9 warnings.ImportWizard.tsx. The same 9 rules fire on the base blob of that file, so the change adds none.parserOptions.project, so linting is not type-aware and this diff cannot move a verdict on an untouched file.Acceptance notes
runAutomationsortreatAsHistorical.git grephits only this file, its tests and the typeImportRequestOptionsinpackages/types/src/data.ts, which is outside this file surface and still correct as a wire type.data-objectstackforwards the request object and names neither field.ImportRequestOptions.runAutomationsinpackages/types/src/data.tsreads "off by default for bulk". The spec and server default is on (ImportRequestSchema,runAutomationsdeclared default). No producer reads it.Session:
https://claude.ai/code/session_01XVp19E1MYUTFM3dnkwz8gBGenerated by Claude Code