@databiosphere/findable-ui 12.0.0 → 14.0.0

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.
Files changed (185) hide show
  1. package/.github/workflows/release-please.yml +48 -0
  2. package/.github/workflows/run-checks.yml +41 -15
  3. package/.prettierignore +1 -0
  4. package/CHANGELOG.md +49 -0
  5. package/jest.config.js +1 -1
  6. package/lib/common/analytics/entities.d.ts +10 -9
  7. package/lib/common/analytics/entities.js +2 -4
  8. package/lib/components/Export/common/tracking.d.ts +12 -3
  9. package/lib/components/Export/common/tracking.js +23 -13
  10. package/lib/components/Export/components/DownloadCurlCommand/downloadCurlCommand.d.ts +1 -1
  11. package/lib/components/Export/components/DownloadCurlCommand/downloadCurlCommand.js +2 -16
  12. package/lib/components/Export/components/ExportMethod/exportMethod.d.ts +2 -1
  13. package/lib/components/Export/components/ExportMethod/exportMethod.js +2 -3
  14. package/lib/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/NIHAccountExpiryWarning/nihAccountExpiryWarning.js +6 -3
  15. package/lib/components/Export/components/ExportToTerra/exportToTerra.js +9 -1
  16. package/lib/components/Export/components/ManifestDownload/manifestDownload.js +7 -1
  17. package/lib/components/Index/components/Hero/components/ExportButton/exportButton.js +1 -1
  18. package/lib/components/Layout/components/Header/components/Content/components/Logo/logo.d.ts +2 -2
  19. package/lib/components/Layout/components/Header/components/Content/components/Logo/logo.js +1 -1
  20. package/lib/components/Layout/components/Header/components/Content/components/Logo/logo.styles.js +0 -1
  21. package/lib/components/Links/components/Link/link.d.ts +2 -3
  22. package/lib/components/Links/components/Link/link.js +1 -2
  23. package/lib/components/Support/components/SupportRequest/components/SupportRequestForm/supportRequestForm.js +1 -3
  24. package/lib/components/TempError/tempError.d.ts +2 -2
  25. package/lib/components/TempError/tempError.js +4 -4
  26. package/lib/components/common/Alert/alert.d.ts +4 -12
  27. package/lib/components/common/Alert/alert.js +5 -7
  28. package/lib/components/common/Alert/alert.styles.d.ts +1 -11
  29. package/lib/components/common/Alert/alert.styles.js +18 -24
  30. package/lib/components/common/Alert/constants.d.ts +2 -0
  31. package/lib/components/common/Alert/constants.js +27 -0
  32. package/lib/components/common/Alert/hooks/useTransition/types.d.ts +5 -0
  33. package/lib/components/common/Alert/hooks/useTransition/types.js +1 -0
  34. package/lib/components/common/Alert/hooks/useTransition/useTransition.d.ts +7 -0
  35. package/lib/components/common/Alert/hooks/useTransition/useTransition.js +20 -0
  36. package/lib/components/common/Banner/banner.d.ts +4 -7
  37. package/lib/components/common/Banner/banner.js +4 -3
  38. package/lib/components/common/Banner/banner.styles.d.ts +3 -0
  39. package/lib/components/common/Banner/banner.styles.js +28 -0
  40. package/lib/components/common/Banner/components/CookieBanner/constants.d.ts +2 -0
  41. package/lib/components/common/Banner/components/CookieBanner/constants.js +7 -0
  42. package/lib/components/common/Banner/components/CookieBanner/cookieBanner.d.ts +3 -3
  43. package/lib/components/common/Banner/components/CookieBanner/cookieBanner.js +17 -31
  44. package/lib/components/common/Banner/components/CookieBanner/cookieBanner.styles.d.ts +1 -1
  45. package/lib/components/common/Banner/components/CookieBanner/cookieBanner.styles.js +2 -16
  46. package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.d.ts +3 -7
  47. package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.js +6 -4
  48. package/lib/components/common/Banner/components/SystemIndexing/systemIndexing.d.ts +3 -8
  49. package/lib/components/common/Banner/components/SystemIndexing/systemIndexing.js +6 -8
  50. package/lib/components/common/Banner/components/SystemStatus/systemStatus.d.ts +3 -8
  51. package/lib/components/common/Banner/components/SystemStatus/systemStatus.js +6 -8
  52. package/lib/components/common/Banner/constants.d.ts +2 -0
  53. package/lib/components/common/Banner/constants.js +9 -0
  54. package/lib/components/common/Breadcrumbs/breadcrumbs.d.ts +2 -2
  55. package/lib/components/common/Breadcrumbs/breadcrumbs.js +3 -4
  56. package/lib/components/common/Paper/paper.styles.js +18 -12
  57. package/lib/components/types.d.ts +10 -0
  58. package/lib/components/types.js +1 -0
  59. package/lib/config/entities.d.ts +0 -1
  60. package/lib/entity/api/service.js +16 -18
  61. package/lib/entity/common/client.d.ts +6 -10
  62. package/lib/entity/common/client.js +21 -31
  63. package/lib/entity/common/service.js +6 -8
  64. package/lib/entity/common/utils.d.ts +4 -4
  65. package/lib/entity/common/utils.js +3 -3
  66. package/lib/hooks/useLocalStorage/useLocalStorage.d.ts +1 -1
  67. package/lib/hooks/useLocalStorage/useLocalStorage.js +1 -1
  68. package/lib/shared/utils.d.ts +0 -5
  69. package/lib/shared/utils.js +0 -8
  70. package/lib/styles/common/constants/size.d.ts +5 -0
  71. package/lib/styles/common/constants/size.js +6 -0
  72. package/lib/styles/common/mui/alert.d.ts +4 -0
  73. package/lib/styles/common/mui/alert.js +20 -0
  74. package/lib/styles/common/mui/icon.d.ts +2 -0
  75. package/lib/styles/common/mui/icon.js +6 -0
  76. package/lib/theme/common/components.d.ts +0 -12
  77. package/lib/theme/common/components.js +17 -157
  78. package/lib/theme/components/index.d.ts +2 -0
  79. package/lib/theme/components/index.js +2 -0
  80. package/lib/theme/components/muiAlert.d.ts +2 -0
  81. package/lib/theme/components/muiAlert.js +121 -0
  82. package/lib/theme/components/muiAlertTitle.d.ts +2 -0
  83. package/lib/theme/components/muiAlertTitle.js +12 -0
  84. package/lib/theme/theme.js +3 -2
  85. package/package.json +7 -6
  86. package/src/common/analytics/entities.ts +9 -8
  87. package/src/common/analytics/readme-analytics.md +19 -7
  88. package/src/components/Export/common/tracking.ts +26 -16
  89. package/src/components/Export/components/DownloadCurlCommand/downloadCurlCommand.tsx +2 -30
  90. package/src/components/Export/components/ExportMethod/exportMethod.tsx +14 -4
  91. package/src/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/NIHAccountExpiryWarning/nihAccountExpiryWarning.tsx +16 -18
  92. package/src/components/Export/components/ExportToTerra/exportToTerra.tsx +11 -1
  93. package/src/components/Export/components/ManifestDownload/manifestDownload.tsx +9 -1
  94. package/src/components/Index/components/Hero/components/ExportButton/exportButton.tsx +5 -1
  95. package/src/components/Layout/components/Header/components/Content/components/Logo/logo.styles.ts +0 -1
  96. package/src/components/Layout/components/Header/components/Content/components/Logo/logo.tsx +3 -2
  97. package/src/components/Links/components/Link/link.tsx +17 -16
  98. package/src/components/Support/components/SupportRequest/components/SupportRequestForm/supportRequestForm.tsx +1 -2
  99. package/src/components/TempError/tempError.tsx +10 -9
  100. package/src/components/common/Alert/alert.styles.ts +22 -25
  101. package/src/components/common/Alert/alert.tsx +14 -35
  102. package/src/components/common/Alert/constants.ts +29 -0
  103. package/src/components/common/Alert/hooks/useTransition/types.ts +5 -0
  104. package/src/components/common/Alert/hooks/useTransition/useTransition.ts +25 -0
  105. package/src/components/common/Banner/banner.styles.ts +29 -0
  106. package/src/components/common/Banner/banner.tsx +11 -18
  107. package/src/components/common/Banner/components/CookieBanner/constants.ts +9 -0
  108. package/src/components/common/Banner/components/CookieBanner/cookieBanner.styles.ts +2 -16
  109. package/src/components/common/Banner/components/CookieBanner/cookieBanner.tsx +36 -64
  110. package/src/components/common/Banner/components/SessionTimeout/sessionTimeout.tsx +12 -17
  111. package/src/components/common/Banner/components/SystemIndexing/systemIndexing.tsx +11 -22
  112. package/src/components/common/Banner/components/SystemStatus/systemStatus.tsx +11 -22
  113. package/src/components/common/Banner/constants.ts +11 -0
  114. package/src/components/common/Breadcrumbs/breadcrumbs.tsx +6 -10
  115. package/src/components/common/Paper/paper.styles.ts +18 -12
  116. package/src/components/types.ts +13 -0
  117. package/src/config/entities.ts +0 -1
  118. package/src/entity/api/service.ts +24 -27
  119. package/src/entity/common/client.ts +22 -40
  120. package/src/entity/common/service.ts +8 -10
  121. package/src/entity/common/utils.ts +4 -6
  122. package/src/hooks/useLocalStorage/useLocalStorage.ts +2 -2
  123. package/src/shared/utils.ts +0 -9
  124. package/src/styles/common/constants/size.ts +5 -0
  125. package/src/styles/common/mui/alert.ts +24 -0
  126. package/src/styles/common/mui/icon.ts +8 -0
  127. package/src/theme/common/components.ts +16 -159
  128. package/src/theme/components/index.ts +2 -0
  129. package/src/theme/components/muiAlert.ts +123 -0
  130. package/src/theme/components/muiAlertTitle.ts +14 -0
  131. package/src/theme/theme.ts +3 -2
  132. package/tests/authentication.test.ts +7 -1
  133. package/tests/azulFileDownload.test.tsx +9 -3
  134. package/tests/fetchApi.test.ts +93 -0
  135. package/tests/tsconfig.json +1 -0
  136. package/tests/useFileLocation.test.ts +6 -2
  137. package/types/data-explorer-ui.d.ts +6 -5
  138. package/lib/components/Detail/components/Table/components/TableHead/tableHead.d.ts +0 -8
  139. package/lib/components/Detail/components/Table/components/TableHead/tableHead.js +0 -36
  140. package/lib/components/Index/components/TitleCell/titleCell.d.ts +0 -6
  141. package/lib/components/Index/components/TitleCell/titleCell.js +0 -10
  142. package/lib/components/Index/components/TitleCell/titleCell.styles.d.ts +0 -3
  143. package/lib/components/Index/components/TitleCell/titleCell.styles.js +0 -6
  144. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.d.ts +0 -6
  145. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.js +0 -13
  146. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.d.ts +0 -36
  147. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.js +0 -9
  148. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.d.ts +0 -5
  149. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.js +0 -10
  150. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.d.ts +0 -36
  151. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.js +0 -9
  152. package/lib/components/Table/components/EntityViewToggle/entityViewToggle.d.ts +0 -2
  153. package/lib/components/Table/components/EntityViewToggle/entityViewToggle.js +0 -37
  154. package/lib/components/common/Alert/alert.stories.d.ts +0 -6
  155. package/lib/components/common/Alert/alert.stories.js +0 -36
  156. package/lib/components/common/Alert/components/AlertText/alertText.styles.d.ts +0 -4
  157. package/lib/components/common/Alert/components/AlertText/alertText.styles.js +0 -19
  158. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.d.ts +0 -7
  159. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.js +0 -5
  160. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.d.ts +0 -3
  161. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.js +0 -19
  162. package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.d.ts +0 -10
  163. package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.js +0 -16
  164. package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.d.ts +0 -3
  165. package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.js +0 -21
  166. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.d.ts +0 -5
  167. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.js +0 -10
  168. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.d.ts +0 -3
  169. package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.js +0 -9
  170. package/lib/hooks/useCategoryConfigs.d.ts +0 -6
  171. package/lib/hooks/useCategoryConfigs.js +0 -17
  172. package/lib/hooks/useEntityListRelatedView.d.ts +0 -15
  173. package/lib/hooks/useEntityListRelatedView.js +0 -62
  174. package/lib/hooks/useMenu.d.ts +0 -10
  175. package/lib/hooks/useMenu.js +0 -17
  176. package/lib/hooks/useMenuWithPosition.d.ts +0 -14
  177. package/lib/hooks/useMenuWithPosition.js +0 -33
  178. package/src/components/Index/components/TitleCell/titleCell.styles.ts +0 -7
  179. package/src/components/Index/components/TitleCell/titleCell.tsx +0 -22
  180. package/src/components/common/Alert/alert.stories.tsx +0 -41
  181. package/src/components/common/Alert/components/AlertText/alertText.styles.ts +0 -20
  182. package/src/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.ts +0 -20
  183. package/src/components/common/Banner/components/BannerPrimary/bannerPrimary.tsx +0 -27
  184. package/src/components/common/Banner/components/DismissibleBanner/dismissibleBanner.tsx +0 -44
  185. package/src/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.ts +0 -22
@@ -0,0 +1,48 @@
1
+ on:
2
+ push:
3
+ branches:
4
+ - main
5
+
6
+ permissions:
7
+ contents: write
8
+ pull-requests: write
9
+
10
+ name: release-please
11
+
12
+ jobs:
13
+ release-please:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: googleapis/release-please-action@v4
17
+ id: release
18
+ with:
19
+ # this assumes that you have created a personal access token
20
+ # (PAT) and configured it as a GitHub action secret named
21
+ # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
22
+ token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
23
+ # This is a built-in strategy in release-please, see "Action Inputs" for more options
24
+ release-type: node
25
+
26
+ # The logic below handles the npm publication:
27
+ - uses: actions/checkout@v4
28
+
29
+ # These if statements ensure that a publication only occurs when a new release is created:
30
+ - uses: actions/setup-node@v4
31
+ if: ${{ steps.release.outputs.release_created }}
32
+ with:
33
+ node-version: 20
34
+ registry-url: "https://registry.npmjs.org"
35
+
36
+ - name: Install dependencies
37
+ if: ${{ steps.release.outputs.release_created }}
38
+ run: npm ci
39
+
40
+ - name: Compile
41
+ if: ${{ steps.release.outputs.release_created }}
42
+ run: npx tsc
43
+
44
+ - name: Publish to NPM
45
+ if: ${{ steps.release.outputs.release_created }}
46
+ run: npm publish
47
+ env:
48
+ NODE_AUTH_TOKEN: ${{ secrets.DATABIOSPHERE_FINDABLE_UI_NPM_PUBLISH_TOKEN }} # Ensure this token is scoped to only the permissions required for npm publication to limit security risks.
@@ -1,31 +1,57 @@
1
1
  name: Run checks
2
- on: [pull_request]
2
+ on:
3
+ pull_request:
4
+ branches:
5
+ - "**"
3
6
 
4
7
  jobs:
5
8
  build:
6
9
  runs-on: ubuntu-latest
7
10
  steps:
8
- - uses: actions/checkout@v2
9
- - uses: actions/setup-node@v2
11
+ - name: Checkout repository
12
+ uses: actions/checkout@v4
13
+
14
+ - name: Set up Node.js
15
+ uses: actions/setup-node@v4
10
16
  with:
11
17
  node-version: "20.10.0"
18
+ cache: "npm"
19
+
20
+ - name: Install dependencies
21
+ run: npm ci
22
+
23
+ - name: Check code format
24
+ run: npm run check-format
25
+
26
+ - name: Run linter
27
+ run: npm run lint
28
+
29
+ - name: Run tests
30
+ run: npm run test
12
31
 
13
- - run: |
14
- npm ci
15
- npm run check-format
16
- npm run lint
17
- npm run test
18
- npm run test-compile
32
+ - name: Test compilation
33
+ run: npm run test-compile
19
34
 
20
35
  install-without-lock:
21
36
  runs-on: ubuntu-latest
22
37
  steps:
23
- - uses: actions/checkout@v2
24
- - uses: actions/setup-node@v2
38
+ - name: Checkout repository
39
+ uses: actions/checkout@v4
40
+
41
+ - name: Set up Node.js
42
+ uses: actions/setup-node@v4
25
43
  with:
26
44
  node-version: "20.10.0"
45
+ cache: "npm"
46
+
47
+ - name: Remove package lock
48
+ run: rm package-lock.json
49
+
50
+ - name: Install dependencies without lock
51
+ run: npm install
52
+
53
+ - name: Run tests
54
+ run: npm run test
27
55
 
28
- - run: |
29
- rm package-lock.json
30
- npm install
31
- npm run test-compile
56
+ - name: Test compilation
57
+ run: npm run test-compile
package/.prettierignore CHANGED
@@ -1,5 +1,6 @@
1
1
  # general
2
2
  README.md
3
+ CHANGELOG.md
3
4
 
4
5
  # testing
5
6
  coverage
package/CHANGELOG.md ADDED
@@ -0,0 +1,49 @@
1
+ # Changelog
2
+
3
+ ## [14.0.0](https://github.com/DataBiosphere/findable-ui/compare/v13.0.1...v14.0.0) (2024-11-05)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * update banner components ([#253](https://github.com/DataBiosphere/findable-ui/issues/253)) (#255)
9
+ * simplify alert components ([#252](https://github.com/DataBiosphere/findable-ui/issues/252)) (#254)
10
+ * fix mui error "cannot resolve @mui/utils/getReactNodeRef" ([#242](https://github.com/DataBiosphere/findable-ui/issues/242)) (#243)
11
+
12
+ ### Features
13
+
14
+ * add 'testid' prop interface ([#247](https://github.com/DataBiosphere/findable-ui/issues/247)) ([#250](https://github.com/DataBiosphere/findable-ui/issues/250)) ([1e494e0](https://github.com/DataBiosphere/findable-ui/commit/1e494e0b7279035b820dcacf16efc4d1f55d7a1e))
15
+ * added and updated index export tracking ([#222](https://github.com/DataBiosphere/findable-ui/issues/222)) ([#224](https://github.com/DataBiosphere/findable-ui/issues/224)) ([15e861d](https://github.com/DataBiosphere/findable-ui/commit/15e861de5a2411e5cbb9d24b137ef62ff48695c4))
16
+ * remove unused titlecell component ([#248](https://github.com/DataBiosphere/findable-ui/issues/248)) ([#249](https://github.com/DataBiosphere/findable-ui/issues/249)) ([51a7c4f](https://github.com/DataBiosphere/findable-ui/commit/51a7c4f8877990dd4a7fef23ddce543e4913f885))
17
+ * simplify alert components ([#252](https://github.com/DataBiosphere/findable-ui/issues/252)) ([#254](https://github.com/DataBiosphere/findable-ui/issues/254)) ([18f3e54](https://github.com/DataBiosphere/findable-ui/commit/18f3e54ef73bedd585b1c162fcabd0cbe74cc8bf))
18
+ * update banner components ([#253](https://github.com/DataBiosphere/findable-ui/issues/253)) ([#255](https://github.com/DataBiosphere/findable-ui/issues/255)) ([d9c87c7](https://github.com/DataBiosphere/findable-ui/commit/d9c87c73c7b0e018c639c98ca8100b12112afe5d))
19
+ * update mui link theme styles ([#245](https://github.com/DataBiosphere/findable-ui/issues/245)) ([#246](https://github.com/DataBiosphere/findable-ui/issues/246)) ([7f401b8](https://github.com/DataBiosphere/findable-ui/commit/7f401b8eba6c53daec2a40e825220e8506bc95b3))
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * fix cookie banner color ([#239](https://github.com/DataBiosphere/findable-ui/issues/239)) ([#251](https://github.com/DataBiosphere/findable-ui/issues/251)) ([54b2802](https://github.com/DataBiosphere/findable-ui/commit/54b2802ce83168c5f79860c2baf53c7148e19767))
25
+ * fix mui error "cannot resolve @mui/utils/getReactNodeRef" ([#242](https://github.com/DataBiosphere/findable-ui/issues/242)) ([#243](https://github.com/DataBiosphere/findable-ui/issues/243)) ([4b832ac](https://github.com/DataBiosphere/findable-ui/commit/4b832acd7b18511781ce4046df9c4e9454896991))
26
+
27
+ ## [13.0.1](https://github.com/DataBiosphere/findable-ui/compare/v13.0.0...v13.0.1) (2024-10-18)
28
+
29
+
30
+ ### Bug Fixes
31
+
32
+ * give release-please workflow step an id ([#235](https://github.com/DataBiosphere/findable-ui/issues/235)) ([#236](https://github.com/DataBiosphere/findable-ui/issues/236)) ([420733f](https://github.com/DataBiosphere/findable-ui/commit/420733f3d6dc51f44301b06476550f499b4ffbd3))
33
+
34
+ ## [13.0.0](https://github.com/DataBiosphere/findable-ui/compare/v12.0.0...v13.0.0) (2024-10-18)
35
+
36
+
37
+ ### ⚠ BREAKING CHANGES
38
+
39
+ * use ky with limited retries instead of axios ([#203](https://github.com/DataBiosphere/findable-ui/issues/203)) (#216)
40
+
41
+ ### Features
42
+
43
+ * remove dry run from npm publish ([#231](https://github.com/DataBiosphere/findable-ui/issues/231)) ([#234](https://github.com/DataBiosphere/findable-ui/issues/234)) ([f44d0c3](https://github.com/DataBiosphere/findable-ui/commit/f44d0c3cb2859af6b87d33f5f6e16673db77ec52))
44
+ * use ky with limited retries instead of axios ([#203](https://github.com/DataBiosphere/findable-ui/issues/203)) ([#216](https://github.com/DataBiosphere/findable-ui/issues/216)) ([ec18080](https://github.com/DataBiosphere/findable-ui/commit/ec18080e3191f99a88e9ddec174c9f953d9e3a41))
45
+
46
+
47
+ ### Bug Fixes
48
+
49
+ * add changelog to gitignore ([#232](https://github.com/DataBiosphere/findable-ui/issues/232)) ([#233](https://github.com/DataBiosphere/findable-ui/issues/233)) ([b99ba34](https://github.com/DataBiosphere/findable-ui/commit/b99ba34088199b561b38493888206ed475a209e4))
package/jest.config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /** @type {import('ts-jest').JestConfigWithTsJest} */
2
2
  module.exports = {
3
- preset: "ts-jest",
3
+ preset: "ts-jest/presets/js-with-ts-esm",
4
4
  testEnvironment: "jest-environment-jsdom",
5
5
  };
@@ -7,20 +7,18 @@ export declare enum EVENT_NAME {
7
7
  ENTITY_SELECTED = "entity_selected",
8
8
  ENTITY_TABLE_PAGINATED = "entity_table_paginated",
9
9
  ENTITY_TABLE_SORTED = "entity_table_sorted",
10
- FILTER_SELECTED = "filter_selected"
10
+ FILTER_SELECTED = "filter_selected",
11
+ INDEX_ANALYZE_IN_TERRA_REQUESTED = "index_analyze_in_terra_requested",
12
+ INDEX_FILE_MANIFEST_REQUESTED = "index_file_manifest_requested"
11
13
  }
12
14
  /**
13
15
  * Set of analytics event parameters.
14
16
  */
15
17
  export declare enum EVENT_PARAM {
16
- CATALOG = "catalog",
17
18
  COLUMN_NAME = "column_name",
18
- CURRENT_QUERY = "current_query",
19
19
  ENTITY_NAME = "entity_name",
20
- ENTITY_TYPE = "entity_type",
21
20
  FILTER_NAME = "filter_name",
22
21
  FILTER_VALUE = "filter_value",
23
- INDEX = "index",
24
22
  PAGINATION_DIRECTION = "pagination_direction",
25
23
  SORT_DIRECTION = "sort_direction",
26
24
  TOOL_NAME = "tool_name"
@@ -44,10 +42,7 @@ export declare enum SORT_DIRECTION {
44
42
  */
45
43
  export type EventParams = {
46
44
  [EVENT_NAME.BULK_DOWNLOAD_REQUESTED]: {
47
- [EVENT_PARAM.CATALOG]: string;
48
- [EVENT_PARAM.CURRENT_QUERY]: string;
49
- [EVENT_PARAM.ENTITY_TYPE]: string;
50
- [EVENT_PARAM.INDEX]: string;
45
+ [EVENT_PARAM.ENTITY_NAME]: string;
51
46
  [EVENT_PARAM.TOOL_NAME]: string;
52
47
  };
53
48
  [EVENT_NAME.ENTITY_SELECTED]: {
@@ -66,4 +61,10 @@ export type EventParams = {
66
61
  [EVENT_PARAM.FILTER_NAME]: string;
67
62
  [EVENT_PARAM.FILTER_VALUE]: string;
68
63
  };
64
+ [EVENT_NAME.INDEX_ANALYZE_IN_TERRA_REQUESTED]: {
65
+ [EVENT_PARAM.ENTITY_NAME]: string;
66
+ };
67
+ [EVENT_NAME.INDEX_FILE_MANIFEST_REQUESTED]: {
68
+ [EVENT_PARAM.ENTITY_NAME]: string;
69
+ };
69
70
  };
@@ -8,20 +8,18 @@ export var EVENT_NAME;
8
8
  EVENT_NAME["ENTITY_TABLE_PAGINATED"] = "entity_table_paginated";
9
9
  EVENT_NAME["ENTITY_TABLE_SORTED"] = "entity_table_sorted";
10
10
  EVENT_NAME["FILTER_SELECTED"] = "filter_selected";
11
+ EVENT_NAME["INDEX_ANALYZE_IN_TERRA_REQUESTED"] = "index_analyze_in_terra_requested";
12
+ EVENT_NAME["INDEX_FILE_MANIFEST_REQUESTED"] = "index_file_manifest_requested";
11
13
  })(EVENT_NAME || (EVENT_NAME = {}));
12
14
  /**
13
15
  * Set of analytics event parameters.
14
16
  */
15
17
  export var EVENT_PARAM;
16
18
  (function (EVENT_PARAM) {
17
- EVENT_PARAM["CATALOG"] = "catalog";
18
19
  EVENT_PARAM["COLUMN_NAME"] = "column_name";
19
- EVENT_PARAM["CURRENT_QUERY"] = "current_query";
20
20
  EVENT_PARAM["ENTITY_NAME"] = "entity_name";
21
- EVENT_PARAM["ENTITY_TYPE"] = "entity_type";
22
21
  EVENT_PARAM["FILTER_NAME"] = "filter_name";
23
22
  EVENT_PARAM["FILTER_VALUE"] = "filter_value";
24
- EVENT_PARAM["INDEX"] = "index";
25
23
  EVENT_PARAM["PAGINATION_DIRECTION"] = "pagination_direction";
26
24
  EVENT_PARAM["SORT_DIRECTION"] = "sort_direction";
27
25
  EVENT_PARAM["TOOL_NAME"] = "tool_name";
@@ -1,7 +1,16 @@
1
1
  /**
2
2
  * Executes event tracking for bulk download.
3
- * @param index - Index.
3
+ * @param entity_name - Entity (tab) name.
4
4
  * @param toolName - Tool name.
5
- * @param requestParams - Request params.
6
5
  */
7
- export declare function bulkDownloadTracking(index: string, toolName: string, requestParams?: URLSearchParams): void;
6
+ export declare function bulkDownloadTracking(entity_name: string, toolName: string): void;
7
+ /**
8
+ * Executes event tracking for the file manifest export.
9
+ * @param entity_name - Entity (tab) name.
10
+ */
11
+ export declare function fileManifestTracking(entity_name: string): void;
12
+ /**
13
+ * Executes event tracking for the Terra export.
14
+ * @param entity_name - Entity (tab) name.
15
+ */
16
+ export declare function exportToTerraTracking(entity_name: string): void;
@@ -2,23 +2,33 @@ import { track } from "../../../common/analytics/analytics";
2
2
  import { EVENT_NAME, EVENT_PARAM } from "../../../common/analytics/entities";
3
3
  /**
4
4
  * Executes event tracking for bulk download.
5
- * @param index - Index.
5
+ * @param entity_name - Entity (tab) name.
6
6
  * @param toolName - Tool name.
7
- * @param requestParams - Request params.
8
7
  */
9
- export function bulkDownloadTracking(index, toolName, requestParams) {
10
- if (!requestParams) {
11
- return;
12
- }
13
- // Grab catalog and current query from the request params.
14
- const catalog = requestParams.get("catalog"); // Catalog will be defined.
15
- const currentQuery = requestParams.get("filters"); // Filters will be defined.
8
+ export function bulkDownloadTracking(entity_name, toolName) {
16
9
  // Track the bulk download requested event.
17
10
  track(EVENT_NAME.BULK_DOWNLOAD_REQUESTED, {
18
- [EVENT_PARAM.CATALOG]: catalog,
19
- [EVENT_PARAM.CURRENT_QUERY]: currentQuery,
20
- [EVENT_PARAM.ENTITY_TYPE]: "Bulk Download",
21
- [EVENT_PARAM.INDEX]: index,
11
+ [EVENT_PARAM.ENTITY_NAME]: entity_name,
22
12
  [EVENT_PARAM.TOOL_NAME]: toolName,
23
13
  });
24
14
  }
15
+ /**
16
+ * Executes event tracking for the file manifest export.
17
+ * @param entity_name - Entity (tab) name.
18
+ */
19
+ export function fileManifestTracking(entity_name) {
20
+ // Track the file manifest requested event.
21
+ track(EVENT_NAME.INDEX_FILE_MANIFEST_REQUESTED, {
22
+ [EVENT_PARAM.ENTITY_NAME]: entity_name,
23
+ });
24
+ }
25
+ /**
26
+ * Executes event tracking for the Terra export.
27
+ * @param entity_name - Entity (tab) name.
28
+ */
29
+ export function exportToTerraTracking(entity_name) {
30
+ // Track the export to terra event.
31
+ track(EVENT_NAME.INDEX_ANALYZE_IN_TERRA_REQUESTED, {
32
+ [EVENT_PARAM.ENTITY_NAME]: entity_name,
33
+ });
34
+ }
@@ -13,5 +13,5 @@ interface DownloadCurlCommandProps {
13
13
  filters: Filters;
14
14
  formFacet: FormFacet;
15
15
  }
16
- export declare const DownloadCurlCommand: ({ DownloadCurlForm, DownloadCurlStart, DownloadCurlSuccess, fileManifestState, fileManifestType, fileSummaryFacetName, filters, formFacet, }: DownloadCurlCommandProps) => JSX.Element;
16
+ export declare const DownloadCurlCommand: ({ DownloadCurlForm, DownloadCurlStart, DownloadCurlSuccess, fileManifestState, fileSummaryFacetName, filters, formFacet, }: DownloadCurlCommandProps) => JSX.Element;
17
17
  export {};
@@ -1,23 +1,21 @@
1
1
  import React, { useState } from "react";
2
2
  import { MANIFEST_DOWNLOAD_FORMAT } from "../../../../apis/azul/common/entities";
3
3
  import { useExploreState } from "../../../../hooks/useExploreState";
4
- import { FILE_MANIFEST_TYPE, } from "../../../../hooks/useFileManifest/common/entities";
5
4
  import { useFileManifest } from "../../../../hooks/useFileManifest/useFileManifest";
6
5
  import { useRequestFileManifest } from "../../../../hooks/useFileManifest/useRequestFileManifest";
7
6
  import { BULK_DOWNLOAD_EXECUTION_ENVIRONMENT, } from "../../common/entities";
8
7
  import { bulkDownloadTracking } from "../../common/tracking";
9
8
  import { DownloadCurlCommandNotStarted } from "./components/DownloadCurlCommandNotStarted/downloadCurlCommandNotStarted";
10
9
  import { DownloadCurlCommandReady } from "./components/DownloadCurlCommandReady/downloadCurlCommandReady";
11
- export const DownloadCurlCommand = ({ DownloadCurlForm, DownloadCurlStart, DownloadCurlSuccess, fileManifestState, fileManifestType, fileSummaryFacetName, filters, formFacet, }) => {
10
+ export const DownloadCurlCommand = ({ DownloadCurlForm, DownloadCurlStart, DownloadCurlSuccess, fileManifestState, fileSummaryFacetName, filters, formFacet, }) => {
12
11
  useRequestFileManifest(MANIFEST_DOWNLOAD_FORMAT.CURL, filters, fileSummaryFacetName);
13
12
  const [executionEnvironment, setExecutionEnvironment] = useState(BULK_DOWNLOAD_EXECUTION_ENVIRONMENT.BASH);
14
13
  const { exploreState: { tabValue: entityList }, } = useExploreState();
15
- const { requestParams } = fileManifestState;
16
14
  const { data, isLoading, run } = useFileManifest();
17
15
  const curlCommand = getBulkDownloadCurlCommand(data, executionEnvironment);
18
16
  return curlCommand ? (React.createElement(DownloadCurlCommandReady, { curlCommand: curlCommand, DownloadCurlSuccess: DownloadCurlSuccess })) : (React.createElement(DownloadCurlCommandNotStarted, { DownloadCurlForm: DownloadCurlForm, DownloadCurlStart: DownloadCurlStart, executionEnvironment: executionEnvironment, fileManifestState: fileManifestState, formFacet: formFacet, isLoading: isLoading, onRequestManifest: () => {
19
17
  // Execute GTM tracking.
20
- track(fileManifestType, entityList, executionEnvironment, requestParams);
18
+ bulkDownloadTracking(entityList, executionEnvironment);
21
19
  // Request manifest.
22
20
  run();
23
21
  }, setExecutionEnvironment: setExecutionEnvironment }));
@@ -35,15 +33,3 @@ function getBulkDownloadCurlCommand(fileLocation, executionEnvironment) {
35
33
  }
36
34
  return commandLine[executionEnvironment];
37
35
  }
38
- /**
39
- * Executes GTM tracking.
40
- * @param fileManifestType - File manifest type.
41
- * @param index - Index.
42
- * @param toolName - Execution environment.
43
- * @param requestParams - Request params.
44
- */
45
- function track(fileManifestType, index, toolName, requestParams) {
46
- if (fileManifestType === FILE_MANIFEST_TYPE.BULK_DOWNLOAD) {
47
- bulkDownloadTracking(index, toolName, requestParams);
48
- }
49
- }
@@ -6,5 +6,6 @@ export interface ExportMethodProps {
6
6
  isAccessible?: boolean;
7
7
  route: string;
8
8
  title: string;
9
+ trackingId?: string;
9
10
  }
10
- export declare const ExportMethod: ({ buttonLabel, description, footnote, isAccessible, route, title, }: ExportMethodProps) => JSX.Element;
11
+ export declare const ExportMethod: ({ buttonLabel, description, footnote, isAccessible, route, title, trackingId, }: ExportMethodProps) => JSX.Element;
@@ -6,7 +6,7 @@ import { FluidPaper } from "../../../common/Paper/paper.styles";
6
6
  import { SectionTitle } from "../../../common/Section/components/SectionTitle/sectionTitle";
7
7
  import { Section, SectionActions, SectionContent, } from "../../../common/Section/section.styles";
8
8
  import { ExportButton, SectionFootnote } from "./exportMethod.styles";
9
- export const ExportMethod = ({ buttonLabel, description, footnote, isAccessible = true, route, title, }) => {
9
+ export const ExportMethod = ({ buttonLabel, description, footnote, isAccessible = true, route, title, trackingId, }) => {
10
10
  const { disabled, message } = useDownloadStatus();
11
11
  return (React.createElement(FluidPaper, null,
12
12
  React.createElement(Section, null,
@@ -16,7 +16,6 @@ export const ExportMethod = ({ buttonLabel, description, footnote, isAccessible
16
16
  React.createElement(SectionActions, null,
17
17
  React.createElement(Tooltip, { arrow: true, title: message },
18
18
  React.createElement("span", null,
19
- React.createElement(Link, { href: route, legacyBehavior: true, passHref: true },
20
- React.createElement(ExportButton, { disabled: disabled || !isAccessible }, buttonLabel))))),
19
+ React.createElement(Link, { href: route, legacyBehavior: true, passHref: true }, trackingId ? (React.createElement(ExportButton, { disabled: disabled || !isAccessible, id: trackingId }, buttonLabel)) : (React.createElement(ExportButton, { disabled: disabled || !isAccessible }, buttonLabel)))))),
21
20
  footnote && React.createElement(SectionFootnote, null, footnote))));
22
21
  };
@@ -1,13 +1,16 @@
1
1
  import React from "react";
2
2
  import { expireTimeInSeconds, useAuthenticationNIHExpiry, } from "../../../../../../../../hooks/useAuthentication/useAuthenticationNIHExpiry";
3
- import { FluidAlert } from "../../../../../../../common/Alert/alert.styles";
3
+ import { Alert } from "../../../../../../../common/Alert/alert";
4
+ import { ALERT_PROPS } from "../../../../../../../common/Alert/constants";
5
+ import { FluidPaper } from "../../../../../../../common/Paper/paper.styles";
4
6
  import { Link } from "../../../../../../../Links/components/Link/link";
5
7
  export const NIHAccountExpiryWarning = () => {
6
8
  const expiryStatus = useAuthenticationNIHExpiry();
7
9
  const { isReady, linkExpired, linkExpireTime, linkWillExpire } = expiryStatus || {};
8
10
  if (!isReady)
9
11
  return null;
10
- return linkWillExpire || linkExpired ? (React.createElement(FluidAlert, { severity: "warning", title: React.createElement(React.Fragment, null,
12
+ return linkWillExpire || linkExpired ? (React.createElement(Alert, { ...ALERT_PROPS.STANDARD_WARNING, component: FluidPaper },
13
+ React.createElement("span", null,
11
14
  React.createElement("span", null, getExpiryMessage(linkExpired, linkExpireTime)),
12
15
  " ",
13
16
  React.createElement("span", null,
@@ -15,7 +18,7 @@ export const NIHAccountExpiryWarning = () => {
15
18
  " ",
16
19
  React.createElement(Link, { label: "renew your account", url: "https://support.terra.bio/hc/en-us/articles/360038086332-Linking-authorization-accessing-controlled-data-on-external-servers#heading-4" }),
17
20
  " ",
18
- "link.")), variant: "banner" })) : null;
21
+ "link.")))) : null;
19
22
  };
20
23
  /**
21
24
  * Calculates the remaining days until the link expires.
@@ -1,13 +1,21 @@
1
1
  import React from "react";
2
+ import { useExploreState } from "../../../../hooks/useExploreState";
2
3
  import { useExportToTerraResponseURL } from "../../../../hooks/useExportToTerraResponseURL";
3
4
  import { useFileManifest } from "../../../../hooks/useFileManifest/useFileManifest";
4
5
  import { useRequestFileManifest } from "../../../../hooks/useFileManifest/useRequestFileManifest";
6
+ import { exportToTerraTracking } from "../../common/tracking";
5
7
  import { ExportToTerraNotStarted } from "./components/ExportToTerraNotStarted/exportToTerraNotStarted";
6
8
  import { ExportToTerraReady } from "./components/ExportToTerraReady/exportToTerraReady";
7
9
  export const ExportToTerra = ({ ExportForm, ExportToTerraStart, ExportToTerraSuccess, fileManifestState, fileSummaryFacetName, filters, formFacet, manifestDownloadFormat, manifestDownloadFormats, }) => {
10
+ const { exploreState: { tabValue: entityList }, } = useExploreState();
8
11
  useRequestFileManifest(manifestDownloadFormat, filters, fileSummaryFacetName);
9
12
  const { requestParams } = fileManifestState;
10
13
  const { data, isLoading, run } = useFileManifest();
11
14
  const exportURL = useExportToTerraResponseURL(requestParams, data);
12
- return exportURL ? (React.createElement(ExportToTerraReady, { ExportToTerraSuccess: ExportToTerraSuccess, exportURL: exportURL })) : (React.createElement(ExportToTerraNotStarted, { ExportTerraForm: ExportForm, ExportToTerraStart: ExportToTerraStart, fileManifestState: fileManifestState, formFacet: formFacet, isLoading: isLoading, manifestDownloadFormats: manifestDownloadFormats, onRequestManifest: run }));
15
+ return exportURL ? (React.createElement(ExportToTerraReady, { ExportToTerraSuccess: ExportToTerraSuccess, exportURL: exportURL })) : (React.createElement(ExportToTerraNotStarted, { ExportTerraForm: ExportForm, ExportToTerraStart: ExportToTerraStart, fileManifestState: fileManifestState, formFacet: formFacet, isLoading: isLoading, manifestDownloadFormats: manifestDownloadFormats, onRequestManifest: () => {
16
+ // Execute GA tracking
17
+ exportToTerraTracking(entityList);
18
+ // Request manifest
19
+ run();
20
+ } }));
13
21
  };
@@ -1,14 +1,20 @@
1
1
  import React from "react";
2
2
  import { MANIFEST_DOWNLOAD_FORMAT } from "../../../../apis/azul/common/entities";
3
+ import { useExploreState } from "../../../../hooks/useExploreState";
3
4
  import { useFileManifest } from "../../../../hooks/useFileManifest/useFileManifest";
4
5
  import { useRequestFileManifest } from "../../../../hooks/useFileManifest/useRequestFileManifest";
6
+ import { fileManifestTracking } from "../../common/tracking";
5
7
  import { ManifestDownloadNotStarted } from "./components/ManifestDownloadNotStarted/manifestDownloadNotStarted";
6
8
  import { ManifestDownloadReady } from "./components/ManifestDownloadReady/manifestDownloadReady";
7
9
  export const ManifestDownload = ({ fileManifestState, fileSummaryFacetName, filters, formFacet, ManifestDownloadForm, ManifestDownloadStart, ManifestDownloadSuccess, }) => {
8
10
  useRequestFileManifest(MANIFEST_DOWNLOAD_FORMAT.COMPACT, filters, fileSummaryFacetName);
11
+ const { exploreState: { tabValue: entityList }, } = useExploreState();
9
12
  const { data, isLoading, run } = useFileManifest();
10
13
  const manifestURL = getManifestDownloadURL(data);
11
- return manifestURL ? (React.createElement(ManifestDownloadReady, { ManifestDownloadSuccess: ManifestDownloadSuccess, manifestURL: manifestURL })) : (React.createElement(ManifestDownloadNotStarted, { ManifestDownloadForm: ManifestDownloadForm, ManifestDownloadStart: ManifestDownloadStart, fileManifestState: fileManifestState, formFacet: formFacet, isLoading: isLoading, onRequestManifest: run }));
14
+ return manifestURL ? (React.createElement(ManifestDownloadReady, { ManifestDownloadSuccess: ManifestDownloadSuccess, manifestURL: manifestURL })) : (React.createElement(ManifestDownloadNotStarted, { ManifestDownloadForm: ManifestDownloadForm, ManifestDownloadStart: ManifestDownloadStart, fileManifestState: fileManifestState, formFacet: formFacet, isLoading: isLoading, onRequestManifest: () => {
15
+ fileManifestTracking(entityList);
16
+ run();
17
+ } }));
12
18
  };
13
19
  /**
14
20
  * Returns the manifest download URL for the generated manifest.
@@ -8,5 +8,5 @@ export const ExportButton = () => {
8
8
  return (React.createElement(Tooltip, { arrow: true, title: message },
9
9
  React.createElement("span", null,
10
10
  React.createElement(Link, { href: "/export", legacyBehavior: true, passHref: true },
11
- React.createElement(Button, { disabled: disabled || isLoading, href: "passHref" }, "Export")))));
11
+ React.createElement(Button, { disabled: disabled || isLoading, href: "passHref", id: "button-cohort-export" }, "Export")))));
12
12
  };
@@ -1,8 +1,8 @@
1
1
  import { ImageSrc } from "../../../../../../../common/StaticImage/staticImage";
2
2
  import { ANCHOR_TARGET } from "../../../../../../../Links/common/entities";
3
- export interface LogoProps {
3
+ import { BaseComponentProps } from "../../../../../../../types";
4
+ export interface LogoProps extends BaseComponentProps {
4
5
  alt: string;
5
- className?: string;
6
6
  height?: number;
7
7
  link: string;
8
8
  src: ImageSrc;
@@ -3,5 +3,5 @@ import { StaticImage, } from "../../../../../../../common/StaticImage/staticImag
3
3
  import { ANCHOR_TARGET } from "../../../../../../../Links/common/entities";
4
4
  import { StyledLink } from "./logo.styles";
5
5
  export const Logo = ({ alt, className, height, link, src, target = ANCHOR_TARGET.SELF, width, }) => {
6
- return (React.createElement(StyledLink, { className: className, label: React.createElement(StaticImage, { alt: alt, height: height, src: src, width: width }), target: target, url: link }));
6
+ return (React.createElement(StyledLink, { className: className, label: React.createElement(StaticImage, { alt: alt, height: height, src: src, width: width }), target: target, underline: "none", url: link }));
7
7
  };
@@ -3,7 +3,6 @@ import { Link } from "../../../../../../../Links/components/Link/link";
3
3
  export const StyledLink = styled(Link) `
4
4
  &.MuiLink-root {
5
5
  flex: none;
6
- text-decoration: none !important;
7
6
  img {
8
7
  margin: 0;
9
8
  }
@@ -1,12 +1,11 @@
1
1
  import { LinkProps as MLinkProps } from "@mui/material";
2
2
  import { ReactNode } from "react";
3
3
  import { TypographyProps } from "../../../common/Typography/common/entities";
4
+ import { BaseComponentProps } from "../../../types";
4
5
  import { ANCHOR_TARGET, Url } from "../../common/entities";
5
- export interface LinkProps {
6
- className?: string;
6
+ export interface LinkProps extends BaseComponentProps, Omit<MLinkProps, "children" | "component"> {
7
7
  copyable?: boolean;
8
8
  label: ReactNode;
9
- noWrap?: MLinkProps["noWrap"];
10
9
  onClick?: () => void;
11
10
  target?: ANCHOR_TARGET;
12
11
  TypographyProps?: TypographyProps;
@@ -15,8 +15,7 @@ export const Link = ({ className, copyable = false, label, noWrap = false, onCli
15
15
  if (isClientSideNavigation(url)) {
16
16
  /* Client-side navigation */
17
17
  return (React.createElement(React.Fragment, null,
18
- React.createElement(NLink, { href: url, legacyBehavior: true, passHref: true },
19
- React.createElement(MLink, { className: className, rel: REL_ATTRIBUTE.NO_OPENER, noWrap: noWrap, target: target || ANCHOR_TARGET.SELF, onClick: onClick, ...TypographyProps, ...props }, label)),
18
+ React.createElement(MLink, { className: className, component: NLink, href: url, noWrap: noWrap, onClick: onClick, rel: REL_ATTRIBUTE.NO_OPENER, target: target || ANCHOR_TARGET.SELF, ...TypographyProps, ...props }, label),
20
19
  copyable && React.createElement(CopyToClipboard, { copyStr: url })));
21
20
  }
22
21
  if (isValidUrl(url)) {
@@ -105,8 +105,6 @@ export const SupportRequestForm = ({ setFormSubmitted, supportRequest, }) => {
105
105
  submitting: false,
106
106
  }));
107
107
  setFormSubmitted(true); // Shows form submitted message.
108
- // Execute GTM tracking.
109
- // TODO(cc) add GTM tracking.
110
108
  }
111
109
  catch (error) {
112
110
  setFormState((formState) => ({
@@ -131,7 +129,7 @@ export const SupportRequestForm = ({ setFormSubmitted, supportRequest, }) => {
131
129
  React.createElement(UploadFile, { isDragActive: isDragActive, label: FORM_CONTROL_LABEL.ATTACHMENT_TOKEN, onAttachmentDeleted: onAttachmentDeleted, open: open, ...formState })),
132
130
  React.createElement(Section, null,
133
131
  React.createElement(SectionActions, null,
134
- React.createElement(ButtonPrimary, { disabled: Boolean(errors) || formState.submitting, fullWidth: true, onClick: onSupportRequestSubmitted }, "Send")))))));
132
+ React.createElement(ButtonPrimary, { disabled: Boolean(errors) || formState.submitting, fullWidth: true, onClick: onSupportRequestSubmitted, id: "button-support-request" }, "Send")))))));
135
133
  };
136
134
  /**
137
135
  * Build support request model from form values.
@@ -1,6 +1,6 @@
1
- import { AxiosError } from "axios";
1
+ import { HTTPError } from "ky";
2
2
  interface TempErrorProps {
3
- error: Error | AxiosError;
3
+ error: Error | HTTPError;
4
4
  }
5
5
  export declare const TempError: ({ error }: TempErrorProps) => JSX.Element;
6
6
  export {};
@@ -1,12 +1,12 @@
1
- import { isAxiosError } from "axios";
1
+ import { HTTPError } from "ky";
2
2
  import React from "react";
3
3
  import { ErrorBox } from "./components/errorBox";
4
4
  export const TempError = ({ error }) => {
5
- const { code, request } = isAxiosError(error)
5
+ const { code, request } = error instanceof HTTPError
6
6
  ? {
7
7
  ...error,
8
- code: error.response?.status,
9
- request: error.request.responseURL,
8
+ code: error.response.status,
9
+ request: error.response.url,
10
10
  }
11
11
  : { ...error, code: null, request: null };
12
12
  return (React.createElement("div", null,
@@ -1,12 +1,4 @@
1
- import { AlertProps as MAlertProps } from "@mui/material";
2
- import { ReactNode } from "react";
3
- export interface AlertProps {
4
- children?: ReactNode;
5
- className?: string;
6
- color?: MAlertProps["color"];
7
- icon?: MAlertProps["icon"];
8
- severity: MAlertProps["severity"];
9
- title?: ReactNode;
10
- variant?: MAlertProps["variant"];
11
- }
12
- export declare const Alert: ({ children, className, color, icon, severity, title, variant, }: AlertProps) => JSX.Element;
1
+ import { AlertProps } from "@mui/material";
2
+ import React from "react";
3
+ import { BaseComponentProps } from "../../types";
4
+ export declare const Alert: React.ForwardRefExoticComponent<Omit<AlertProps & BaseComponentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -1,7 +1,5 @@
1
- import { AlertTitle, Alert as MAlert, } from "@mui/material";
2
- import React from "react";
3
- export const Alert = ({ children, className, color, icon, severity, title, variant = "standard", }) => {
4
- return (React.createElement(MAlert, { className: className, color: color, icon: icon, severity: severity, variant: variant },
5
- title && React.createElement(AlertTitle, null, title),
6
- children));
7
- };
1
+ import React, { forwardRef } from "react";
2
+ import { StyledAlert } from "./alert.styles";
3
+ export const Alert = forwardRef(function Alert({ children, className, ...props }, ref) {
4
+ return (React.createElement(StyledAlert, { className: className, ref: ref, ...props }, children));
5
+ });