openstack-uicore-foundation 5.0.7-beta.1 → 5.0.8-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.codegraph/config.json +140 -0
- package/docs/plans/2026-04-09-showconfirmdialog-react16-compat.md +83 -0
- package/lib/components/ajaxloader.js.map +1 -1
- package/lib/components/attendance-tracker.js +1 -1
- package/lib/components/attendance-tracker.js.map +1 -1
- package/lib/components/bulk-actions-selector.js.map +1 -1
- package/lib/components/circle-button.js.map +1 -1
- package/lib/components/clock.js +1 -1
- package/lib/components/clock.js.map +1 -1
- package/lib/components/exclusive-wrapper.js.map +1 -1
- package/lib/components/extra-questions-mui.js.map +1 -1
- package/lib/components/extra-questions.js +1 -1
- package/lib/components/extra-questions.js.map +1 -1
- package/lib/components/form-validation.js.map +1 -1
- package/lib/components/forms/rsvp-form.js.map +1 -1
- package/lib/components/forms/simple-form.js +1 -1
- package/lib/components/forms/simple-form.js.map +1 -1
- package/lib/components/free-text-search.js +1 -1
- package/lib/components/free-text-search.js.map +1 -1
- package/lib/components/google-map.js +1 -1
- package/lib/components/google-map.js.map +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/index.js.map +1 -1
- package/lib/components/inputs/access-levels-input.js +1 -1
- package/lib/components/inputs/access-levels-input.js.map +1 -1
- package/lib/components/inputs/action-dropdown.js.map +1 -1
- package/lib/components/inputs/attendee-input.js +1 -1
- package/lib/components/inputs/attendee-input.js.map +1 -1
- package/lib/components/inputs/checkbox-list.js.map +1 -1
- package/lib/components/inputs/company-input-v2.js +1 -1
- package/lib/components/inputs/company-input-v2.js.map +1 -1
- package/lib/components/inputs/company-input.js +1 -1
- package/lib/components/inputs/company-input.js.map +1 -1
- package/lib/components/inputs/country-dropdown.js +1 -1
- package/lib/components/inputs/country-dropdown.js.map +1 -1
- package/lib/components/inputs/country-input.js +1 -1
- package/lib/components/inputs/country-input.js.map +1 -1
- package/lib/components/inputs/datetimepicker.js.map +1 -1
- package/lib/components/inputs/dropdown.js.map +1 -1
- package/lib/components/inputs/editor-input-v2.js.map +1 -1
- package/lib/components/inputs/editor-input-v3.js.map +1 -1
- package/lib/components/inputs/editor-input.js.map +1 -1
- package/lib/components/inputs/event-input.js +1 -1
- package/lib/components/inputs/event-input.js.map +1 -1
- package/lib/components/inputs/free-multi-text-input.js.map +1 -1
- package/lib/components/inputs/group-input.js +1 -1
- package/lib/components/inputs/group-input.js.map +1 -1
- package/lib/components/inputs/grouped-dropdown.js.map +1 -1
- package/lib/components/inputs/language-input.js +1 -1
- package/lib/components/inputs/language-input.js.map +1 -1
- package/lib/components/inputs/member-input.js +1 -1
- package/lib/components/inputs/member-input.js.map +1 -1
- package/lib/components/inputs/operator-input.js.map +1 -1
- package/lib/components/inputs/organization-input.js +1 -1
- package/lib/components/inputs/organization-input.js.map +1 -1
- package/lib/components/inputs/promocode-input.js +1 -1
- package/lib/components/inputs/promocode-input.js.map +1 -1
- package/lib/components/inputs/radio-list.js.map +1 -1
- package/lib/components/inputs/registration-company-input.js +1 -1
- package/lib/components/inputs/registration-company-input.js.map +1 -1
- package/lib/components/inputs/speaker-input.js +1 -1
- package/lib/components/inputs/speaker-input.js.map +1 -1
- package/lib/components/inputs/sponsor-input.js +1 -1
- package/lib/components/inputs/sponsor-input.js.map +1 -1
- package/lib/components/inputs/stepped-select.js.map +1 -1
- package/lib/components/inputs/summit-days-select.js.map +1 -1
- package/lib/components/inputs/summit-input.js +1 -1
- package/lib/components/inputs/summit-input.js.map +1 -1
- package/lib/components/inputs/summit-venues-select.js.map +1 -1
- package/lib/components/inputs/tag-input.js +1 -1
- package/lib/components/inputs/tag-input.js.map +1 -1
- package/lib/components/inputs/text-input.js.map +1 -1
- package/lib/components/inputs/textarea-input.js.map +1 -1
- package/lib/components/inputs/ticket-types-input.js +1 -1
- package/lib/components/inputs/ticket-types-input.js.map +1 -1
- package/lib/components/inputs/upload-input-v2.js +1 -1
- package/lib/components/inputs/upload-input-v2.js.map +1 -1
- package/lib/components/inputs/upload-input-v3.js +1 -1
- package/lib/components/inputs/upload-input-v3.js.map +1 -1
- package/lib/components/inputs/upload-input.js.map +1 -1
- package/lib/components/mui/checkbox-list.js.map +1 -1
- package/lib/components/mui/chip-list.js.map +1 -1
- package/lib/components/mui/chip-notify.js +1 -1
- package/lib/components/mui/chip-notify.js.map +1 -1
- package/lib/components/mui/chip-select-input.js.map +1 -1
- package/lib/components/mui/confirm-dialog-provider.js +2 -0
- package/lib/components/mui/confirm-dialog-provider.js.map +1 -0
- package/lib/components/mui/confirm-dialog.js.map +1 -1
- package/lib/components/mui/custom-alert.js.map +1 -1
- package/lib/components/mui/dnd-list.js.map +1 -1
- package/lib/components/mui/dropdown-checkbox.js.map +1 -1
- package/lib/components/mui/editable-table.js +1 -1
- package/lib/components/mui/editable-table.js.map +1 -1
- package/lib/components/mui/form-item-table.js +1 -1
- package/lib/components/mui/form-item-table.js.map +1 -1
- package/lib/components/mui/formik-inputs/additional-input-list.js +1 -1
- package/lib/components/mui/formik-inputs/additional-input-list.js.map +1 -1
- package/lib/components/mui/formik-inputs/additional-input.js +1 -1
- package/lib/components/mui/formik-inputs/additional-input.js.map +1 -1
- package/lib/components/mui/formik-inputs/async-select.js.map +1 -1
- package/lib/components/mui/formik-inputs/checkbox-group.js.map +1 -1
- package/lib/components/mui/formik-inputs/checkbox.js.map +1 -1
- package/lib/components/mui/formik-inputs/company-input.js +1 -1
- package/lib/components/mui/formik-inputs/company-input.js.map +1 -1
- package/lib/components/mui/formik-inputs/datepicker.js.map +1 -1
- package/lib/components/mui/formik-inputs/discount-field.js.map +1 -1
- package/lib/components/mui/formik-inputs/dropdown-checkbox.js.map +1 -1
- package/lib/components/mui/formik-inputs/dropdown-radio.js.map +1 -1
- package/lib/components/mui/formik-inputs/file-size-field.js.map +1 -1
- package/lib/components/mui/formik-inputs/item-price-tiers.js +1 -1
- package/lib/components/mui/formik-inputs/item-price-tiers.js.map +1 -1
- package/lib/components/mui/formik-inputs/price-field.js.map +1 -1
- package/lib/components/mui/formik-inputs/quantity-field.js.map +1 -1
- package/lib/components/mui/formik-inputs/radio-group.js.map +1 -1
- package/lib/components/mui/formik-inputs/select-group.js.map +1 -1
- package/lib/components/mui/formik-inputs/select.js.map +1 -1
- package/lib/components/mui/formik-inputs/sponsor-input.js +1 -1
- package/lib/components/mui/formik-inputs/sponsor-input.js.map +1 -1
- package/lib/components/mui/formik-inputs/sponsorship-input.js +1 -1
- package/lib/components/mui/formik-inputs/sponsorship-input.js.map +1 -1
- package/lib/components/mui/formik-inputs/sponsorship-summit-select.js +1 -1
- package/lib/components/mui/formik-inputs/sponsorship-summit-select.js.map +1 -1
- package/lib/components/mui/formik-inputs/summit-addon-select.js +1 -1
- package/lib/components/mui/formik-inputs/summit-addon-select.js.map +1 -1
- package/lib/components/mui/formik-inputs/switch.js.map +1 -1
- package/lib/components/mui/formik-inputs/textfield.js.map +1 -1
- package/lib/components/mui/formik-inputs/timepicker.js.map +1 -1
- package/lib/components/mui/formik-inputs/upload.js +1 -1
- package/lib/components/mui/formik-inputs/upload.js.map +1 -1
- package/lib/components/mui/infinite-table.js.map +1 -1
- package/lib/components/mui/item-settings-modal.js +1 -1
- package/lib/components/mui/item-settings-modal.js.map +1 -1
- package/lib/components/mui/menu-button.js.map +1 -1
- package/lib/components/mui/notes-modal.js +1 -1
- package/lib/components/mui/notes-modal.js.map +1 -1
- package/lib/components/mui/search-input.js.map +1 -1
- package/lib/components/mui/show-confirm-dialog.js +1 -1
- package/lib/components/mui/show-confirm-dialog.js.map +1 -1
- package/lib/components/mui/snackbar-notification.js +1 -1
- package/lib/components/mui/snackbar-notification.js.map +1 -1
- package/lib/components/mui/sortable-table.js +1 -1
- package/lib/components/mui/sortable-table.js.map +1 -1
- package/lib/components/mui/sponsor-addon-select.js +1 -1
- package/lib/components/mui/sponsor-addon-select.js.map +1 -1
- package/lib/components/mui/summit-addon-select.js +1 -1
- package/lib/components/mui/summit-addon-select.js.map +1 -1
- package/lib/components/mui/summits-dropdown.js +1 -1
- package/lib/components/mui/summits-dropdown.js.map +1 -1
- package/lib/components/mui/table.js +1 -1
- package/lib/components/mui/table.js.map +1 -1
- package/lib/components/progressive-img.js.map +1 -1
- package/lib/components/raw-html.js.map +1 -1
- package/lib/components/schedule-builder-view.js +1 -1
- package/lib/components/schedule-builder-view.js.map +1 -1
- package/lib/components/sections/panel.js.map +1 -1
- package/lib/components/simple-link-list.js.map +1 -1
- package/lib/components/sponsored-project-input.js +1 -1
- package/lib/components/sponsored-project-input.js.map +1 -1
- package/lib/components/summit-dropdown.js.map +1 -1
- package/lib/components/table-editable.js +1 -1
- package/lib/components/table-editable.js.map +1 -1
- package/lib/components/table-selectable.js.map +1 -1
- package/lib/components/table-sortable.js.map +1 -1
- package/lib/components/table.js.map +1 -1
- package/lib/components/video-stream.js.map +1 -1
- package/lib/css/components/index.css +1 -1
- package/lib/css/components/index.css.map +1 -1
- package/lib/i18n.js +1 -1
- package/lib/i18n.js.map +1 -1
- package/lib/models/index.js.map +1 -1
- package/lib/models/summit-event.js.map +1 -1
- package/lib/security/abstract-auth-callback-route-v2.js +1 -1
- package/lib/security/abstract-auth-callback-route-v2.js.map +1 -1
- package/lib/security/abstract-auth-callback-route.js +1 -1
- package/lib/security/abstract-auth-callback-route.js.map +1 -1
- package/lib/security/actions.js +1 -1
- package/lib/security/actions.js.map +1 -1
- package/lib/security/methods.js +1 -1
- package/lib/security/methods.js.map +1 -1
- package/lib/security/reducers.js +1 -1
- package/lib/security/reducers.js.map +1 -1
- package/lib/security/session-checker.js +1 -1
- package/lib/security/session-checker.js.map +1 -1
- package/lib/utils/actions.js +1 -1
- package/lib/utils/actions.js.map +1 -1
- package/lib/utils/fragment-parser.js.map +1 -1
- package/lib/utils/methods.js +1 -1
- package/lib/utils/methods.js.map +1 -1
- package/lib/utils/money.js.map +1 -1
- package/lib/utils/query-actions.js +1 -1
- package/lib/utils/query-actions.js.map +1 -1
- package/lib/utils/questions-set.js +1 -1
- package/lib/utils/questions-set.js.map +1 -1
- package/lib/utils/reducers.js +1 -1
- package/lib/utils/reducers.js.map +1 -1
- package/lib/utils/use-fit-text.js.map +1 -1
- package/package.json +1 -9
- package/.claude/settings.local.json +0 -12
- package/lib/components/mui/alert-button.js +0 -2
- package/lib/components/mui/alert-button.js.map +0 -1
- package/lib/components/mui/alert-modal.js +0 -2
- package/lib/components/mui/alert-modal.js.map +0 -1
- package/lib/components/mui/auth-button.js +0 -2
- package/lib/components/mui/auth-button.js.map +0 -1
- package/lib/components/mui/cart-button.js +0 -2
- package/lib/components/mui/cart-button.js.map +0 -1
- package/lib/components/mui/confirm-delete-dialog.js +0 -2
- package/lib/components/mui/confirm-delete-dialog.js.map +0 -1
- package/lib/components/mui/dashboard-card.js +0 -2
- package/lib/components/mui/dashboard-card.js.map +0 -1
- package/lib/components/mui/download-btn.js +0 -2
- package/lib/components/mui/download-btn.js.map +0 -1
- package/lib/components/mui/loading-overlay.js +0 -2
- package/lib/components/mui/loading-overlay.js.map +0 -1
- package/lib/components/mui/nav-bar.js +0 -2
- package/lib/components/mui/nav-bar.js.map +0 -1
- package/lib/components/mui/order-summary.js +0 -2
- package/lib/components/mui/order-summary.js.map +0 -1
- package/lib/components/mui/status-chip.js +0 -2
- package/lib/components/mui/status-chip.js.map +0 -1
- package/lib/components/mui/stripe-payment.js +0 -2
- package/lib/components/mui/stripe-payment.js.map +0 -1
- package/lib/components/mui/upload-btn.js +0 -2
- package/lib/components/mui/upload-btn.js.map +0 -1
- package/lib/components/mui/upload-dialog.js +0 -2
- package/lib/components/mui/upload-dialog.js.map +0 -1
- package/lib/css/components/mui/auth-button.css +0 -1
- package/lib/css/components/mui/nav-bar.css +0 -1
- package/lib/css/components/mui/upload-dialog.css +0 -2
- package/lib/css/components/mui/upload-dialog.css.map +0 -1
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"include": [
|
|
4
|
+
"**/*.ts",
|
|
5
|
+
"**/*.tsx",
|
|
6
|
+
"**/*.js",
|
|
7
|
+
"**/*.jsx",
|
|
8
|
+
"**/*.py",
|
|
9
|
+
"**/*.go",
|
|
10
|
+
"**/*.rs",
|
|
11
|
+
"**/*.java",
|
|
12
|
+
"**/*.c",
|
|
13
|
+
"**/*.h",
|
|
14
|
+
"**/*.cpp",
|
|
15
|
+
"**/*.hpp",
|
|
16
|
+
"**/*.cc",
|
|
17
|
+
"**/*.cxx",
|
|
18
|
+
"**/*.cs",
|
|
19
|
+
"**/*.php",
|
|
20
|
+
"**/*.rb",
|
|
21
|
+
"**/*.swift",
|
|
22
|
+
"**/*.kt",
|
|
23
|
+
"**/*.kts",
|
|
24
|
+
"**/*.dart",
|
|
25
|
+
"**/*.svelte",
|
|
26
|
+
"**/*.liquid",
|
|
27
|
+
"**/*.pas",
|
|
28
|
+
"**/*.dpr",
|
|
29
|
+
"**/*.dpk",
|
|
30
|
+
"**/*.lpr",
|
|
31
|
+
"**/*.dfm",
|
|
32
|
+
"**/*.fmx"
|
|
33
|
+
],
|
|
34
|
+
"exclude": [
|
|
35
|
+
"**/.git/**",
|
|
36
|
+
"**/node_modules/**",
|
|
37
|
+
"**/vendor/**",
|
|
38
|
+
"**/Pods/**",
|
|
39
|
+
"**/dist/**",
|
|
40
|
+
"**/build/**",
|
|
41
|
+
"**/out/**",
|
|
42
|
+
"**/bin/**",
|
|
43
|
+
"**/obj/**",
|
|
44
|
+
"**/target/**",
|
|
45
|
+
"**/*.min.js",
|
|
46
|
+
"**/*.bundle.js",
|
|
47
|
+
"**/.next/**",
|
|
48
|
+
"**/.nuxt/**",
|
|
49
|
+
"**/.svelte-kit/**",
|
|
50
|
+
"**/.output/**",
|
|
51
|
+
"**/.turbo/**",
|
|
52
|
+
"**/.cache/**",
|
|
53
|
+
"**/.parcel-cache/**",
|
|
54
|
+
"**/.vite/**",
|
|
55
|
+
"**/.astro/**",
|
|
56
|
+
"**/.docusaurus/**",
|
|
57
|
+
"**/.gatsby/**",
|
|
58
|
+
"**/.webpack/**",
|
|
59
|
+
"**/.nx/**",
|
|
60
|
+
"**/.yarn/cache/**",
|
|
61
|
+
"**/.pnpm-store/**",
|
|
62
|
+
"**/storybook-static/**",
|
|
63
|
+
"**/.expo/**",
|
|
64
|
+
"**/web-build/**",
|
|
65
|
+
"**/ios/Pods/**",
|
|
66
|
+
"**/ios/build/**",
|
|
67
|
+
"**/android/build/**",
|
|
68
|
+
"**/android/.gradle/**",
|
|
69
|
+
"**/__pycache__/**",
|
|
70
|
+
"**/.venv/**",
|
|
71
|
+
"**/venv/**",
|
|
72
|
+
"**/site-packages/**",
|
|
73
|
+
"**/dist-packages/**",
|
|
74
|
+
"**/.pytest_cache/**",
|
|
75
|
+
"**/.mypy_cache/**",
|
|
76
|
+
"**/.ruff_cache/**",
|
|
77
|
+
"**/.tox/**",
|
|
78
|
+
"**/.nox/**",
|
|
79
|
+
"**/*.egg-info/**",
|
|
80
|
+
"**/.eggs/**",
|
|
81
|
+
"**/go/pkg/mod/**",
|
|
82
|
+
"**/target/debug/**",
|
|
83
|
+
"**/target/release/**",
|
|
84
|
+
"**/.gradle/**",
|
|
85
|
+
"**/.m2/**",
|
|
86
|
+
"**/generated-sources/**",
|
|
87
|
+
"**/.kotlin/**",
|
|
88
|
+
"**/.dart_tool/**",
|
|
89
|
+
"**/.vs/**",
|
|
90
|
+
"**/.nuget/**",
|
|
91
|
+
"**/artifacts/**",
|
|
92
|
+
"**/publish/**",
|
|
93
|
+
"**/cmake-build-*/**",
|
|
94
|
+
"**/CMakeFiles/**",
|
|
95
|
+
"**/bazel-*/**",
|
|
96
|
+
"**/vcpkg_installed/**",
|
|
97
|
+
"**/.conan/**",
|
|
98
|
+
"**/Debug/**",
|
|
99
|
+
"**/Release/**",
|
|
100
|
+
"**/x64/**",
|
|
101
|
+
"**/release/**",
|
|
102
|
+
"**/*.app/**",
|
|
103
|
+
"**/*.asar",
|
|
104
|
+
"**/DerivedData/**",
|
|
105
|
+
"**/.build/**",
|
|
106
|
+
"**/.swiftpm/**",
|
|
107
|
+
"**/xcuserdata/**",
|
|
108
|
+
"**/Carthage/Build/**",
|
|
109
|
+
"**/SourcePackages/**",
|
|
110
|
+
"**/__history/**",
|
|
111
|
+
"**/__recovery/**",
|
|
112
|
+
"**/*.dcu",
|
|
113
|
+
"**/.composer/**",
|
|
114
|
+
"**/storage/framework/**",
|
|
115
|
+
"**/bootstrap/cache/**",
|
|
116
|
+
"**/.bundle/**",
|
|
117
|
+
"**/tmp/cache/**",
|
|
118
|
+
"**/public/assets/**",
|
|
119
|
+
"**/public/packs/**",
|
|
120
|
+
"**/.yardoc/**",
|
|
121
|
+
"**/coverage/**",
|
|
122
|
+
"**/htmlcov/**",
|
|
123
|
+
"**/.nyc_output/**",
|
|
124
|
+
"**/test-results/**",
|
|
125
|
+
"**/.coverage/**",
|
|
126
|
+
"**/.idea/**",
|
|
127
|
+
"**/logs/**",
|
|
128
|
+
"**/tmp/**",
|
|
129
|
+
"**/temp/**",
|
|
130
|
+
"**/_build/**",
|
|
131
|
+
"**/docs/_build/**",
|
|
132
|
+
"**/site/**"
|
|
133
|
+
],
|
|
134
|
+
"languages": [],
|
|
135
|
+
"frameworks": [],
|
|
136
|
+
"maxFileSize": 1048576,
|
|
137
|
+
"extractDocstrings": true,
|
|
138
|
+
"trackCallSites": true,
|
|
139
|
+
"enableEmbeddings": true
|
|
140
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# showConfirmDialog React 16 Compatibility Fix Plan
|
|
2
|
+
|
|
3
|
+
Created: 2026-04-09
|
|
4
|
+
Author: smarcet@gmail.com
|
|
5
|
+
Status: VERIFIED
|
|
6
|
+
Approved: Yes
|
|
7
|
+
Iterations: 0
|
|
8
|
+
Worktree: No
|
|
9
|
+
Type: Bugfix
|
|
10
|
+
|
|
11
|
+
## Summary
|
|
12
|
+
|
|
13
|
+
**Symptom:** `showConfirmDialog` causes "Module not found: Error: Can't resolve 'react-dom/client'" build error on React 16 projects, despite a `/* webpackIgnore: true */` dynamic import guard.
|
|
14
|
+
|
|
15
|
+
**Trigger:** Any consuming project on React 16 that bundles `openstack-uicore-foundation` hits the error during webpack build.
|
|
16
|
+
|
|
17
|
+
**Root Cause:** `src/components/mui/showConfirmDialog.js:27` — The `import(/* webpackIgnore: true */ "react-dom/client")` compiles into the UMD output as a bare `import("react-dom/client")` (the magic comment is stripped during this library's build). When a consuming project's webpack processes the compiled bundle, it encounters the bare dynamic import, tries to resolve `react-dom/client`, and fails because React 16 has no such module path.
|
|
18
|
+
|
|
19
|
+
## Investigation
|
|
20
|
+
|
|
21
|
+
- **Evolution:** Original code (cd39cf3) used only `ReactDOM.render()`. PR #214 (094c6b9) added `require("react-dom/client")` in try/catch for React 18+ support — caused the same build error. Commit 6c95b33 replaced `require()` with `import(/* webpackIgnore: true */ ...)` — the magic comment works for THIS library's webpack but is stripped from the compiled UMD output.
|
|
22
|
+
- **Confirmed in built output:** `lib/components/mui/show-confirm-dialog.js` contains literal `await import("react-dom/client")` with no webpack annotation — any consuming webpack resolves it at build time.
|
|
23
|
+
- **Key insight:** The `webpackIgnore` comment is a build-time directive that only affects the webpack instance that processes the source file. It does not survive into the output and cannot protect consuming projects.
|
|
24
|
+
- **Internal callers** (5 files: mui-table, mui-table-sortable, mui-table-editable, meta-field-values, additional-input-list) all use `showConfirmDialog` as a plain imperative function — `const isConfirmed = await showConfirmDialog({...})`.
|
|
25
|
+
|
|
26
|
+
## Fix Approach
|
|
27
|
+
|
|
28
|
+
**Chosen:** Bridge Pattern + Context Provider
|
|
29
|
+
|
|
30
|
+
**Why:** Completely eliminates all references to `react-dom/client` from the source and compiled output. The dialog renders inside the existing React tree (managed by whatever React version the app uses), so no version-specific rendering API is needed. Preserves the imperative `showConfirmDialog()` API unchanged.
|
|
31
|
+
|
|
32
|
+
**Alternatives considered:**
|
|
33
|
+
- *Configuration injection* (`configureConfirmDialog({ createRoot })`) — simpler but less ergonomic; consumer must handle version detection and import themselves.
|
|
34
|
+
- *Remove createRoot entirely* (pure `ReactDOM.render`) — works on 16/17/18 but breaks React 19 where `ReactDOM.render` was removed.
|
|
35
|
+
|
|
36
|
+
**How it works:**
|
|
37
|
+
1. A new `ConfirmDialogProvider` component manages dialog state (open/closed, options, resolve callback) and renders `ConfirmDialog` within the existing React tree.
|
|
38
|
+
2. On mount, the provider registers a "bridge" callback in a module-level variable inside `showConfirmDialog.js`.
|
|
39
|
+
3. When `showConfirmDialog()` is called, it delegates to the bridge if registered. If no provider is mounted, it falls back to `ReactDOM.render()` with a console warning (backward compat for React 16/17/18 consumers who haven't added the provider yet).
|
|
40
|
+
4. Zero references to `react-dom/client` remain in the codebase.
|
|
41
|
+
|
|
42
|
+
**Files:**
|
|
43
|
+
- `src/components/mui/showConfirmDialog.js` — Add bridge registration, fallback logic
|
|
44
|
+
- `src/components/mui/ConfirmDialogProvider.js` — NEW: Provider component
|
|
45
|
+
- `src/components/index.js` — Export the new provider
|
|
46
|
+
- `webpack.common.js` — Add entry point for the new provider
|
|
47
|
+
|
|
48
|
+
**Tests:**
|
|
49
|
+
- `src/components/mui/__tests__/show-confirm-dialog.test.js` — Update for bridge-based flow
|
|
50
|
+
- `src/components/mui/__tests__/confirm-dialog-provider.test.js` — NEW: Provider tests
|
|
51
|
+
|
|
52
|
+
**Defense-in-depth:** Not applicable — this is a build-time resolution error, not a data flow issue.
|
|
53
|
+
|
|
54
|
+
## Progress
|
|
55
|
+
|
|
56
|
+
- [x] Task 1: Implement bridge pattern + provider
|
|
57
|
+
- [x] Task 2: Verify
|
|
58
|
+
**Tasks:** 2 | **Done:** 2
|
|
59
|
+
|
|
60
|
+
## Tasks
|
|
61
|
+
|
|
62
|
+
### Task 1: Implement bridge pattern + provider
|
|
63
|
+
|
|
64
|
+
**Objective:** Replace the `react-dom/client` dynamic import with a bridge pattern. Create `ConfirmDialogProvider`, modify `showConfirmDialog` to use bridge with ReactDOM.render fallback, export the new provider.
|
|
65
|
+
|
|
66
|
+
**Files:**
|
|
67
|
+
- `src/components/mui/showConfirmDialog.js` — Remove `getCreateRoot()`, add bridge registration exports (`_registerBridge`, `_unregisterBridge`). When bridge is registered, delegate. When not, fall back to `ReactDOM.render()` with `console.warn` suggesting provider migration.
|
|
68
|
+
- `src/components/mui/ConfirmDialogProvider.js` — NEW: Functional component using `useState` + `useEffect`. On mount, registers bridge via `_registerBridge`. Bridge callback sets dialog state and returns a Promise. Renders `<ConfirmDialog>` when dialog state is active. On unmount, calls `_unregisterBridge`.
|
|
69
|
+
- `src/components/index.js` — Add export: `export { default as ConfirmDialogProvider } from './mui/ConfirmDialogProvider'`
|
|
70
|
+
- `webpack.common.js` — Add entry: `'components/mui/confirm-dialog-provider': './src/components/mui/ConfirmDialogProvider.js'`
|
|
71
|
+
|
|
72
|
+
**TDD:**
|
|
73
|
+
1. Write regression test: import `showConfirmDialog` without mocking `react-dom/client` — verify no reference to `react-dom/client` exists in the module
|
|
74
|
+
2. Write provider test: render `ConfirmDialogProvider`, call `showConfirmDialog`, verify dialog appears and resolves correctly
|
|
75
|
+
3. Write fallback test: call `showConfirmDialog` without provider mounted — verify `ReactDOM.render` is called with console warning
|
|
76
|
+
4. Verify all existing tests still pass (callers mock `showConfirmDialog` so they are unaffected)
|
|
77
|
+
|
|
78
|
+
**Verify:** `npx jest --no-cache`
|
|
79
|
+
|
|
80
|
+
### Task 2: Verify
|
|
81
|
+
|
|
82
|
+
**Objective:** Full test suite passes, no regressions across all components that use `showConfirmDialog`.
|
|
83
|
+
**Verify:** `npx jest --no-cache && grep -r "react-dom/client" src/ && echo "FAIL: react-dom/client still referenced" || echo "PASS: no react-dom/client references"`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/ajaxloader.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,mCCTTH,EAAOD,QAAUK,QAAQ,Q,GCCrBC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaT,QAGrB,IAAIC,EAASK,EAAyBE,GAAY,CAGjDR,QAAS,CAAC,GAOX,OAHAW,EAAoBH,GAAUP,EAAQA,EAAOD,QAASO,GAG/CN,EAAOD,OACf,C,MCrBAO,EAAoBK,EAAKX,IACxB,IAAIY,EAASZ,GAAUA,EAAOa,WAC7B,IAAOb,EAAiB,QACxB,IAAM,EAEP,OADAM,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,C,WCLdN,EAAoBQ,EAAI,CAACf,EAASiB,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEnB,EAASkB,IAC5EE,OAAOC,eAAerB,EAASkB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,C,WCNDX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,E,WCClFlB,EAAoBsB,EAAK7B,IACH,oBAAX8B,QAA0BA,OAAOC,aAC1CX,OAAOC,eAAerB,EAAS8B,OAAOC,YAAa,CAAEC,MAAO,WAE7DZ,OAAOC,eAAerB,EAAS,aAAc,CAAEgC,OAAO,GAAO,C,mECU9D,MA8DA,
|
|
1
|
+
{"version":3,"file":"components/ajaxloader.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,mCCTTH,EAAOD,QAAUK,QAAQ,Q,GCCrBC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaT,QAGrB,IAAIC,EAASK,EAAyBE,GAAY,CAGjDR,QAAS,CAAC,GAOX,OAHAW,EAAoBH,GAAUP,EAAQA,EAAOD,QAASO,GAG/CN,EAAOD,OACf,C,MCrBAO,EAAoBK,EAAKX,IACxB,IAAIY,EAASZ,GAAUA,EAAOa,WAC7B,IAAOb,EAAiB,QACxB,IAAM,EAEP,OADAM,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,C,WCLdN,EAAoBQ,EAAI,CAACf,EAASiB,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEnB,EAASkB,IAC5EE,OAAOC,eAAerB,EAASkB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,C,WCNDX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,E,WCClFlB,EAAoBsB,EAAK7B,IACH,oBAAX8B,QAA0BA,OAAOC,aAC1CX,OAAOC,eAAerB,EAAS8B,OAAOC,YAAa,CAAEC,MAAO,WAE7DZ,OAAOC,eAAerB,EAAS,aAAc,CAAEgC,OAAO,GAAO,C,mECU9D,MA8DA,EA9DmB,EACKC,OACAC,WACAC,QACAC,OACAC,eAGpB,IAAIC,EAAS,CACTC,QAASN,EAAO,QAAU,OAC1BO,MAAO,OACPC,OAAQ,OACRC,SAAUR,EAAW,WAAa,QAClCS,OAAQ,IACRC,OAAQ,OACRC,OAAQ,OACRC,gBAAiB,kBACjBC,IAAK,EACLC,KAAM,GAGNC,EAAe,CACfC,SAAUd,EAAO,KACjBD,MAAO,SAGPgB,EAAwB,CACxBX,MAAO,QACPC,OAAQ,OACRW,UAAW,SACXV,SAAUR,EAAW,WAAa,QAClCa,IAAKb,EAAW,MAAQ,IACxBc,KAAMd,EAAW,GAAK,IACtBmB,MAAO,IACPC,OAAQ,IACRV,OAAQ,OACRD,OAAQ,GACRR,MAAO,WAGPoB,EAAkB,CAClBC,WAAYrB,EACZsB,QAAS,MACTjB,MAAO,OACPC,OAAQ,OACRC,SAAU,WACVK,IAAK,GAGT,OACI,yBAAKW,UAAU,wBAAwBC,MAAOrB,GAC1C,yBAAKqB,MAAOR,GACR,uBAAGO,UAAU,wBAAwBC,MAAOV,IAC5C,6BACKZ,IAGT,yBAAKsB,MAAOJ,EAAiBG,UAAU,sBAR/C,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/ajaxloader/index.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","module.exports = require(\"react\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\n\nconst AjaxLoader = ({\n show,\n relative,\n color,\n size,\n children,\n }) => {\n\n let styles = {\n display: show ? 'block' : 'none',\n width: '100%',\n height: '100%',\n position: relative ? 'absolute' : 'fixed',\n zIndex: 10000000,\n margin: 'auto',\n cursor: 'wait',\n backgroundColor: 'rgba(0,0,0,0.2)',\n top: 0,\n left: 0\n };\n\n let styleSpinner = {\n fontSize: size + 'px',\n color: 'black',\n };\n\n let styleSpinnerContainer = {\n width: '250px',\n height: '75px',\n textAlign: 'center',\n position: relative ? 'relative' : 'fixed',\n top: relative ? '50%' : '0',\n left: relative ? '' : '0',\n right: '0',\n bottom: '0',\n margin: 'auto',\n zIndex: 10,\n color: '#ffffff'\n };\n\n let styleBackground = {\n background: color,\n opacity: '0.8',\n width: '100%',\n height: '100%',\n position: 'absolute',\n top: 0\n };\n\n return (\n <div className=\"ajax-loader-container\" style={styles}>\n <div style={styleSpinnerContainer}>\n <i className=\"fa fa-spinner fa-spin\" style={styleSpinner}></i>\n <div>\n {children}\n </div>\n </div>\n <div style={styleBackground} className=\"loader-background\"></div>\n </div>\n );\n};\n\nexport default AjaxLoader;\n"],"names":["root","factory","exports","module","define","amd","this","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","show","relative","color","size","children","styles","display","width","height","position","zIndex","margin","cursor","backgroundColor","top","left","styleSpinner","fontSize","styleSpinnerContainer","textAlign","right","bottom","styleBackground","background","opacity","className","style"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],o):"object"==typeof exports?exports["openstack-uicore-foundation"]=o():e["openstack-uicore-foundation"]=o()}(this,(()=>(()=>{"use strict";var e={5097:(e,o,t)=>{t(1116),t(6842),t(9087),t(
|
|
1
|
+
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],o):"object"==typeof exports?exports["openstack-uicore-foundation"]=o():e["openstack-uicore-foundation"]=o()}(this,(()=>(()=>{"use strict";var e={5097:(e,o,t)=>{t(1116),t(6842),t(9087),t(9558),t(2183)},3195:(e,o,t)=>{t.d(o,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>s,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>i,AUTH_ERROR_MISSING_AUTH_INFO:()=>r,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>n,AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR:()=>c,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>a});const r="AUTH_ERROR_MISSING_AUTH_INFO",n="AUTH_ERROR_MISSING_REFRESH_TOKEN",s="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",i="AUTH_ERROR_LOCK_ACQUIRE_ERROR",a="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR",c="AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR"},2183:(e,o,t)=>{t.d(o,{getAccessToken:()=>f});var r=t(9558),n=t(5812),s=t.n(n);t(806);const i=require("browser-tabs-lock");var a=t.n(i);const c=require("js-cookie");var R=t.n(c),u=(t(8041),t(9891),t(5097),t(8853),t(3195));const Lock=new(a()),GET_TOKEN_SILENTLY_LOCK_KEY="openstackuicore.lock.getTokenSilently",d="code",l="authInfo",_="idToken",E=async(e,o)=>{if(e===d&&g()){if(!o)throw m(),Error(u.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await(async(e,o=5,t=1e3)=>{for(let r=0;r<o;r++)try{return await e()}catch(e){if(!e.message||!e.message.startsWith(u.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR)||r===o-1)throw e;const n=t*Math.pow(2,r);console.log(`retryWithBackoff retry ${r+1}/${o} in ${n}ms`),await new Promise((e=>setTimeout(e,n)))}})((()=>T(o))),{access_token:t,expires_in:r,refresh_token:n,id_token:s}=e;return void 0===n&&(n=null),w(t,r,n,s),t}throw m(),Error(u.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)},p=async()=>{console.log("openstack-uicore-foundation::Security::methods::_getAccessToken");let e=O();if(!e)throw console.log("openstack-uicore-foundation::Security::methods::_getAccessToken AUTH_ERROR_MISSING_AUTH_INFO"),Error(u.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:o,expiresIn:t,accessTokenUpdatedAt:r,refreshToken:n}=e,i=y();const a=s()().unix();let c=a-r;return t-=60,console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken now ${a} accessTokenUpdatedAt ${r} expiresIn ${t} timeElapsedSecs ${c}`),(c>=t||null==o)&&(console.log("openstack-uicore-foundation::Security::methods::_getAccessToken access token expired, refreshing it ..."),o=await E(i,n)),o},f=async()=>{if("undefined"!=typeof navigator&&navigator.locks)return await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY,(async e=>(console.log("openstack-uicore-foundation::Security::methods::getAccessToken web lock api",e),await p())));if(!await(0,r.retryPromise)((()=>Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY,6e3)),10))throw Error(u.AUTH_ERROR_LOCK_ACQUIRE_ERROR);try{return await p()}finally{await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY)}},T=async e=>{let o=k(),t=S();const n={grant_type:"refresh_token",client_id:encodeURI(t),refresh_token:e},s=new AbortController,i=setTimeout((()=>s.abort()),1e4);let a,c;try{a=await fetch(`${o}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n),signal:s.signal})}catch(e){throw console.log("refreshAccessToken network error:",e.message),Error(`${u.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${e.message}`)}finally{clearTimeout(i)}if(!a.ok){if(console.log(`refreshAccessToken server error: ${a.status} - ${a.statusText}`),a.status>=500||408===a.status||429===a.status)throw Error(`${u.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${a.status} - ${a.statusText}`);throw(0,r.setSessionClearingState)(!0),Error(`${u.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${a.status} - ${a.statusText}`)}try{c=await a.json()}catch(e){throw Error(`${u.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: invalid JSON response from IDP`)}let{access_token:R,refresh_token:d,expires_in:l,id_token:_}=c;if(!R)throw(0,r.setSessionClearingState)(!0),Error(`${u.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: missing access_token in refresh response`);return{access_token:R,refresh_token:d,expires_in:l,id_token:_}},w=(e,o,t=null,n=null)=>{let s=O(),i={accessToken:e,expiresIn:o,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null==t&&s&&(t=s.refreshToken),null==n&&s&&(n=s.idToken),t&&(i.refreshToken=t),n?(i[_]=n,R().set(_,n,{secure:!0,sameSite:"Lax"})):R().remove(_),(0,r.putOnLocalStorage)(l,JSON.stringify(i))},O=()=>{try{let e=(0,r.getFromLocalStorage)(l,!1);return e?JSON.parse(e):null}catch(e){return null}},m=()=>{"undefined"!=typeof window&&((0,r.removeFromLocalStorage)(l),R().remove(_))},S=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,y=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",g=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),k=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},9087:(e,o,t)=>{t(2462),t(1116),t(806);var r=t(8041),n=t.n(r);t(9236),t(6842),t(9558),t(5097),t(2183),t(3209);n().escapeQuerySpace=!1;const s=e=>o=>({type:e,payload:o});s("RESET_LOADING"),s("START_LOADING"),s("STOP_LOADING")},3209:(e,o,t)=>{},8853:()=>{require("spark-md5"),require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto)},9558:(e,o,t)=>{t.d(o,{getFromLocalStorage:()=>n,putOnLocalStorage:()=>r,removeFromLocalStorage:()=>s,retryPromise:()=>a,setSessionClearingState:()=>i});t(5812),t(8041);const r=(e,o)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,o)},n=(e,o)=>{if("undefined"!=typeof window){let t=window.localStorage.getItem(e);return o&&(console.log(`getFromLocalStorage removing key ${e}`),s(e)),t}return null},s=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},a=async(e,o=3)=>{for(let t=0;t<o;t++)if(await e())return!0;return!1}},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},9891:e=>{e.exports=require("idtoken-verifier")},5812:e=>{e.exports=require("moment-timezone")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")},806:e=>{e.exports=require("superagent/lib/client")},9236:e=>{e.exports=require("sweetalert2")},8041:e=>{e.exports=require("urijs")}},o={};function t(r){var n=o[r];if(void 0!==n)return n.exports;var s=o[r]={exports:{}};return e[r](s,s.exports,t),s.exports}(()=>{t.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o}})(),(()=>{t.d=(e,o)=>{for(var r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})}})(),(()=>{t.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};t.r(r),t.d(r,{default:()=>E});var n=t(1116),s=t.n(n),i=t(2015),a=t.n(i),c=t(9825),R=t.n(c),u=t(806),d=t.n(u),l=t(2183);class _ extends a().Component{constructor(...e){super(...e),s()(this,"trackEnter",(async()=>{const{apiBaseUrl:e,summitId:o,sourceId:t,sourceName:r}=this.props,n=this.getLocation();try{const s=await(0,l.getAccessToken)();d().put(`${e}/api/v1/summits/${o}/metrics/enter`).send({access_token:s,type:r,source_id:t,location:n}).end((()=>console.log("ENTER PAGE")))}catch(e){console.log(e)}})),s()(this,"trackLeave",(async()=>{const{apiBaseUrl:e,summitId:o,sourceId:t,sourceName:r}=this.props,n=this.getLocation();try{const s=await(0,l.getAccessToken)();d().post(`${e}/api/v1/summits/${o}/metrics/leave`).send({access_token:s,type:r,source_id:t,location:n}).end((()=>console.log("LEFT PAGE")))}catch(e){console.log(e)}})),s()(this,"onBeforeUnload",(async()=>{const{apiBaseUrl:e,summitId:o,sourceId:t,sourceName:r}=this.props,n=this.getLocation();try{const s=await(0,l.getAccessToken)();return void navigator.sendBeacon(`${e}/api/v1/summits/${o}/metrics/leave?access_token=${s}&type=${r}&source_id=${t}&location=${n}`,{})}catch(e){console.log(e)}})),s()(this,"getLocation",(()=>"undefined"!=typeof window?encodeURIComponent(window.location.href):""))}componentDidMount(){const{trackEnter:e,onBeforeUnload:o}=this;e(),"undefined"!=typeof window&&window.addEventListener("beforeunload",o)}componentWillUnmount(){const{trackLeave:e,onBeforeUnload:o}=this;e(),"undefined"!=typeof window&&window.removeEventListener("beforeunload",o)}render(){return null}}_.propTypes={sourceName:R().string,sourceId:R().number,summitId:R().number.isRequired,apiBaseUrl:R().string.isRequired},_.defaultProps={sourceId:0,sourceName:"GENERAL"};const E=_;return r})()));
|
|
2
2
|
//# sourceMappingURL=attendance-tracker.js.map
|