From ed3b2bf9d2be5ac60c6b43f044cb26a4d0155d7f Mon Sep 17 00:00:00 2001 From: Assem Hafez Date: Thu, 15 Feb 2024 15:58:23 +0100 Subject: [PATCH] init next.js code base --- .docker_env | 4 +- .gitignore | 44 +- CONTRIBUTING.md | 21 - Dockerfile | 86 +- README.md | 94 +- babel.config.js | 50 - client/.eslintrc | 8 - client/App.vue | 497 - client/assets/logo.svg | 5 - client/components/autocomplete.vue | 203 - client/components/bar-loader.vue | 64 - client/components/button-fill.vue | 221 - client/components/button-group.vue | 81 - client/components/button-icon.vue | 123 - client/components/copy.vue | 75 - client/components/data-viewer.vue | 149 - .../components/date-range-picker/constants.js | 46 - .../components/date-range-picker/helpers.js | 125 - .../date-range-picker/helpers.spec.js | 601 - client/components/date-range-picker/index.vue | 314 - client/components/detail-list.vue | 111 - client/components/error-message.vue | 39 - client/components/feature-flag.vue | 97 - client/components/flex-grid-item.vue | 45 - client/components/flex-grid.vue | 61 - client/components/highlight-toggle.vue | 101 - client/components/index.js | 47 - client/components/loading-message.vue | 83 - client/components/loading-spinner.vue | 49 - client/components/navigation-bar.vue | 40 - client/components/navigation-link.vue | 104 - client/components/news-modal.vue | 137 - client/components/no-results.vue | 54 - client/components/notification-bar.vue | 100 - client/components/paged-grid.js | 46 - client/components/select-input.vue | 151 - client/components/settings-footer.vue | 63 - client/components/settings-toggle.vue | 77 - client/components/text-input.vue | 52 - client/components/workflow-grid.vue | 201 - client/constants.js | 145 - .../containers/active-status/action-types.js | 24 - client/containers/active-status/actions.js | 50 - client/containers/active-status/component.vue | 136 - client/containers/active-status/connector.js | 51 - client/containers/active-status/constants.js | 23 - .../containers/active-status/getter-types.js | 29 - client/containers/active-status/getters.js | 125 - .../containers/active-status/getters.spec.js | 55 - .../helpers/get-cluster-from-cluster-list.js | 56 - ...et-cluster-list-from-domain-config-list.js | 56 - .../helpers/get-filtered-cluster-list.js | 44 - .../helpers/get-href-from-cluster.js | 51 - .../containers/active-status/helpers/index.js | 28 - .../helpers/merge-domain-config-list.js | 53 - .../active-status/helpers/state-prefix.js | 26 - .../active-status/helpers/type-prefix.js | 26 - client/containers/active-status/index.js | 29 - client/containers/cluster/action-types.js | 22 - client/containers/cluster/actions.js | 50 - client/containers/cluster/actions.spec.js | 113 - client/containers/cluster/constants.js | 25 - .../containers/cluster/get-default-state.js | 29 - .../cluster/get-default-state.spec.js | 56 - client/containers/cluster/getter-types.js | 26 - client/containers/cluster/getters.js | 53 - client/containers/cluster/getters.spec.js | 145 - .../cluster/helpers/can-fetch-cluster.js | 32 - .../cluster/helpers/can-fetch-cluster.spec.js | 66 - client/containers/cluster/helpers/index.js | 22 - client/containers/cluster/index.js | 27 - client/containers/cluster/mutation-types.js | 24 - client/containers/cluster/mutations.js | 45 - client/containers/cluster/mutations.spec.js | 80 - .../containers/cross-region/action-types.js | 24 - client/containers/cross-region/actions.js | 74 - client/containers/cross-region/component.vue | 39 - client/containers/cross-region/connector.js | 38 - client/containers/cross-region/constants.js | 23 - .../cross-region/get-default-state.js | 30 - .../containers/cross-region/getter-types.js | 32 - client/containers/cross-region/getters.js | 42 - .../containers/cross-region/helpers/index.js | 23 - .../cross-region/helpers/state-prefix.js | 26 - .../cross-region/helpers/type-prefix.js | 26 - client/containers/cross-region/index.js | 31 - .../containers/cross-region/mutation-types.js | 32 - client/containers/cross-region/mutations.js | 47 - .../domain-autocomplete/action-types.js | 28 - .../containers/domain-autocomplete/actions.js | 146 - .../domain-autocomplete/component.vue | 130 - .../domain-autocomplete/connector.js | 59 - .../domain-autocomplete/constants.js | 26 - .../domain-autocomplete/get-default-state.js | 34 - .../domain-autocomplete/getter-types.js | 39 - .../containers/domain-autocomplete/getters.js | 85 - .../helpers/combine-domain-list.js | 36 - .../helpers/combine-domain-list.spec.js | 108 - .../filter-duplicates-from-domain-list.js | 44 - .../helpers/filter-top-domain-list.js | 27 - .../helpers/filter-top-domain-list.spec.js | 53 - .../helpers/filter-visited-domain-list.js | 29 - .../filter-visited-domain-list.spec.js | 79 - .../helpers/format-domain-label.js | 34 - .../helpers/format-domain-label.spec.js | 74 - .../helpers/format-domain-list.js | 30 - .../domain-autocomplete/helpers/index.js | 32 - .../helpers/migrate-recent-domains.js | 37 - .../helpers/migrate-recent-domains.spec.js | 137 - .../helpers/sort-domain-list.js | 38 - .../helpers/sort-domain-list.spec.js | 54 - .../helpers/state-prefix.js | 26 - .../helpers/type-prefix.js | 26 - .../helpers/update-visited-domain-list.js | 53 - .../update-visited-domain-list.spec.js | 160 - .../containers/domain-autocomplete/index.js | 32 - .../domain-autocomplete/mutation-types.js | 32 - .../domain-autocomplete/mutations.js | 50 - .../containers/domain-autocomplete/reducer.js | 30 - client/containers/domain/action-types.js | 26 - client/containers/domain/actions.js | 126 - client/containers/domain/component.vue | 68 - client/containers/domain/connector.js | 88 - client/containers/domain/constants.js | 23 - client/containers/domain/get-default-state.js | 27 - client/containers/domain/getter-types.js | 30 - client/containers/domain/getters.js | 87 - .../domain/helpers/get-cross-origin.js | 69 - .../containers/domain/helpers/get-domain.js | 43 - client/containers/domain/helpers/index.js | 25 - .../containers/domain/helpers/state-prefix.js | 26 - .../containers/domain/helpers/type-prefix.js | 26 - client/containers/domain/index.js | 31 - client/containers/domain/mutation-types.js | 26 - client/containers/domain/mutations.js | 94 - client/containers/graph/get-default-state.js | 32 - client/containers/graph/getters.js | 33 - client/containers/graph/index.js | 26 - client/containers/graph/mutations.js | 49 - client/containers/index.js | 92 - client/containers/route/action-creator.js | 43 - .../containers/route/action-creator.spec.js | 72 - client/containers/route/action-types.js | 24 - client/containers/route/getter-types.js | 26 - client/containers/route/getters.js | 40 - client/containers/route/getters.spec.js | 113 - .../route/helpers/get-updated-query.js | 68 - .../route/helpers/get-updated-query.spec.js | 57 - client/containers/route/helpers/index.js | 22 - client/containers/route/index.js | 38 - .../containers/settings-modal/component.vue | 173 - .../components/settings-date-format.vue | 201 - .../components/settings-header.vue | 70 - .../components/settings-list.vue | 74 - client/containers/settings-modal/constants.js | 31 - client/containers/settings-modal/index.js | 28 - .../settings-workflow-history/component.vue | 298 - .../settings-workflow-history/connector.js | 52 - .../settings-workflow-history/constants.js | 22 - .../get-default-state.js | 27 - .../settings-workflow-history/getter-types.js | 23 - .../settings-workflow-history/getters.js | 37 - .../settings-workflow-history/index.js | 30 - .../mutation-types.js | 27 - .../settings-workflow-history/mutations.js | 49 - .../containers/workflow-history/component.vue | 1041 -- .../components/event-detail.vue | 108 - .../components/footer-toolbar.vue | 79 - .../workflow-history/components/index.js | 25 - .../workflow-history/components/timeline.vue | 213 - .../components/graph-legend.vue | 154 - .../workflow-graph/components/graph.vue | 195 - .../components/workflow-graph/constants.js | 141 - .../workflow-graph/helpers/arrange-graph.js | 111 - .../workflow-graph/helpers/arrange-nodes.js | 76 - .../helpers/cytoscape-layout.js | 55 - .../helpers/find-child-event.js | 75 - .../activity-task-cancel-requested.js | 26 - .../activity-task-canceled.js | 26 - .../activity-task-completed.js | 34 - .../activity-task-failed.js | 35 - .../activity-task-scheduled.js | 26 - .../activity-task-started.js | 26 - .../activity-task-timed-out.js | 34 - .../cancel-timer-failed.js | 27 - .../child-workflow-execution-canceled.js | 26 - .../child-workflow-execution-completed.js | 37 - .../child-workflow-execution-failed.js | 37 - .../child-workflow-execution-started.js | 36 - .../child-workflow-execution-terminated.js | 26 - .../child-workflow-execution-timed-out.js | 26 - .../decision-task-completed.js | 33 - .../decision-task-failed.js | 27 - .../decision-task-started.js | 26 - .../decision-task-timed-out.js | 26 - ...nal-workflow-execution-cancel-requested.js | 34 - .../external-workflow-execution-signaled.js | 33 - .../helpers/get-event-connections/index.js | 111 - .../get-event-connections/marker-recorded.js | 26 - .../request-cancel-activity-task-failed.js | 27 - ...ncel-external-workflow-execution-failed.js | 27 - ...l-external-workflow-execution-initiated.js | 26 - ...gnal-external-workflow-execution-failed.js | 27 - ...l-external-workflow-execution-initiated.js | 26 - .../start-child-workflow-execution-failed.js | 27 - ...tart-child-workflow-execution-initiated.js | 26 - .../get-event-connections/timer-canceled.js | 26 - .../get-event-connections/timer-fired.js | 33 - .../get-event-connections/timer-started.js | 26 - .../upsert-workflow-search-attributes.js | 26 - .../workflow-execution-cancel-requested.js | 32 - .../workflow-execution-canceled.js | 26 - .../workflow-execution-completed.js | 27 - .../workflow-execution-continued-as-new.js | 35 - .../workflow-execution-failed.js | 27 - .../workflow-execution-signaled.js | 32 - .../workflow-execution-started.js | 35 - .../workflow-execution-timed-out.js | 26 - .../helpers/get-graph-pan-center.js | 34 - .../helpers/get-time-index-pair-key.js | 24 - .../workflow-graph/helpers/index.js | 31 - .../workflow-graph/helpers/select-node.js | 150 - .../helpers/set-chronological-children.js | 40 - .../set-direct-and-inferred-children.js | 51 - .../components/workflow-graph/index.vue | 227 - .../containers/workflow-history/connector.js | 36 - .../containers/workflow-history/constants.js | 27 - .../workflow-history/get-default-state.js | 27 - .../get-default-state.spec.js | 44 - client/containers/workflow-history/helpers.js | 39 - client/containers/workflow-history/index.js | 28 - .../containers/workflow-list/action-types.js | 24 - client/containers/workflow-list/actions.js | 39 - .../containers/workflow-list/actions.spec.js | 39 - client/containers/workflow-list/component.vue | 637 - client/containers/workflow-list/connector.js | 72 - client/containers/workflow-list/constants.js | 64 - .../containers/workflow-list/getter-types.js | 34 - client/containers/workflow-list/getters.js | 74 - .../containers/workflow-list/getters.spec.js | 116 - .../workflow-list/helpers/get-criteria.js | 56 - .../helpers/get-criteria.spec.js | 111 - .../helpers/get-fetch-workflow-list-url.js | 32 - .../get-fetch-workflow-list-url.spec.js | 70 - .../workflow-list/helpers/get-filter-by.js | 34 - .../helpers/get-filter-by.spec.js | 61 - .../helpers/get-filter-mode-button-label.js | 29 - .../get-filter-mode-button-label.spec.js | 55 - .../helpers/get-formatted-results.js | 60 - .../helpers/get-formatted-results.spec.js | 106 - .../workflow-list/helpers/get-is-cron.js | 37 - .../helpers/get-min-start-date.js | 35 - .../helpers/get-min-start-date.spec.js | 57 - .../workflow-list/helpers/get-state.js | 42 - .../workflow-list/helpers/get-state.spec.js | 83 - .../workflow-list/helpers/get-status.js | 37 - .../workflow-list/helpers/get-status.spec.js | 156 - .../containers/workflow-list/helpers/index.js | 33 - .../workflow-list/helpers/is-range-valid.js | 62 - .../helpers/is-range-valid.spec.js | 80 - .../helpers/is-route-range-valid.js | 42 - .../helpers/is-route-range-valid.spec.js | 56 - .../helpers/toggle-filter-mode.js | 29 - .../helpers/toggle-filter-mode.spec.js | 55 - client/containers/workflow-list/index.js | 29 - .../workflow-pending/action-types.js | 23 - client/containers/workflow-pending/actions.js | 30 - .../workflow-pending/actions.spec.js | 38 - .../containers/workflow-pending/component.vue | 114 - .../workflow-pending/components/index.js | 22 - .../components/pending-task-list-item.vue | 75 - .../containers/workflow-pending/connector.js | 45 - .../containers/workflow-pending/constants.js | 76 - .../workflow-pending/getter-types.js | 26 - client/containers/workflow-pending/getters.js | 59 - .../workflow-pending/getters.spec.js | 298 - .../helpers/get-workflow-link.js | 39 - .../workflow-pending/helpers/index.js | 24 - .../helpers/map-filter-to-getter-type.js | 27 - .../helpers/map-pending-task-list.js | 58 - client/containers/workflow-pending/index.js | 29 - client/containers/workflow/component.vue | 448 - client/containers/workflow/connector.js | 47 - client/containers/workflow/constants.js | 27 - .../containers/workflow/get-default-state.js | 28 - .../workflow/get-default-state.spec.js | 58 - client/containers/workflow/getter-types.js | 35 - client/containers/workflow/getters.js | 78 - client/containers/workflow/getters.spec.js | 290 - .../workflow/helpers/event-full-transforms.js | 45 - .../helpers/event-full-transforms.spec.js | 109 - .../workflow/helpers/get-event-details.js | 57 - .../helpers/get-event-details.spec.js | 64 - .../helpers/get-event-full-details.js | 61 - .../helpers/get-event-full-details.spec.js | 72 - .../helpers/get-event-kvps-highlight.js | 68 - .../helpers/get-event-kvps-highlight.spec.js | 137 - .../workflow/helpers/get-event-summary.js | 53 - .../helpers/get-event-summary.spec.js | 72 - .../workflow/helpers/get-history-events.js | 98 - .../helpers/get-history-timeline-events.js | 32 - .../helpers/get-summary-workflow-status.js | 63 - .../get-summary-workflow-status.spec.js | 114 - .../workflow/helpers/get-summary.js | 90 - .../helpers/get-time-elapsed-display.js | 58 - .../helpers/get-time-elapsed-display.spec.js | 79 - .../helpers/get-time-stamp-display.js | 40 - .../helpers/get-time-stamp-display.spec.js | 60 - client/containers/workflow/helpers/index.js | 35 - .../workflow/helpers/map-timeline-events.js | 243 - .../workflow/helpers/parent-workflow-link.js | 39 - .../helpers/parent-workflow-link.spec.js | 68 - .../workflow/helpers/summarize-events.js | 165 - .../workflow/helpers/workflow-link.js | 46 - client/containers/workflow/index.js | 30 - client/containers/workflow/mutation-types.js | 23 - client/containers/workflow/mutations.js | 38 - client/containers/workflow/mutations.spec.js | 84 - client/directives/snapscroll.js | 38 - client/helpers/__mocks__/index.js | 22 - client/helpers/combine.js | 28 - client/helpers/delay.js | 24 - .../helpers/get-datetime-formatted-string.js | 73 - .../get-datetime-formatted-string.spec.js | 126 - client/helpers/get-end-time-iso-string.js | 34 - .../helpers/get-end-time-iso-string.spec.js | 47 - client/helpers/get-environment-list.js | 23 - client/helpers/get-environment-list.spec.js | 48 - client/helpers/get-environment.js | 26 - client/helpers/get-environment.spec.js | 56 - client/helpers/get-error-message.js | 30 - client/helpers/get-error-message.spec.js | 69 - .../helpers/get-expiry-date-time-from-now.js | 30 - .../get-expiry-date-time-from-now.spec.js | 39 - client/helpers/get-json-string-object.js | 36 - client/helpers/get-key-value-pairs.js | 124 - client/helpers/get-latest-news-items.js | 33 - client/helpers/get-latest-news-items.spec.js | 84 - .../helpers/get-query-string-from-object.js | 46 - .../get-query-string-from-object.spec.js | 42 - client/helpers/get-start-time-iso-string.js | 35 - .../helpers/get-start-time-iso-string.spec.js | 47 - client/helpers/get-string-elipsis.js | 29 - client/helpers/get-string-elipsis.spec.js | 50 - client/helpers/has-expired.js | 32 - client/helpers/has-expired.spec.js | 57 - client/helpers/index.js | 43 - .../helpers/inject-moment-duration-format.js | 38 - client/helpers/json-try-parse.js | 33 - client/helpers/map-domain-description.js | 61 - client/helpers/map-domain-description.spec.js | 203 - client/helpers/parse-string-to-boolean.js | 34 - .../helpers/parse-string-to-boolean.spec.js | 48 - client/helpers/short-name.js | 22 - ...tory-event-highlight-list-add-or-update.js | 70 - ...event-highlight-list-add-or-update.spec.js | 172 - ...y-event-highlight-list-find-index-by-id.js | 25 - ...nt-highlight-list-find-index-by-id.spec.js | 55 - ...low-history-event-highlight-list-remove.js | 42 - ...istory-event-highlight-list-remove.spec.js | 57 - client/main.js | 401 - client/routes/domain-search/index.vue | 50 - client/routes/domain/domain-metrics.vue | 31 - client/routes/domain/domain-service.js | 30 - client/routes/domain/domain-settings.vue | 112 - client/routes/domain/index.vue | 97 - .../domain/workflow-archival/advanced.vue | 232 - .../routes/domain/workflow-archival/basic.vue | 335 - .../archival-disabled-messaging/constants.js | 37 - .../archival-disabled-messaging/index.vue | 123 - .../components/archival-table-row.vue | 71 - .../components/archival-table.vue | 54 - .../workflow-archival/components/index.js | 24 - .../domain/workflow-archival/constants.js | 34 - .../workflow-archival/helpers/get-domain.js | 24 - .../helpers/get-domain.spec.js | 46 - .../helpers/get-history-archival-status.js | 25 - .../get-history-archival-status.spec.js | 46 - .../helpers/get-query-params.js | 42 - .../helpers/get-query-params.spec.js | 102 - .../helpers/get-query-params.spec.js | 81 - .../workflow-archival/helpers/get-range.js | 31 - .../helpers/get-range.spec.js | 64 - .../helpers/get-status-value.js | 23 - .../helpers/get-status-value.spec.js | 42 - .../workflow-archival/helpers/get-status.js | 30 - .../helpers/get-status.spec.js | 46 - .../helpers/get-visibility-archival-status.js | 25 - .../get-visibility-archival-status.spec.js | 46 - .../domain/workflow-archival/helpers/index.js | 34 - .../helpers/is-archival-enabled.js | 27 - .../helpers/is-archival-enabled.spec.js | 80 - .../helpers/is-history-archival-enabled.js | 25 - .../is-history-archival-enabled.spec.js | 59 - .../helpers/is-visibility-archival-enabled.js | 25 - .../is-visibility-archival-enabled.spec.js | 59 - .../helpers/map-archived-workflow-response.js | 54 - .../map-archived-workflow-response.spec.js | 49 - .../helpers/replace-domain.js | 25 - .../helpers/replace-domain.spec.js | 39 - .../helpers/update-query-from-range.js | 38 - .../helpers/update-query-from-range.spec.js | 52 - .../routes/domain/workflow-archival/index.vue | 87 - .../workflow-archival-service.js | 53 - .../workflow-archival-service.spec.js | 71 - client/routes/help/constants.js | 121 - client/routes/help/index.vue | 295 - client/routes/index.vue | 73 - client/routes/news/helpers/get-iframe-src.js | 25 - .../news/helpers/get-iframe-src.spec.js | 50 - .../helpers/get-updated-iframe-location.js | 29 - .../get-updated-iframe-location.spec.js | 56 - client/routes/news/helpers/index.js | 23 - client/routes/news/index.vue | 173 - .../task-list/components/partition-table.vue | 47 - client/routes/task-list/index.vue | 94 - client/routes/task-list/metrics.vue | 31 - client/routes/task-list/partition.vue | 69 - client/routes/task-list/pollers.vue | 111 - client/routes/workflow/constants.js | 23 - .../workflow/helpers/get-query-result.js | 26 - client/routes/workflow/helpers/index.js | 22 - client/routes/workflow/query.vue | 195 - client/routes/workflow/stack-trace.vue | 155 - client/routes/workflow/summary.vue | 351 - client/services/feature-flag-service.js | 42 - client/services/http-service.js | 113 - client/services/index.js | 23 - client/store/index.js | 184 - client/styles/animations.styl | 35 - client/styles/base.styl | 168 - client/styles/code.styl | 76 - client/styles/definitions.styl | 205 - client/styles/modal.styl | 40 - client/styles/reset.styl | 76 - client/styles/vis.styl | 667 - client/test/.eslintrc | 15 - client/test/domain-search.test.js | 165 - client/test/domain-settings.test.js | 69 - client/test/domain.test.js | 129 - client/test/fixtures.js | 727 - client/test/help.test.js | 95 - client/test/helpers/get-fixture.js | 28 - client/test/helpers/index.js | 22 - client/test/index.js | 166 - .../lint/license/LICENSE_FILE_DOES_NOT_EXIST | 20 - .../test/lint/license/LICENSE_FILE_MODIFIED | 20 - client/test/lint/license/LICENSE_FILE_NEW | 20 - .../test/lint/license/LICENSE_FILE_UNMODIFIED | 20 - .../test-license-file-does-not-exist.vue | 26 - .../license/test-license-file-modified.vue | 26 - .../lint/license/test-license-file-new.vue | 26 - .../license/test-license-file-unmodified.vue | 26 - client/test/scenario.js | 454 - client/test/task-list.test.js | 65 - client/test/workflow-list.test.js | 410 - client/test/workflow.test.js | 1339 -- docker-compose.prod.yml | 10 + docker-compose.yml | 31 +- favicon.ico | Bin 1150 -> 0 bytes jest.config.js | 205 - news/.gitignore | 12 - news/blog/.vuepress/components/index.js | 2 - .../components/release-notes-link.vue | 18 - .../.vuepress/components/release-notes.vue | 45 - news/blog/.vuepress/config.js | 37 - news/blog/.vuepress/enhanceApp.js | 14 - news/blog/.vuepress/helpers/get-github-api.js | 3 - .../blog/.vuepress/helpers/get-github-link.js | 3 - news/blog/.vuepress/helpers/index.js | 2 - news/blog/.vuepress/styles/index.styl | 62 - news/blog/.vuepress/styles/palette.styl | 11 - news/blog/_posts/2020-06-03-cadence-docs.md | 10 - .../_posts/2020-06-03-cadence-go-0-12-0.md | 12 - .../_posts/2020-06-03-cadence-java-2-7-1.md | 12 - .../2020-06-03-cadence-server-0-12-0.md | 12 - .../_posts/2020-06-03-cadence-ui-3-16-0.md | 12 - .../_posts/2020-06-11-cadence-ui-3-17-0.md | 12 - .../2020-07-07-cadence-server-0-13-0.md | 12 - .../_posts/2020-07-12-cadence-go-0-13-0.md | 12 - .../_posts/2020-07-17-cadence-ui-3-18-0.md | 12 - .../_posts/2020-07-28-cadence-ui-3-19-0.md | 12 - .../_posts/2021-02-25-cadence-go-0-16-0.md | 26 - .../2021-02-25-cadence-server-0-18-0.md | 117 - .../_posts/2021-02-25-cadence-ui-3-23-0.md | 33 - .../_posts/2021-04-19-cadence-java-3-0-0.md | 12 - .../2021-04-19-cadence-server-0-20-0.md | 19 - .../_posts/2021-04-19-cadence-ui-3-25-0.md | 21 - news/package-lock.json | 10510 ----------- news/package.json | 23 - next.config.mjs | 4 + package-lock.json | 14397 ---------------- package.json | 170 +- pnpm-lock.yaml | 3483 ++++ public/next.svg | 1 + public/vercel.svg | 1 + server.js | 10 - server/.eslintrc | 5 - server/constants.js | 41 - server/feature-flags.json | 54 - server/helpers/combine.js | 28 - server/helpers/index.js | 26 - server/index.js | 174 - .../middleware/grpc-client/configuration.js | 41 - .../format-long-to-timestamp.js | 33 - .../format-long-to-timestamp.spec.js | 45 - .../format-request/format-request-default.js | 24 - .../format-request-describe-task-list.js | 30 - .../format-request-get-history.js | 29 - .../format-request-workflow-list.js | 45 - .../grpc-client/format-request/index.js | 34 - .../format-duration-to-seconds.js | 25 - .../format-response/format-enum.js | 51 - .../format-response/format-enum.spec.js | 45 - .../format-response/format-failure-details.js | 38 - ...-task-cancel-requested-event-attributes.js | 30 - ...activity-task-canceled-event-attributes.js | 38 - ...ctivity-task-completed-event-attributes.js | 36 - ...t-activity-task-failed-event-attributes.js | 37 - ...ctivity-task-scheduled-event-attributes.js | 61 - ...-activity-task-started-event-attributes.js | 35 - ...ctivity-task-timed-out-event-attributes.js | 40 - ...at-cancel-timer-failed-event-attributes.js | 30 - ...low-execution-canceled-event-attributes.js | 36 - ...ow-execution-completed-event-attributes.js | 36 - ...kflow-execution-failed-event-attributes.js | 37 - ...flow-execution-started-event-attributes.js | 34 - ...w-execution-terminated-event-attributes.js | 32 - ...ow-execution-timed-out-event-attributes.js | 32 - ...ecision-task-completed-event-attributes.js | 34 - ...t-decision-task-failed-event-attributes.js | 39 - ...ecision-task-scheduled-event-attributes.js | 38 - ...-decision-task-started-event-attributes.js | 30 - ...ecision-task-timed-out-event-attributes.js | 34 - ...ution-cancel-requested-event-attributes.js | 30 - ...low-execution-signaled-event-attributes.js | 34 - ...format-marker-recorded-event-attributes.js | 37 - .../format-prev-auto-reset-points.js | 40 - ...l-activity-task-failed-event-attributes.js | 30 - ...kflow-execution-failed-event-attributes.js | 36 - ...ow-execution-initiated-event-attributes.js | 34 - .../format-retry-policy.js | 44 - ...kflow-execution-failed-event-attributes.js | 36 - ...ow-execution-initiated-event-attributes.js | 37 - ...kflow-execution-failed-event-attributes.js | 36 - ...ow-execution-initiated-event-attributes.js | 72 - .../format-timer-canceled-event-attributes.js | 32 - .../format-timer-fired-event-attributes.js | 30 - .../format-timer-started-event-attributes.js | 34 - ...flow-search-attributes-event-attributes.js | 32 - ...ution-cancel-requested-event-attributes.js | 33 - ...low-execution-canceled-event-attributes.js | 32 - ...ow-execution-completed-event-attributes.js | 32 - ...ution-continued-as-new-event-attributes.js | 64 - ...kflow-execution-failed-event-attributes.js | 33 - ...low-execution-signaled-event-attributes.js | 32 - ...flow-execution-started-event-attributes.js | 91 - ...w-execution-terminated-event-attributes.js | 32 - .../format-history-event-details/index.js | 120 - .../format-history-event-type.js | 30 - .../format-response/format-payload-map.js | 44 - .../format-response/format-payload.js | 50 - .../format-response-default.js | 24 - .../format-response-describe-task-list.js | 31 - .../format-response-describe-workflow.js | 144 - .../format-response/format-response-domain.js | 75 - .../format-response-export-history.js | 51 - .../format-response-get-history.js | 46 - .../format-response-list-domains.js | 83 - .../format-response-query-workflow.js | 30 - ...rmat-response-signal-workflow-execution.js | 24 - ...t-response-terminate-workflow-execution.js | 24 - .../format-response-workflow-list.js | 60 - .../format-timestamp-to-datetime.js | 29 - .../format-timestamp-to-long.js | 27 - .../grpc-client/format-response/index.js | 58 - server/middleware/grpc-client/index.js | 177 - .../grpc-client/transform/cli-transform.js | 53 - .../transform/cli-transform.spec.js | 148 - .../middleware/grpc-client/transform/index.js | 34 - .../transform/transform-default.js | 24 - .../grpc-client/transform/with-domain.js | 27 - .../grpc-client/transform/with-pagination.js | 27 - .../transform/with-workflow-execution.js | 30 - .../tchannel-client/helpers/cli-transform.js | 49 - .../tchannel-client/helpers/format-body.js | 25 - .../tchannel-client/helpers/format-method.js | 24 - .../helpers/format-request-name.js | 25 - .../tchannel-client/helpers/index.js | 48 - .../tchannel-client/helpers/lookup-async.js | 35 - .../tchannel-client/helpers/make-channels.js | 67 - .../tchannel-client/helpers/make-request.js | 72 - .../tchannel-client/helpers/ui-transform.js | 71 - .../helpers/with-domain-paging.js | 36 - .../with-next-page-token-body-transform.js | 36 - .../with-verbose-workflow-execution.js | 41 - .../helpers/with-workflow-execution.js | 41 - server/middleware/tchannel-client/index.js | 158 - server/router/constants.js | 32 - server/router/helpers/build-query-string.js | 44 - .../router/helpers/build-query-string.spec.js | 139 - server/router/helpers/delay.js | 24 - server/router/helpers/index.js | 40 - .../inject-domain-into-workflow-list.js | 30 - .../helpers/is-advanced-visibility-enabled.js | 39 - .../is-advanced-visibility-enabled.spec.js | 76 - server/router/helpers/list-workflows.js | 81 - server/router/helpers/map-history-response.js | 45 - server/router/helpers/moment-to-long.js | 26 - server/router/helpers/replacer.js | 33 - server/router/index.js | 158 - server/router/managers/cache-manager.js | 60 - server/router/managers/cache-manager.spec.js | 113 - server/router/managers/index.js | 26 - server/router/routes/clear-cache-handler.js | 27 - server/router/routes/cluster-handler.js | 25 - .../routes/domain-authorization-handler.js | 30 - server/router/routes/domain-handler.js | 26 - server/router/routes/domain-list-handler.js | 26 - server/router/routes/feature-flag-handler.js | 39 - server/router/routes/health-handler.js | 24 - server/router/routes/index.js | 62 - server/router/routes/tasklist-handler.js | 41 - .../routes/tasklist-partition-list-handler.js | 31 - .../routes/tasklist-poller-list-handler.js | 55 - .../routes/workflow-archived-list-handler.js | 56 - .../router/routes/workflow-export-handler.js | 45 - server/router/routes/workflow-handler.js | 90 - .../router/routes/workflow-history-handler.js | 35 - server/router/routes/workflow-list-handler.js | 41 - .../router/routes/workflow-query-handler.js | 41 - .../routes/workflow-query-type-handler.js | 30 - .../router/routes/workflow-signal-handler.js | 28 - .../routes/workflow-terminate-handler.js | 28 - server/router/services/cluster-service.js | 42 - .../router/services/cluster-service.spec.js | 54 - .../services/domain-service/constants.js | 34 - .../helpers/fetch-domain-list-next-page.js | 84 - .../fetch-domain-list-next-page.spec.js | 82 - .../helpers/fetch-domain-list.js | 37 - .../helpers/filter-domain-list.js | 29 - .../helpers/filter-domain-list.spec.js | 56 - .../domain-service/helpers/get-domain-list.js | 27 - .../helpers/get-matching-domains.js | 46 - .../helpers/get-matching-domains.spec.js | 69 - .../services/domain-service/helpers/index.js | 36 - .../helpers/sort-domain-list.js | 38 - .../helpers/sort-domain-list.spec.js | 40 - .../router/services/domain-service/index.js | 48 - server/router/services/index.js | 28 - server/test/.eslintrc | 10 - server/test/cadence-frontend-simulator.js | 81 - server/test/domain.test.js | 185 - server/test/history.test.js | 363 - server/test/mock-grpc.js | 196 - server/test/mock-tchannel.js | 111 - server/test/query-workflow.test.js | 140 - server/test/task-list.test.js | 101 - server/test/workflow-execution.test.js | 95 - server/test/workflows.test.js | 387 - src/app/StyletronProviderWrapper.tsx | 15 + .../app/domains/page.module.css | 0 src/app/domains/page.tsx | 12 + src/app/favicon.ico | Bin 0 -> 15406 bytes src/app/globals.css | 107 + src/app/layout.tsx | 27 + src/app/page.module.css | 230 + src/app/page.tsx | 98 + src/app/registry.tsx | 25 + .../test-component/test-component.tsx | 5 + src/components/test-table/test-table.tsx | 17 + src/styletron.ts | 15 + src/utils/grpc-client.ts | 135 + .../utils/grpc-service.ts | 86 +- test/helpers/index.js | 2 - test/helpers/init-getters.js | 5 - test/helpers/init-store.js | 10 - test/setup.js | 27 - tsconfig.json | 26 + webpack.config.js | 99 - 680 files changed, 4441 insertions(+), 69668 deletions(-) delete mode 100644 babel.config.js delete mode 100644 client/.eslintrc delete mode 100644 client/App.vue delete mode 100644 client/assets/logo.svg delete mode 100644 client/components/autocomplete.vue delete mode 100644 client/components/bar-loader.vue delete mode 100644 client/components/button-fill.vue delete mode 100644 client/components/button-group.vue delete mode 100644 client/components/button-icon.vue delete mode 100644 client/components/copy.vue delete mode 100644 client/components/data-viewer.vue delete mode 100644 client/components/date-range-picker/constants.js delete mode 100644 client/components/date-range-picker/helpers.js delete mode 100644 client/components/date-range-picker/helpers.spec.js delete mode 100644 client/components/date-range-picker/index.vue delete mode 100644 client/components/detail-list.vue delete mode 100644 client/components/error-message.vue delete mode 100644 client/components/feature-flag.vue delete mode 100644 client/components/flex-grid-item.vue delete mode 100644 client/components/flex-grid.vue delete mode 100644 client/components/highlight-toggle.vue delete mode 100644 client/components/index.js delete mode 100644 client/components/loading-message.vue delete mode 100644 client/components/loading-spinner.vue delete mode 100644 client/components/navigation-bar.vue delete mode 100644 client/components/navigation-link.vue delete mode 100644 client/components/news-modal.vue delete mode 100644 client/components/no-results.vue delete mode 100644 client/components/notification-bar.vue delete mode 100644 client/components/paged-grid.js delete mode 100644 client/components/select-input.vue delete mode 100644 client/components/settings-footer.vue delete mode 100644 client/components/settings-toggle.vue delete mode 100644 client/components/text-input.vue delete mode 100644 client/components/workflow-grid.vue delete mode 100644 client/constants.js delete mode 100644 client/containers/active-status/action-types.js delete mode 100644 client/containers/active-status/actions.js delete mode 100644 client/containers/active-status/component.vue delete mode 100644 client/containers/active-status/connector.js delete mode 100644 client/containers/active-status/constants.js delete mode 100644 client/containers/active-status/getter-types.js delete mode 100644 client/containers/active-status/getters.js delete mode 100644 client/containers/active-status/getters.spec.js delete mode 100644 client/containers/active-status/helpers/get-cluster-from-cluster-list.js delete mode 100644 client/containers/active-status/helpers/get-cluster-list-from-domain-config-list.js delete mode 100644 client/containers/active-status/helpers/get-filtered-cluster-list.js delete mode 100644 client/containers/active-status/helpers/get-href-from-cluster.js delete mode 100644 client/containers/active-status/helpers/index.js delete mode 100644 client/containers/active-status/helpers/merge-domain-config-list.js delete mode 100644 client/containers/active-status/helpers/state-prefix.js delete mode 100644 client/containers/active-status/helpers/type-prefix.js delete mode 100644 client/containers/active-status/index.js delete mode 100644 client/containers/cluster/action-types.js delete mode 100644 client/containers/cluster/actions.js delete mode 100644 client/containers/cluster/actions.spec.js delete mode 100644 client/containers/cluster/constants.js delete mode 100644 client/containers/cluster/get-default-state.js delete mode 100644 client/containers/cluster/get-default-state.spec.js delete mode 100644 client/containers/cluster/getter-types.js delete mode 100644 client/containers/cluster/getters.js delete mode 100644 client/containers/cluster/getters.spec.js delete mode 100644 client/containers/cluster/helpers/can-fetch-cluster.js delete mode 100644 client/containers/cluster/helpers/can-fetch-cluster.spec.js delete mode 100644 client/containers/cluster/helpers/index.js delete mode 100644 client/containers/cluster/index.js delete mode 100644 client/containers/cluster/mutation-types.js delete mode 100644 client/containers/cluster/mutations.js delete mode 100644 client/containers/cluster/mutations.spec.js delete mode 100644 client/containers/cross-region/action-types.js delete mode 100644 client/containers/cross-region/actions.js delete mode 100644 client/containers/cross-region/component.vue delete mode 100644 client/containers/cross-region/connector.js delete mode 100644 client/containers/cross-region/constants.js delete mode 100644 client/containers/cross-region/get-default-state.js delete mode 100644 client/containers/cross-region/getter-types.js delete mode 100644 client/containers/cross-region/getters.js delete mode 100644 client/containers/cross-region/helpers/index.js delete mode 100644 client/containers/cross-region/helpers/state-prefix.js delete mode 100644 client/containers/cross-region/helpers/type-prefix.js delete mode 100644 client/containers/cross-region/index.js delete mode 100644 client/containers/cross-region/mutation-types.js delete mode 100644 client/containers/cross-region/mutations.js delete mode 100644 client/containers/domain-autocomplete/action-types.js delete mode 100644 client/containers/domain-autocomplete/actions.js delete mode 100644 client/containers/domain-autocomplete/component.vue delete mode 100644 client/containers/domain-autocomplete/connector.js delete mode 100644 client/containers/domain-autocomplete/constants.js delete mode 100644 client/containers/domain-autocomplete/get-default-state.js delete mode 100644 client/containers/domain-autocomplete/getter-types.js delete mode 100644 client/containers/domain-autocomplete/getters.js delete mode 100644 client/containers/domain-autocomplete/helpers/combine-domain-list.js delete mode 100644 client/containers/domain-autocomplete/helpers/combine-domain-list.spec.js delete mode 100644 client/containers/domain-autocomplete/helpers/filter-duplicates-from-domain-list.js delete mode 100644 client/containers/domain-autocomplete/helpers/filter-top-domain-list.js delete mode 100644 client/containers/domain-autocomplete/helpers/filter-top-domain-list.spec.js delete mode 100644 client/containers/domain-autocomplete/helpers/filter-visited-domain-list.js delete mode 100644 client/containers/domain-autocomplete/helpers/filter-visited-domain-list.spec.js delete mode 100644 client/containers/domain-autocomplete/helpers/format-domain-label.js delete mode 100644 client/containers/domain-autocomplete/helpers/format-domain-label.spec.js delete mode 100644 client/containers/domain-autocomplete/helpers/format-domain-list.js delete mode 100644 client/containers/domain-autocomplete/helpers/index.js delete mode 100644 client/containers/domain-autocomplete/helpers/migrate-recent-domains.js delete mode 100644 client/containers/domain-autocomplete/helpers/migrate-recent-domains.spec.js delete mode 100644 client/containers/domain-autocomplete/helpers/sort-domain-list.js delete mode 100644 client/containers/domain-autocomplete/helpers/sort-domain-list.spec.js delete mode 100644 client/containers/domain-autocomplete/helpers/state-prefix.js delete mode 100644 client/containers/domain-autocomplete/helpers/type-prefix.js delete mode 100644 client/containers/domain-autocomplete/helpers/update-visited-domain-list.js delete mode 100644 client/containers/domain-autocomplete/helpers/update-visited-domain-list.spec.js delete mode 100644 client/containers/domain-autocomplete/index.js delete mode 100644 client/containers/domain-autocomplete/mutation-types.js delete mode 100644 client/containers/domain-autocomplete/mutations.js delete mode 100644 client/containers/domain-autocomplete/reducer.js delete mode 100644 client/containers/domain/action-types.js delete mode 100644 client/containers/domain/actions.js delete mode 100644 client/containers/domain/component.vue delete mode 100644 client/containers/domain/connector.js delete mode 100644 client/containers/domain/constants.js delete mode 100644 client/containers/domain/get-default-state.js delete mode 100644 client/containers/domain/getter-types.js delete mode 100644 client/containers/domain/getters.js delete mode 100644 client/containers/domain/helpers/get-cross-origin.js delete mode 100644 client/containers/domain/helpers/get-domain.js delete mode 100644 client/containers/domain/helpers/index.js delete mode 100644 client/containers/domain/helpers/state-prefix.js delete mode 100644 client/containers/domain/helpers/type-prefix.js delete mode 100644 client/containers/domain/index.js delete mode 100644 client/containers/domain/mutation-types.js delete mode 100644 client/containers/domain/mutations.js delete mode 100644 client/containers/graph/get-default-state.js delete mode 100644 client/containers/graph/getters.js delete mode 100644 client/containers/graph/index.js delete mode 100644 client/containers/graph/mutations.js delete mode 100644 client/containers/index.js delete mode 100644 client/containers/route/action-creator.js delete mode 100644 client/containers/route/action-creator.spec.js delete mode 100644 client/containers/route/action-types.js delete mode 100644 client/containers/route/getter-types.js delete mode 100644 client/containers/route/getters.js delete mode 100644 client/containers/route/getters.spec.js delete mode 100644 client/containers/route/helpers/get-updated-query.js delete mode 100644 client/containers/route/helpers/get-updated-query.spec.js delete mode 100644 client/containers/route/helpers/index.js delete mode 100644 client/containers/route/index.js delete mode 100644 client/containers/settings-modal/component.vue delete mode 100644 client/containers/settings-modal/components/settings-date-format.vue delete mode 100644 client/containers/settings-modal/components/settings-header.vue delete mode 100644 client/containers/settings-modal/components/settings-list.vue delete mode 100644 client/containers/settings-modal/constants.js delete mode 100644 client/containers/settings-modal/index.js delete mode 100644 client/containers/settings-workflow-history/component.vue delete mode 100644 client/containers/settings-workflow-history/connector.js delete mode 100644 client/containers/settings-workflow-history/constants.js delete mode 100644 client/containers/settings-workflow-history/get-default-state.js delete mode 100644 client/containers/settings-workflow-history/getter-types.js delete mode 100644 client/containers/settings-workflow-history/getters.js delete mode 100644 client/containers/settings-workflow-history/index.js delete mode 100644 client/containers/settings-workflow-history/mutation-types.js delete mode 100644 client/containers/settings-workflow-history/mutations.js delete mode 100644 client/containers/workflow-history/component.vue delete mode 100644 client/containers/workflow-history/components/event-detail.vue delete mode 100644 client/containers/workflow-history/components/footer-toolbar.vue delete mode 100644 client/containers/workflow-history/components/index.js delete mode 100644 client/containers/workflow-history/components/timeline.vue delete mode 100644 client/containers/workflow-history/components/workflow-graph/components/graph-legend.vue delete mode 100644 client/containers/workflow-history/components/workflow-graph/components/graph.vue delete mode 100644 client/containers/workflow-history/components/workflow-graph/constants.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/arrange-graph.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/arrange-nodes.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/cytoscape-layout.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/find-child-event.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-cancel-requested.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-canceled.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-completed.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-failed.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-scheduled.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-started.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-timed-out.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/cancel-timer-failed.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-canceled.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-completed.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-failed.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-started.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-terminated.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-timed-out.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/decision-task-completed.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/decision-task-failed.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/decision-task-started.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/decision-task-timed-out.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/external-workflow-execution-cancel-requested.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/external-workflow-execution-signaled.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/index.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/marker-recorded.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/request-cancel-activity-task-failed.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/request-cancel-external-workflow-execution-failed.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/request-cancel-external-workflow-execution-initiated.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/signal-external-workflow-execution-failed.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/signal-external-workflow-execution-initiated.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/start-child-workflow-execution-failed.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/start-child-workflow-execution-initiated.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/timer-canceled.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/timer-fired.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/timer-started.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/upsert-workflow-search-attributes.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-cancel-requested.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-canceled.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-completed.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-continued-as-new.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-failed.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-signaled.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-started.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-timed-out.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-graph-pan-center.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/get-time-index-pair-key.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/index.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/select-node.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/set-chronological-children.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/helpers/set-direct-and-inferred-children.js delete mode 100644 client/containers/workflow-history/components/workflow-graph/index.vue delete mode 100644 client/containers/workflow-history/connector.js delete mode 100644 client/containers/workflow-history/constants.js delete mode 100644 client/containers/workflow-history/get-default-state.js delete mode 100644 client/containers/workflow-history/get-default-state.spec.js delete mode 100644 client/containers/workflow-history/helpers.js delete mode 100644 client/containers/workflow-history/index.js delete mode 100644 client/containers/workflow-list/action-types.js delete mode 100644 client/containers/workflow-list/actions.js delete mode 100644 client/containers/workflow-list/actions.spec.js delete mode 100644 client/containers/workflow-list/component.vue delete mode 100644 client/containers/workflow-list/connector.js delete mode 100644 client/containers/workflow-list/constants.js delete mode 100644 client/containers/workflow-list/getter-types.js delete mode 100644 client/containers/workflow-list/getters.js delete mode 100644 client/containers/workflow-list/getters.spec.js delete mode 100644 client/containers/workflow-list/helpers/get-criteria.js delete mode 100644 client/containers/workflow-list/helpers/get-criteria.spec.js delete mode 100644 client/containers/workflow-list/helpers/get-fetch-workflow-list-url.js delete mode 100644 client/containers/workflow-list/helpers/get-fetch-workflow-list-url.spec.js delete mode 100644 client/containers/workflow-list/helpers/get-filter-by.js delete mode 100644 client/containers/workflow-list/helpers/get-filter-by.spec.js delete mode 100644 client/containers/workflow-list/helpers/get-filter-mode-button-label.js delete mode 100644 client/containers/workflow-list/helpers/get-filter-mode-button-label.spec.js delete mode 100644 client/containers/workflow-list/helpers/get-formatted-results.js delete mode 100644 client/containers/workflow-list/helpers/get-formatted-results.spec.js delete mode 100644 client/containers/workflow-list/helpers/get-is-cron.js delete mode 100644 client/containers/workflow-list/helpers/get-min-start-date.js delete mode 100644 client/containers/workflow-list/helpers/get-min-start-date.spec.js delete mode 100644 client/containers/workflow-list/helpers/get-state.js delete mode 100644 client/containers/workflow-list/helpers/get-state.spec.js delete mode 100644 client/containers/workflow-list/helpers/get-status.js delete mode 100644 client/containers/workflow-list/helpers/get-status.spec.js delete mode 100644 client/containers/workflow-list/helpers/index.js delete mode 100644 client/containers/workflow-list/helpers/is-range-valid.js delete mode 100644 client/containers/workflow-list/helpers/is-range-valid.spec.js delete mode 100644 client/containers/workflow-list/helpers/is-route-range-valid.js delete mode 100644 client/containers/workflow-list/helpers/is-route-range-valid.spec.js delete mode 100644 client/containers/workflow-list/helpers/toggle-filter-mode.js delete mode 100644 client/containers/workflow-list/helpers/toggle-filter-mode.spec.js delete mode 100644 client/containers/workflow-list/index.js delete mode 100644 client/containers/workflow-pending/action-types.js delete mode 100644 client/containers/workflow-pending/actions.js delete mode 100644 client/containers/workflow-pending/actions.spec.js delete mode 100644 client/containers/workflow-pending/component.vue delete mode 100644 client/containers/workflow-pending/components/index.js delete mode 100644 client/containers/workflow-pending/components/pending-task-list-item.vue delete mode 100644 client/containers/workflow-pending/connector.js delete mode 100644 client/containers/workflow-pending/constants.js delete mode 100644 client/containers/workflow-pending/getter-types.js delete mode 100644 client/containers/workflow-pending/getters.js delete mode 100644 client/containers/workflow-pending/getters.spec.js delete mode 100644 client/containers/workflow-pending/helpers/get-workflow-link.js delete mode 100644 client/containers/workflow-pending/helpers/index.js delete mode 100644 client/containers/workflow-pending/helpers/map-filter-to-getter-type.js delete mode 100644 client/containers/workflow-pending/helpers/map-pending-task-list.js delete mode 100644 client/containers/workflow-pending/index.js delete mode 100644 client/containers/workflow/component.vue delete mode 100644 client/containers/workflow/connector.js delete mode 100644 client/containers/workflow/constants.js delete mode 100644 client/containers/workflow/get-default-state.js delete mode 100644 client/containers/workflow/get-default-state.spec.js delete mode 100644 client/containers/workflow/getter-types.js delete mode 100644 client/containers/workflow/getters.js delete mode 100644 client/containers/workflow/getters.spec.js delete mode 100644 client/containers/workflow/helpers/event-full-transforms.js delete mode 100644 client/containers/workflow/helpers/event-full-transforms.spec.js delete mode 100644 client/containers/workflow/helpers/get-event-details.js delete mode 100644 client/containers/workflow/helpers/get-event-details.spec.js delete mode 100644 client/containers/workflow/helpers/get-event-full-details.js delete mode 100644 client/containers/workflow/helpers/get-event-full-details.spec.js delete mode 100644 client/containers/workflow/helpers/get-event-kvps-highlight.js delete mode 100644 client/containers/workflow/helpers/get-event-kvps-highlight.spec.js delete mode 100644 client/containers/workflow/helpers/get-event-summary.js delete mode 100644 client/containers/workflow/helpers/get-event-summary.spec.js delete mode 100644 client/containers/workflow/helpers/get-history-events.js delete mode 100644 client/containers/workflow/helpers/get-history-timeline-events.js delete mode 100644 client/containers/workflow/helpers/get-summary-workflow-status.js delete mode 100644 client/containers/workflow/helpers/get-summary-workflow-status.spec.js delete mode 100644 client/containers/workflow/helpers/get-summary.js delete mode 100644 client/containers/workflow/helpers/get-time-elapsed-display.js delete mode 100644 client/containers/workflow/helpers/get-time-elapsed-display.spec.js delete mode 100644 client/containers/workflow/helpers/get-time-stamp-display.js delete mode 100644 client/containers/workflow/helpers/get-time-stamp-display.spec.js delete mode 100644 client/containers/workflow/helpers/index.js delete mode 100644 client/containers/workflow/helpers/map-timeline-events.js delete mode 100644 client/containers/workflow/helpers/parent-workflow-link.js delete mode 100644 client/containers/workflow/helpers/parent-workflow-link.spec.js delete mode 100644 client/containers/workflow/helpers/summarize-events.js delete mode 100644 client/containers/workflow/helpers/workflow-link.js delete mode 100644 client/containers/workflow/index.js delete mode 100644 client/containers/workflow/mutation-types.js delete mode 100644 client/containers/workflow/mutations.js delete mode 100644 client/containers/workflow/mutations.spec.js delete mode 100644 client/directives/snapscroll.js delete mode 100644 client/helpers/__mocks__/index.js delete mode 100644 client/helpers/combine.js delete mode 100644 client/helpers/delay.js delete mode 100644 client/helpers/get-datetime-formatted-string.js delete mode 100644 client/helpers/get-datetime-formatted-string.spec.js delete mode 100644 client/helpers/get-end-time-iso-string.js delete mode 100644 client/helpers/get-end-time-iso-string.spec.js delete mode 100644 client/helpers/get-environment-list.js delete mode 100644 client/helpers/get-environment-list.spec.js delete mode 100644 client/helpers/get-environment.js delete mode 100644 client/helpers/get-environment.spec.js delete mode 100644 client/helpers/get-error-message.js delete mode 100644 client/helpers/get-error-message.spec.js delete mode 100644 client/helpers/get-expiry-date-time-from-now.js delete mode 100644 client/helpers/get-expiry-date-time-from-now.spec.js delete mode 100644 client/helpers/get-json-string-object.js delete mode 100644 client/helpers/get-key-value-pairs.js delete mode 100644 client/helpers/get-latest-news-items.js delete mode 100644 client/helpers/get-latest-news-items.spec.js delete mode 100644 client/helpers/get-query-string-from-object.js delete mode 100644 client/helpers/get-query-string-from-object.spec.js delete mode 100644 client/helpers/get-start-time-iso-string.js delete mode 100644 client/helpers/get-start-time-iso-string.spec.js delete mode 100644 client/helpers/get-string-elipsis.js delete mode 100644 client/helpers/get-string-elipsis.spec.js delete mode 100644 client/helpers/has-expired.js delete mode 100644 client/helpers/has-expired.spec.js delete mode 100644 client/helpers/index.js delete mode 100644 client/helpers/inject-moment-duration-format.js delete mode 100644 client/helpers/json-try-parse.js delete mode 100644 client/helpers/map-domain-description.js delete mode 100644 client/helpers/map-domain-description.spec.js delete mode 100644 client/helpers/parse-string-to-boolean.js delete mode 100644 client/helpers/parse-string-to-boolean.spec.js delete mode 100644 client/helpers/short-name.js delete mode 100644 client/helpers/workflow-history-event-highlight-list-add-or-update.js delete mode 100644 client/helpers/workflow-history-event-highlight-list-add-or-update.spec.js delete mode 100644 client/helpers/workflow-history-event-highlight-list-find-index-by-id.js delete mode 100644 client/helpers/workflow-history-event-highlight-list-find-index-by-id.spec.js delete mode 100644 client/helpers/workflow-history-event-highlight-list-remove.js delete mode 100644 client/helpers/workflow-history-event-highlight-list-remove.spec.js delete mode 100644 client/main.js delete mode 100644 client/routes/domain-search/index.vue delete mode 100644 client/routes/domain/domain-metrics.vue delete mode 100644 client/routes/domain/domain-service.js delete mode 100644 client/routes/domain/domain-settings.vue delete mode 100644 client/routes/domain/index.vue delete mode 100644 client/routes/domain/workflow-archival/advanced.vue delete mode 100644 client/routes/domain/workflow-archival/basic.vue delete mode 100644 client/routes/domain/workflow-archival/components/archival-disabled-messaging/constants.js delete mode 100644 client/routes/domain/workflow-archival/components/archival-disabled-messaging/index.vue delete mode 100644 client/routes/domain/workflow-archival/components/archival-table-row.vue delete mode 100644 client/routes/domain/workflow-archival/components/archival-table.vue delete mode 100644 client/routes/domain/workflow-archival/components/index.js delete mode 100644 client/routes/domain/workflow-archival/constants.js delete mode 100644 client/routes/domain/workflow-archival/helpers/get-domain.js delete mode 100644 client/routes/domain/workflow-archival/helpers/get-domain.spec.js delete mode 100644 client/routes/domain/workflow-archival/helpers/get-history-archival-status.js delete mode 100644 client/routes/domain/workflow-archival/helpers/get-history-archival-status.spec.js delete mode 100644 client/routes/domain/workflow-archival/helpers/get-query-params.js delete mode 100644 client/routes/domain/workflow-archival/helpers/get-query-params.spec.js delete mode 100644 client/routes/domain/workflow-archival/helpers/get-query-params.spec.js delete mode 100644 client/routes/domain/workflow-archival/helpers/get-range.js delete mode 100644 client/routes/domain/workflow-archival/helpers/get-range.spec.js delete mode 100644 client/routes/domain/workflow-archival/helpers/get-status-value.js delete mode 100644 client/routes/domain/workflow-archival/helpers/get-status-value.spec.js delete mode 100644 client/routes/domain/workflow-archival/helpers/get-status.js delete mode 100644 client/routes/domain/workflow-archival/helpers/get-status.spec.js delete mode 100644 client/routes/domain/workflow-archival/helpers/get-visibility-archival-status.js delete mode 100644 client/routes/domain/workflow-archival/helpers/get-visibility-archival-status.spec.js delete mode 100644 client/routes/domain/workflow-archival/helpers/index.js delete mode 100644 client/routes/domain/workflow-archival/helpers/is-archival-enabled.js delete mode 100644 client/routes/domain/workflow-archival/helpers/is-archival-enabled.spec.js delete mode 100644 client/routes/domain/workflow-archival/helpers/is-history-archival-enabled.js delete mode 100644 client/routes/domain/workflow-archival/helpers/is-history-archival-enabled.spec.js delete mode 100644 client/routes/domain/workflow-archival/helpers/is-visibility-archival-enabled.js delete mode 100644 client/routes/domain/workflow-archival/helpers/is-visibility-archival-enabled.spec.js delete mode 100644 client/routes/domain/workflow-archival/helpers/map-archived-workflow-response.js delete mode 100644 client/routes/domain/workflow-archival/helpers/map-archived-workflow-response.spec.js delete mode 100644 client/routes/domain/workflow-archival/helpers/replace-domain.js delete mode 100644 client/routes/domain/workflow-archival/helpers/replace-domain.spec.js delete mode 100644 client/routes/domain/workflow-archival/helpers/update-query-from-range.js delete mode 100644 client/routes/domain/workflow-archival/helpers/update-query-from-range.spec.js delete mode 100644 client/routes/domain/workflow-archival/index.vue delete mode 100644 client/routes/domain/workflow-archival/workflow-archival-service.js delete mode 100644 client/routes/domain/workflow-archival/workflow-archival-service.spec.js delete mode 100644 client/routes/help/constants.js delete mode 100644 client/routes/help/index.vue delete mode 100644 client/routes/index.vue delete mode 100644 client/routes/news/helpers/get-iframe-src.js delete mode 100644 client/routes/news/helpers/get-iframe-src.spec.js delete mode 100644 client/routes/news/helpers/get-updated-iframe-location.js delete mode 100644 client/routes/news/helpers/get-updated-iframe-location.spec.js delete mode 100644 client/routes/news/helpers/index.js delete mode 100644 client/routes/news/index.vue delete mode 100644 client/routes/task-list/components/partition-table.vue delete mode 100644 client/routes/task-list/index.vue delete mode 100644 client/routes/task-list/metrics.vue delete mode 100644 client/routes/task-list/partition.vue delete mode 100644 client/routes/task-list/pollers.vue delete mode 100644 client/routes/workflow/constants.js delete mode 100644 client/routes/workflow/helpers/get-query-result.js delete mode 100644 client/routes/workflow/helpers/index.js delete mode 100644 client/routes/workflow/query.vue delete mode 100644 client/routes/workflow/stack-trace.vue delete mode 100644 client/routes/workflow/summary.vue delete mode 100644 client/services/feature-flag-service.js delete mode 100644 client/services/http-service.js delete mode 100644 client/services/index.js delete mode 100644 client/store/index.js delete mode 100644 client/styles/animations.styl delete mode 100644 client/styles/base.styl delete mode 100644 client/styles/code.styl delete mode 100644 client/styles/definitions.styl delete mode 100644 client/styles/modal.styl delete mode 100644 client/styles/reset.styl delete mode 100644 client/styles/vis.styl delete mode 100644 client/test/.eslintrc delete mode 100644 client/test/domain-search.test.js delete mode 100644 client/test/domain-settings.test.js delete mode 100644 client/test/domain.test.js delete mode 100644 client/test/fixtures.js delete mode 100644 client/test/help.test.js delete mode 100644 client/test/helpers/get-fixture.js delete mode 100644 client/test/helpers/index.js delete mode 100644 client/test/index.js delete mode 100644 client/test/lint/license/LICENSE_FILE_DOES_NOT_EXIST delete mode 100644 client/test/lint/license/LICENSE_FILE_MODIFIED delete mode 100644 client/test/lint/license/LICENSE_FILE_NEW delete mode 100644 client/test/lint/license/LICENSE_FILE_UNMODIFIED delete mode 100644 client/test/lint/license/test-license-file-does-not-exist.vue delete mode 100644 client/test/lint/license/test-license-file-modified.vue delete mode 100644 client/test/lint/license/test-license-file-new.vue delete mode 100644 client/test/lint/license/test-license-file-unmodified.vue delete mode 100644 client/test/scenario.js delete mode 100644 client/test/task-list.test.js delete mode 100644 client/test/workflow-list.test.js delete mode 100644 client/test/workflow.test.js create mode 100644 docker-compose.prod.yml delete mode 100644 favicon.ico delete mode 100644 jest.config.js delete mode 100755 news/.gitignore delete mode 100644 news/blog/.vuepress/components/index.js delete mode 100644 news/blog/.vuepress/components/release-notes-link.vue delete mode 100644 news/blog/.vuepress/components/release-notes.vue delete mode 100755 news/blog/.vuepress/config.js delete mode 100755 news/blog/.vuepress/enhanceApp.js delete mode 100644 news/blog/.vuepress/helpers/get-github-api.js delete mode 100644 news/blog/.vuepress/helpers/get-github-link.js delete mode 100644 news/blog/.vuepress/helpers/index.js delete mode 100755 news/blog/.vuepress/styles/index.styl delete mode 100644 news/blog/.vuepress/styles/palette.styl delete mode 100644 news/blog/_posts/2020-06-03-cadence-docs.md delete mode 100644 news/blog/_posts/2020-06-03-cadence-go-0-12-0.md delete mode 100644 news/blog/_posts/2020-06-03-cadence-java-2-7-1.md delete mode 100644 news/blog/_posts/2020-06-03-cadence-server-0-12-0.md delete mode 100644 news/blog/_posts/2020-06-03-cadence-ui-3-16-0.md delete mode 100644 news/blog/_posts/2020-06-11-cadence-ui-3-17-0.md delete mode 100644 news/blog/_posts/2020-07-07-cadence-server-0-13-0.md delete mode 100644 news/blog/_posts/2020-07-12-cadence-go-0-13-0.md delete mode 100644 news/blog/_posts/2020-07-17-cadence-ui-3-18-0.md delete mode 100644 news/blog/_posts/2020-07-28-cadence-ui-3-19-0.md delete mode 100644 news/blog/_posts/2021-02-25-cadence-go-0-16-0.md delete mode 100644 news/blog/_posts/2021-02-25-cadence-server-0-18-0.md delete mode 100644 news/blog/_posts/2021-02-25-cadence-ui-3-23-0.md delete mode 100644 news/blog/_posts/2021-04-19-cadence-java-3-0-0.md delete mode 100644 news/blog/_posts/2021-04-19-cadence-server-0-20-0.md delete mode 100644 news/blog/_posts/2021-04-19-cadence-ui-3-25-0.md delete mode 100644 news/package-lock.json delete mode 100755 news/package.json create mode 100644 next.config.mjs delete mode 100644 package-lock.json create mode 100644 pnpm-lock.yaml create mode 100644 public/next.svg create mode 100644 public/vercel.svg delete mode 100644 server.js delete mode 100644 server/.eslintrc delete mode 100644 server/constants.js delete mode 100644 server/feature-flags.json delete mode 100644 server/helpers/combine.js delete mode 100644 server/helpers/index.js delete mode 100644 server/index.js delete mode 100644 server/middleware/grpc-client/configuration.js delete mode 100644 server/middleware/grpc-client/format-request/format-long-to-timestamp.js delete mode 100644 server/middleware/grpc-client/format-request/format-long-to-timestamp.spec.js delete mode 100644 server/middleware/grpc-client/format-request/format-request-default.js delete mode 100644 server/middleware/grpc-client/format-request/format-request-describe-task-list.js delete mode 100644 server/middleware/grpc-client/format-request/format-request-get-history.js delete mode 100644 server/middleware/grpc-client/format-request/format-request-workflow-list.js delete mode 100644 server/middleware/grpc-client/format-request/index.js delete mode 100644 server/middleware/grpc-client/format-response/format-duration-to-seconds.js delete mode 100644 server/middleware/grpc-client/format-response/format-enum.js delete mode 100644 server/middleware/grpc-client/format-response/format-enum.spec.js delete mode 100644 server/middleware/grpc-client/format-response/format-failure-details.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-activity-task-cancel-requested-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-activity-task-canceled-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-activity-task-completed-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-activity-task-failed-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-activity-task-scheduled-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-activity-task-started-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-activity-task-timed-out-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-cancel-timer-failed-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-child-workflow-execution-canceled-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-child-workflow-execution-completed-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-child-workflow-execution-failed-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-child-workflow-execution-started-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-child-workflow-execution-terminated-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-child-workflow-execution-timed-out-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-decision-task-completed-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-decision-task-failed-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-decision-task-scheduled-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-decision-task-started-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-decision-task-timed-out-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-external-workflow-execution-cancel-requested-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-external-workflow-execution-signaled-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-marker-recorded-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-prev-auto-reset-points.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-request-cancel-activity-task-failed-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-request-cancel-external-workflow-execution-failed-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-request-cancel-external-workflow-execution-initiated-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-retry-policy.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-signal-external-workflow-execution-failed-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-signal-external-workflow-execution-initiated-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-start-child-workflow-execution-failed-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-start-child-workflow-execution-initiated-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-timer-canceled-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-timer-fired-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-timer-started-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-upsert-workflow-search-attributes-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-workflow-execution-cancel-requested-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-workflow-execution-canceled-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-workflow-execution-completed-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-workflow-execution-continued-as-new-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-workflow-execution-failed-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-workflow-execution-signaled-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-workflow-execution-started-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/format-workflow-execution-terminated-event-attributes.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-details/index.js delete mode 100644 server/middleware/grpc-client/format-response/format-history-event-type.js delete mode 100644 server/middleware/grpc-client/format-response/format-payload-map.js delete mode 100644 server/middleware/grpc-client/format-response/format-payload.js delete mode 100644 server/middleware/grpc-client/format-response/format-response-default.js delete mode 100644 server/middleware/grpc-client/format-response/format-response-describe-task-list.js delete mode 100644 server/middleware/grpc-client/format-response/format-response-describe-workflow.js delete mode 100644 server/middleware/grpc-client/format-response/format-response-domain.js delete mode 100644 server/middleware/grpc-client/format-response/format-response-export-history.js delete mode 100644 server/middleware/grpc-client/format-response/format-response-get-history.js delete mode 100644 server/middleware/grpc-client/format-response/format-response-list-domains.js delete mode 100644 server/middleware/grpc-client/format-response/format-response-query-workflow.js delete mode 100644 server/middleware/grpc-client/format-response/format-response-signal-workflow-execution.js delete mode 100644 server/middleware/grpc-client/format-response/format-response-terminate-workflow-execution.js delete mode 100644 server/middleware/grpc-client/format-response/format-response-workflow-list.js delete mode 100644 server/middleware/grpc-client/format-response/format-timestamp-to-datetime.js delete mode 100644 server/middleware/grpc-client/format-response/format-timestamp-to-long.js delete mode 100644 server/middleware/grpc-client/format-response/index.js delete mode 100644 server/middleware/grpc-client/index.js delete mode 100644 server/middleware/grpc-client/transform/cli-transform.js delete mode 100644 server/middleware/grpc-client/transform/cli-transform.spec.js delete mode 100644 server/middleware/grpc-client/transform/index.js delete mode 100644 server/middleware/grpc-client/transform/transform-default.js delete mode 100644 server/middleware/grpc-client/transform/with-domain.js delete mode 100644 server/middleware/grpc-client/transform/with-pagination.js delete mode 100644 server/middleware/grpc-client/transform/with-workflow-execution.js delete mode 100644 server/middleware/tchannel-client/helpers/cli-transform.js delete mode 100644 server/middleware/tchannel-client/helpers/format-body.js delete mode 100644 server/middleware/tchannel-client/helpers/format-method.js delete mode 100644 server/middleware/tchannel-client/helpers/format-request-name.js delete mode 100644 server/middleware/tchannel-client/helpers/index.js delete mode 100644 server/middleware/tchannel-client/helpers/lookup-async.js delete mode 100644 server/middleware/tchannel-client/helpers/make-channels.js delete mode 100644 server/middleware/tchannel-client/helpers/make-request.js delete mode 100644 server/middleware/tchannel-client/helpers/ui-transform.js delete mode 100644 server/middleware/tchannel-client/helpers/with-domain-paging.js delete mode 100644 server/middleware/tchannel-client/helpers/with-next-page-token-body-transform.js delete mode 100644 server/middleware/tchannel-client/helpers/with-verbose-workflow-execution.js delete mode 100644 server/middleware/tchannel-client/helpers/with-workflow-execution.js delete mode 100644 server/middleware/tchannel-client/index.js delete mode 100644 server/router/constants.js delete mode 100644 server/router/helpers/build-query-string.js delete mode 100644 server/router/helpers/build-query-string.spec.js delete mode 100644 server/router/helpers/delay.js delete mode 100644 server/router/helpers/index.js delete mode 100644 server/router/helpers/inject-domain-into-workflow-list.js delete mode 100644 server/router/helpers/is-advanced-visibility-enabled.js delete mode 100644 server/router/helpers/is-advanced-visibility-enabled.spec.js delete mode 100644 server/router/helpers/list-workflows.js delete mode 100644 server/router/helpers/map-history-response.js delete mode 100644 server/router/helpers/moment-to-long.js delete mode 100644 server/router/helpers/replacer.js delete mode 100644 server/router/index.js delete mode 100644 server/router/managers/cache-manager.js delete mode 100644 server/router/managers/cache-manager.spec.js delete mode 100644 server/router/managers/index.js delete mode 100644 server/router/routes/clear-cache-handler.js delete mode 100644 server/router/routes/cluster-handler.js delete mode 100644 server/router/routes/domain-authorization-handler.js delete mode 100644 server/router/routes/domain-handler.js delete mode 100644 server/router/routes/domain-list-handler.js delete mode 100644 server/router/routes/feature-flag-handler.js delete mode 100644 server/router/routes/health-handler.js delete mode 100644 server/router/routes/index.js delete mode 100644 server/router/routes/tasklist-handler.js delete mode 100644 server/router/routes/tasklist-partition-list-handler.js delete mode 100644 server/router/routes/tasklist-poller-list-handler.js delete mode 100644 server/router/routes/workflow-archived-list-handler.js delete mode 100644 server/router/routes/workflow-export-handler.js delete mode 100644 server/router/routes/workflow-handler.js delete mode 100644 server/router/routes/workflow-history-handler.js delete mode 100644 server/router/routes/workflow-list-handler.js delete mode 100644 server/router/routes/workflow-query-handler.js delete mode 100644 server/router/routes/workflow-query-type-handler.js delete mode 100644 server/router/routes/workflow-signal-handler.js delete mode 100644 server/router/routes/workflow-terminate-handler.js delete mode 100644 server/router/services/cluster-service.js delete mode 100644 server/router/services/cluster-service.spec.js delete mode 100644 server/router/services/domain-service/constants.js delete mode 100644 server/router/services/domain-service/helpers/fetch-domain-list-next-page.js delete mode 100644 server/router/services/domain-service/helpers/fetch-domain-list-next-page.spec.js delete mode 100644 server/router/services/domain-service/helpers/fetch-domain-list.js delete mode 100644 server/router/services/domain-service/helpers/filter-domain-list.js delete mode 100644 server/router/services/domain-service/helpers/filter-domain-list.spec.js delete mode 100644 server/router/services/domain-service/helpers/get-domain-list.js delete mode 100644 server/router/services/domain-service/helpers/get-matching-domains.js delete mode 100644 server/router/services/domain-service/helpers/get-matching-domains.spec.js delete mode 100644 server/router/services/domain-service/helpers/index.js delete mode 100644 server/router/services/domain-service/helpers/sort-domain-list.js delete mode 100644 server/router/services/domain-service/helpers/sort-domain-list.spec.js delete mode 100644 server/router/services/domain-service/index.js delete mode 100644 server/router/services/index.js delete mode 100644 server/test/.eslintrc delete mode 100644 server/test/cadence-frontend-simulator.js delete mode 100644 server/test/domain.test.js delete mode 100644 server/test/history.test.js delete mode 100644 server/test/mock-grpc.js delete mode 100644 server/test/mock-tchannel.js delete mode 100644 server/test/query-workflow.test.js delete mode 100644 server/test/task-list.test.js delete mode 100644 server/test/workflow-execution.test.js delete mode 100644 server/test/workflows.test.js create mode 100644 src/app/StyletronProviderWrapper.tsx rename news/blog/.vuepress/styles/global.styl => src/app/domains/page.module.css (100%) mode change 100755 => 100644 create mode 100644 src/app/domains/page.tsx create mode 100644 src/app/favicon.ico create mode 100644 src/app/globals.css create mode 100644 src/app/layout.tsx create mode 100644 src/app/page.module.css create mode 100644 src/app/page.tsx create mode 100644 src/app/registry.tsx create mode 100644 src/components/test-component/test-component.tsx create mode 100644 src/components/test-table/test-table.tsx create mode 100644 src/styletron.ts create mode 100644 src/utils/grpc-client.ts rename server/middleware/grpc-client/grpc-service.js => src/utils/grpc-service.ts (56%) delete mode 100644 test/helpers/index.js delete mode 100644 test/helpers/init-getters.js delete mode 100644 test/helpers/init-store.js delete mode 100644 test/setup.js create mode 100644 tsconfig.json delete mode 100644 webpack.config.js diff --git a/.docker_env b/.docker_env index ae33516e8..b68ed7c33 100644 --- a/.docker_env +++ b/.docker_env @@ -1,6 +1,6 @@ NODE_ENV=development -CADENCE_TCHANNEL_PEERS="127.0.0.1:7933" -CADENCE_TCHANNEL_SERVICE=cadence-frontend +CADENCE_GRPC_PEERS="127.0.0.1:7833" +CADENCE_GRPC_SERVICE=cadence-frontend CADENCE_WEB_PORT=8088 CADENCE_EXTERNAL_SCRIPTS="" ENABLE_AUTH=false diff --git a/.gitignore b/.gitignore index 04e2f4bba..2350a7ed1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,39 @@ -node_modules/ -npm-debug.log -dist/ -.vscode +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js +.yarn/install-state.gz + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc .DS_Store -.idea -server/idl +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts + +#idl +src/idl diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 56a920d84..69ffa825d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,24 +15,3 @@ You also need to run [cadence-server](https://github.com/uber/cadence) locally o ## Working with the source code Follow [this great guide](https://gist.github.com/Chaser324/ce0505fbed06b947d962) on how to work with a GitHub fork and submit a pull request. - -## Building - -The standard node.js workflow is used here. Use Node version 10. Version 12 is unable to install the -[farmhash](https://www.npmjs.com/package/farmhash) package. - -``` -npm i -npm run dev # webpack hot reload environment -npm start # for production -``` - -## Testing - -Start up the webserver for testing via: - -``` -npm run test-server -``` - -The open `localhost:8090` in the browser of your choice, or use `npm test` to run it with [mocha-chrome](https://www.npmjs.com/package/mocha-chrome) from the command line. This runs the tests via Chrome in headless mode and shows the results in your terminal. diff --git a/Dockerfile b/Dockerfile index 2d204763f..aa32a6a2b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,34 +1,72 @@ -FROM node:fermium-bullseye AS BUILD_IMAGE +FROM node:18-alpine AS base -### Build step ### -WORKDIR /usr/build +# Install dependencies only when needed +FROM base AS deps +# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. +RUN apk add --no-cache libc6-compat +WORKDIR /app -# Bundle app source +# Install dependencies based on the preferred package manager +COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ +RUN \ + if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ + elif [ -f package-lock.json ]; then npm ci; \ + elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \ + else echo "Lockfile not found." && exit 1; \ + fi + + +FROM base AS dev + +WORKDIR /app +COPY --from=deps /app/node_modules ./node_modules +COPY . . + + + +# Rebuild the source code only when needed +FROM base AS builder +WORKDIR /app +COPY --from=deps /app/node_modules ./node_modules COPY . . -# Install app dependencies -RUN npm install --no-save --production --unsafe-perm +# Next.js collects completely anonymous telemetry data about general usage. +# Learn more here: https://nextjs.org/telemetry +# Uncomment the following line in case you want to disable telemetry during the build. +ENV NEXT_TELEMETRY_DISABLED 1 + +RUN \ + if [ -f yarn.lock ]; then yarn run build; \ + elif [ -f package-lock.json ]; then npm run build; \ + elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \ + else echo "Lockfile not found." && exit 1; \ + fi + + +# Production image, copy all the files and run next +FROM base AS runner +WORKDIR /app + +ENV NODE_ENV production +# Uncomment the following line in case you want to disable telemetry during runtime. +ENV NEXT_TELEMETRY_DISABLED 1 + +RUN addgroup --system --gid 1001 nodejs +RUN adduser --system --uid 1001 nextjs + +COPY --from=builder /app/public ./public -# Bundle the client code -RUN npm run build-production -# switch to lite version of node -FROM node:fermium-bullseye-slim +# Set the correct permission for prerender cache +RUN mkdir .next +RUN chown nextjs:nodejs .next -### Run step ### -WORKDIR /usr/app +# Automatically leverage output traces to reduce image size +# https://nextjs.org/docs/advanced-features/output-file-tracing +COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ +COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static -# copy from build image -COPY --from=BUILD_IMAGE /usr/build/server.js ./ -COPY --from=BUILD_IMAGE /usr/build/webpack.config.js ./ -COPY --from=BUILD_IMAGE /usr/build/dist ./dist -COPY --from=BUILD_IMAGE /usr/build/server ./server -COPY --from=BUILD_IMAGE /usr/build/node_modules ./node_modules +USER nextjs -# setup production environment variables -ENV NODE_ENV=production -ENV NPM_CONFIG_PRODUCTION=true -# run node server -EXPOSE 8088 -CMD [ "node", "server.js" ] +CMD ["node", "server.js"] \ No newline at end of file diff --git a/README.md b/README.md index b9b9d342b..c4033664f 100644 --- a/README.md +++ b/README.md @@ -1,86 +1,36 @@ -# Cadence Web UI - -[![Build Status](https://github.com/uber/cadence-web/actions/workflows/build.yml/badge.svg)](https://github.com/uber/cadence-web/actions/workflows/build.yml) [![Docker Status](https://github.com/uber/cadence-web/actions/workflows/docker_publish.yml/badge.svg)](https://hub.docker.com/r/ubercadence/web/tags) - -Cadence is a distributed, scalable, durable, and highly available orchestration engine we developed at Uber Engineering to execute asynchronous long-running business logic in a scalable and resilient way. - -This web UI is used to view workflows from [Cadence][cadence], see what's running, and explore and debug workflow executions. - -![Demo Usage](https://s3-us-west-2.amazonaws.com/uber-common-public/svc-cadence-web/cadence-web.demo.gif) +This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). ## Getting Started -### Configuration - -Set these environment variables if you need to change their defaults - -| Variable | Description | Default | -| -------------------------- | -------------------------------------------- | ---------------- | -| CADENCE_TCHANNEL_PEERS | Comma-delmited list of tchannel peers | 127.0.0.1:7933 | -| CADENCE_TCHANNEL_SERVICE | Name of the cadence tchannel service to call | cadence-frontend | -| CADENCE_WEB_PORT | HTTP port to serve on | 8088 | -| CADENCE_EXTERNAL_SCRIPTS | Addtional JavaScript tags to serve in the UI | | -| ENABLE_AUTH | Enable auth feature | false | -| AUTH_TYPE | concurrently supports ADMIN_JWT | '' | -| AUTH_ADMIN_JWT_PRIVATE_KEY | JWT signing private key for ADMIN_JWT type | '' | - -### Running locally - -`cadence-web` requires node `v10.22.1` or greater to be able to run correctly. `cadence-web` uses all the standard [npm scripts](https://docs.npmjs.com/misc/scripts) to install dependencies, run the -server, and run tests. - -To provide a consistent environment we recommend using docker in development. We provide a default configuration for remote containers using docker-compose. - -#### Using VSCode Dev Containers +First, run the development server: -1. Set up the [Remote Containers plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) in VSCode. -2. Open the cadence-web directory in VSCode. -3. Use the Command Palette to select the 'Reopen folder in Container' option. `npm install` should run automatically in the container upon doing so. -4. Run the app in the container with `npm run dev`. -5. Open `localhost:8088` (or the custom Cadence Web port you have defined) to load the webapp. - -#### Using docker-compose to start the dev container - -To start local server with live reload on code change you can run `docker-compose up`. - -For development and contributing to `cadence-web`, please see the [contributing guide](https://github.com/uber/cadence-web/blob/master/CONTRIBUTING.md). - -You may also use docker by pulling [ubercadence/web](https://hub.docker.com/r/ubercadence/web/). It is also included in the Cadence server's [local docker setup](https://github.com/uber/cadence/tree/master/docker). - -### API - -If you need to extend `cadence-web` to add middleware to the server, you can install `cadence-web` as a dependecy, and it will export the [Koa](http://koajs.com/) web server that has not yet been started or configured. It includes an additional `init` function that will then compose the built-in middleware. This gives you an option to add middleware before or after you call `init` so it will add the middleware at the beginning or the end of the chain, respectively. - -#### `init(options)` +```bash +npm run dev +# or +yarn dev +# or +pnpm dev +# or +bun dev +``` -All options are optional. +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. -`useWebpack`: If `true`, starts webpack and adds the middleware, otherwise if `false`, it assumes the UI bundle was already built and serves it statically. Defaults to `process.env.NODE_ENV === 'production'`. +You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. -`logErrors`: If `true`, thrown errors are logged to `console.error`. Defaults to `true`. +This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. -For example, here is how you would add a request count metric using `uber-statsd-client`: +## Learn More -```javascript -var app = require('cadence-web'); -var createStatsd = require('uber-statsd-client'); -var sdc = createStatsd({ - host: 'statsd.example.com', -}); +To learn more about Next.js, take a look at the following resources: -app - .use(async function(ctx, next) { - sdc.increment('http.request'); - await next(); - }) - .init() - .listen(7000); -``` +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. -The [webpack](https://webpack.js.org/) configuration is also exported as `webpackConfig`, and can be modified before calling `init()`. +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! -### Licence +## Deploy on Vercel -MIT License, please see [LICENSE](https://github.com/uber/cadence-web/blob/master/LICENSE) for details. +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. -[cadence]: https://github.com/uber/cadence +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index addec3b19..000000000 --- a/babel.config.js +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -module.exports = { - plugins: [ - [ - 'module-resolver', - { - alias: { - '~components': './client/components', - '~constants': './client/constants', - '~containers': './client/containers', - '~helpers': './client/helpers', - '~services': './client/services', - '~test': './test/helpers', - }, - }, - ], - ['@babel/plugin-transform-regenerator'], - ], - presets: [ - [ - 'env', - { - targets: { - node: 'current', - }, - }, - ], - '@babel/preset-env', - ], -}; diff --git a/client/.eslintrc b/client/.eslintrc deleted file mode 100644 index add3c22fb..000000000 --- a/client/.eslintrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "env": { - "browser": true - }, - "parserOptions": { - "sourceType": "module" - } -} \ No newline at end of file diff --git a/client/App.vue b/client/App.vue deleted file mode 100644 index f3974e58b..000000000 --- a/client/App.vue +++ /dev/null @@ -1,497 +0,0 @@ - - - - - - - - diff --git a/client/assets/logo.svg b/client/assets/logo.svg deleted file mode 100644 index 75f0b2bce..000000000 --- a/client/assets/logo.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - adence - diff --git a/client/components/autocomplete.vue b/client/components/autocomplete.vue deleted file mode 100644 index befc9468a..000000000 --- a/client/components/autocomplete.vue +++ /dev/null @@ -1,203 +0,0 @@ - - - - - diff --git a/client/components/bar-loader.vue b/client/components/bar-loader.vue deleted file mode 100644 index 38a22b34e..000000000 --- a/client/components/bar-loader.vue +++ /dev/null @@ -1,64 +0,0 @@ - - - - - diff --git a/client/components/button-fill.vue b/client/components/button-fill.vue deleted file mode 100644 index 467341688..000000000 --- a/client/components/button-fill.vue +++ /dev/null @@ -1,221 +0,0 @@ - - - - - diff --git a/client/components/button-group.vue b/client/components/button-group.vue deleted file mode 100644 index 724c53218..000000000 --- a/client/components/button-group.vue +++ /dev/null @@ -1,81 +0,0 @@ - - - - - diff --git a/client/components/button-icon.vue b/client/components/button-icon.vue deleted file mode 100644 index 397d11d60..000000000 --- a/client/components/button-icon.vue +++ /dev/null @@ -1,123 +0,0 @@ - - - - - diff --git a/client/components/copy.vue b/client/components/copy.vue deleted file mode 100644 index ac0e391f6..000000000 --- a/client/components/copy.vue +++ /dev/null @@ -1,75 +0,0 @@ - - - - - diff --git a/client/components/data-viewer.vue b/client/components/data-viewer.vue deleted file mode 100644 index 03422d387..000000000 --- a/client/components/data-viewer.vue +++ /dev/null @@ -1,149 +0,0 @@ - - - - - diff --git a/client/components/date-range-picker/constants.js b/client/components/date-range-picker/constants.js deleted file mode 100644 index 200905970..000000000 --- a/client/components/date-range-picker/constants.js +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const ALLOWED_PERIOD_TYPES = [ - 'second', - 'seconds', - 'minute', - 'minutes', - 'hour', - 'hours', - 'day', - 'days', - 'month', - 'months', -]; - -export const DATETIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'; - -export const RANGE_OPTIONS = [ - { text: 'Last 10 minutes', value: 'last-10-minutes', daysAgo: 0.007 }, - { text: 'Last 60 minutes', value: 'last-60-minutes', daysAgo: 0.041 }, - { text: 'Last 3 hours', value: 'last-3-hours', daysAgo: 0.125 }, - { text: 'Last 24 hours', value: 'last-24-hours', daysAgo: 1 }, - { text: 'Last 3 days', value: 'last-3-days', daysAgo: 3 }, - { text: 'Last 7 days', value: 'last-7-days', daysAgo: 7 }, - { text: 'Last 30 days', value: 'last-30-days', daysAgo: 30 }, - { text: 'Last 3 months', value: 'last-3-months', daysAgo: 90 }, -]; diff --git a/client/components/date-range-picker/helpers.js b/client/components/date-range-picker/helpers.js deleted file mode 100644 index 45a9923ee..000000000 --- a/client/components/date-range-picker/helpers.js +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; -import { - ALLOWED_PERIOD_TYPES, - DATETIME_FORMAT, - RANGE_OPTIONS, -} from './constants'; - -export const getDateString = date => moment(date).format(DATETIME_FORMAT); - -export const getMaxEndDate = now => moment(now).endOf('day'); - -export const getRange = dateRange => { - if (!dateRange) { - return []; - } - - if (typeof dateRange !== 'string') { - return [dateRange.startTime.toDate(), dateRange.endTime.toDate()]; - } - - const [, count, unit] = dateRange.split('-'); - - const startTime = moment() - .subtract(count, unit) - .startOf(unit) - .toDate(); - - const endTime = moment() - .endOf(unit) - .toDate(); - - return [startTime, endTime]; -}; - -export const getRangeDisplayText = dateRange => { - if (!dateRange) { - return ''; - } - - if (typeof dateRange !== 'string') { - return `${dateRange.startTime.format( - DATETIME_FORMAT - )} - ${dateRange.endTime.format(DATETIME_FORMAT)}`; - } - - const [, count, unit] = dateRange.split('-'); - - const parsedCount = parseInt(count); - - if (!parsedCount) { - return ''; - } - - if (!ALLOWED_PERIOD_TYPES.includes(unit)) { - return ''; - } - - return `Last ${parsedCount} ${unit}`; -}; - -export const getShortcuts = (maxDays, minStartDate) => { - let options = RANGE_OPTIONS; - - if (!minStartDate) { - return options; - } - - if (maxDays && maxDays < 90) { - options = options.filter(o => o.daysAgo < maxDays); - const periodType = maxDays === 1 ? 'day' : 'days'; - - const option = { - daysAgo: maxDays, - text: `Last ${maxDays} ${periodType}`, - value: `last-${maxDays}-${periodType}`, - }; - - options.push(option); - options.sort((a, b) => a.daysAgo - b.daysAgo); - } - - return options; -}; - -export const getTimePanelLabel = showTimePanel => - showTimePanel ? 'Select date' : 'Select time'; - -export const isDateValid = (date, minStartDate, maxEndDate) => - (date.isValid && - !date.isAfter(maxEndDate) && - !(minStartDate && date.isBefore(minStartDate))) || - false; - -export const isDayDisabled = minStartDate => date => { - const momentDate = moment(date); - - if (minStartDate) { - if (momentDate.isBefore(minStartDate)) { - return true; - } - } - - return momentDate.isAfter(moment().endOf('day')); -}; diff --git a/client/components/date-range-picker/helpers.spec.js b/client/components/date-range-picker/helpers.spec.js deleted file mode 100644 index 6b22f0f3d..000000000 --- a/client/components/date-range-picker/helpers.spec.js +++ /dev/null @@ -1,601 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; -import { - getDateString, - getMaxEndDate, - getRange, - getRangeDisplayText, - getShortcuts, - getTimePanelLabel, - isDateValid, - isDayDisabled, -} from './helpers'; - -describe('DateRangePicker helpers', () => { - describe('getDateString', () => { - describe('When date = March 10th 2020', () => { - it('should return "2020-03-10 00:00:00".', () => { - const date = moment('2020-03-10 00:00:00'); - const output = getDateString(date); - - expect(output).toEqual('2020-03-10 00:00:00'); - }); - }); - }); - - describe('getMaxEndDate', () => { - describe('When moment is set to March 10th 2020', () => { - beforeEach(() => { - jest - .spyOn(Date, 'now') - .mockImplementation(() => new Date(Date.UTC(2020, 2, 10)).getTime()); - }); - - it('should return date = the end of March 10th 2020.', () => { - const output = getMaxEndDate(); - - expect(output.toISOString()).toEqual('2020-03-10T23:59:59.999Z'); - }); - }); - }); - - describe('getRange', () => { - describe('When dateRange = "".', () => { - it('should return [].', () => { - const dateRange = ''; - const output = getRange(dateRange); - - expect(output).toEqual([]); - }); - }); - - describe('When dateRange = { startTime: March 9th 2020, endTime: March 10th 2020 }.', () => { - const dateRange = { - startTime: moment(new Date(Date.UTC(2020, 2, 9))), - endTime: moment(new Date(Date.UTC(2020, 2, 10))), - }; - - it('should return range[0] = March 9th 2020.', () => { - const output = getRange(dateRange); - - expect(output[0].toISOString()).toEqual('2020-03-09T00:00:00.000Z'); - }); - - it('should return range[1] = March 10th 2020.', () => { - const output = getRange(dateRange); - - expect(output[1].toISOString()).toEqual('2020-03-10T00:00:00.000Z'); - }); - }); - - describe('When moment is set to March 10th 2020', () => { - beforeEach(() => { - jest - .spyOn(Date, 'now') - .mockImplementation(() => new Date(Date.UTC(2020, 2, 10)).getTime()); - }); - - describe('and dateRange = "last-1-second".', () => { - const dateRange = 'last-1-second'; - - it('should return range[0] = "2020-03-09T23:59:59.000Z".', () => { - const output = getRange(dateRange); - - expect(output[0].toISOString()).toEqual('2020-03-09T23:59:59.000Z'); - }); - - it('should return range[1] = "2020-03-10T00:00:00.999Z".', () => { - const output = getRange(dateRange); - - expect(output[1].toISOString()).toEqual('2020-03-10T00:00:00.999Z'); - }); - }); - - describe('and dateRange = "last-60-seconds".', () => { - const dateRange = 'last-60-seconds'; - - it('should return range[0] = "2020-03-09T23:59:00.000Z".', () => { - const output = getRange(dateRange); - - expect(output[0].toISOString()).toEqual('2020-03-09T23:59:00.000Z'); - }); - - it('should return range[1] = "2020-03-10T00:00:00.999Z".', () => { - const output = getRange(dateRange); - - expect(output[1].toISOString()).toEqual('2020-03-10T00:00:00.999Z'); - }); - }); - - describe('and dateRange = "last-1-minute".', () => { - const dateRange = 'last-1-minute'; - - it('should return range[0] = "2020-03-09T23:59:00.000Z".', () => { - const output = getRange(dateRange); - - expect(output[0].toISOString()).toEqual('2020-03-09T23:59:00.000Z'); - }); - - it('should return range[1] = "2020-03-10T00:00:59.999Z".', () => { - const output = getRange(dateRange); - - expect(output[1].toISOString()).toEqual('2020-03-10T00:00:59.999Z'); - }); - }); - - describe('and dateRange = "last-10-minutes".', () => { - const dateRange = 'last-10-minutes'; - - it('should return range[0] = "2020-03-09T23:50:00.000Z".', () => { - const output = getRange(dateRange); - - expect(output[0].toISOString()).toEqual('2020-03-09T23:50:00.000Z'); - }); - - it('should return range[1] = "2020-03-10T00:00:59.999Z".', () => { - const output = getRange(dateRange); - - expect(output[1].toISOString()).toEqual('2020-03-10T00:00:59.999Z'); - }); - }); - - describe('and dateRange = "last-1-hour".', () => { - const dateRange = 'last-1-hour'; - - it('should return range[0] = "2020-03-09T23:00:00.000Z".', () => { - const output = getRange(dateRange); - - expect(output[0].toISOString()).toEqual('2020-03-09T23:00:00.000Z'); - }); - - it('should return range[1] = "2020-03-10T00:59:59.999Z".', () => { - const output = getRange(dateRange); - - expect(output[1].toISOString()).toEqual('2020-03-10T00:59:59.999Z'); - }); - }); - - describe('and dateRange = "last-3-hours".', () => { - const dateRange = 'last-3-hours'; - - it('should return range[0] = "2020-03-09T21:00:00.000Z".', () => { - const output = getRange(dateRange); - - expect(output[0].toISOString()).toEqual('2020-03-09T21:00:00.000Z'); - }); - - it('should return range[1] = "2020-03-10T00:59:59.999Z".', () => { - const output = getRange(dateRange); - - expect(output[1].toISOString()).toEqual('2020-03-10T00:59:59.999Z'); - }); - }); - - describe('and dateRange = "last-1-day".', () => { - const dateRange = 'last-1-day'; - - it('should return range[0] = "2020-03-09T00:00:00.000Z".', () => { - const output = getRange(dateRange); - - expect(output[0].toISOString()).toEqual('2020-03-09T00:00:00.000Z'); - }); - - it('should return range[1] = "2020-03-10T23:59:59.999Z".', () => { - const output = getRange(dateRange); - - expect(output[1].toISOString()).toEqual('2020-03-10T23:59:59.999Z'); - }); - }); - - describe('and dateRange = "last-3-days".', () => { - const dateRange = 'last-3-days'; - - it('should return range[0] = "2020-03-07T00:00:00.000Z".', () => { - const output = getRange(dateRange); - - expect(output[0].toISOString()).toEqual('2020-03-07T00:00:00.000Z'); - }); - - it('should return range[1] = "2020-03-10T23:59:59.999Z".', () => { - const output = getRange(dateRange); - - expect(output[1].toISOString()).toEqual('2020-03-10T23:59:59.999Z'); - }); - }); - - describe('and dateRange = "last-1-month".', () => { - const dateRange = 'last-1-month'; - - it('should return range[0] = "2020-02-01T00:00:00.000Z".', () => { - const output = getRange(dateRange); - - expect(output[0].toISOString()).toEqual('2020-02-01T00:00:00.000Z'); - }); - - it('should return range[1] = "2020-03-31T23:59:59.999Z".', () => { - const output = getRange(dateRange); - - expect(output[1].toISOString()).toEqual('2020-03-31T23:59:59.999Z'); - }); - }); - - describe('and dateRange = "last-3-months".', () => { - const dateRange = 'last-3-months'; - - it('should return range[0] = "2019-12-01T00:00:00.000Z".', () => { - const output = getRange(dateRange); - - expect(output[0].toISOString()).toEqual('2019-12-01T00:00:00.000Z'); - }); - - it('should return range[1] = "2020-03-31T23:59:59.999Z".', () => { - const output = getRange(dateRange); - - expect(output[1].toISOString()).toEqual('2020-03-31T23:59:59.999Z'); - }); - }); - }); - }); - - describe('getRangeDisplayText', () => { - describe('When dateRange = ""', () => { - it('should return "".', () => { - const dateRange = ''; - const output = getRangeDisplayText(dateRange); - - expect(output).toEqual(''); - }); - }); - - describe('When dateRange = { startTime: March 9th 2020, endTime: March 10th 2020 }.', () => { - it('should return "2020-03-09 00:00:00 - 2020-03-10 00:00:00".', () => { - const dateRange = { - startTime: moment(new Date(2020, 2, 9)), - endTime: moment(new Date(2020, 2, 10)), - }; - const output = getRangeDisplayText(dateRange); - - expect(output).toEqual('2020-03-09 00:00:00 - 2020-03-10 00:00:00'); - }); - }); - - describe('When dateRange = "last-1-second"', () => { - it('should return "Last 1 second".', () => { - const dateRange = 'last-1-second'; - const output = getRangeDisplayText(dateRange); - - expect(output).toEqual('Last 1 second'); - }); - }); - - describe('When dateRange = "last-10-seconds"', () => { - it('should return "Last 10 seconds".', () => { - const dateRange = 'last-10-seconds'; - const output = getRangeDisplayText(dateRange); - - expect(output).toEqual('Last 10 seconds'); - }); - }); - - describe('When dateRange = "last-1-minute"', () => { - it('should return "Last 1 minute".', () => { - const dateRange = 'last-1-minute'; - const output = getRangeDisplayText(dateRange); - - expect(output).toEqual('Last 1 minute'); - }); - }); - - describe('When dateRange = "last-10-minutes"', () => { - it('should return "Last 10 minutes".', () => { - const dateRange = 'last-10-minutes'; - const output = getRangeDisplayText(dateRange); - - expect(output).toEqual('Last 10 minutes'); - }); - }); - - describe('When dateRange = "last-1-hour"', () => { - it('should return "Last 1 hour".', () => { - const dateRange = 'last-1-hour'; - const output = getRangeDisplayText(dateRange); - - expect(output).toEqual('Last 1 hour'); - }); - }); - - describe('When dateRange = "last-3-hours"', () => { - it('should return "Last 3 hours".', () => { - const dateRange = 'last-3-hours'; - const output = getRangeDisplayText(dateRange); - - expect(output).toEqual('Last 3 hours'); - }); - }); - - describe('When dateRange = "last-1-day"', () => { - it('should return "Last 1 day".', () => { - const dateRange = 'last-1-day'; - const output = getRangeDisplayText(dateRange); - - expect(output).toEqual('Last 1 day'); - }); - }); - - describe('When dateRange = "last-3-days"', () => { - it('should return "Last 3 days".', () => { - const dateRange = 'last-3-days'; - const output = getRangeDisplayText(dateRange); - - expect(output).toEqual('Last 3 days'); - }); - }); - }); - - describe('getShortcuts', () => { - describe('When maxDays = 1 and minStartDate is defined', () => { - const maxDays = 1; - const minStartDate = {}; - - it('should return 4 shortcuts.', () => { - const output = getShortcuts(maxDays, minStartDate); - - expect(output.length).toEqual(4); - }); - - it('should not contain "Last 24 hours".', () => { - const output = getShortcuts(maxDays, minStartDate); - const last24HourOption = output.find( - option => option.text === 'Last 24 hours' - ); - - expect(last24HourOption).toEqual(undefined); - }); - - it('should return the last option as "Last 1 day".', () => { - const output = getShortcuts(maxDays, minStartDate); - const lastOption = output[output.length - 1]; - - expect(lastOption.text).toEqual('Last 1 day'); - }); - }); - - describe('When maxDays = 3 and minStartDate is defined', () => { - const maxDays = 3; - const minStartDate = {}; - - it('should return 5 shortcuts.', () => { - const output = getShortcuts(maxDays, minStartDate); - - expect(output.length).toEqual(5); - }); - - it('should return the last option as "Last 3 days".', () => { - const output = getShortcuts(maxDays, minStartDate); - const lastOption = output[output.length - 1]; - - expect(lastOption.text).toEqual('Last 3 days'); - }); - }); - - describe('When maxDays = 7 and minStartDate is defined', () => { - const maxDays = 7; - const minStartDate = {}; - - it('should return 6 shortcuts.', () => { - const output = getShortcuts(maxDays, minStartDate); - - expect(output.length).toEqual(6); - }); - - it('should return the last option as "Last 7 days".', () => { - const output = getShortcuts(maxDays, minStartDate); - const lastOption = output[output.length - 1]; - - expect(lastOption.text).toEqual('Last 7 days'); - }); - }); - - describe('When maxDays = 30 and minStartDate is defined', () => { - const maxDays = 30; - const minStartDate = {}; - - it('should return 7 shortcuts.', () => { - const output = getShortcuts(maxDays, minStartDate); - - expect(output.length).toEqual(7); - }); - - it('should return the last option as "Last 30 days".', () => { - const output = getShortcuts(maxDays, minStartDate); - const lastOption = output[output.length - 1]; - - expect(lastOption.text).toEqual('Last 30 days'); - }); - }); - - describe('When maxDays = 90 and minStartDate is defined', () => { - const maxDays = 90; - const minStartDate = {}; - - it('should return 8 shortcuts.', () => { - const output = getShortcuts(maxDays, minStartDate); - - expect(output.length).toEqual(8); - }); - - it('should return the last option as "Last 3 months".', () => { - const output = getShortcuts(maxDays, minStartDate); - const lastOption = output[output.length - 1]; - - expect(lastOption.text).toEqual('Last 3 months'); - }); - }); - - describe('When maxDays = 3 and minStartDate = null', () => { - const maxDays = 3; - const minStartDate = null; - - it('should return 8 shortcuts', () => { - const output = getShortcuts(maxDays, minStartDate); - - expect(output.length).toEqual(8); - }); - - it('should return the last option as "Last 3 months".', () => { - const output = getShortcuts(maxDays, minStartDate); - const lastOption = output[output.length - 1]; - - expect(lastOption.text).toEqual('Last 3 months'); - }); - }); - }); - - describe('getTimePanelLabel', () => { - describe('When showTimePanel = true', () => { - it('should return "Select date".', () => { - const showTimePanel = true; - const output = getTimePanelLabel(showTimePanel); - - expect(output).toEqual('Select date'); - }); - }); - - describe('When showTimePanel = false', () => { - it('should return "Select time".', () => { - const showTimePanel = false; - const output = getTimePanelLabel(showTimePanel); - - expect(output).toEqual('Select time'); - }); - }); - }); - - describe('isDayDisabled', () => { - describe('When moment is set to March 10th 2020', () => { - beforeEach(() => { - jest - .spyOn(Date, 'now') - .mockImplementation(() => new Date(2020, 2, 10).getTime()); - }); - - describe('and minStartDate = March 8th 2020', () => { - let minStartDate; - - beforeEach(() => { - minStartDate = moment(new Date(2020, 2, 8)); - }); - - describe('and date = March 10th 2020', () => { - it('should return false.', () => { - const date = new Date(2020, 2, 10); - const output = isDayDisabled(minStartDate)(date); - - expect(output).toEqual(false); - }); - }); - - describe('and date = March 9th 2020', () => { - it('should return false.', () => { - const date = new Date(2020, 2, 9); - const output = isDayDisabled(minStartDate)(date); - - expect(output).toEqual(false); - }); - }); - - describe('and date = March 8th 2020', () => { - it('should return false.', () => { - const date = new Date(2020, 2, 8); - const output = isDayDisabled(minStartDate)(date); - - expect(output).toEqual(false); - }); - }); - - describe('and date = March 7th 2020', () => { - it('should return true.', () => { - const date = new Date(2020, 2, 7); - const output = isDayDisabled(minStartDate)(date); - - expect(output).toEqual(true); - }); - }); - - describe('and date = March 11th 2020', () => { - it('should return true.', () => { - const date = new Date(2020, 2, 11); - const output = isDayDisabled(minStartDate)(date); - - expect(output).toEqual(true); - }); - }); - }); - }); - }); - - describe('isDateValid', () => { - let minStartDate, maxEndDate; - - beforeEach(() => { - minStartDate = moment('2020-03-07 00:00:00'); - maxEndDate = moment('2020-03-10 00:00:00'); - }); - - describe('when passing an invalid date', () => { - it('should return false.', () => { - const date = { _isValid: false }; - const output = isDateValid(date, minStartDate, maxEndDate); - - expect(output).toEqual(false); - }); - }); - - describe('when passing a date before minStartDate', () => { - it('should return false.', () => { - const date = moment('2020-03-06 00:00:00'); - const output = isDateValid(date, minStartDate, maxEndDate); - - expect(output).toEqual(false); - }); - }); - - describe('when passing a date after maxEndDate', () => { - it('should return false.', () => { - const date = moment('2020-03-11 00:00:00'); - const output = isDateValid(date, minStartDate, maxEndDate); - - expect(output).toEqual(false); - }); - }); - - describe('when passing a date between minStartDate and maxEndDate', () => { - it('should return true.', () => { - const date = moment('2020-03-08 00:00:00'); - const output = isDateValid(date, minStartDate, maxEndDate); - - expect(output).toEqual(true); - }); - }); - }); -}); diff --git a/client/components/date-range-picker/index.vue b/client/components/date-range-picker/index.vue deleted file mode 100644 index 9e064a8d0..000000000 --- a/client/components/date-range-picker/index.vue +++ /dev/null @@ -1,314 +0,0 @@ - - - - - diff --git a/client/components/detail-list.vue b/client/components/detail-list.vue deleted file mode 100644 index fc71ad429..000000000 --- a/client/components/detail-list.vue +++ /dev/null @@ -1,111 +0,0 @@ - - - diff --git a/client/components/error-message.vue b/client/components/error-message.vue deleted file mode 100644 index 30c65d0bc..000000000 --- a/client/components/error-message.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - - - diff --git a/client/components/feature-flag.vue b/client/components/feature-flag.vue deleted file mode 100644 index 7ed1ff0c4..000000000 --- a/client/components/feature-flag.vue +++ /dev/null @@ -1,97 +0,0 @@ - - - - - diff --git a/client/components/flex-grid-item.vue b/client/components/flex-grid-item.vue deleted file mode 100644 index 488759865..000000000 --- a/client/components/flex-grid-item.vue +++ /dev/null @@ -1,45 +0,0 @@ - - - - - diff --git a/client/components/flex-grid.vue b/client/components/flex-grid.vue deleted file mode 100644 index 84c082a9f..000000000 --- a/client/components/flex-grid.vue +++ /dev/null @@ -1,61 +0,0 @@ - - - - - diff --git a/client/components/highlight-toggle.vue b/client/components/highlight-toggle.vue deleted file mode 100644 index 956e2bb70..000000000 --- a/client/components/highlight-toggle.vue +++ /dev/null @@ -1,101 +0,0 @@ - - - - - diff --git a/client/components/index.js b/client/components/index.js deleted file mode 100644 index 67f7fbd6b..000000000 --- a/client/components/index.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// Portions of the Software are attributed to Copyright (c) 2020-2024 Temporal Technologies Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export { default as Autocomplete } from './autocomplete'; -export { default as BarLoader } from './bar-loader'; -export { default as ButtonFill } from './button-fill'; -export { default as ButtonGroup } from './button-group'; -export { default as ButtonIcon } from './button-icon'; -export { default as Copy } from './copy'; -export { default as DataViewer } from './data-viewer'; -export { default as DateRangePicker } from './date-range-picker'; -export { default as DetailList } from './detail-list'; -export { default as ErrorMessage } from './error-message'; -export { default as FeatureFlag } from './feature-flag'; -export { default as FlexGrid } from './flex-grid'; -export { default as FlexGridItem } from './flex-grid-item'; -export { default as HighlightToggle } from './highlight-toggle'; -export { default as LoadingMessage } from './loading-message'; -export { default as LoadingSpinner } from './loading-spinner'; -export { default as NavigationBar } from './navigation-bar'; -export { default as NavigationLink } from './navigation-link'; -export { default as NewsModal } from './news-modal'; -export { default as NoResults } from './no-results'; -export { default as NotificationBar } from './notification-bar'; -export { default as SelectInput } from './select-input'; -export { default as SettingsFooter } from './settings-footer'; -export { default as SettingsToggle } from './settings-toggle'; -export { default as TextInput } from './text-input'; -export { default as WorkflowGrid } from './workflow-grid'; diff --git a/client/components/loading-message.vue b/client/components/loading-message.vue deleted file mode 100644 index 230880272..000000000 --- a/client/components/loading-message.vue +++ /dev/null @@ -1,83 +0,0 @@ - - - - - diff --git a/client/components/loading-spinner.vue b/client/components/loading-spinner.vue deleted file mode 100644 index 0b7214816..000000000 --- a/client/components/loading-spinner.vue +++ /dev/null @@ -1,49 +0,0 @@ - - - - - diff --git a/client/components/navigation-bar.vue b/client/components/navigation-bar.vue deleted file mode 100644 index c379dc984..000000000 --- a/client/components/navigation-bar.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - - - diff --git a/client/components/navigation-link.vue b/client/components/navigation-link.vue deleted file mode 100644 index d1e798b1e..000000000 --- a/client/components/navigation-link.vue +++ /dev/null @@ -1,104 +0,0 @@ - - - - - diff --git a/client/components/news-modal.vue b/client/components/news-modal.vue deleted file mode 100644 index 8192ec51d..000000000 --- a/client/components/news-modal.vue +++ /dev/null @@ -1,137 +0,0 @@ - - - - - diff --git a/client/components/no-results.vue b/client/components/no-results.vue deleted file mode 100644 index 3324f37ec..000000000 --- a/client/components/no-results.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - - - diff --git a/client/components/notification-bar.vue b/client/components/notification-bar.vue deleted file mode 100644 index 2a0f97af1..000000000 --- a/client/components/notification-bar.vue +++ /dev/null @@ -1,100 +0,0 @@ - - - - - diff --git a/client/components/paged-grid.js b/client/components/paged-grid.js deleted file mode 100644 index 0163ab8f1..000000000 --- a/client/components/paged-grid.js +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import deepmerge from 'deepmerge'; - -export default function(vue) { - return deepmerge( - { - computed: { - showTable() { - return !this.error && (this.loading || this.results.length); - }, - showNoResults() { - return !this.error && !this.loading && this.results.length === 0; - }, - disableInfiniteScroll() { - return this.loading || !this.npt; - }, - }, - methods: { - nextPage() { - this.nextPageToken = this.npt; - }, - }, - }, - vue - ); -} diff --git a/client/components/select-input.vue b/client/components/select-input.vue deleted file mode 100644 index 849ef8949..000000000 --- a/client/components/select-input.vue +++ /dev/null @@ -1,151 +0,0 @@ - - - - - diff --git a/client/components/settings-footer.vue b/client/components/settings-footer.vue deleted file mode 100644 index afc57c4a9..000000000 --- a/client/components/settings-footer.vue +++ /dev/null @@ -1,63 +0,0 @@ - - - diff --git a/client/components/settings-toggle.vue b/client/components/settings-toggle.vue deleted file mode 100644 index 297947c47..000000000 --- a/client/components/settings-toggle.vue +++ /dev/null @@ -1,77 +0,0 @@ - - - - - diff --git a/client/components/text-input.vue b/client/components/text-input.vue deleted file mode 100644 index c14639597..000000000 --- a/client/components/text-input.vue +++ /dev/null @@ -1,52 +0,0 @@ - - - - - diff --git a/client/components/workflow-grid.vue b/client/components/workflow-grid.vue deleted file mode 100644 index 2c9293262..000000000 --- a/client/components/workflow-grid.vue +++ /dev/null @@ -1,201 +0,0 @@ - - - - - diff --git a/client/constants.js b/client/constants.js deleted file mode 100644 index 3a6f19596..000000000 --- a/client/constants.js +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const jsonKeys = ['result', 'input', 'details', 'data', 'Error']; -export const preKeys = jsonKeys.concat(['stackTrace', 'details.stackTrace']); - -export const DATE_FORMAT_MMM_D_YYYY = 'DATE_FORMAT_MMM_D_YYYY'; -export const DATE_FORMAT_D_MMM_YYYY = 'DATE_FORMAT_D_MMM_YYYY'; -export const DATE_FORMAT_YYYY_MM_DD = 'DATE_FORMAT_YYYY_MM_DD'; -export const DATE_FORMAT_OPTIONS = [ - { label: 'Month Day, Year', value: DATE_FORMAT_MMM_D_YYYY }, - { label: 'Day Month, Year', value: DATE_FORMAT_D_MMM_YYYY }, - { label: 'Year-Month-Day', value: DATE_FORMAT_YYYY_MM_DD }, -]; - -export const ENVIRONMENT_LIST = [ - // Make sure to enable "environmentSelect" in feature-flags.json to enable environment select. - // - // Examples: - // - // { - // label: 'Production', - // value: 'http://.com', - // }, - // { - // label: 'Staging', - // value: 'http://.com', - // }, - // { - // label: 'Development', - // value: 'http://.com', - // }, - // { - // label: 'Localhost', - // value: 'http://localhost:8088', - // }, -]; - -export const LOCAL_STORAGE_NEWS_LAST_VIEWED_AT = 'news-last-viewed-at'; -export const LOCAL_STORAGE_SETTINGS = { - dateFormat: 'settings-date-format', - timeFormat: 'settings-time-format', - timezone: 'settings-timezone', - workflowHistoryEventHighlightList: - 'settings-workflow-history-event-highlight-list', - workflowHistoryEventHighlightListEnabled: - 'settings-workflow-history-event-highlight-list-enabled', -}; - -export const MAXIMUM_JSON_CHARACTER_LIMIT = 5000; -export const MAXIMUM_JSON_MESSAGE = - '\n ... to see more open full screen mode from top right arrow.'; - -export const NOTIFICATION_TYPE_ERROR = 'error'; -export const NOTIFICATION_TYPE_ERROR_MESSAGE_DEFAULT = - 'An unexpected error has occurred. Please try again. If problems persist contact cadence-support.'; -export const NOTIFICATION_TYPE_SUCCESS = 'success'; -export const NOTIFICATION_TYPE_WARNING = 'warning'; -export const NOTIFICATION_TIMEOUT = 5000; - -export const ONE_HOUR_IN_MILLISECONDS = 60 * 60 * 1000; - -export const TIME_FORMAT_12 = 'TIME_FORMAT_12'; -export const TIME_FORMAT_24 = 'TIME_FORMAT_24'; -export const TIME_FORMAT_OPTIONS = [ - { label: '12 hour', value: TIME_FORMAT_12 }, - { label: '24 hour', value: TIME_FORMAT_24 }, -]; - -export const TIMEZONE_LOCAL = 'TIMEZONE_LOCAL'; -export const TIMEZONE_UTC = 'TIMEZONE_UTC'; -export const TIMEZONE_OPTIONS = [ - { label: 'Local', value: TIMEZONE_LOCAL }, - { label: 'UTC', value: TIMEZONE_UTC }, -]; - -export const WORKFLOW_EVENT_TYPE = { - ActivityTaskCanceled: 'ActivityTaskCanceled', - ActivityTaskCancelRequested: 'ActivityTaskCancelRequested', - ActivityTaskCompleted: 'ActivityTaskCompleted', - ActivityTaskFailed: 'ActivityTaskFailed', - ActivityTaskScheduled: 'ActivityTaskScheduled', - ActivityTaskStarted: 'ActivityTaskStarted', - ActivityTaskTimedOut: 'ActivityTaskTimedOut', - CancelTimerFailed: 'CancelTimerFailed', - ChildWorkflowExecutionCanceled: 'ChildWorkflowExecutionCanceled', - ChildWorkflowExecutionCompleted: 'ChildWorkflowExecutionCompleted', - ChildWorkflowExecutionFailed: 'ChildWorkflowExecutionFailed', - ChildWorkflowExecutionStarted: 'ChildWorkflowExecutionStarted', - ChildWorkflowExecutionTerminated: 'ChildWorkflowExecutionTerminated', - ChildWorkflowExecutionTimedOut: 'ChildWorkflowExecutionTimedOut', - DecisionTaskCompleted: 'DecisionTaskCompleted', - DecisionTaskFailed: 'DecisionTaskFailed', - DecisionTaskScheduled: 'DecisionTaskScheduled', - DecisionTaskStarted: 'DecisionTaskStarted', - DecisionTaskTimedOut: 'DecisionTaskTimedOut', - ExternalWorkflowExecutionCancelRequested: - 'ExternalWorkflowExecutionCancelRequested', - ExternalWorkflowExecutionSignaled: 'ExternalWorkflowExecutionSignaled', - MarkerRecorded: 'MarkerRecorded', - RequestCancelActivityTaskFailed: 'RequestCancelActivityTaskFailed', - RequestCancelExternalWorkflowExecutionFailed: - 'RequestCancelExternalWorkflowExecutionFailed', - RequestCancelExternalWorkflowExecutionInitiated: - 'RequestCancelExternalWorkflowExecutionInitiated', - SignalExternalWorkflowExecutionFailed: - 'SignalExternalWorkflowExecutionFailed', - SignalExternalWorkflowExecutionInitiated: - 'SignalExternalWorkflowExecutionInitiated', - StartChildWorkflowExecutionFailed: 'StartChildWorkflowExecutionFailed', - StartChildWorkflowExecutionInitiated: 'StartChildWorkflowExecutionInitiated', - TimerCanceled: 'TimerCanceled', - TimerFired: 'TimerFired', - TimerStarted: 'TimerStarted', - UpsertWorkflowSearchAttributes: 'UpsertWorkflowSearchAttributes', - WorkflowExecutionCanceled: 'WorkflowExecutionCanceled', - WorkflowExecutionCancelRequested: 'WorkflowExecutionCancelRequested', - WorkflowExecutionCompleted: 'WorkflowExecutionCompleted', - WorkflowExecutionContinuedAsNew: 'WorkflowExecutionContinuedAsNew', - WorkflowExecutionFailed: 'WorkflowExecutionFailed', - WorkflowExecutionSignaled: 'WorkflowExecutionSignaled', - WorkflowExecutionStarted: 'WorkflowExecutionStarted', - WorkflowExecutionTerminated: 'WorkflowExecutionTerminated', - WorkflowExecutionTimedOut: 'WorkflowExecutionTimedOut', -}; - -export const WORKFLOW_EVENT_TYPES = Object.values(WORKFLOW_EVENT_TYPE); diff --git a/client/containers/active-status/action-types.js b/client/containers/active-status/action-types.js deleted file mode 100644 index bf8f183f7..000000000 --- a/client/containers/active-status/action-types.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { typePrefix } from './helpers'; - -export const ACTIVE_STATUS_ON_CHANGE = typePrefix('ON_CHANGE'); diff --git a/client/containers/active-status/actions.js b/client/containers/active-status/actions.js deleted file mode 100644 index 871fc44a5..000000000 --- a/client/containers/active-status/actions.js +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { CROSS_REGION_ALLOWED_CROSS_ORIGIN } from '../cross-region/getter-types'; -import { - ROUTE_PARAMS_CLUSTER_NAME, - ROUTE_PARAMS_DOMAIN, -} from '../route/getter-types'; -import { ACTIVE_STATUS_ON_CHANGE } from './action-types'; -import { getHrefFromCluster } from './helpers'; - -const actions = { - [ACTIVE_STATUS_ON_CHANGE]: ({ dispatch, getters }, cluster) => { - const allowedCrossOrigin = getters[CROSS_REGION_ALLOWED_CROSS_ORIGIN]; - const clusterName = getters[ROUTE_PARAMS_CLUSTER_NAME]; - const domainName = getters[ROUTE_PARAMS_DOMAIN]; - const { origin, pathname } = window.location; - - const href = getHrefFromCluster({ - allowedCrossOrigin, - cluster, - clusterName, - domainName, - origin, - pathname, - }); - - window.location = href; - }, -}; - -export default actions; diff --git a/client/containers/active-status/component.vue b/client/containers/active-status/component.vue deleted file mode 100644 index c59cde7d7..000000000 --- a/client/containers/active-status/component.vue +++ /dev/null @@ -1,136 +0,0 @@ - - - - - diff --git a/client/containers/active-status/connector.js b/client/containers/active-status/connector.js deleted file mode 100644 index 228afd6c0..000000000 --- a/client/containers/active-status/connector.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { connect } from 'vuex-connect'; -import { DOMAIN_IS_READY } from '../domain/getter-types'; -import { CROSS_REGION } from '../cross-region/getter-types'; -import { - ACTIVE_STATUS_CLUSTER, - ACTIVE_STATUS_SELECT_LIST, - ACTIVE_STATUS_CLASSNAME, - ACTIVE_STATUS_LABEL, - ACTIVE_STATUS_TAG, -} from './getter-types'; -import { ACTIVE_STATUS_ON_CHANGE } from './action-types'; - -const actionsToEvents = { - change: ACTIVE_STATUS_ON_CHANGE, -}; - -const gettersToProps = { - classname: ACTIVE_STATUS_CLASSNAME, - cluster: ACTIVE_STATUS_CLUSTER, - crossRegion: CROSS_REGION, - selectList: ACTIVE_STATUS_SELECT_LIST, - isReady: DOMAIN_IS_READY, - label: ACTIVE_STATUS_LABEL, - tag: ACTIVE_STATUS_TAG, -}; - -export default connect({ - actionsToEvents, - gettersToProps, -}); diff --git a/client/containers/active-status/constants.js b/client/containers/active-status/constants.js deleted file mode 100644 index 3da94a17d..000000000 --- a/client/containers/active-status/constants.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const ACTIVE_STATUS_STATE_PREFIX = 'activeStatus'; -export const ACTIVE_STATUS_TYPE_PREFIX = 'ACTIVE_STATUS'; diff --git a/client/containers/active-status/getter-types.js b/client/containers/active-status/getter-types.js deleted file mode 100644 index 25803ebe4..000000000 --- a/client/containers/active-status/getter-types.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { typePrefix } from './helpers'; - -export const ACTIVE_STATUS_CLASSNAME = typePrefix('CLASSNAME'); -export const ACTIVE_STATUS_CLUSTER = typePrefix('CLUSTER'); -export const ACTIVE_STATUS_CLUSTER_LIST = typePrefix('CLUSTER_LIST'); -export const ACTIVE_STATUS_LABEL = typePrefix('LABEL'); -export const ACTIVE_STATUS_SELECT_LIST = typePrefix('SELECT_LIST'); -export const ACTIVE_STATUS_TAG = typePrefix('TAG'); diff --git a/client/containers/active-status/getters.js b/client/containers/active-status/getters.js deleted file mode 100644 index 6821c4058..000000000 --- a/client/containers/active-status/getters.js +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { DOMAIN_IS_READY, DOMAIN_HASH } from '../domain/getter-types'; -import { - ROUTE_PARAMS_WORKFLOW_ID, - ROUTE_PARAMS_CLUSTER_NAME, - ROUTE_PARAMS_DOMAIN, -} from '../route/getter-types'; -import { - CROSS_REGION, - CROSS_REGION_ALLOWED_CROSS_ORIGIN, - CROSS_REGION_CLUSTER_ORIGIN_LIST, -} from '../cross-region/getter-types'; -import { - ACTIVE_STATUS_CLASSNAME, - ACTIVE_STATUS_CLUSTER, - ACTIVE_STATUS_CLUSTER_LIST, - ACTIVE_STATUS_LABEL, - ACTIVE_STATUS_SELECT_LIST, - ACTIVE_STATUS_TAG, -} from './getter-types'; -import { - getClusterFromClusterList, - getClusterListFromDomainConfigList, - getFilteredClusterList, -} from './helpers'; - -const getters = { - [ACTIVE_STATUS_CLASSNAME]: (_, getters) => { - const cluster = getters[ACTIVE_STATUS_CLUSTER]; - - return cluster && cluster.isActive ? 'active' : 'passive'; - }, - [ACTIVE_STATUS_CLUSTER]: (_, getters) => { - const allowedCrossOrigin = getters[CROSS_REGION_ALLOWED_CROSS_ORIGIN]; - const clusterList = getters[ACTIVE_STATUS_CLUSTER_LIST]; - const clusterName = getters[ROUTE_PARAMS_CLUSTER_NAME]; - const { origin } = window.location; - - return getClusterFromClusterList({ - allowedCrossOrigin, - clusterList, - clusterName, - origin, - }); - }, - [ACTIVE_STATUS_CLUSTER_LIST]: (_, getters) => { - const clusterOriginList = getters[CROSS_REGION_CLUSTER_ORIGIN_LIST]; - const crossRegion = getters[CROSS_REGION]; - const domainHash = getters[DOMAIN_HASH]; - const domainName = getters[ROUTE_PARAMS_DOMAIN]; - const isReady = getters[DOMAIN_IS_READY]; - - const domainNamespace = domainHash[domainName]; - - if (!domainName || !crossRegion || !isReady) { - return []; - } - - const domainConfigList = domainNamespace.global - ? [domainNamespace.global] - : domainNamespace.local; - - return getClusterListFromDomainConfigList({ - clusterOriginList, - domainConfigList, - }); - }, - [ACTIVE_STATUS_LABEL]: (_, getters) => { - const cluster = getters[ACTIVE_STATUS_CLUSTER]; - - return cluster && cluster.label; - }, - [ACTIVE_STATUS_SELECT_LIST]: (_, getters) => { - const allowedCrossOrigin = getters[CROSS_REGION_ALLOWED_CROSS_ORIGIN]; - const clusterList = getters[ACTIVE_STATUS_CLUSTER_LIST]; - const clusterName = getters[ROUTE_PARAMS_CLUSTER_NAME]; - const { origin } = window.location; - - return getFilteredClusterList({ - allowedCrossOrigin, - clusterList, - clusterName, - origin, - }); - }, - [ACTIVE_STATUS_TAG]: (_, getters) => { - const cluster = getters[ACTIVE_STATUS_CLUSTER]; - const isReady = getters[DOMAIN_IS_READY]; - const selectList = getters[ACTIVE_STATUS_SELECT_LIST]; - const workflowId = getters[ROUTE_PARAMS_WORKFLOW_ID]; - - if (!isReady || !cluster) { - return 'span'; - } - - const { isGlobalDomain } = cluster; - - return (selectList && selectList.length === 0) || - (!isGlobalDomain && workflowId) - ? 'span' - : 'select-input'; - }, -}; - -export default getters; diff --git a/client/containers/active-status/getters.spec.js b/client/containers/active-status/getters.spec.js deleted file mode 100644 index 950f8a87c..000000000 --- a/client/containers/active-status/getters.spec.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { ROUTE_PARAMS_DOMAIN } from '../route/getter-types'; -import { - CROSS_REGION, - CROSS_REGION_CLUSTER_ORIGIN_LIST, -} from '../cross-region/getter-types'; -import { DOMAIN_HASH, DOMAIN_IS_READY } from '../domain/getter-types'; -import activeStatusGetterFns from './getters'; -import { ACTIVE_STATUS_CLUSTER_LIST } from './getter-types'; -import { initGetters } from '~test'; - -describe('Active status getters', () => { - describe('when calling getters[ACTIVE_STATUS_CLUSTER_LIST]', () => { - it('should return empty array if its dynamic dependent getters returned Nil', () => { - const dependentGetterNames = [ - CROSS_REGION_CLUSTER_ORIGIN_LIST, - CROSS_REGION, - ROUTE_PARAMS_DOMAIN, - ]; - - dependentGetterNames.forEach(getterName => { - const getterFns = { - ...activeStatusGetterFns, - [getterName]: () => null, - [DOMAIN_IS_READY]: () => true, - [DOMAIN_HASH]: () => ({}), - }; - const getters = initGetters({ getterFns }); - const output = getters[ACTIVE_STATUS_CLUSTER_LIST]; - - expect(output).toEqual([]); - }); - }); - }); -}); diff --git a/client/containers/active-status/helpers/get-cluster-from-cluster-list.js b/client/containers/active-status/helpers/get-cluster-from-cluster-list.js deleted file mode 100644 index 635791e1f..000000000 --- a/client/containers/active-status/helpers/get-cluster-from-cluster-list.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const getClusterFromClusterList = ({ - allowedCrossOrigin, - clusterList, - clusterName, - origin, -}) => { - if (!clusterList || allowedCrossOrigin === undefined) { - return; - } - - const matchParamName = allowedCrossOrigin - ? clusterName - ? 'clusterName' - : 'isActive' - : 'origin'; - const matchValue = allowedCrossOrigin - ? clusterName - ? clusterName - : true - : origin; - - const cluster = clusterList.find( - ({ [matchParamName]: paramValue }) => paramValue === matchValue - ); - - if (!cluster) { - console.warn( - `Could not find cluster "${matchParamName}:${matchValue}" in crossRegion.clusterOriginList configuration.` - ); - } - - return cluster; -}; - -export default getClusterFromClusterList; diff --git a/client/containers/active-status/helpers/get-cluster-list-from-domain-config-list.js b/client/containers/active-status/helpers/get-cluster-list-from-domain-config-list.js deleted file mode 100644 index 2d8ba0a7c..000000000 --- a/client/containers/active-status/helpers/get-cluster-list-from-domain-config-list.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import mergeDomainConfigList from './merge-domain-config-list'; - -const getClusterListFromDomainConfigList = ({ - clusterOriginList = [], - domainConfigList = [], -}) => { - const { - activeClusterNames, - isGlobalDomain, - clusters, - } = mergeDomainConfigList(domainConfigList); - - const clusterList = clusterOriginList - .filter(({ clusterName }) => - clusters.find( - ({ clusterName: domainClusterName }) => - clusterName === domainClusterName - ) - ) - .map(cluster => { - const isActive = activeClusterNames.includes(cluster.clusterName); - const label = !isGlobalDomain ? 'local' : isActive ? 'active' : 'passive'; - - return { - ...cluster, - isActive, - isGlobalDomain, - label: `${label} - ${cluster.clusterName}`, - }; - }); - - return clusterList; -}; - -export default getClusterListFromDomainConfigList; diff --git a/client/containers/active-status/helpers/get-filtered-cluster-list.js b/client/containers/active-status/helpers/get-filtered-cluster-list.js deleted file mode 100644 index de6585b82..000000000 --- a/client/containers/active-status/helpers/get-filtered-cluster-list.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const getFilteredClusterList = ({ - allowedCrossOrigin, - clusterName, - clusterList, - origin, -}) => - clusterList.filter( - allowedCrossOrigin - ? cluster => { - if (cluster.clusterName === clusterName) { - return false; - } - - if (cluster.isActive && !clusterName) { - return false; - } - - return true; - } - : cluster => cluster.origin !== origin - ); - -export default getFilteredClusterList; diff --git a/client/containers/active-status/helpers/get-href-from-cluster.js b/client/containers/active-status/helpers/get-href-from-cluster.js deleted file mode 100644 index f2e028fe8..000000000 --- a/client/containers/active-status/helpers/get-href-from-cluster.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const getHrefFromCluster = ({ - allowedCrossOrigin, - cluster: { - isActive, - isGlobalDomain, - clusterName: clusterNamePath, - origin: clusterOrigin, - }, - clusterName, - domainName, - origin, - pathname, -}) => { - if (!allowedCrossOrigin) { - return `${clusterOrigin}${pathname}`; - } - - const replaceKey = `/domains/${domainName}/${ - clusterName ? clusterName + '/' : '' - }`; - const replaceValue = `/domains/${domainName}/${ - isGlobalDomain && isActive ? '' : clusterNamePath + '/' - }`; - - const newPathname = pathname.replace(replaceKey, replaceValue); - - return `${origin}${newPathname}`; -}; - -export default getHrefFromCluster; diff --git a/client/containers/active-status/helpers/index.js b/client/containers/active-status/helpers/index.js deleted file mode 100644 index ea514a2f0..000000000 --- a/client/containers/active-status/helpers/index.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export { default as getClusterFromClusterList } from './get-cluster-from-cluster-list'; -export { default as getClusterListFromDomainConfigList } from './get-cluster-list-from-domain-config-list'; -export { default as getFilteredClusterList } from './get-filtered-cluster-list'; -export { default as getHrefFromCluster } from './get-href-from-cluster'; -export { default as mergeDomainConfigList } from './merge-domain-config-list'; -export { default as statePrefix } from './state-prefix'; -export { default as typePrefix } from './type-prefix'; diff --git a/client/containers/active-status/helpers/merge-domain-config-list.js b/client/containers/active-status/helpers/merge-domain-config-list.js deleted file mode 100644 index ab7a21c40..000000000 --- a/client/containers/active-status/helpers/merge-domain-config-list.js +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const mergeDomainConfigList = domainConfigList => - domainConfigList.reduce( - ( - accumulator, - { - isGlobalDomain, - replicationConfiguration: { activeClusterName, clusters }, - } - ) => { - accumulator.isGlobalDomain = isGlobalDomain; - - if (!accumulator.activeClusterNames.includes(activeClusterName)) { - accumulator.activeClusterNames.push(activeClusterName); - } - - const nonDupeClusters = clusters.filter( - ({ clusterName: matchClusterName }) => - !accumulator.clusters.find( - ({ clusterName }) => clusterName === matchClusterName - ) - ); - - if (nonDupeClusters.length) { - accumulator.clusters.push(...nonDupeClusters); - } - - return accumulator; - }, - { activeClusterNames: [], clusters: [], isGlobalDomain: undefined } - ); - -export default mergeDomainConfigList; diff --git a/client/containers/active-status/helpers/state-prefix.js b/client/containers/active-status/helpers/state-prefix.js deleted file mode 100644 index 0dd83f49b..000000000 --- a/client/containers/active-status/helpers/state-prefix.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { ACTIVE_STATUS_STATE_PREFIX } from '../constants'; - -const statePrefix = term => `${ACTIVE_STATUS_STATE_PREFIX}.${term}`; - -export default statePrefix; diff --git a/client/containers/active-status/helpers/type-prefix.js b/client/containers/active-status/helpers/type-prefix.js deleted file mode 100644 index 4a48e1a5e..000000000 --- a/client/containers/active-status/helpers/type-prefix.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { ACTIVE_STATUS_TYPE_PREFIX } from '../constants'; - -const typePrefix = term => `${ACTIVE_STATUS_TYPE_PREFIX}_${term}`; - -export default typePrefix; diff --git a/client/containers/active-status/index.js b/client/containers/active-status/index.js deleted file mode 100644 index f4eb20bdc..000000000 --- a/client/containers/active-status/index.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import actions from './actions'; -import Component from './component'; -import connector from './connector'; -import getters from './getters'; - -const container = connector(Component); - -export { actions, container, getters }; diff --git a/client/containers/cluster/action-types.js b/client/containers/cluster/action-types.js deleted file mode 100644 index 807828b72..000000000 --- a/client/containers/cluster/action-types.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const CLUSTER_FETCH = 'CLUSTER_FETCH'; diff --git a/client/containers/cluster/actions.js b/client/containers/cluster/actions.js deleted file mode 100644 index b291defd7..000000000 --- a/client/containers/cluster/actions.js +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { CLUSTER_FETCH } from './action-types'; -import { CLUSTER_FETCH_EXPIRY_DATE_TIME } from './getter-types'; -import { canFetchCluster } from './helpers'; -import { - CLUSTER_FETCH_FAILED, - CLUSTER_FETCH_START, - CLUSTER_FETCH_SUCCESS, -} from './mutation-types'; -import { httpService } from '~services'; - -const actions = { - [CLUSTER_FETCH]: async ({ commit, getters }) => { - if (!canFetchCluster(getters[CLUSTER_FETCH_EXPIRY_DATE_TIME])) { - return; - } - - commit(CLUSTER_FETCH_START); - - try { - const cluster = await httpService.get('/api/cluster'); - - commit(CLUSTER_FETCH_SUCCESS, cluster); - } catch (error) { - commit(CLUSTER_FETCH_FAILED, error); - } - }, -}; - -export default actions; diff --git a/client/containers/cluster/actions.spec.js b/client/containers/cluster/actions.spec.js deleted file mode 100644 index 884b42484..000000000 --- a/client/containers/cluster/actions.spec.js +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import actions from './actions'; -import { CLUSTER_FETCH } from './action-types'; -import { - CLUSTER_FETCH_FAILED, - CLUSTER_FETCH_START, - CLUSTER_FETCH_SUCCESS, -} from './mutation-types'; -import { canFetchCluster } from './helpers'; -import { httpService } from '~services'; - -jest.mock('./helpers', () => ({ - canFetchCluster: jest.fn(), -})); - -jest.mock('~services', () => ({ - httpService: { - get: jest.fn(), - }, -})); - -describe('cluster actions', () => { - describe('CLUSTER_FETCH', () => { - describe('canFetchCluster returns false', () => { - beforeEach(() => { - canFetchCluster.mockImplementation(() => false); - }); - - it('should not commit CLUSTER_FETCH_START', () => { - const commit = jest.fn(); - const getters = {}; - - actions[CLUSTER_FETCH]({ commit, getters }); - - expect(commit).not.toHaveBeenCalled(); - }); - }); - - describe('canFetchCluster returns true', () => { - beforeEach(() => { - canFetchCluster.mockImplementation(() => true); - }); - - it('should commit CLUSTER_FETCH_START', () => { - const commit = jest.fn(); - const getters = {}; - - actions[CLUSTER_FETCH]({ commit, getters }); - - expect(commit).toHaveBeenCalledWith(CLUSTER_FETCH_START); - }); - - describe('when API throws an error', () => { - beforeEach(() => { - httpService.get.mockImplementation(() => { - throw new Error(); - }); - }); - - it('should commit CLUSTER_FETCH_FAILED', () => { - const commit = jest.fn(); - const getters = {}; - - actions[CLUSTER_FETCH]({ commit, getters }); - - expect(commit).toHaveBeenCalledWith( - CLUSTER_FETCH_FAILED, - new Error() - ); - }); - }); - - describe('when API returns cluster', () => { - const cluster = { - persistenceInfo: {}, - }; - - beforeEach(() => { - httpService.get.mockImplementation(() => cluster); - }); - - it('should commit CLUSTER_FETCH_SUCCESS with cluster', async () => { - const commit = jest.fn(); - const getters = {}; - - await actions[CLUSTER_FETCH]({ commit, getters }); - - expect(commit).toHaveBeenCalledWith(CLUSTER_FETCH_SUCCESS, cluster); - }); - }); - }); - }); -}); diff --git a/client/containers/cluster/constants.js b/client/containers/cluster/constants.js deleted file mode 100644 index 1664539aa..000000000 --- a/client/containers/cluster/constants.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// time until application will try to fetch a fresh value from server to replace cached value. -export const CLUSTER_FETCH_EXPIRY_TTL = 1000 * 60 * 60; // 1 hour -export const CLUSTER_VISIBILITY_FEATURES_ADVANCED_VISIBILITY_ENABLED_KEY = - 'advancedVisibilityEnabled'; diff --git a/client/containers/cluster/get-default-state.js b/client/containers/cluster/get-default-state.js deleted file mode 100644 index 961b1a900..000000000 --- a/client/containers/cluster/get-default-state.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const getDefaultState = (state = {}) => ({ - data: null, - error: null, - expiryDateTime: null, - ...state, -}); - -export default getDefaultState; diff --git a/client/containers/cluster/get-default-state.spec.js b/client/containers/cluster/get-default-state.spec.js deleted file mode 100644 index 668ef39fa..000000000 --- a/client/containers/cluster/get-default-state.spec.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getDefaultState from './get-default-state'; - -describe('cluster getDefaultState', () => { - describe('when state = undefined', () => { - const state = undefined; - - it('should return the default state.', () => { - const output = getDefaultState(state); - - expect(output).toEqual({ - data: null, - error: null, - expiryDateTime: null, - }); - }); - }); - - describe('when state = { data: {}, error: false, expiryDateTime: "2021-05-21T21:48:30.624Z" }', () => { - const state = { - data: {}, - error: false, - expiryDateTime: '2021-05-21T21:48:30.624Z', - }; - - it('should return the state', () => { - const output = getDefaultState(state); - - expect(output).toEqual({ - data: {}, - error: false, - expiryDateTime: '2021-05-21T21:48:30.624Z', - }); - }); - }); -}); diff --git a/client/containers/cluster/getter-types.js b/client/containers/cluster/getter-types.js deleted file mode 100644 index a36048333..000000000 --- a/client/containers/cluster/getter-types.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const CLUSTER_ADVANCED_VISIBILITY_ENABLED = - 'CLUSTER_ADVANCED_VISIBILITY_ENABLED'; -export const CLUSTER_FETCH_ERROR = 'CLUSTER_FETCH_ERROR'; -export const CLUSTER_FETCH_EXPIRY_DATE_TIME = 'CLUSTER_FETCH_EXPIRY_DATE_TIME'; -export const CLUSTER_VISIBILITY_FEATURES = 'CLUSTER_VISIBILITY_FEATURES'; diff --git a/client/containers/cluster/getters.js b/client/containers/cluster/getters.js deleted file mode 100644 index 8e1286e28..000000000 --- a/client/containers/cluster/getters.js +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { get } from 'lodash-es'; -import { - CLUSTER_ADVANCED_VISIBILITY_ENABLED, - CLUSTER_FETCH_ERROR, - CLUSTER_FETCH_EXPIRY_DATE_TIME, - CLUSTER_VISIBILITY_FEATURES, -} from './getter-types'; -import { CLUSTER_VISIBILITY_FEATURES_ADVANCED_VISIBILITY_ENABLED_KEY } from './constants'; - -const getters = { - [CLUSTER_ADVANCED_VISIBILITY_ENABLED]: (_, getters) => { - const advancedVisibilityEnabledFeature = getters[ - CLUSTER_VISIBILITY_FEATURES - ].find( - ({ key }) => - key === CLUSTER_VISIBILITY_FEATURES_ADVANCED_VISIBILITY_ENABLED_KEY - ); - - if (advancedVisibilityEnabledFeature) { - return advancedVisibilityEnabledFeature.enabled; - } - - return false; - }, - [CLUSTER_FETCH_ERROR]: state => get(state, 'cluster.error'), - [CLUSTER_FETCH_EXPIRY_DATE_TIME]: state => - get(state, 'cluster.expiryDateTime'), - [CLUSTER_VISIBILITY_FEATURES]: state => - get(state, 'cluster.data.persistenceInfo.visibilityStore.features') || [], -}; - -export default getters; diff --git a/client/containers/cluster/getters.spec.js b/client/containers/cluster/getters.spec.js deleted file mode 100644 index d30d6f0e3..000000000 --- a/client/containers/cluster/getters.spec.js +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getterFns from './getters'; -import { - CLUSTER_ADVANCED_VISIBILITY_ENABLED, - CLUSTER_FETCH_ERROR, - CLUSTER_FETCH_EXPIRY_DATE_TIME, - CLUSTER_VISIBILITY_FEATURES, -} from './getter-types'; -import { initGetters } from '~test'; - -describe('cluster getters', () => { - describe('CLUSTER_ADVANCED_VISIBILITY_ENABLED', () => { - describe('state.cluster.data.persistenceInfo.visibilityStore.features is not set', () => { - it('should return false.', () => { - const state = { - cluster: {}, - }; - - const getters = initGetters({ getterFns, state }); - - const output = getters[CLUSTER_ADVANCED_VISIBILITY_ENABLED]; - - expect(output).toEqual(false); - }); - }); - - describe('state.cluster.data.persistenceInfo.visibilityStore.features is set', () => { - it('should return advancedVisibilityEnabled enabled value.', () => { - const state = { - cluster: { - data: { - persistenceInfo: { - visibilityStore: { - features: [ - { enabled: true, key: 'advancedVisibilityEnabled' }, - ], - }, - }, - }, - }, - }; - - const getters = initGetters({ getterFns, state }); - - const output = getters[CLUSTER_ADVANCED_VISIBILITY_ENABLED]; - - expect(output).toEqual(true); - }); - }); - }); - - describe('CLUSTER_FETCH_ERROR', () => { - it('should return state.cluster.error.', () => { - const state = { - cluster: { - error: 'an error message', - }, - }; - - const getters = initGetters({ getterFns, state }); - - const output = getters[CLUSTER_FETCH_ERROR]; - - expect(output).toEqual('an error message'); - }); - }); - - describe('CLUSTER_FETCH_EXPIRY_DATE_TIME', () => { - it('should return state.cluster.expiryDateTime', () => { - const state = { - cluster: { - expiryDateTime: '2021-05-21T23:03:51.913Z', - }, - }; - - const getters = initGetters({ getterFns, state }); - - const output = getters[CLUSTER_FETCH_EXPIRY_DATE_TIME]; - - expect(output).toEqual('2021-05-21T23:03:51.913Z'); - }); - }); - - describe('CLUSTER_VISIBILITY_FEATURES', () => { - describe('state.cluster.data.persistenceInfo.visibilityStore.features is not set', () => { - it('should return an empty array.', () => { - const state = { - cluster: {}, - }; - - const getters = initGetters({ getterFns, state }); - - const output = getters[CLUSTER_VISIBILITY_FEATURES]; - - expect(output).toEqual([]); - }); - }); - - describe('state.cluster.data.persistenceInfo.visibilityStore.features is set', () => { - it('should return state.cluster.data.persistenceInfo.visibilityStore.features.', () => { - const state = { - cluster: { - data: { - persistenceInfo: { - visibilityStore: { - features: [ - { enabled: true, key: 'advancedVisibilityEnabled' }, - ], - }, - }, - }, - }, - }; - - const getters = initGetters({ getterFns, state }); - - const output = getters[CLUSTER_VISIBILITY_FEATURES]; - - expect(output).toEqual([ - { enabled: true, key: 'advancedVisibilityEnabled' }, - ]); - }); - }); - }); -}); diff --git a/client/containers/cluster/helpers/can-fetch-cluster.js b/client/containers/cluster/helpers/can-fetch-cluster.js deleted file mode 100644 index 6ce9f3296..000000000 --- a/client/containers/cluster/helpers/can-fetch-cluster.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; - -const canFetchCluster = expiryDateTime => { - if (!expiryDateTime) { - return true; - } - - return moment().isAfter(expiryDateTime); -}; - -export default canFetchCluster; diff --git a/client/containers/cluster/helpers/can-fetch-cluster.spec.js b/client/containers/cluster/helpers/can-fetch-cluster.spec.js deleted file mode 100644 index dafae867d..000000000 --- a/client/containers/cluster/helpers/can-fetch-cluster.spec.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import canFetchCluster from './can-fetch-cluster'; - -describe('canFetchCluster', () => { - describe('expiryDateTime = null', () => { - const expiryDateTime = null; - - it('should return true.', () => { - const output = canFetchCluster(expiryDateTime); - - expect(output).toEqual(true); - }); - }); - - describe('expiryDateTime = 1 hour from now', () => { - const expiryDateTime = new Date(Date.UTC(2020, 2, 31, 1)); - - beforeEach(() => { - jest - .spyOn(Date, 'now') - .mockImplementation(() => new Date(Date.UTC(2020, 2, 31)).getTime()); - }); - - it('should return false.', () => { - const output = canFetchCluster(expiryDateTime); - - expect(output).toEqual(false); - }); - }); - - describe('expiryDateTime = 1 hour past from now', () => { - const expiryDateTime = new Date(Date.UTC(2020, 2, 31, 0)); - - beforeEach(() => { - jest - .spyOn(Date, 'now') - .mockImplementation(() => new Date(Date.UTC(2020, 2, 31, 1)).getTime()); - }); - - it('should return true.', () => { - const output = canFetchCluster(expiryDateTime); - - expect(output).toEqual(true); - }); - }); -}); diff --git a/client/containers/cluster/helpers/index.js b/client/containers/cluster/helpers/index.js deleted file mode 100644 index 03c60b8d7..000000000 --- a/client/containers/cluster/helpers/index.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export { default as canFetchCluster } from './can-fetch-cluster'; diff --git a/client/containers/cluster/index.js b/client/containers/cluster/index.js deleted file mode 100644 index 4bb226e79..000000000 --- a/client/containers/cluster/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import actions from './actions'; -import getDefaultState from './get-default-state'; -import getters from './getters'; -import mutations from './mutations'; - -export { actions, getDefaultState, getters, mutations }; diff --git a/client/containers/cluster/mutation-types.js b/client/containers/cluster/mutation-types.js deleted file mode 100644 index 384fd146e..000000000 --- a/client/containers/cluster/mutation-types.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const CLUSTER_FETCH_FAILED = 'CLUSTER_FETCH_FAILED'; -export const CLUSTER_FETCH_START = 'CLUSTER_FETCH_START'; -export const CLUSTER_FETCH_SUCCESS = 'CLUSTER_FETCH_SUCCESS'; diff --git a/client/containers/cluster/mutations.js b/client/containers/cluster/mutations.js deleted file mode 100644 index be7217b51..000000000 --- a/client/containers/cluster/mutations.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; -import { - CLUSTER_FETCH_FAILED, - CLUSTER_FETCH_START, - CLUSTER_FETCH_SUCCESS, -} from './mutation-types'; -import { CLUSTER_FETCH_EXPIRY_TTL } from './constants'; - -const mutations = { - [CLUSTER_FETCH_FAILED]: (state, payload) => { - state.cluster.error = payload; - }, - [CLUSTER_FETCH_START]: state => { - state.cluster.error = null; - }, - [CLUSTER_FETCH_SUCCESS]: (state, payload) => { - state.cluster.expiryDateTime = moment() - .add(CLUSTER_FETCH_EXPIRY_TTL) - .toISOString(); - state.cluster.data = payload; - }, -}; - -export default mutations; diff --git a/client/containers/cluster/mutations.spec.js b/client/containers/cluster/mutations.spec.js deleted file mode 100644 index e61762576..000000000 --- a/client/containers/cluster/mutations.spec.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import mutations from './mutations'; -import { - CLUSTER_FETCH_FAILED, - CLUSTER_FETCH_START, - CLUSTER_FETCH_SUCCESS, -} from './mutation-types'; - -jest.mock('moment', () => () => - jest.requireActual('moment')('2020-01-01T00:00:00.000Z') -); - -describe('cluster mutations', () => { - describe('CLUSTER_FETCH_FAILED', () => { - const state = { - cluster: { - error: null, - }, - }; - - it('should set state.cluster.error = payload.', () => { - const payload = 'an error message'; - - mutations[CLUSTER_FETCH_FAILED](state, payload); - expect(state.cluster.error).toEqual('an error message'); - }); - }); - - describe('CLUSTER_FETCH_START', () => { - const state = { - cluster: { - error: 'an error message', - }, - }; - - it('should set state.cluster.error = null.', () => { - mutations[CLUSTER_FETCH_START](state); - expect(state.cluster.error).toEqual(null); - }); - }); - - describe('CLUSTER_FETCH_SUCCESS', () => { - const state = { - cluster: { - data: null, - expiryDateTime: null, - }, - }; - - it('should set state.cluster.data = payload and state.cluster.expiryDateTime = Date() + CLUSTER_FETCH_EXPIRY_TTL', () => { - const payload = {}; - - mutations[CLUSTER_FETCH_SUCCESS](state, payload); - expect(state.cluster).toEqual({ - data: {}, - expiryDateTime: '2020-01-01T01:00:00.000Z', - }); - }); - }); -}); diff --git a/client/containers/cross-region/action-types.js b/client/containers/cross-region/action-types.js deleted file mode 100644 index 6a6de94d1..000000000 --- a/client/containers/cross-region/action-types.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { typePrefix } from './helpers'; - -export const CROSS_REGION_FETCH = typePrefix('FETCH'); diff --git a/client/containers/cross-region/actions.js b/client/containers/cross-region/actions.js deleted file mode 100644 index c9c8791fb..000000000 --- a/client/containers/cross-region/actions.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { CROSS_REGION_FETCH } from './action-types'; -import { CROSS_REGION_IS_READY } from './getter-types'; -import { - CROSS_REGION_RESET_STATE, - CROSS_REGION_SET_ALLOWED_CROSS_ORIGIN, - CROSS_REGION_SET_CLUSTER_ORIGIN_LIST, - CROSS_REGION_SET_CROSS_REGION, - CROSS_REGION_SET_IS_READY, -} from './mutation-types'; -import { featureFlagService } from '~services'; - -const actions = { - [CROSS_REGION_FETCH]: async ({ commit, getters }) => { - const ready = getters[CROSS_REGION_IS_READY]; - - if (ready) { - return; - } - - commit(CROSS_REGION_RESET_STATE); - - const crossRegion = await featureFlagService.isFeatureFlagEnabled({ - name: 'crossRegion', - }); - - commit(CROSS_REGION_SET_CROSS_REGION, crossRegion); - - if (!crossRegion) { - commit(CROSS_REGION_SET_IS_READY, true); - - return; - } - - const { origin } = window.location; - const [allowedCrossOrigin, clusterOriginList] = await Promise.all([ - featureFlagService.isFeatureFlagEnabled({ - name: 'crossRegion.allowedCrossOrigin', - params: { - origin, - }, - }), - featureFlagService.getConfiguration({ - name: 'crossRegion.clusterOriginList', - }), - ]); - - commit(CROSS_REGION_SET_ALLOWED_CROSS_ORIGIN, allowedCrossOrigin); - commit(CROSS_REGION_SET_CLUSTER_ORIGIN_LIST, clusterOriginList); - commit(CROSS_REGION_SET_IS_READY, true); - }, -}; - -export default actions; diff --git a/client/containers/cross-region/component.vue b/client/containers/cross-region/component.vue deleted file mode 100644 index 36cfb43a7..000000000 --- a/client/containers/cross-region/component.vue +++ /dev/null @@ -1,39 +0,0 @@ - - diff --git a/client/containers/cross-region/connector.js b/client/containers/cross-region/connector.js deleted file mode 100644 index 0af7aba6c..000000000 --- a/client/containers/cross-region/connector.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { connect } from 'vuex-connect'; -import { CROSS_REGION_FETCH } from './action-types'; -import { CROSS_REGION_IS_LOADING, CROSS_REGION_IS_READY } from './getter-types'; - -const gettersToProps = { - isLoading: CROSS_REGION_IS_LOADING, - isReady: CROSS_REGION_IS_READY, -}; - -const lifecycle = { - mounted: ({ dispatch }) => dispatch(CROSS_REGION_FETCH), -}; - -export default connect({ - gettersToProps, - lifecycle, -}); diff --git a/client/containers/cross-region/constants.js b/client/containers/cross-region/constants.js deleted file mode 100644 index e8371af3f..000000000 --- a/client/containers/cross-region/constants.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const CROSS_REGION_STATE_PREFIX = 'crossRegion'; -export const CROSS_REGION_TYPE_PREFIX = 'CROSS_REGION'; diff --git a/client/containers/cross-region/get-default-state.js b/client/containers/cross-region/get-default-state.js deleted file mode 100644 index 2b720e5cb..000000000 --- a/client/containers/cross-region/get-default-state.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const getDefaultState = (state = {}) => ({ - allowedCrossOrigin: undefined, - clusterOriginList: undefined, - crossRegion: undefined, - isReady: false, - ...state, -}); - -export default getDefaultState; diff --git a/client/containers/cross-region/getter-types.js b/client/containers/cross-region/getter-types.js deleted file mode 100644 index 5aec8f21d..000000000 --- a/client/containers/cross-region/getter-types.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { typePrefix } from './helpers'; - -export const CROSS_REGION = 'CROSS_REGION'; -export const CROSS_REGION_ALLOWED_CROSS_ORIGIN = typePrefix( - 'ALLOWED_CROSS_ORIGIN' -); -export const CROSS_REGION_CLUSTER_ORIGIN_LIST = typePrefix( - 'CLUSTER_ORIGIN_LIST' -); -export const CROSS_REGION_IS_LOADING = typePrefix('IS_LOADING'); -export const CROSS_REGION_IS_READY = typePrefix('IS_READY'); diff --git a/client/containers/cross-region/getters.js b/client/containers/cross-region/getters.js deleted file mode 100644 index 31da0a0bf..000000000 --- a/client/containers/cross-region/getters.js +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { get } from 'lodash-es'; -import { statePrefix } from './helpers'; -import { - CROSS_REGION, - CROSS_REGION_ALLOWED_CROSS_ORIGIN, - CROSS_REGION_CLUSTER_ORIGIN_LIST, - CROSS_REGION_IS_LOADING, - CROSS_REGION_IS_READY, -} from './getter-types'; - -const getters = { - [CROSS_REGION]: state => get(state, statePrefix('crossRegion')), - [CROSS_REGION_ALLOWED_CROSS_ORIGIN]: state => - get(state, statePrefix('allowedCrossOrigin')), - [CROSS_REGION_CLUSTER_ORIGIN_LIST]: state => - get(state, statePrefix('clusterOriginList')), - [CROSS_REGION_IS_LOADING]: (_, getters) => !getters[CROSS_REGION_IS_READY], - [CROSS_REGION_IS_READY]: state => get(state, statePrefix('isReady')), -}; - -export default getters; diff --git a/client/containers/cross-region/helpers/index.js b/client/containers/cross-region/helpers/index.js deleted file mode 100644 index f723f68ed..000000000 --- a/client/containers/cross-region/helpers/index.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export { default as statePrefix } from './state-prefix'; -export { default as typePrefix } from './type-prefix'; diff --git a/client/containers/cross-region/helpers/state-prefix.js b/client/containers/cross-region/helpers/state-prefix.js deleted file mode 100644 index 3b410daa8..000000000 --- a/client/containers/cross-region/helpers/state-prefix.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { CROSS_REGION_STATE_PREFIX } from '../constants'; - -const statePrefix = term => `${CROSS_REGION_STATE_PREFIX}.${term}`; - -export default statePrefix; diff --git a/client/containers/cross-region/helpers/type-prefix.js b/client/containers/cross-region/helpers/type-prefix.js deleted file mode 100644 index c92ce0995..000000000 --- a/client/containers/cross-region/helpers/type-prefix.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { CROSS_REGION_TYPE_PREFIX } from '../constants'; - -const typePrefix = term => `${CROSS_REGION_TYPE_PREFIX}_${term}`; - -export default typePrefix; diff --git a/client/containers/cross-region/index.js b/client/containers/cross-region/index.js deleted file mode 100644 index cab0138d1..000000000 --- a/client/containers/cross-region/index.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import actions from './actions'; -import Component from './component'; -import connector from './connector'; -import getDefaultState from './get-default-state'; -import getters from './getters'; -import mutations from './mutations'; - -const container = connector(Component); - -export { actions, container, getDefaultState, getters, mutations }; diff --git a/client/containers/cross-region/mutation-types.js b/client/containers/cross-region/mutation-types.js deleted file mode 100644 index b681ac8c3..000000000 --- a/client/containers/cross-region/mutation-types.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { typePrefix } from './helpers'; - -export const CROSS_REGION_RESET_STATE = typePrefix('RESET_STATE'); -export const CROSS_REGION_SET_ALLOWED_CROSS_ORIGIN = typePrefix( - 'SET_ALLOWED_CROSS_ORIGIN' -); -export const CROSS_REGION_SET_CLUSTER_ORIGIN_LIST = typePrefix( - 'SET_CLUSTER_ORIGIN_LIST' -); -export const CROSS_REGION_SET_CROSS_REGION = typePrefix('SET_CROSS_REGION'); -export const CROSS_REGION_SET_IS_READY = typePrefix('SET_IS_READY'); diff --git a/client/containers/cross-region/mutations.js b/client/containers/cross-region/mutations.js deleted file mode 100644 index 763c577b9..000000000 --- a/client/containers/cross-region/mutations.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { - CROSS_REGION_SET_ALLOWED_CROSS_ORIGIN, - CROSS_REGION_SET_CLUSTER_ORIGIN_LIST, - CROSS_REGION_SET_CROSS_REGION, - CROSS_REGION_SET_IS_READY, - CROSS_REGION_RESET_STATE, -} from './mutation-types'; -import getDefaultState from './get-default-state'; - -const mutations = { - [CROSS_REGION_RESET_STATE]: state => { - const defaultState = getDefaultState(); - - state.crossRegion = defaultState; - }, - [CROSS_REGION_SET_ALLOWED_CROSS_ORIGIN]: (state, payload) => - (state.crossRegion.allowedCrossOrigin = payload), - [CROSS_REGION_SET_CLUSTER_ORIGIN_LIST]: (state, payload) => - (state.crossRegion.clusterOriginList = payload), - [CROSS_REGION_SET_CROSS_REGION]: (state, payload) => - (state.crossRegion.crossRegion = payload), - [CROSS_REGION_SET_IS_READY]: (state, payload) => - (state.crossRegion.isReady = payload), -}; - -export default mutations; diff --git a/client/containers/domain-autocomplete/action-types.js b/client/containers/domain-autocomplete/action-types.js deleted file mode 100644 index bc7f0dd1c..000000000 --- a/client/containers/domain-autocomplete/action-types.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { typePrefix } from './helpers'; - -export const DOMAIN_AUTOCOMPLETE_FETCH_DOMAIN_LIST = typePrefix( - 'FETCH_DOMAIN_LIST' -); -export const DOMAIN_AUTOCOMPLETE_ON_CHANGE = typePrefix('ON_CHANGE'); -export const DOMAIN_AUTOCOMPLETE_ON_SEARCH = typePrefix('ON_SEARCH'); diff --git a/client/containers/domain-autocomplete/actions.js b/client/containers/domain-autocomplete/actions.js deleted file mode 100644 index 4fdae3207..000000000 --- a/client/containers/domain-autocomplete/actions.js +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { debounce } from 'lodash-es'; -import { ROUTE_PUSH } from '../route/action-types'; -import { - CROSS_REGION_ALLOWED_CROSS_ORIGIN, - CROSS_REGION_CLUSTER_ORIGIN_LIST, -} from '../cross-region/getter-types'; -import { - DOMAIN_AUTOCOMPLETE_FETCH_DOMAIN_LIST, - DOMAIN_AUTOCOMPLETE_ON_CHANGE, - DOMAIN_AUTOCOMPLETE_ON_SEARCH, -} from './action-types'; -import { - DOMAIN_AUTOCOMPLETE_SET_IS_LOADING, - DOMAIN_AUTOCOMPLETE_SET_DOMAIN_LIST, - DOMAIN_AUTOCOMPLETE_SET_SEARCH, - DOMAIN_AUTOCOMPLETE_SET_VISITED_DOMAIN_LIST, -} from './mutation-types'; -import { - DOMAIN_AUTOCOMPLETE_SEARCH_URL, - DOMAIN_AUTOCOMPLETE_VISITED_DOMAIN_LIST, -} from './getter-types'; -import { DEBOUNCE_WAIT } from './constants'; -import { - updateVisitedDomainList, - filterDuplicatesFromDomainList, -} from './helpers'; -import { httpService } from '~services'; - -const actions = { - [DOMAIN_AUTOCOMPLETE_FETCH_DOMAIN_LIST]: debounce( - async ({ commit, getters }) => { - const searchUrl = getters[DOMAIN_AUTOCOMPLETE_SEARCH_URL]; - const allowedCrossOrigin = getters[CROSS_REGION_ALLOWED_CROSS_ORIGIN]; - const clusterOriginList = getters[CROSS_REGION_CLUSTER_ORIGIN_LIST]; - - const fetchDomainForOrigin = async ({ clusterName = '', origin }) => { - try { - const result = await httpService.get( - `${origin}${searchUrl}`, - origin && { - credentials: 'include', - mode: 'cors', - } - ); - - return result; - } catch (error) { - console.warn( - `Failed to fetch result from cluster "${clusterName}" with origin "${origin}" with error:`, - error - ); - } - }; - - if (allowedCrossOrigin && clusterOriginList) { - const domainListSet = await Promise.all( - clusterOriginList.map(fetchDomainForOrigin) - ); - - const domainList = filterDuplicatesFromDomainList( - domainListSet.filter(result => !!result).flat() - ); - - commit(DOMAIN_AUTOCOMPLETE_SET_IS_LOADING, false); - commit(DOMAIN_AUTOCOMPLETE_SET_DOMAIN_LIST, domainList); - } else { - const domainList = await fetchDomainForOrigin({ origin: '' }); - - commit(DOMAIN_AUTOCOMPLETE_SET_IS_LOADING, false); - commit(DOMAIN_AUTOCOMPLETE_SET_DOMAIN_LIST, domainList); - } - }, - DEBOUNCE_WAIT - ), - [DOMAIN_AUTOCOMPLETE_ON_CHANGE]: async ( - { commit, dispatch, getters }, - payload - ) => { - if (!payload) { - return; - } - - const { value } = payload; - const visitedDomainList = getters[DOMAIN_AUTOCOMPLETE_VISITED_DOMAIN_LIST]; - const allowedCrossOrigin = getters[CROSS_REGION_ALLOWED_CROSS_ORIGIN]; - const dispatchToGlobalRoute = () => - dispatch(ROUTE_PUSH, `/domains/${value.domainInfo.name}`); - - const updatedVisitedDomainList = updateVisitedDomainList({ - value, - visitedDomainList, - }); - - commit( - DOMAIN_AUTOCOMPLETE_SET_VISITED_DOMAIN_LIST, - updatedVisitedDomainList - ); - - if ( - !allowedCrossOrigin || - !value.replicationConfiguration || - (value.isGlobalDomain && - value.replicationConfiguration.clusters.length > 1) - ) { - return dispatchToGlobalRoute(); - } - - dispatch( - ROUTE_PUSH, - `/domains/${value.domainInfo.name}/${value.replicationConfiguration.activeClusterName}` - ); - }, - [DOMAIN_AUTOCOMPLETE_ON_SEARCH]: async ({ commit, dispatch }, payload) => { - commit(DOMAIN_AUTOCOMPLETE_SET_SEARCH, payload); - - if (payload) { - commit(DOMAIN_AUTOCOMPLETE_SET_IS_LOADING, true); - dispatch(DOMAIN_AUTOCOMPLETE_FETCH_DOMAIN_LIST); - } else { - commit(DOMAIN_AUTOCOMPLETE_SET_DOMAIN_LIST, []); - } - }, -}; - -export default actions; diff --git a/client/containers/domain-autocomplete/component.vue b/client/containers/domain-autocomplete/component.vue deleted file mode 100644 index 1fa7b308d..000000000 --- a/client/containers/domain-autocomplete/component.vue +++ /dev/null @@ -1,130 +0,0 @@ - - - - - diff --git a/client/containers/domain-autocomplete/connector.js b/client/containers/domain-autocomplete/connector.js deleted file mode 100644 index 8854cc7b8..000000000 --- a/client/containers/domain-autocomplete/connector.js +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { connect } from 'vuex-connect'; -import { ROUTE_PARAMS_DOMAIN } from '../route/getter-types'; -import { - DOMAIN_AUTOCOMPLETE_ON_CHANGE, - DOMAIN_AUTOCOMPLETE_ON_SEARCH, -} from './action-types'; -import { - DOMAIN_AUTOCOMPLETE_COMBINED_DOMAIN_LIST, - DOMAIN_AUTOCOMPLETE_IS_LOADING, - DOMAIN_AUTOCOMPLETE_NAVIGATE_TO_DOMAIN_URL, - DOMAIN_AUTOCOMPLETE_SEARCH, -} from './getter-types'; -import { DOMAIN_AUTOCOMPLETE_ON_MOUNTED } from './mutation-types'; - -const actionsToEvents = { - onChange: DOMAIN_AUTOCOMPLETE_ON_CHANGE, - onSearch: DOMAIN_AUTOCOMPLETE_ON_SEARCH, -}; - -const gettersToProps = { - isLoading: DOMAIN_AUTOCOMPLETE_IS_LOADING, - domain: ROUTE_PARAMS_DOMAIN, - domainList: DOMAIN_AUTOCOMPLETE_COMBINED_DOMAIN_LIST, - navigateToDomainUrl: DOMAIN_AUTOCOMPLETE_NAVIGATE_TO_DOMAIN_URL, - search: DOMAIN_AUTOCOMPLETE_SEARCH, -}; - -const lifecycle = { - mounted: ({ commit }) => { - commit(DOMAIN_AUTOCOMPLETE_ON_MOUNTED); - }, -}; - -export default connect({ - actionsToEvents, - gettersToProps, - lifecycle, -}); diff --git a/client/containers/domain-autocomplete/constants.js b/client/containers/domain-autocomplete/constants.js deleted file mode 100644 index 90fff3999..000000000 --- a/client/containers/domain-autocomplete/constants.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const DEBOUNCE_WAIT = 500; -export const DOMAIN_AUTOCOMPLETE_STATE_PREFIX = 'domainAutocomplete'; -export const DOMAIN_AUTOCOMPLETE_TYPE_PREFIX = 'DOMAIN_AUTOCOMPLETE'; -export const TOP_DOMAIN_LIST_LIMIT = 15; -export const VISITED_DOMAIN_LIST_LIMIT = 15; diff --git a/client/containers/domain-autocomplete/get-default-state.js b/client/containers/domain-autocomplete/get-default-state.js deleted file mode 100644 index 5de73a7a1..000000000 --- a/client/containers/domain-autocomplete/get-default-state.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { migrateRecentDomains } from './helpers'; - -const getDefaultState = (state = {}) => ({ - isLoading: false, - domainList: [], - search: '', - visitedDomainList: migrateRecentDomains( - JSON.tryParse(localStorage.getItem('recent-domains')) - ), - ...state, -}); - -export default getDefaultState; diff --git a/client/containers/domain-autocomplete/getter-types.js b/client/containers/domain-autocomplete/getter-types.js deleted file mode 100644 index ddedcab3d..000000000 --- a/client/containers/domain-autocomplete/getter-types.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { typePrefix } from './helpers'; - -export const DOMAIN_AUTOCOMPLETE_COMBINED_DOMAIN_LIST = typePrefix( - 'COMBINED_DOMAIN_LIST' -); -export const DOMAIN_AUTOCOMPLETE_DOMAIN_LIST = typePrefix('DOMAIN_LIST'); -export const DOMAIN_AUTOCOMPLETE_FILTERED_VISITED_DOMAIN_LIST = typePrefix( - 'FILTERED_VISITED_DOMAIN_LIST' -); -export const DOMAIN_AUTOCOMPLETE_IS_LOADING = typePrefix('IS_LOADING'); -export const DOMAIN_AUTOCOMPLETE_NAVIGATE_TO_DOMAIN_URL = typePrefix( - 'NAVIGATE_TO_DOMAIN_URL' -); -export const DOMAIN_AUTOCOMPLETE_SEARCH = typePrefix('SEARCH'); -export const DOMAIN_AUTOCOMPLETE_SEARCH_URL = typePrefix('SEARCH_URL'); -export const DOMAIN_AUTOCOMPLETE_VISITED_DOMAIN_LIST = typePrefix( - 'VISITED_DOMAIN_LIST' -); diff --git a/client/containers/domain-autocomplete/getters.js b/client/containers/domain-autocomplete/getters.js deleted file mode 100644 index 03b7e9674..000000000 --- a/client/containers/domain-autocomplete/getters.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { get } from 'lodash-es'; -import { - DOMAIN_AUTOCOMPLETE_COMBINED_DOMAIN_LIST, - DOMAIN_AUTOCOMPLETE_DOMAIN_LIST, - DOMAIN_AUTOCOMPLETE_FILTERED_VISITED_DOMAIN_LIST, - DOMAIN_AUTOCOMPLETE_IS_LOADING, - DOMAIN_AUTOCOMPLETE_NAVIGATE_TO_DOMAIN_URL, - DOMAIN_AUTOCOMPLETE_SEARCH, - DOMAIN_AUTOCOMPLETE_SEARCH_URL, - DOMAIN_AUTOCOMPLETE_VISITED_DOMAIN_LIST, -} from './getter-types'; -import { - combineDomainList, - filterVisitedDomainList, - filterTopDomainList, - formatDomainList, - sortDomainList, - statePrefix, -} from './helpers'; -import { combine } from '~helpers'; - -const getters = { - [DOMAIN_AUTOCOMPLETE_COMBINED_DOMAIN_LIST]: (_, getters) => { - const visitedDomainList = - getters[DOMAIN_AUTOCOMPLETE_FILTERED_VISITED_DOMAIN_LIST]; - const domainList = getters[DOMAIN_AUTOCOMPLETE_DOMAIN_LIST]; - const combinedDomainList = combineDomainList({ - visitedDomainList, - domainList, - }); - - return combine( - sortDomainList, - filterTopDomainList, - formatDomainList - )(combinedDomainList); - }, - [DOMAIN_AUTOCOMPLETE_DOMAIN_LIST]: state => - sortDomainList(get(state, statePrefix('domainList')) || []), - [DOMAIN_AUTOCOMPLETE_FILTERED_VISITED_DOMAIN_LIST]: (_, getters) => - filterVisitedDomainList({ - visitedDomainList: getters[DOMAIN_AUTOCOMPLETE_VISITED_DOMAIN_LIST], - search: getters[DOMAIN_AUTOCOMPLETE_SEARCH], - }), - [DOMAIN_AUTOCOMPLETE_IS_LOADING]: state => - get(state, statePrefix('isLoading')) || false, - [DOMAIN_AUTOCOMPLETE_NAVIGATE_TO_DOMAIN_URL]: (_, getters) => { - const search = getters[DOMAIN_AUTOCOMPLETE_SEARCH]; - - if (!search) { - return ''; - } - - return `/domains/${search}`; - }, - [DOMAIN_AUTOCOMPLETE_SEARCH]: state => - get(state, statePrefix('search')) || '', - [DOMAIN_AUTOCOMPLETE_SEARCH_URL]: (_, getters) => - `/api/domains?querystring=${getters[DOMAIN_AUTOCOMPLETE_SEARCH]}`, - [DOMAIN_AUTOCOMPLETE_VISITED_DOMAIN_LIST]: state => - sortDomainList(get(state, statePrefix('visitedDomainList')) || []), -}; - -export default getters; diff --git a/client/containers/domain-autocomplete/helpers/combine-domain-list.js b/client/containers/domain-autocomplete/helpers/combine-domain-list.js deleted file mode 100644 index 0b89e1956..000000000 --- a/client/containers/domain-autocomplete/helpers/combine-domain-list.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const combineDomainList = ({ domainList, visitedDomainList }) => { - const domainListUuidList = domainList.map(domain => domain.domainInfo.uuid); - const domainNameList = domainList.map(domain => domain.domainInfo.name); - - return [ - ...domainList, - ...visitedDomainList.filter(domain => - domain.domainInfo.uuid === undefined - ? domainNameList.indexOf(domain.domainInfo.name) === -1 - : domainListUuidList.indexOf(domain.domainInfo.uuid) === -1 - ), - ]; -}; - -export default combineDomainList; diff --git a/client/containers/domain-autocomplete/helpers/combine-domain-list.spec.js b/client/containers/domain-autocomplete/helpers/combine-domain-list.spec.js deleted file mode 100644 index 0e573949b..000000000 --- a/client/containers/domain-autocomplete/helpers/combine-domain-list.spec.js +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import combineDomainList from './combine-domain-list'; - -describe('combineDomainList', () => { - describe('when passed domainList & visitedDomainList', () => { - const visitedDomainList = [ - { - domainInfo: { - name: 'domain1', - }, - }, - { - domainInfo: { - name: 'domain2', - uuid: 2, - }, - }, - { - domainInfo: { - name: 'domain3', - }, - }, - { - domainInfo: { - name: 'domain4', - uuid: 4, - }, - }, - ]; - - const domainList = [ - { - domainInfo: { - name: 'domain0', - uuid: 0, - }, - }, - { - domainInfo: { - name: 'domain1', - uuid: 1, - }, - }, - { - domainInfo: { - name: 'domain2', - uuid: 2, - }, - }, - ]; - - it('should combine the two lists into a single list by removing any duplicates from the visitedDomainList.', () => { - const output = combineDomainList({ domainList, visitedDomainList }); - - expect(output).toEqual([ - { - domainInfo: { - name: 'domain0', - uuid: 0, - }, - }, - { - domainInfo: { - name: 'domain1', - uuid: 1, - }, - }, - { - domainInfo: { - name: 'domain2', - uuid: 2, - }, - }, - { - domainInfo: { - name: 'domain3', - }, - }, - { - domainInfo: { - name: 'domain4', - uuid: 4, - }, - }, - ]); - }); - }); -}); diff --git a/client/containers/domain-autocomplete/helpers/filter-duplicates-from-domain-list.js b/client/containers/domain-autocomplete/helpers/filter-duplicates-from-domain-list.js deleted file mode 100644 index f1c325c7c..000000000 --- a/client/containers/domain-autocomplete/helpers/filter-duplicates-from-domain-list.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const filterDuplicatesFromDomainList = domainList => { - return domainList.reduce( - (accumulator, domain) => { - const domainName = domain.domainInfo.name; - - if ( - !domain.isGlobalDomain || - !accumulator.domainNameList.includes(domainName) - ) { - if (domain.isGlobalDomain) { - accumulator.domainNameList.push(domainName); - } - - accumulator.result.push(domain); - } - - return accumulator; - }, - { domainNameList: [], result: [] } - ).result; -}; - -export default filterDuplicatesFromDomainList; diff --git a/client/containers/domain-autocomplete/helpers/filter-top-domain-list.js b/client/containers/domain-autocomplete/helpers/filter-top-domain-list.js deleted file mode 100644 index 12def9f37..000000000 --- a/client/containers/domain-autocomplete/helpers/filter-top-domain-list.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { TOP_DOMAIN_LIST_LIMIT } from '../constants'; - -const filterTopDomainList = domainList => - domainList.slice(0, TOP_DOMAIN_LIST_LIMIT); - -export default filterTopDomainList; diff --git a/client/containers/domain-autocomplete/helpers/filter-top-domain-list.spec.js b/client/containers/domain-autocomplete/helpers/filter-top-domain-list.spec.js deleted file mode 100644 index 1fc3b65ef..000000000 --- a/client/containers/domain-autocomplete/helpers/filter-top-domain-list.spec.js +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { TOP_DOMAIN_LIST_LIMIT } from '../constants'; -import filterTopDomainList from './filter-top-domain-list'; - -describe('filterTopDomainList', () => { - const createDomainList = size => { - const newDomainList = []; - - for (let i = 1; i < size + 1; i++) { - newDomainList.push(`domain${i}`); - } - - return newDomainList; - }; - - describe('when domainList is greater than TOP_DOMAIN_LIST_LIMIT', () => { - let domainList; - - beforeEach(() => { - domainList = createDomainList(TOP_DOMAIN_LIST_LIMIT * 2); - }); - - it('should return only the first domains of size = TOP_DOMAIN_LIST_LIMIT', () => { - const output = filterTopDomainList(domainList); - - expect(output.length).toEqual(TOP_DOMAIN_LIST_LIMIT); - expect(output[0]).toEqual('domain1'); - expect(output[output.length - 1]).toEqual( - `domain${TOP_DOMAIN_LIST_LIMIT}` - ); - }); - }); -}); diff --git a/client/containers/domain-autocomplete/helpers/filter-visited-domain-list.js b/client/containers/domain-autocomplete/helpers/filter-visited-domain-list.js deleted file mode 100644 index 6b4862477..000000000 --- a/client/containers/domain-autocomplete/helpers/filter-visited-domain-list.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const filterVisitedDomainList = ({ search, visitedDomainList }) => - !search - ? visitedDomainList - : visitedDomainList.filter( - domain => domain.domainInfo.name.indexOf(search) !== -1 - ); - -export default filterVisitedDomainList; diff --git a/client/containers/domain-autocomplete/helpers/filter-visited-domain-list.spec.js b/client/containers/domain-autocomplete/helpers/filter-visited-domain-list.spec.js deleted file mode 100644 index 53f7e2e3a..000000000 --- a/client/containers/domain-autocomplete/helpers/filter-visited-domain-list.spec.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import filterVisitedDomainList from './filter-visited-domain-list'; - -describe('filterVisitedDomainList', () => { - let visitedDomainList; - - beforeEach(() => { - visitedDomainList = [ - { - domainInfo: { - name: 'domain1', - }, - }, - { - domainInfo: { - name: 'domain2', - uuid: 2, - }, - }, - { - domainInfo: { - name: 'other', - }, - }, - ]; - }); - - describe('when search = ""', () => { - const search = ''; - - it('should return all of visitedDomainList.', () => { - const output = filterVisitedDomainList({ search, visitedDomainList }); - - expect(output).toEqual(visitedDomainList); - }); - }); - - describe('when search = "domain"', () => { - const search = 'domain'; - - it('should only return domains which match search from visitedDomainList', () => { - const output = filterVisitedDomainList({ search, visitedDomainList }); - - expect(output).toEqual([ - { - domainInfo: { - name: 'domain1', - }, - }, - { - domainInfo: { - name: 'domain2', - uuid: 2, - }, - }, - ]); - }); - }); -}); diff --git a/client/containers/domain-autocomplete/helpers/format-domain-label.js b/client/containers/domain-autocomplete/helpers/format-domain-label.js deleted file mode 100644 index c97729629..000000000 --- a/client/containers/domain-autocomplete/helpers/format-domain-label.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import get from 'lodash.get'; - -const formatDomainLabel = domain => - [ - domain.domainInfo.name, - domain.isGlobalDomain !== undefined && - (domain.isGlobalDomain ? 'Global' : 'Local'), - get(domain, 'replicationConfiguration.activeClusterName'), - ] - .filter(substring => !!substring) - .join(' - '); - -export default formatDomainLabel; diff --git a/client/containers/domain-autocomplete/helpers/format-domain-label.spec.js b/client/containers/domain-autocomplete/helpers/format-domain-label.spec.js deleted file mode 100644 index f55fce813..000000000 --- a/client/containers/domain-autocomplete/helpers/format-domain-label.spec.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import formatDomainLabel from './format-domain-label'; - -describe('formatDomainLabel', () => { - describe('when passed domain object with only name defined', () => { - const domain = { - domainInfo: { - name: 'domainName', - }, - }; - - it('should render only the domainName.', () => { - const output = formatDomainLabel(domain); - - expect(output).toEqual('domainName'); - }); - }); - - describe('when passed a local domain object', () => { - it('should return "domainName - Local - activeCluster"', () => { - const domain = { - domainInfo: { - name: 'domainName', - }, - isGlobalDomain: false, - replicationConfiguration: { - activeClusterName: 'activeCluster', - }, - }; - - const output = formatDomainLabel(domain); - - expect(output).toEqual('domainName - Local - activeCluster'); - }); - }); - - describe('when passed a global domain object', () => { - it('should return "domainName - Global - activeCluster"', () => { - const domain = { - domainInfo: { - name: 'domainName', - }, - isGlobalDomain: true, - replicationConfiguration: { - activeClusterName: 'activeCluster', - }, - }; - - const output = formatDomainLabel(domain); - - expect(output).toEqual('domainName - Global - activeCluster'); - }); - }); -}); diff --git a/client/containers/domain-autocomplete/helpers/format-domain-list.js b/client/containers/domain-autocomplete/helpers/format-domain-list.js deleted file mode 100644 index a8c99d258..000000000 --- a/client/containers/domain-autocomplete/helpers/format-domain-list.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import formatDomainLabel from './format-domain-label'; - -const formatDomainList = domainList => - domainList.map(domain => ({ - label: formatDomainLabel(domain), - value: domain, - })); - -export default formatDomainList; diff --git a/client/containers/domain-autocomplete/helpers/index.js b/client/containers/domain-autocomplete/helpers/index.js deleted file mode 100644 index f32e26400..000000000 --- a/client/containers/domain-autocomplete/helpers/index.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export { default as combineDomainList } from './combine-domain-list'; -export { default as filterDuplicatesFromDomainList } from './filter-duplicates-from-domain-list'; -export { default as filterTopDomainList } from './filter-top-domain-list'; -export { default as filterVisitedDomainList } from './filter-visited-domain-list'; -export { default as formatDomainLabel } from './format-domain-label'; -export { default as formatDomainList } from './format-domain-list'; -export { default as migrateRecentDomains } from './migrate-recent-domains'; -export { default as sortDomainList } from './sort-domain-list'; -export { default as statePrefix } from './state-prefix'; -export { default as typePrefix } from './type-prefix'; -export { default as updateVisitedDomainList } from './update-visited-domain-list'; diff --git a/client/containers/domain-autocomplete/helpers/migrate-recent-domains.js b/client/containers/domain-autocomplete/helpers/migrate-recent-domains.js deleted file mode 100644 index e81d31e79..000000000 --- a/client/containers/domain-autocomplete/helpers/migrate-recent-domains.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const migrateRecentDomains = domainList => - (domainList && - domainList.map(domain => { - if (typeof domain === 'string') { - return { - domainInfo: { - name: domain, - }, - }; - } - - return domain; - })) || - []; - -export default migrateRecentDomains; diff --git a/client/containers/domain-autocomplete/helpers/migrate-recent-domains.spec.js b/client/containers/domain-autocomplete/helpers/migrate-recent-domains.spec.js deleted file mode 100644 index e25c3b424..000000000 --- a/client/containers/domain-autocomplete/helpers/migrate-recent-domains.spec.js +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import migrateRecentDomains from './migrate-recent-domains'; - -describe('migrateRecentDomains', () => { - describe('when passed domainList array of strings', () => { - it('should format to array objects.', () => { - const domainList = ['domainA', 'domainB', 'domainC']; - const output = migrateRecentDomains(domainList); - - expect(output).toEqual([ - { - domainInfo: { - name: 'domainA', - }, - }, - { - domainInfo: { - name: 'domainB', - }, - }, - { - domainInfo: { - name: 'domainC', - }, - }, - ]); - }); - }); - - describe('when passed domainList array of objects', () => { - it('should not change the array.', () => { - const domainList = [ - { - domainInfo: { - name: 'domainA', - uuid: 1, - }, - }, - { - domainInfo: { - name: 'domainB', - uuid: 2, - }, - }, - { - domainInfo: { - name: 'domainC', - uuid: 2, - }, - }, - ]; - const output = migrateRecentDomains(domainList); - - expect(output).toEqual([ - { - domainInfo: { - name: 'domainA', - uuid: 1, - }, - }, - { - domainInfo: { - name: 'domainB', - uuid: 2, - }, - }, - { - domainInfo: { - name: 'domainC', - uuid: 2, - }, - }, - ]); - }); - }); - - describe('when passed domainList array of mixed strings and objects', () => { - it('should only change the strings to objects and leave the rest.', () => { - const domainList = [ - { - domainInfo: { - name: 'domainA', - uuid: 1, - }, - }, - { - domainInfo: { - name: 'domainB', - uuid: 2, - }, - }, - 'domainC', - ]; - const output = migrateRecentDomains(domainList); - - expect(output).toEqual([ - { - domainInfo: { - name: 'domainA', - uuid: 1, - }, - }, - { - domainInfo: { - name: 'domainB', - uuid: 2, - }, - }, - { - domainInfo: { - name: 'domainC', - }, - }, - ]); - }); - }); -}); diff --git a/client/containers/domain-autocomplete/helpers/sort-domain-list.js b/client/containers/domain-autocomplete/helpers/sort-domain-list.js deleted file mode 100644 index d821012ef..000000000 --- a/client/containers/domain-autocomplete/helpers/sort-domain-list.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const sortDomainList = domainList => - domainList.sort((domainA, domainB) => { - const domainNameA = domainA.domainInfo.name; - const domainNameB = domainB.domainInfo.name; - - if (domainNameA < domainNameB) { - return -1; - } - - if (domainNameA > domainNameB) { - return 1; - } - - return 0; - }); - -export default sortDomainList; diff --git a/client/containers/domain-autocomplete/helpers/sort-domain-list.spec.js b/client/containers/domain-autocomplete/helpers/sort-domain-list.spec.js deleted file mode 100644 index cd9b824e9..000000000 --- a/client/containers/domain-autocomplete/helpers/sort-domain-list.spec.js +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import sortDomainList from './sort-domain-list'; - -describe('sortDomainList', () => { - const createDomainObject = domainName => ({ - domainInfo: { - name: domainName, - }, - }); - - describe('when passed an unsorted domainList', () => { - it('should return an alphabetically sorted domainList', () => { - const domainA = createDomainObject('domainA'); - const domainB = createDomainObject('domainB'); - const domainC = createDomainObject('domainC'); - const domainD = createDomainObject('domainD'); - const domainE = createDomainObject('domainE'); - const domainF = createDomainObject('domainF'); - - const domainList = [domainF, domainD, domainB, domainE, domainA, domainC]; - - const output = sortDomainList(domainList); - - expect(output).toEqual([ - domainA, - domainB, - domainC, - domainD, - domainE, - domainF, - ]); - }); - }); -}); diff --git a/client/containers/domain-autocomplete/helpers/state-prefix.js b/client/containers/domain-autocomplete/helpers/state-prefix.js deleted file mode 100644 index 6fc5a71f8..000000000 --- a/client/containers/domain-autocomplete/helpers/state-prefix.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { DOMAIN_AUTOCOMPLETE_STATE_PREFIX } from '../constants'; - -const statePrefix = term => `${DOMAIN_AUTOCOMPLETE_STATE_PREFIX}.${term}`; - -export default statePrefix; diff --git a/client/containers/domain-autocomplete/helpers/type-prefix.js b/client/containers/domain-autocomplete/helpers/type-prefix.js deleted file mode 100644 index 65f14bb81..000000000 --- a/client/containers/domain-autocomplete/helpers/type-prefix.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { DOMAIN_AUTOCOMPLETE_TYPE_PREFIX } from '../constants'; - -const typePrefix = term => `${DOMAIN_AUTOCOMPLETE_TYPE_PREFIX}_${term}`; - -export default typePrefix; diff --git a/client/containers/domain-autocomplete/helpers/update-visited-domain-list.js b/client/containers/domain-autocomplete/helpers/update-visited-domain-list.js deleted file mode 100644 index 17acd26bb..000000000 --- a/client/containers/domain-autocomplete/helpers/update-visited-domain-list.js +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { VISITED_DOMAIN_LIST_LIMIT } from '../constants'; - -const updateVisitedDomainList = ({ value, visitedDomainList }) => { - const name = value.domainInfo.name; - const uuid = value.domainInfo.uuid || null; - - const matchedDomainIndex = visitedDomainList.findIndex( - domain => - domain.domainInfo.uuid === uuid || - ((!uuid || !domain.domainInfo.uuid) && domain.domainInfo.name === name) - ); - - if (matchedDomainIndex === -1) { - const visitedDomainListExceededLimit = - visitedDomainList.length - VISITED_DOMAIN_LIST_LIMIT + 1; - - return [ - ...(visitedDomainListExceededLimit >= 1 - ? visitedDomainList.slice(visitedDomainListExceededLimit) - : visitedDomainList), - value, - ]; - } - - return [ - ...visitedDomainList.slice(0, matchedDomainIndex), - ...visitedDomainList.slice(matchedDomainIndex + 1), - value, - ]; -}; - -export default updateVisitedDomainList; diff --git a/client/containers/domain-autocomplete/helpers/update-visited-domain-list.spec.js b/client/containers/domain-autocomplete/helpers/update-visited-domain-list.spec.js deleted file mode 100644 index 487f9a6e2..000000000 --- a/client/containers/domain-autocomplete/helpers/update-visited-domain-list.spec.js +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { VISITED_DOMAIN_LIST_LIMIT } from '../constants'; -import updateVisitedDomainList from './update-visited-domain-list'; - -describe('updateVisitedDomainList', () => { - const getVisitedDomainList = () => [ - { - domainInfo: { - name: 'domainString', - }, - }, - { - domainInfo: { - uuid: 2, - name: 'domainObject', - }, - }, - ]; - - const getVisitedDomainListOfSize = size => { - const visitedDomainList = []; - - for (let i = 1; i < size + 1; i++) { - visitedDomainList.push({ - domainInfo: { - uuid: i, - name: `domain${i}`, - }, - }); - } - - return visitedDomainList; - }; - - describe('when value does not exist in visitedDomainList', () => { - describe('and the visited domain list does not equal the limit', () => { - it('should add the value to the end of the visitedDomainList.', () => { - const value = { - domainInfo: { - uuid: 3, - name: 'domain3', - }, - }; - const visitedDomainList = getVisitedDomainListOfSize(2); - const output = updateVisitedDomainList({ value, visitedDomainList }); - - expect(output).toEqual([ - { - domainInfo: { - uuid: 1, - name: 'domain1', - }, - }, - { - domainInfo: { - uuid: 2, - name: 'domain2', - }, - }, - { - domainInfo: { - uuid: 3, - name: 'domain3', - }, - }, - ]); - }); - }); - - describe('and the visited domain list equals the limit', () => { - it('should remove the first item and add the value to the end of the visitedDomainList.', () => { - const value = { - domainInfo: { - uuid: VISITED_DOMAIN_LIST_LIMIT + 1, - name: `domain${VISITED_DOMAIN_LIST_LIMIT + 1}`, - }, - }; - const visitedDomainList = getVisitedDomainListOfSize( - VISITED_DOMAIN_LIST_LIMIT - ); - - const output = updateVisitedDomainList({ value, visitedDomainList }); - - expect(output).toEqual([ - ...getVisitedDomainListOfSize(VISITED_DOMAIN_LIST_LIMIT).slice(1), - value, - ]); - }); - }); - - describe('and the visited domain list exceeds the limit', () => { - it('should remove the first three items and add the value to the end of the visitedDomainList.', () => { - const value = { - domainInfo: { - uuid: VISITED_DOMAIN_LIST_LIMIT + 3, - name: `domain${VISITED_DOMAIN_LIST_LIMIT + 3}`, - }, - }; - const visitedDomainList = getVisitedDomainListOfSize( - VISITED_DOMAIN_LIST_LIMIT + 2 - ); - - const output = updateVisitedDomainList({ value, visitedDomainList }); - - expect(output).toEqual([ - ...getVisitedDomainListOfSize(VISITED_DOMAIN_LIST_LIMIT + 2).slice(3), - value, - ]); - }); - }); - }); - - describe('when value does exist in visitedDomainList', () => { - it('should update the matchedDomain in visitedDomainList with the value object and place it at the end of the visitedDomainList.', () => { - const value = { - domainInfo: { - uuid: 1, - name: 'domainString', - }, - }; - const visitedDomainList = getVisitedDomainList(); - const output = updateVisitedDomainList({ value, visitedDomainList }); - - expect(output).toEqual([ - { - domainInfo: { - uuid: 2, - name: 'domainObject', - }, - }, - { - domainInfo: { - uuid: 1, - name: 'domainString', - }, - }, - ]); - }); - }); -}); diff --git a/client/containers/domain-autocomplete/index.js b/client/containers/domain-autocomplete/index.js deleted file mode 100644 index 5fba0c18b..000000000 --- a/client/containers/domain-autocomplete/index.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import actions from './actions'; -import Component from './component'; -import getDefaultState from './get-default-state'; -import getters from './getters'; -import connector from './connector'; -import mutations from './mutations'; -import reducer from './reducer'; - -const container = connector(Component); - -export { actions, container, getDefaultState, getters, mutations, reducer }; diff --git a/client/containers/domain-autocomplete/mutation-types.js b/client/containers/domain-autocomplete/mutation-types.js deleted file mode 100644 index dd910b517..000000000 --- a/client/containers/domain-autocomplete/mutation-types.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { typePrefix } from './helpers'; - -export const DOMAIN_AUTOCOMPLETE_ON_MOUNTED = typePrefix('ON_MOUNTED'); -export const DOMAIN_AUTOCOMPLETE_SET_IS_LOADING = typePrefix('SET_IS_LOADING'); -export const DOMAIN_AUTOCOMPLETE_SET_DOMAIN_LIST = typePrefix( - 'SET_DOMAIN_LIST' -); -export const DOMAIN_AUTOCOMPLETE_SET_SEARCH = typePrefix('SET_SEARCH'); -export const DOMAIN_AUTOCOMPLETE_SET_VISITED_DOMAIN_LIST = typePrefix( - 'SET_VISITED_DOMAIN_LIST' -); diff --git a/client/containers/domain-autocomplete/mutations.js b/client/containers/domain-autocomplete/mutations.js deleted file mode 100644 index bc6a9b3ca..000000000 --- a/client/containers/domain-autocomplete/mutations.js +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { - DOMAIN_AUTOCOMPLETE_ON_MOUNTED, - DOMAIN_AUTOCOMPLETE_SET_DOMAIN_LIST, - DOMAIN_AUTOCOMPLETE_SET_IS_LOADING, - DOMAIN_AUTOCOMPLETE_SET_SEARCH, - DOMAIN_AUTOCOMPLETE_SET_VISITED_DOMAIN_LIST, -} from './mutation-types'; - -const mutations = { - [DOMAIN_AUTOCOMPLETE_ON_MOUNTED]: state => { - state.domainAutocomplete.isLoading = false; - state.domainAutocomplete.domainList = []; - state.domainAutocomplete.search = ''; - }, - [DOMAIN_AUTOCOMPLETE_SET_DOMAIN_LIST]: (state, payload) => { - state.domainAutocomplete.domainList = payload; - }, - [DOMAIN_AUTOCOMPLETE_SET_IS_LOADING]: (state, payload) => { - state.domainAutocomplete.isLoading = payload; - }, - [DOMAIN_AUTOCOMPLETE_SET_VISITED_DOMAIN_LIST]: (state, payload) => { - state.domainAutocomplete.visitedDomainList = payload; - }, - [DOMAIN_AUTOCOMPLETE_SET_SEARCH]: (state, payload) => { - state.domainAutocomplete.search = payload; - }, -}; - -export default mutations; diff --git a/client/containers/domain-autocomplete/reducer.js b/client/containers/domain-autocomplete/reducer.js deleted file mode 100644 index 2b54b0673..000000000 --- a/client/containers/domain-autocomplete/reducer.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { migrateRecentDomains } from './helpers'; - -const reducer = state => - state && { - ...state, - visitedDomainList: migrateRecentDomains(state.visitedDomainList), - }; - -export default reducer; diff --git a/client/containers/domain/action-types.js b/client/containers/domain/action-types.js deleted file mode 100644 index ce5aaa0b1..000000000 --- a/client/containers/domain/action-types.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { typePrefix } from './helpers'; - -export const DOMAIN_CHANGE_ORIGIN = typePrefix('CHANGE_ORIGIN'); -export const DOMAIN_FETCH = typePrefix('FETCH'); -export const DOMAIN_ON_MOUNT = typePrefix('ON_MOUNT'); diff --git a/client/containers/domain/actions.js b/client/containers/domain/actions.js deleted file mode 100644 index 162a763b5..000000000 --- a/client/containers/domain/actions.js +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { - ROUTE_PARAMS_CLUSTER_NAME, - ROUTE_PARAMS_DOMAIN, -} from '../route/getter-types'; -import { - CROSS_REGION_ALLOWED_CROSS_ORIGIN, - CROSS_REGION_CLUSTER_ORIGIN_LIST, -} from '../cross-region/getter-types'; -import { - DOMAIN_CHANGE_ORIGIN, - DOMAIN_FETCH, - DOMAIN_ON_MOUNT, -} from './action-types'; -import { DOMAIN_CROSS_ORIGIN, DOMAIN_IS_READY } from './getter-types'; -import { - DOMAIN_RESET_STATE, - DOMAIN_SET_DOMAIN, - DOMAIN_SET_ERROR, -} from './mutation-types'; -import { httpService } from '~services'; -import { getExpiryDateTimeFromNow } from '~helpers'; - -const actions = { - [DOMAIN_FETCH]: async ({ commit, getters }) => { - const clusterName = getters[ROUTE_PARAMS_CLUSTER_NAME]; - const domainName = getters[ROUTE_PARAMS_DOMAIN]; - const ready = getters[DOMAIN_IS_READY]; - const allowedCrossOrigin = getters[CROSS_REGION_ALLOWED_CROSS_ORIGIN]; - const clusterOriginList = getters[CROSS_REGION_CLUSTER_ORIGIN_LIST]; - - if (ready) { - return; - } - - commit(DOMAIN_RESET_STATE, domainName); - - const cluster = - allowedCrossOrigin && - clusterName && - clusterOriginList && - clusterOriginList.find( - ({ clusterName: matchClusterName }) => matchClusterName === clusterName - ); - const origin = (cluster && cluster.origin) || ''; - - try { - const domain = await httpService.get( - `${origin}/api/domains/${domainName}` - ); - - if (allowedCrossOrigin && !domain.isGlobalDomain) { - const fetchList = clusterOriginList - .filter( - ({ clusterName }) => - clusterName !== domain.replicationConfiguration.activeClusterName - ) - .map(({ origin }) => async () => { - try { - const domainConfig = await httpService.get( - `${origin}/api/domains/${domainName}` - ); - - return domainConfig; - } catch (error) { - console.warn( - `Unable to resolve domain configuration for domain = "${domainName}" and origin = "${origin}".` - ); - } - }); - - const domainList = ( - await Promise.all(fetchList.map(callback => callback())) - ).filter(response => !!response); - - domainList.forEach(localDomain => { - localDomain.expiryDateTime = getExpiryDateTimeFromNow(); - commit(DOMAIN_SET_DOMAIN, localDomain); - }); - } - - domain.expiryDateTime = getExpiryDateTimeFromNow(); - commit(DOMAIN_SET_DOMAIN, domain); - } catch (error) { - console.warn( - `Failed to fetch domain configuration for "${domainName}" from "${origin}".` - ); - console.warn(error); - commit(DOMAIN_SET_ERROR, { - domainName, - error: `An error occurred while trying to fetch domain "${domainName}". Please check the domain is correct and try again.`, - }); - } - }, - [DOMAIN_ON_MOUNT]: ({ dispatch }) => { - dispatch(DOMAIN_CHANGE_ORIGIN); - dispatch(DOMAIN_FETCH); - }, - [DOMAIN_CHANGE_ORIGIN]: ({ getters }) => { - const origin = getters[DOMAIN_CROSS_ORIGIN]; - - httpService.setOrigin(origin); - }, -}; - -export default actions; diff --git a/client/containers/domain/component.vue b/client/containers/domain/component.vue deleted file mode 100644 index 42e5abe2f..000000000 --- a/client/containers/domain/component.vue +++ /dev/null @@ -1,68 +0,0 @@ - - diff --git a/client/containers/domain/connector.js b/client/containers/domain/connector.js deleted file mode 100644 index 7a885fe08..000000000 --- a/client/containers/domain/connector.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { connect } from 'vuex-connect'; -import { ROUTE_REPLACE } from '../route/action-types'; -import { - ROUTE_PARAMS_CLUSTER_NAME, - ROUTE_PARAMS_DOMAIN, -} from '../route/getter-types'; -import { ACTIVE_STATUS_CLUSTER } from '../active-status/getter-types'; -import { - DOMAIN_FETCH, - DOMAIN_ON_MOUNT, - DOMAIN_CHANGE_ORIGIN, -} from './action-types'; -import { - DOMAIN_ERROR, - DOMAIN_IS_LOADING, - DOMAIN_IS_READY, - DOMAIN_CROSS_ORIGIN, -} from './getter-types'; - -const actionsToEvents = { - onClusterChange: DOMAIN_FETCH, - onDomainChange: DOMAIN_FETCH, - onOriginChange: DOMAIN_CHANGE_ORIGIN, -}; - -const gettersToProps = { - clusterName: ROUTE_PARAMS_CLUSTER_NAME, - activeCluster: ACTIVE_STATUS_CLUSTER, - domainName: ROUTE_PARAMS_DOMAIN, - error: DOMAIN_ERROR, - isLoading: DOMAIN_IS_LOADING, - isReady: DOMAIN_IS_READY, - origin: DOMAIN_CROSS_ORIGIN, -}; - -const lifecycle = { - mounted: ({ dispatch }) => dispatch(DOMAIN_ON_MOUNT), - updated({ dispatch, state }) { - const urlParams = state.route.params; - const routeSupportsClusterNameParam = urlParams?.hasOwnProperty( - 'clusterName' - ); - - const hasClusterNameParam = Boolean(urlParams.clusterName); - - if ( - routeSupportsClusterNameParam && - !hasClusterNameParam && - this.activeCluster?.clusterName - ) { - // in some cases users have urls that are generic (with no cluster name specified) those are used when we want to auto redirect the user to one of the clusters by default without carring about which cluster. - dispatch(ROUTE_REPLACE, { - name: state.route.name, - params: { - ...state.route.params, - clusterName: this.activeCluster?.clusterName, - }, - }); - } - }, -}; - -export default connect({ - actionsToEvents, - gettersToProps, - lifecycle, -}); diff --git a/client/containers/domain/constants.js b/client/containers/domain/constants.js deleted file mode 100644 index af0cc8400..000000000 --- a/client/containers/domain/constants.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const DOMAIN_STATE_PREFIX = 'domain'; -export const DOMAIN_TYPE_PREFIX = 'DOMAIN'; diff --git a/client/containers/domain/get-default-state.js b/client/containers/domain/get-default-state.js deleted file mode 100644 index 85f0a33af..000000000 --- a/client/containers/domain/get-default-state.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const getDefaultState = (state = {}) => ({ - domainHash: {}, - ...state, -}); - -export default getDefaultState; diff --git a/client/containers/domain/getter-types.js b/client/containers/domain/getter-types.js deleted file mode 100644 index 3867620bc..000000000 --- a/client/containers/domain/getter-types.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { typePrefix } from './helpers'; - -export const DOMAIN_CROSS_ORIGIN = typePrefix('CROSS_ORIGIN'); -export const DOMAIN_CURRENT = typePrefix('CURRENT'); -export const DOMAIN_ERROR = typePrefix('ERROR'); -export const DOMAIN_HASH = typePrefix('HASH'); -export const DOMAIN_IS_LOADING = typePrefix('IS_LOADING'); -export const DOMAIN_IS_READY = typePrefix('IS_READY'); -export const DOMAIN_NAMESPACE = typePrefix('NAMESPACE'); diff --git a/client/containers/domain/getters.js b/client/containers/domain/getters.js deleted file mode 100644 index 64209f127..000000000 --- a/client/containers/domain/getters.js +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { get } from 'lodash-es'; -import { - ROUTE_PARAMS_CLUSTER_NAME, - ROUTE_PARAMS_DOMAIN, -} from '../route/getter-types'; -import { - CROSS_REGION, - CROSS_REGION_ALLOWED_CROSS_ORIGIN, - CROSS_REGION_CLUSTER_ORIGIN_LIST, -} from '../cross-region/getter-types'; -import { - DOMAIN_CROSS_ORIGIN, - DOMAIN_CURRENT, - DOMAIN_ERROR, - DOMAIN_HASH, - DOMAIN_IS_LOADING, - DOMAIN_IS_READY, - DOMAIN_NAMESPACE, -} from './getter-types'; -import { statePrefix, getDomain, getCrossOrigin } from './helpers'; -import { hasExpired } from '~helpers'; - -const getters = { - [DOMAIN_CURRENT]: (_, getters) => { - const clusterName = getters[ROUTE_PARAMS_CLUSTER_NAME]; - const domainNamespace = getters[DOMAIN_NAMESPACE]; - - return getDomain({ clusterName, domainNamespace }); - }, - [DOMAIN_NAMESPACE]: (_, getters) => { - const domainName = getters[ROUTE_PARAMS_DOMAIN]; - const domainHash = getters[DOMAIN_HASH]; - - return domainHash[domainName]; - }, - [DOMAIN_ERROR]: (_, getters) => { - const domainNamespace = getters[DOMAIN_NAMESPACE]; - - return domainNamespace && domainNamespace.error; - }, - [DOMAIN_HASH]: state => get(state, statePrefix('domainHash')), - [DOMAIN_IS_LOADING]: (_, getters) => - getters[CROSS_REGION] && - getters[ROUTE_PARAMS_DOMAIN] && - !getters[DOMAIN_ERROR] && - hasExpired(get(getters[DOMAIN_CURRENT], 'expiryDateTime')), - [DOMAIN_IS_READY]: (_, getters) => - !getters[DOMAIN_IS_LOADING] && !getters[DOMAIN_ERROR], - [DOMAIN_CROSS_ORIGIN]: (_, getters) => { - const allowedCrossOrigin = getters[CROSS_REGION_ALLOWED_CROSS_ORIGIN]; - const clusterName = getters[ROUTE_PARAMS_CLUSTER_NAME]; - const clusterOriginList = getters[CROSS_REGION_CLUSTER_ORIGIN_LIST]; - const crossRegion = getters[CROSS_REGION]; - const domain = getters[DOMAIN_CURRENT]; - - return getCrossOrigin({ - allowedCrossOrigin, - clusterName, - clusterOriginList, - crossRegion, - domain, - }); - }, -}; - -export default getters; diff --git a/client/containers/domain/helpers/get-cross-origin.js b/client/containers/domain/helpers/get-cross-origin.js deleted file mode 100644 index df69b1dae..000000000 --- a/client/containers/domain/helpers/get-cross-origin.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const getCrossOrigin = ({ - allowedCrossOrigin, - clusterName, - clusterOriginList, - crossRegion, - domain, -}) => { - if ( - !domain || - !crossRegion || - !allowedCrossOrigin || - !clusterOriginList || - !clusterOriginList.length - ) { - return window.location.origin; - } - - const { - replicationConfiguration: { activeClusterName, clusters }, - } = domain; - - const matchedActiveClusterOrigin = clusterOriginList.find( - ({ clusterName: matchClusterName }) => - matchClusterName === activeClusterName - ); - const matchedCluster = - clusterName && - clusters.find( - ({ clusterName: matchClusterName }) => matchClusterName === clusterName - ); - const matchedClusterOrigin = clusterOriginList.find( - ({ clusterName: matchClusterName }) => - matchedCluster && matchClusterName === clusterName - ); - const origin = - (matchedClusterOrigin && matchedClusterOrigin.origin) || - (matchedActiveClusterOrigin && matchedActiveClusterOrigin.origin); - - if (!origin) { - console.warn( - `could not find clusterName "${clusterName}" or "${activeClusterName}" in crossRegion.clusterOriginList.` - ); - } - - return origin || window.location.origin; -}; - -export default getCrossOrigin; diff --git a/client/containers/domain/helpers/get-domain.js b/client/containers/domain/helpers/get-domain.js deleted file mode 100644 index b166f19fa..000000000 --- a/client/containers/domain/helpers/get-domain.js +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const getDomain = ({ clusterName, domainNamespace }) => { - if (!domainNamespace) { - return; - } - - if (domainNamespace.global) { - return domainNamespace.global; - } - - if (domainNamespace.local) { - if (clusterName) { - return domainNamespace.local.find( - ({ replicationConfiguration: { activeClusterName } }) => - activeClusterName === clusterName - ); - } - - return domainNamespace.local[0]; - } -}; - -export default getDomain; diff --git a/client/containers/domain/helpers/index.js b/client/containers/domain/helpers/index.js deleted file mode 100644 index 73a91c49a..000000000 --- a/client/containers/domain/helpers/index.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export { default as getCrossOrigin } from './get-cross-origin'; -export { default as getDomain } from './get-domain'; -export { default as statePrefix } from './state-prefix'; -export { default as typePrefix } from './type-prefix'; diff --git a/client/containers/domain/helpers/state-prefix.js b/client/containers/domain/helpers/state-prefix.js deleted file mode 100644 index bd4dbdbb7..000000000 --- a/client/containers/domain/helpers/state-prefix.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { DOMAIN_STATE_PREFIX } from '../constants'; - -const statePrefix = term => `${DOMAIN_STATE_PREFIX}.${term}`; - -export default statePrefix; diff --git a/client/containers/domain/helpers/type-prefix.js b/client/containers/domain/helpers/type-prefix.js deleted file mode 100644 index aa524ac61..000000000 --- a/client/containers/domain/helpers/type-prefix.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { DOMAIN_TYPE_PREFIX } from '../constants'; - -const typePrefix = term => `${DOMAIN_TYPE_PREFIX}_${term}`; - -export default typePrefix; diff --git a/client/containers/domain/index.js b/client/containers/domain/index.js deleted file mode 100644 index cab0138d1..000000000 --- a/client/containers/domain/index.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import actions from './actions'; -import Component from './component'; -import connector from './connector'; -import getDefaultState from './get-default-state'; -import getters from './getters'; -import mutations from './mutations'; - -const container = connector(Component); - -export { actions, container, getDefaultState, getters, mutations }; diff --git a/client/containers/domain/mutation-types.js b/client/containers/domain/mutation-types.js deleted file mode 100644 index 22a550e63..000000000 --- a/client/containers/domain/mutation-types.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { typePrefix } from './helpers'; - -export const DOMAIN_RESET_STATE = typePrefix('RESET_STATE'); -export const DOMAIN_SET_DOMAIN = typePrefix('SET_DOMAIN'); -export const DOMAIN_SET_ERROR = typePrefix('SET_ERROR'); diff --git a/client/containers/domain/mutations.js b/client/containers/domain/mutations.js deleted file mode 100644 index e56c7e6bf..000000000 --- a/client/containers/domain/mutations.js +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { - DOMAIN_RESET_STATE, - DOMAIN_SET_DOMAIN, - DOMAIN_SET_ERROR, -} from './mutation-types'; - -const mutations = { - [DOMAIN_RESET_STATE]: (state, domainName) => { - state.domain.domainHash = { - ...state.domain.domainHash, - [domainName]: {}, - }; - }, - [DOMAIN_SET_DOMAIN]: (state, domain) => { - const { - domainInfo: { name: domainName }, - isGlobalDomain, - replicationConfiguration: { activeClusterName }, - } = domain; - - if (isGlobalDomain) { - return (state.domain.domainHash = { - ...state.domain.domainHash, - [domainName]: { - global: domain, - }, - }); - } - - if (!state.domain.domainHash[domainName].local) { - return (state.domain.domainHash = { - ...state.domain.domainHash, - [domainName]: { - local: [domain], - }, - }); - } - - const matchIndex = state.domain.domainHash[domainName].local.findIndex( - ({ - replicationConfiguration: { activeClusterName: matchActiveClusterName }, - }) => matchActiveClusterName === activeClusterName - ); - - if (matchIndex === -1) { - return (state.domain.domainHash = { - ...state.domain.domainHash, - [domainName]: { - local: [...state.domain.domainHash[domainName].local, domain], - }, - }); - } - - state.domain.domainHash[domainName].local.splice(matchIndex, 1, domain); - - state.domain.domainHash = { - ...state.domain.domainHash, - [domainName]: { - local: [...state.domain.domainHash[domainName].local], - }, - }; - }, - [DOMAIN_SET_ERROR]: (state, { domainName, error }) => { - state.domain.domainHash = { - ...state.domain.domainHash, - [domainName]: { - error, - }, - }; - }, -}; - -export default mutations; diff --git a/client/containers/graph/get-default-state.js b/client/containers/graph/get-default-state.js deleted file mode 100644 index a975db53a..000000000 --- a/client/containers/graph/get-default-state.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const getDefaultState = (state = {}) => ({ - childRoute: null, - newExecutionId: null, - parentRoute: null, - hasChildBtn: false, - childBtnText: null, - parentBtnText: 'to parent', - ...state, -}); - -export default getDefaultState; diff --git a/client/containers/graph/getters.js b/client/containers/graph/getters.js deleted file mode 100644 index 3b1856a9a..000000000 --- a/client/containers/graph/getters.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { get } from 'lodash-es'; - -const getters = { - childRoute: state => get(state, 'graph.childRoute'), - newExecutionId: state => get(state, 'graph.newExecutionId'), - hasChildBtn: state => get(state, 'graph.hasChildBtn'), - childBtnText: state => get(state, 'graph.childBtnText'), - parentBtnText: state => get(state, 'graph.parentBtnText'), - parentRoute: state => get(state, 'graph.parentRoute'), -}; - -export default getters; diff --git a/client/containers/graph/index.js b/client/containers/graph/index.js deleted file mode 100644 index 84bf52e5a..000000000 --- a/client/containers/graph/index.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getDefaultState from './get-default-state'; -import getters from './getters'; -import mutations from './mutations'; - -export { getDefaultState, getters, mutations }; diff --git a/client/containers/graph/mutations.js b/client/containers/graph/mutations.js deleted file mode 100644 index 7406c30b4..000000000 --- a/client/containers/graph/mutations.js +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getDefaultState from './get-default-state'; - -const mutations = { - childRoute(state, param) { - state.graph.childRoute = param.route; - state.graph.hasChildBtn = true; - state.graph.childBtnText = param.btnText; - }, - newExecutionRoute(state, route) { - (state.graph.newExecutionId = route), - (state.graph.hasChildBtn = !state.graph.hasChildBtn); - }, - previousExecutionRoute(state, route) { - (state.graph.parentRoute = route), - (state.graph.parentBtnText = 'previous execution'); - }, - toggleChildBtn(state) { - state.graph.hasChildBtn = false; - }, - parentRoute(state, route) { - state.graph.parentRoute = route; - }, - resetGraphState(state) { - Object.assign(state.graph, getDefaultState()); - }, -}; - -export default mutations; diff --git a/client/containers/index.js b/client/containers/index.js deleted file mode 100644 index 92835961c..000000000 --- a/client/containers/index.js +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export { - actions as activeStatusActions, - container as ActiveStatus, - getters as activeStatusGetters, -} from './active-status'; -export { - actions as clusterActions, - getDefaultState as getClusterDefaultState, - getters as clusterGetters, - mutations as clusterMutations, -} from './cluster'; -export { - actions as crossRegionActions, - container as CrossRegion, - getDefaultState as getCrossRegionDefaultState, - getters as crossRegionGetters, - mutations as crossRegionMutations, -} from './cross-region'; -export { - actions as domainActions, - container as Domain, - getDefaultState as getDomainDefaultState, - getters as domainGetters, - mutations as domainMutations, -} from './domain'; -export { - actions as domainAutocompleteActions, - container as DomainAutocomplete, - getDefaultState as getDomainAutocompleteDefaultState, - getters as domainAutocompleteGetters, - mutations as domainAutocompleteMutations, - reducer as domainAutocompleteReducer, -} from './domain-autocomplete'; -export { - getDefaultState as getGraphDefaultState, - getters as graphGetters, - mutations as graphMutations, -} from './graph'; -export { - actionCreator as routeActionCreator, - actionTypes as routeActionTypes, - getters as routeGetters, - getterTypes as routeGetterTypes, -} from './route'; -export { container as SettingsModal } from './settings-modal'; -export { - container as SettingsWorkflowHistory, - getDefaultState as getSettingsWorkflowHistoryDefaultState, - getters as settingsWorkflowHistoryGetters, - mutations as settingsWorkflowHistoryMutations, -} from './settings-workflow-history'; -export { - container as Workflow, - getDefaultState as getWorkflowDefaultState, - getters as workflowGetters, - mutations as workflowMutations, -} from './workflow'; -export { - container as WorkflowHistory, - getDefaultState as getWorkflowHistoryDefaultState, -} from './workflow-history'; -export { - actions as workflowListActions, - container as WorkflowList, - getters as workflowListGetters, -} from './workflow-list'; -export { - actions as workflowPendingActions, - container as WorkflowPending, - getters as workflowPendingGetters, -} from './workflow-pending'; diff --git a/client/containers/route/action-creator.js b/client/containers/route/action-creator.js deleted file mode 100644 index 7d0a2d6a3..000000000 --- a/client/containers/route/action-creator.js +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { ROUTE_PUSH, ROUTE_REPLACE, ROUTE_UPDATE_QUERY } from './action-types'; -import { ROUTE_QUERY } from './getter-types'; -import { getUpdatedQuery } from './helpers'; - -const actionCreator = router => ({ - [ROUTE_PUSH]: (_, args) => router.push(args), - [ROUTE_REPLACE]: (_, args) => router.replace(args), - [ROUTE_UPDATE_QUERY]: ({ getters }, payload) => { - const updatedQuery = getUpdatedQuery({ - payload, - query: getters[ROUTE_QUERY], - }); - - if (updatedQuery) { - router.replace({ - query: updatedQuery, - }); - } - }, -}); - -export default actionCreator; diff --git a/client/containers/route/action-creator.spec.js b/client/containers/route/action-creator.spec.js deleted file mode 100644 index 293741c81..000000000 --- a/client/containers/route/action-creator.spec.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import actionCreator from './action-creator'; -import { ROUTE_PUSH, ROUTE_REPLACE, ROUTE_UPDATE_QUERY } from './action-types'; -import { ROUTE_QUERY } from './getter-types'; - -const getRouterMock = () => ({ - push: jest.fn(), - replace: jest.fn(), -}); - -describe('route action creator', () => { - describe('when calling actions[ROUTE_PUSH] with "/test"', () => { - it('should call router.push with "/test".', () => { - const router = getRouterMock(); - const actions = actionCreator(router); - - actions[ROUTE_PUSH](null, '/test'); - expect(router.push).toHaveBeenCalledWith('/test'); - }); - }); - - describe('when calling actions[ROUTE_REPLACE] with "/test"', () => { - it('should call router.replace with "/test".', () => { - const router = getRouterMock(); - const actions = actionCreator(router); - - actions[ROUTE_REPLACE](null, '/test'); - expect(router.replace).toHaveBeenCalledWith('/test'); - }); - }); - - describe('when calling actions[ROUTE_UPDATE_QUERY] with a getter and test object', () => { - it('should call router.replace with the original getter query with the test object override.', () => { - const router = getRouterMock(); - const getters = { - [ROUTE_QUERY]: { - otherQuery: 'otherValue', - test: 'valueA', - }, - }; - const actions = actionCreator(router); - - actions[ROUTE_UPDATE_QUERY]({ getters }, { test: 'valueB' }); - expect(router.replace).toHaveBeenCalledWith({ - query: { - otherQuery: 'otherValue', - test: 'valueB', - }, - }); - }); - }); -}); diff --git a/client/containers/route/action-types.js b/client/containers/route/action-types.js deleted file mode 100644 index eefc456a8..000000000 --- a/client/containers/route/action-types.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const ROUTE_PUSH = 'ROUTE_PUSH'; -export const ROUTE_REPLACE = 'ROUTE_REPLACE'; -export const ROUTE_UPDATE_QUERY = 'ROUTE_UPDATE_QUERY'; diff --git a/client/containers/route/getter-types.js b/client/containers/route/getter-types.js deleted file mode 100644 index 9f9b4ca8e..000000000 --- a/client/containers/route/getter-types.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const ROUTE_PARAMS = 'ROUTE_PARAMS'; -export const ROUTE_PARAMS_CLUSTER_NAME = 'ROUTE_PARAMS_CLUSTER_NAME'; -export const ROUTE_PARAMS_DOMAIN = 'ROUTE_PARAMS_DOMAIN'; -export const ROUTE_PARAMS_WORKFLOW_ID = 'ROUTE_PARAMS_WORKFLOW_ID'; -export const ROUTE_QUERY = 'ROUTE_QUERY'; diff --git a/client/containers/route/getters.js b/client/containers/route/getters.js deleted file mode 100644 index bb25a13ea..000000000 --- a/client/containers/route/getters.js +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { get } from 'lodash-es'; -import { - ROUTE_PARAMS, - ROUTE_PARAMS_CLUSTER_NAME, - ROUTE_PARAMS_DOMAIN, - ROUTE_PARAMS_WORKFLOW_ID, - ROUTE_QUERY, -} from './getter-types'; - -const getters = { - [ROUTE_PARAMS]: state => get(state, 'route.params', {}), - [ROUTE_PARAMS_CLUSTER_NAME]: (_, getters) => - getters[ROUTE_PARAMS].clusterName, - [ROUTE_PARAMS_DOMAIN]: (_, getters) => getters[ROUTE_PARAMS].domain, - [ROUTE_PARAMS_WORKFLOW_ID]: (_, getters) => getters[ROUTE_PARAMS].workflowId, - [ROUTE_QUERY]: state => get(state, 'route.query', {}), -}; - -export default getters; diff --git a/client/containers/route/getters.spec.js b/client/containers/route/getters.spec.js deleted file mode 100644 index a2f2325d9..000000000 --- a/client/containers/route/getters.spec.js +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { ROUTE_PARAMS, ROUTE_PARAMS_DOMAIN, ROUTE_QUERY } from './getter-types'; -import getterFns from './getters'; -import { initGetters } from '~test'; - -describe('route getters', () => { - describe('calling getters[ROUTE_PARAMS]', () => { - describe('and state.route.params is defined', () => { - const state = { - route: { - params: { - paramA: 'valueA', - paramB: 'valueB', - }, - }, - }; - - it('should return the value from state.route.params', () => { - const getters = initGetters({ getterFns, state }); - const output = getters[ROUTE_PARAMS]; - - expect(output.paramA).toEqual('valueA'); - expect(output.paramB).toEqual('valueB'); - }); - }); - - describe('and state.route.params is not defined', () => { - const state = { - route: {}, - }; - - it('should return an empty object.', () => { - const getters = initGetters({ getterFns, state }); - const output = getters[ROUTE_PARAMS]; - - expect(output).toEqual({}); - }); - }); - }); - - describe('calling getters[ROUTE_PARAMS_DOMAIN]', () => { - describe('and state.route.params.domain is defined', () => { - const state = { - route: { - params: { - domain: 'domainA', - }, - }, - }; - - it('should return the value from state.route.params.domain', () => { - const getters = initGetters({ getterFns, state }); - const output = getters[ROUTE_PARAMS_DOMAIN]; - - expect(output).toEqual('domainA'); - }); - }); - }); - - describe('calling getters[ROUTE_QUERY]', () => { - describe('and state.route.query is defined', () => { - const state = { - route: { - query: { - queryA: 'valueA', - queryB: 'valueB', - }, - }, - }; - - it('should return the value from state.route.query', () => { - const getters = initGetters({ getterFns, state }); - const output = getters[ROUTE_QUERY]; - - expect(output.queryA).toEqual('valueA'); - expect(output.queryB).toEqual('valueB'); - }); - }); - - describe('and state.route.query is not defined', () => { - const state = { - route: {}, - }; - - it('should return an empty object.', () => { - const getters = initGetters({ getterFns, state }); - const output = getters[ROUTE_QUERY]; - - expect(output).toEqual({}); - }); - }); - }); -}); diff --git a/client/containers/route/helpers/get-updated-query.js b/client/containers/route/helpers/get-updated-query.js deleted file mode 100644 index be796850a..000000000 --- a/client/containers/route/helpers/get-updated-query.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import isEqual from 'lodash.isequal'; - -// omits entries from payload with empty string to be removed from original URL query params -// if query and updated query are equal, it will return null. -const getUpdatedQuery = ({ payload, query }) => { - const omittedKeys = []; - const omittedPayload = Object.entries(payload).reduce( - (accumulator, [key, value]) => { - if (value === '') { - omittedKeys.push(key); - - return accumulator; - } - - accumulator[key] = value; - - return accumulator; - }, - {} - ); - - const omittedQuery = Object.entries(query).reduce( - (accumulator, [key, value]) => { - if (omittedKeys.includes(key)) { - return accumulator; - } - - accumulator[key] = value; - - return accumulator; - }, - {} - ); - - const updatedQuery = { - ...omittedQuery, - ...omittedPayload, - }; - - if (isEqual(query, updatedQuery)) { - return null; - } - - return updatedQuery; -}; - -export default getUpdatedQuery; diff --git a/client/containers/route/helpers/get-updated-query.spec.js b/client/containers/route/helpers/get-updated-query.spec.js deleted file mode 100644 index 2f76158c6..000000000 --- a/client/containers/route/helpers/get-updated-query.spec.js +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getUpdatedQuery from './get-updated-query'; - -describe('route helpers getUpdatedQuery', () => { - describe('when getUpdatedQuery is called with a param in payload that is an empty string', () => { - const query = { - omittedQuery: 'previous-query-value', - }; - - const payload = { - omittedQuery: '', - }; - - it('should omit that entry from the returned updated query.', () => { - const output = getUpdatedQuery({ payload, query }); - - expect(output.omittedQuery).toEqual(undefined); - }); - }); - - describe('when getUpdatedQuery is called with a payload which does not change the query', () => { - const query = { - key: 'value', - key2: 'value2', - }; - - const payload = { - key: 'value', - }; - - it('should return null.', () => { - const output = getUpdatedQuery({ payload, query }); - - expect(output).toEqual(null); - }); - }); -}); diff --git a/client/containers/route/helpers/index.js b/client/containers/route/helpers/index.js deleted file mode 100644 index cceb7f03e..000000000 --- a/client/containers/route/helpers/index.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export { default as getUpdatedQuery } from './get-updated-query'; diff --git a/client/containers/route/index.js b/client/containers/route/index.js deleted file mode 100644 index 23013165f..000000000 --- a/client/containers/route/index.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import actionCreator from './action-creator'; -import { ROUTE_PUSH, ROUTE_REPLACE, ROUTE_UPDATE_QUERY } from './action-types'; -import { ROUTE_PARAMS, ROUTE_QUERY } from './getter-types'; -import getters from './getters'; - -const actionTypes = { - ROUTE_PUSH, - ROUTE_REPLACE, - ROUTE_UPDATE_QUERY, -}; - -const getterTypes = { - ROUTE_PARAMS, - ROUTE_QUERY, -}; - -export { actionCreator, actionTypes, getterTypes, getters }; diff --git a/client/containers/settings-modal/component.vue b/client/containers/settings-modal/component.vue deleted file mode 100644 index 8d2dc5f7a..000000000 --- a/client/containers/settings-modal/component.vue +++ /dev/null @@ -1,173 +0,0 @@ - - - - - diff --git a/client/containers/settings-modal/components/settings-date-format.vue b/client/containers/settings-modal/components/settings-date-format.vue deleted file mode 100644 index 3a30b0859..000000000 --- a/client/containers/settings-modal/components/settings-date-format.vue +++ /dev/null @@ -1,201 +0,0 @@ - - - diff --git a/client/containers/settings-modal/components/settings-header.vue b/client/containers/settings-modal/components/settings-header.vue deleted file mode 100644 index ad497ad1e..000000000 --- a/client/containers/settings-modal/components/settings-header.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - - - diff --git a/client/containers/settings-modal/components/settings-list.vue b/client/containers/settings-modal/components/settings-list.vue deleted file mode 100644 index d08cc4dd0..000000000 --- a/client/containers/settings-modal/components/settings-list.vue +++ /dev/null @@ -1,74 +0,0 @@ - - - - - diff --git a/client/containers/settings-modal/constants.js b/client/containers/settings-modal/constants.js deleted file mode 100644 index 132365b85..000000000 --- a/client/containers/settings-modal/constants.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const SETTINGS_VIEW_LIST = [ - { - displayName: 'DateTime', - name: 'settings-date-format', - }, - { - displayName: 'Workflow History', - name: 'settings-workflow-history', - }, -]; diff --git a/client/containers/settings-modal/index.js b/client/containers/settings-modal/index.js deleted file mode 100644 index b4a1f8229..000000000 --- a/client/containers/settings-modal/index.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import Component from './component'; - -// TODO - refactor App.vue to reference props from vuex store -// const container = Connector('SettingsModal', Component); -const container = Component; - -export { container }; diff --git a/client/containers/settings-workflow-history/component.vue b/client/containers/settings-workflow-history/component.vue deleted file mode 100644 index a353e0285..000000000 --- a/client/containers/settings-workflow-history/component.vue +++ /dev/null @@ -1,298 +0,0 @@ - - - - - diff --git a/client/containers/settings-workflow-history/connector.js b/client/containers/settings-workflow-history/connector.js deleted file mode 100644 index aeb023360..000000000 --- a/client/containers/settings-workflow-history/connector.js +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { connect } from 'vuex-connect'; -import { SETTINGS_WORKFLOW_HISTORY_IS_SUBMIT_ENABLED } from './getter-types'; -import { - SETTINGS_WORKFLOW_HISTORY_ON_CHANGE_VALUE, - SETTINGS_WORKFLOW_HISTORY_ON_MOUNTED, - SETTINGS_WORKFLOW_HISTORY_ON_SUBMIT, -} from './mutation-types'; - -const gettersToProps = { - isSubmitEnabled: SETTINGS_WORKFLOW_HISTORY_IS_SUBMIT_ENABLED, -}; - -const lifecycle = { - mounted: ({ commit }) => commit(SETTINGS_WORKFLOW_HISTORY_ON_MOUNTED), -}; - -const stateToProps = { - graphEnabled: state => state.settingsWorkflowHistory.graphEnabled, -}; - -const mutationsToEvents = { - onChange: SETTINGS_WORKFLOW_HISTORY_ON_CHANGE_VALUE, - onSubmit: SETTINGS_WORKFLOW_HISTORY_ON_SUBMIT, -}; - -export default connect({ - gettersToProps, - lifecycle, - mutationsToEvents, - stateToProps, -}); diff --git a/client/containers/settings-workflow-history/constants.js b/client/containers/settings-workflow-history/constants.js deleted file mode 100644 index 365d709d6..000000000 --- a/client/containers/settings-workflow-history/constants.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const SUBMIT_CHANGE_KEYS = ['graphEnabled']; diff --git a/client/containers/settings-workflow-history/get-default-state.js b/client/containers/settings-workflow-history/get-default-state.js deleted file mode 100644 index d8f42d40a..000000000 --- a/client/containers/settings-workflow-history/get-default-state.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const getDefaultState = (state = {}) => ({ - graphEnabled: true, - ...state, -}); - -export default getDefaultState; diff --git a/client/containers/settings-workflow-history/getter-types.js b/client/containers/settings-workflow-history/getter-types.js deleted file mode 100644 index f4b59e10e..000000000 --- a/client/containers/settings-workflow-history/getter-types.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const SETTINGS_WORKFLOW_HISTORY_IS_SUBMIT_ENABLED = - 'SETTINGS_WORKFLOW_HISTORY_IS_SUBMIT_ENABLED'; diff --git a/client/containers/settings-workflow-history/getters.js b/client/containers/settings-workflow-history/getters.js deleted file mode 100644 index 660f4244b..000000000 --- a/client/containers/settings-workflow-history/getters.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { SUBMIT_CHANGE_KEYS } from './constants'; -import { SETTINGS_WORKFLOW_HISTORY_IS_SUBMIT_ENABLED } from './getter-types'; - -const getters = { - [SETTINGS_WORKFLOW_HISTORY_IS_SUBMIT_ENABLED]: ({ - settingsWorkflowHistory, - workflowHistory, - }) => - SUBMIT_CHANGE_KEYS.reduce( - (accumulator, key) => - accumulator || settingsWorkflowHistory[key] !== workflowHistory[key], - false - ), -}; - -export default getters; diff --git a/client/containers/settings-workflow-history/index.js b/client/containers/settings-workflow-history/index.js deleted file mode 100644 index 8c8084834..000000000 --- a/client/containers/settings-workflow-history/index.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import Component from './component'; -import Connector from './connector'; -import getDefaultState from './get-default-state'; -import getters from './getters'; -import mutations from './mutations'; - -const container = Connector('SettingsWorkflowHistory', Component); - -export { container, getDefaultState, getters, mutations }; diff --git a/client/containers/settings-workflow-history/mutation-types.js b/client/containers/settings-workflow-history/mutation-types.js deleted file mode 100644 index 049fd4fe6..000000000 --- a/client/containers/settings-workflow-history/mutation-types.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const SETTINGS_WORKFLOW_HISTORY_ON_CHANGE_VALUE = - 'SETTINGS_WORKFLOW_HISTORY_ON_CHANGE_VALUE'; -export const SETTINGS_WORKFLOW_HISTORY_ON_MOUNTED = - 'SETTINGS_WORKFLOW_HISTORY_ON_MOUNTED'; -export const SETTINGS_WORKFLOW_HISTORY_ON_SUBMIT = - 'SETTINGS_WORKFLOW_HISTORY_ON_SUBMIT'; diff --git a/client/containers/settings-workflow-history/mutations.js b/client/containers/settings-workflow-history/mutations.js deleted file mode 100644 index 38a60fa81..000000000 --- a/client/containers/settings-workflow-history/mutations.js +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { - SETTINGS_WORKFLOW_HISTORY_ON_CHANGE_VALUE, - SETTINGS_WORKFLOW_HISTORY_ON_MOUNTED, - SETTINGS_WORKFLOW_HISTORY_ON_SUBMIT, -} from './mutation-types'; - -const mutations = { - [SETTINGS_WORKFLOW_HISTORY_ON_CHANGE_VALUE]: (state, { name, value }) => { - state.settingsWorkflowHistory = { - ...state.settingsWorkflowHistory, - [name]: value, - }; - }, - [SETTINGS_WORKFLOW_HISTORY_ON_MOUNTED]: state => { - state.settingsWorkflowHistory = { - ...state.settingsWorkflowHistory, - graphEnabled: state.workflowHistory.graphEnabled, - }; - }, - [SETTINGS_WORKFLOW_HISTORY_ON_SUBMIT]: state => { - state.workflowHistory = { - ...state.workflowHistory, - ...state.settingsWorkflowHistory, - }; - }, -}; - -export default mutations; diff --git a/client/containers/workflow-history/component.vue b/client/containers/workflow-history/component.vue deleted file mode 100644 index fe75eebc3..000000000 --- a/client/containers/workflow-history/component.vue +++ /dev/null @@ -1,1041 +0,0 @@ - - - - - diff --git a/client/containers/workflow-history/components/event-detail.vue b/client/containers/workflow-history/components/event-detail.vue deleted file mode 100644 index 61e5a0d56..000000000 --- a/client/containers/workflow-history/components/event-detail.vue +++ /dev/null @@ -1,108 +0,0 @@ - - - diff --git a/client/containers/workflow-history/components/footer-toolbar.vue b/client/containers/workflow-history/components/footer-toolbar.vue deleted file mode 100644 index 99f3cf9ec..000000000 --- a/client/containers/workflow-history/components/footer-toolbar.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - - - diff --git a/client/containers/workflow-history/components/index.js b/client/containers/workflow-history/components/index.js deleted file mode 100644 index b2ee023f2..000000000 --- a/client/containers/workflow-history/components/index.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export { default as EventDetail } from './event-detail'; -export { default as FooterToolbar } from './footer-toolbar'; -export { default as Timeline } from './timeline'; -export { default as WorkflowGraph } from './workflow-graph'; diff --git a/client/containers/workflow-history/components/timeline.vue b/client/containers/workflow-history/components/timeline.vue deleted file mode 100644 index 037fb8a33..000000000 --- a/client/containers/workflow-history/components/timeline.vue +++ /dev/null @@ -1,213 +0,0 @@ - - - - - diff --git a/client/containers/workflow-history/components/workflow-graph/components/graph-legend.vue b/client/containers/workflow-history/components/workflow-graph/components/graph-legend.vue deleted file mode 100644 index 9f7343449..000000000 --- a/client/containers/workflow-history/components/workflow-graph/components/graph-legend.vue +++ /dev/null @@ -1,154 +0,0 @@ - - - - - diff --git a/client/containers/workflow-history/components/workflow-graph/components/graph.vue b/client/containers/workflow-history/components/workflow-graph/components/graph.vue deleted file mode 100644 index 8a4e25b3e..000000000 --- a/client/containers/workflow-history/components/workflow-graph/components/graph.vue +++ /dev/null @@ -1,195 +0,0 @@ - - - - - diff --git a/client/containers/workflow-history/components/workflow-graph/constants.js b/client/containers/workflow-history/components/workflow-graph/constants.js deleted file mode 100644 index 8433ec7e8..000000000 --- a/client/containers/workflow-history/components/workflow-graph/constants.js +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const CYTOSCAPE_LAYOUT_DEFAULTS = { - // Horizontal `x` offset between same level nodes - levelStep: 300, - - // Offset between primary chronological layers - timeStep: 90, - - // Offset between primary and secondary chronological layers (having the same timestamps) - secondaryTimeStep: 65, -}; -export const CYTOSCAPE_LAYOUT_NAME = 'cadence'; -export const CYTOSCAPE_GRAPH_STYLES = [ - { - selector: 'node', - style: { - height: 'label', - width: 'label', - padding: '10px', - 'font-weight': '200', - 'font-family': 'Avenir, Helvetica, Arial, sans-serif', - 'background-color': 'white', - 'border-radius': 5, - 'min-zoomed-font-size': 8, - shape: 'round-rectangle', - 'border-color': '#d1d1d1', - 'border-width': 1.2, - label: 'data(name)', - 'text-valign': 'center', - 'text-halign': 'center', - }, - }, - { - selector: "node[status = 'completed']", - style: { - 'border-color': '#26bd77', - 'border-width': 1, - 'background-color': '#dcffe6', - }, - }, - { - selector: "node[status = 'failed']", - style: { - 'border-color': '#ff6c6c', - 'border-width': 1, - 'background-color': '#ffcccc', - }, - }, - { - selector: 'node:selected', - style: { 'border-color': '#11939A', 'border-width': 2 }, - }, - { - selector: "node[status = 'failed']:selected", - style: { 'border-color': '#ff6c6c', 'border-width': 2.5 }, - }, - { - selector: "node[status = 'completed']:selected", - style: { 'border-color': '#26bd77', 'border-width': 2.5 }, - }, - { - selector: 'edge', - style: { - 'border-color': '#26bd77', - 'border-width': 2.5, - 'target-arrow-shape': 'triangle', - 'target-arrow-color': '#2c3e50', - 'line-color': '#2c3e50', - width: 1.5, - 'curve-style': 'bezier', //'hay-stack' <- set to improve perfomance - }, - }, - { - selector: "edge[type = 'inferred']", - style: { - 'target-arrow-color': '#ECAB20', - 'line-color': '#ECAB20', - }, - }, - { - selector: "edge[type = 'chronological']", - style: { - 'target-arrow-color': '#5879DA', - 'line-color': '#5879DA', - }, - }, -]; -export const CYTOSCAPE_DEFAULT_OPTIONS = { - autoungrabify: true, - headless: true, - hideEdgesOnViewport: true, - layout: { - name: CYTOSCAPE_LAYOUT_NAME, - }, - style: CYTOSCAPE_GRAPH_STYLES, - styleEnabled: true, - - // NOTE: Uncomment the two lines below for better performance - // textureOnViewport: true, - // pixelRatio: 1, -}; - -export const GRAPH_SLICE_SIZE = 300; -export const GRAPH_SLICE_DELTA_MAX = GRAPH_SLICE_SIZE * 0.3; -export const GRAPH_SHOW_DELAY = 400; -export const GRAPH_ZOOM_DEFAULT = 1.1; -export const GRAPH_ZOOM_MAX = 10; -export const GRAPH_ZOOM_MIN = 0.1; - -export const LEGEND_CONNECTION_LIST = [ - { - name: 'direct', - text: - 'Represents direct connections, when a child has the id of the parent', - }, - { name: 'chron', text: 'Represents chronological connections' }, - { - name: 'inferred', - text: 'Represents connections between a signal and its triggered child ', - }, -]; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/arrange-graph.js b/client/containers/workflow-history/components/workflow-graph/helpers/arrange-graph.js deleted file mode 100644 index 20bb2555a..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/arrange-graph.js +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { orderBy } from 'lodash-es'; -import { CYTOSCAPE_LAYOUT_NAME } from '../constants'; -import arrangeNodes from './arrange-nodes'; -import getTimeIndexPairKey from './get-time-index-pair-key'; - -const arrangeGraph = ({ nodes, edges }, options) => { - const idToNode = {}; - const idToChildren = {}; - const timeIndices = {}; - const hasParent = {}; - const rootNodes = []; - - // Iterate through nodes and set `timeIndex` and `timeIndexSecondary` for every node - // timeIndex is an index of the node timestamp in a sorted array of all timestamps - // Which is used to keep the chronogical order of nodes but discard the scale of time intervals - // when drawing the graph - nodes.forEach(node => { - idToNode[node.id()] = node; - idToChildren[node.id()] = []; - const timestamp = node.data().timestamp; - - if (timeIndices[timestamp] === undefined) { - timeIndices[timestamp] = Object.keys(timeIndices).length; - } - - node.scratch(CYTOSCAPE_LAYOUT_NAME, { - timeIndex: timeIndices[timestamp], - timeIndexSecondary: 0, - }); - }); - - // Find all roots (entry points with no parents) of the graph - for (const edge of edges) { - idToChildren[edge.data().source].push(idToNode[edge.data().target]); - hasParent[edge.data().target] = true; - } - - for (const node of nodes) { - if (!hasParent[node.id()]) { - rootNodes.push(node); - } - } - - // Arrange all nodes in the graph, starting from root entry points - arrangeNodes({ idToChildren, nodes: rootNodes }); - - // Calculate `tTimes` for all (timeIndex, timeIndexSecondary) pairs - // which are the time (Y) coordinates nodes in the graph - let t = 0; - let prevT1 = 0; - let prevT2 = 0; - const tTimes = {}; - const times = orderBy( - nodes.map(n => ({ - t1: n.scratch(CYTOSCAPE_LAYOUT_NAME).timeIndex, - t2: n.scratch(CYTOSCAPE_LAYOUT_NAME).timeIndexSecondary, - })), - ['t1', 't2'] - ); - - times.forEach(({ t1, t2 }) => { - const key = getTimeIndexPairKey(t1, t2); - - if (t1 === prevT1) { - t += (t2 - prevT2) * options.secondaryTimeStep; - } - - t += (t1 - prevT1) * options.timeStep; - prevT1 = t1; - prevT2 = t2; - - tTimes[key] = t; - }); - - // Set the `position` for all nodes using the calculated `level` and `tTimes` values - nodes.forEach(node => { - const nodeScratch = node.scratch(CYTOSCAPE_LAYOUT_NAME); - const key = getTimeIndexPairKey( - nodeScratch.timeIndex, - nodeScratch.timeIndexSecondary - ); - - nodeScratch.position = { - x: nodeScratch.level * options.levelStep, - y: tTimes[key], - }; - }); -}; - -export default arrangeGraph; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/arrange-nodes.js b/client/containers/workflow-history/components/workflow-graph/helpers/arrange-nodes.js deleted file mode 100644 index a6301d29a..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/arrange-nodes.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { CYTOSCAPE_LAYOUT_NAME } from '../constants'; - -/** - * Traverse the graph recursively and set `level` and `parentTimeIndexOffset` for all nodes - * @method arrangeNodes - * @param {object} options - * @param {object} options.idToChildren - node id to child lookup hash - * @param {object} options.level - horizontal offset of the tree-like graph node arranged to avoid overlapping. - * @param {object} options.nodes - * @param {object} options.parentTimeIndex - * @param {object} options.parentTimeIndexOffset - secondary time coordinate: - * there are two connected nodes: A -----> B - * A.data.timeIndex === B.data.timeIndex - * then we set - * A.data.timeIndexSecondary = 0 - * B.data.timeIndexSecondary = 1 - * To display B node beflow the A node whilst they they have the same timestamp - */ -const arrangeNodes = ({ - idToChildren, - level = 0, - nodes, - parentTimeIndex = -1, - parentTimeIndexOffset = 0, -}) => { - let levelOffset = level; - - nodes.forEach((node, index) => { - levelOffset += index ? 1 : 0; - const children = idToChildren[node.id()]; - const nodeScratch = node.scratch(CYTOSCAPE_LAYOUT_NAME); - - nodeScratch.level = levelOffset; - nodeScratch.timeIndexSecondary = - parentTimeIndex === nodeScratch.timeIndex ? parentTimeIndexOffset + 1 : 0; - - if (children.length) { - const { level: newLevel } = arrangeNodes({ - idToChildren, - level: levelOffset, - nodes: children, - parentTimeIndex: nodeScratch.timeIndex, - parentTimeIndexOffset: nodeScratch.timeIndexSecondary, - }); - - levelOffset = newLevel; - } - }); - - return { - level: levelOffset, - }; -}; - -export default arrangeNodes; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/cytoscape-layout.js b/client/containers/workflow-history/components/workflow-graph/helpers/cytoscape-layout.js deleted file mode 100644 index 8fb35fbc1..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/cytoscape-layout.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { CYTOSCAPE_LAYOUT_DEFAULTS, CYTOSCAPE_LAYOUT_NAME } from '../constants'; -import arrangeGraph from './arrange-graph'; - -class CytoscapeLayout { - constructor(options) { - this.options = { - ...CYTOSCAPE_LAYOUT_DEFAULTS, - ...options, - }; - } - - run() { - const options = this.options; - const eles = options.eles; - const nodes = eles - .nodes() - .sort((n1, n2) => n1.data().timestamp - n2.data().timestamp); - const edges = eles.edges(); - - arrangeGraph({ nodes, edges }, options); - - nodes.layoutPositions(this, options, ele => { - return ele.scratch(CYTOSCAPE_LAYOUT_NAME).position; - }); - } -} - -export default function(cytoscape) { - if (!cytoscape) { - return; - } - - cytoscape('layout', 'cadence', CytoscapeLayout); -} diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/find-child-event.js b/client/containers/workflow-history/components/workflow-graph/helpers/find-child-event.js deleted file mode 100644 index d952eeb4d..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/find-child-event.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -/** - * Looks for a chronological or inferred child. - * It is inferred if a DecisionTaskScheduled, otherwise its chronological. - * External signals are not children and therefore they are skipped. - * @method findChildEvent - * @param {object} event - * @param {string} event.eventId - * @param {string} event.eventType - * @param {array} workflowList - */ -function findChildEvent({ eventId, eventType }, workflowList) { - const slicedWorkflowList = workflowList.slice(eventId); - - // We are at the end of the workflow, no children! - if (!slicedWorkflowList.length) { - return {}; - } - - if (slicedWorkflowList[0].eventType === 'DecisionTaskScheduled') { - return { - inferredChild: slicedWorkflowList[0].eventId, - }; - } - - if (eventType === 'WorkflowExecutionSignaled') { - for (const targetEvent of slicedWorkflowList) { - switch (targetEvent.eventType) { - case 'WorkflowExecutionSignaled': - case 'WorkflowExecutionCancelRequested': - break; - case 'DecisionTaskScheduled': - return { - inferredChild: targetEvent.eventId, - }; - } - } - } else { - for (const targetEvent of slicedWorkflowList) { - switch (targetEvent.eventType) { - case 'WorkflowExecutionSignaled': - case 'WorkflowExecutionCancelRequested': - break; - default: - return { - chronologicalChild: targetEvent.eventId, - }; - } - } - } - - return {}; -} - -export default findChildEvent; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-cancel-requested.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-cancel-requested.js deleted file mode 100644 index 00e8bb8f6..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-cancel-requested.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const ActivityTaskCancelRequested = event => ({ - parent: event.eventFullDetails.decisionTaskCompletedEventId, -}); - -export default ActivityTaskCancelRequested; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-canceled.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-canceled.js deleted file mode 100644 index bc2981433..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-canceled.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const ActivityTaskCanceled = event => ({ - parent: event.eventFullDetails.startedEventId, -}); - -export default ActivityTaskCanceled; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-completed.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-completed.js deleted file mode 100644 index 471822197..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-completed.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import findChildEvent from '../find-child-event'; - -const ActivityTaskCompleted = (event, workflow) => { - const { inferredChild, chronologicalChild } = findChildEvent(event, workflow); - - return { - parent: event.eventFullDetails.startedEventId, - chronologicalChild, - inferredChild, - }; -}; - -export default ActivityTaskCompleted; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-failed.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-failed.js deleted file mode 100644 index c8eaf5d66..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-failed.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import findChildEvent from '../find-child-event'; - -const ActivityTaskFailed = (event, workflow) => { - const { inferredChild, chronologicalChild } = findChildEvent(event, workflow); - - return { - parent: event.eventFullDetails.startedEventId, - chronologicalChild, - inferredChild, - status: 'failed', - }; -}; - -export default ActivityTaskFailed; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-scheduled.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-scheduled.js deleted file mode 100644 index 91217bf22..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-scheduled.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const ActivityTaskScheduled = event => ({ - parent: event.eventFullDetails.decisionTaskCompletedEventId, -}); - -export default ActivityTaskScheduled; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-started.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-started.js deleted file mode 100644 index 4dea526ab..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-started.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const ActivityTaskStarted = event => ({ - parent: event.eventFullDetails.scheduledEventId, -}); - -export default ActivityTaskStarted; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-timed-out.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-timed-out.js deleted file mode 100644 index f704a2eb3..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/activity-task-timed-out.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import findChildEvent from '../find-child-event'; - -const ActivityTaskTimedOut = (event, workflow) => { - const { inferredChild, chronologicalChild } = findChildEvent(event, workflow); - - return { - parent: event.eventFullDetails.startedEventId, - chronologicalChild, - inferredChild, - }; -}; - -export default ActivityTaskTimedOut; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/cancel-timer-failed.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/cancel-timer-failed.js deleted file mode 100644 index c8738e47f..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/cancel-timer-failed.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const CancelTimerFailed = event => ({ - parent: event.eventFullDetails.decisionTaskCompletedEventId, - status: 'failed', -}); - -export default CancelTimerFailed; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-canceled.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-canceled.js deleted file mode 100644 index e4dba8d9b..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-canceled.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const ChildWorkflowExecutionCanceled = event => ({ - parent: event.eventFullDetails.startedEventId, -}); - -export default ChildWorkflowExecutionCanceled; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-completed.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-completed.js deleted file mode 100644 index a5bfc4040..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-completed.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import findChildEvent from '../find-child-event'; - -const ChildWorkflowExecutionCompleted = (event, workflow) => { - const eventDetails = event.eventFullDetails; - const { inferredChild, chronologicalChild } = findChildEvent(event, workflow); - - return { - parent: eventDetails.startedEventId, - status: 'completed', - inferredChild, - chronologicalChild, - childRoute: eventDetails.workflowExecution, - }; -}; - -export default ChildWorkflowExecutionCompleted; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-failed.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-failed.js deleted file mode 100644 index ed62941fb..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-failed.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import findChildEvent from '../find-child-event'; - -const ChildWorkflowExecutionFailed = (event, workflow) => { - const eventDetails = event.eventFullDetails; - const { inferredChild, chronologicalChild } = findChildEvent(event, workflow); - - return { - parent: eventDetails.startedEventId, - inferredChild, - chronologicalChild, - childRoute: eventDetails.workflowExecution, - status: 'failed', - }; -}; - -export default ChildWorkflowExecutionFailed; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-started.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-started.js deleted file mode 100644 index ceb6933cf..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-started.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import findChildEvent from '../find-child-event'; - -const ChildWorkflowExecutionStarted = (event, workflow) => { - const eventDetails = event.eventFullDetails; - const { inferredChild, chronologicalChild } = findChildEvent(event, workflow); - - return { - parent: eventDetails.initiatedEventId, - inferredChild, - chronologicalChild, - childRoute: eventDetails.workflowExecution, - }; -}; - -export default ChildWorkflowExecutionStarted; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-terminated.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-terminated.js deleted file mode 100644 index cc74d9d7c..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-terminated.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const ChildWorkflowExecutionTerminated = event => ({ - parent: event.eventFullDetails.startedEventId, -}); - -export default ChildWorkflowExecutionTerminated; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-timed-out.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-timed-out.js deleted file mode 100644 index 00dc97f94..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/child-workflow-execution-timed-out.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const ChildWorkflowExecutionTimedOut = event => ({ - parent: event.eventFullDetails.startedEventId, -}); - -export default ChildWorkflowExecutionTimedOut; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/decision-task-completed.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/decision-task-completed.js deleted file mode 100644 index 102eccc41..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/decision-task-completed.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import findChildEvent from '../find-child-event'; - -const DecisionTaskCompleted = (event, workflow) => { - const { chronologicalChild } = findChildEvent(event, workflow); - - return { - parent: event.eventFullDetails.startedEventId, - chronologicalChild, - }; -}; - -export default DecisionTaskCompleted; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/decision-task-failed.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/decision-task-failed.js deleted file mode 100644 index 3b485ef2f..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/decision-task-failed.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const DecisionTaskFailed = event => ({ - status: 'failed', - parent: event.eventFullDetails.startedEventId, -}); - -export default DecisionTaskFailed; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/decision-task-started.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/decision-task-started.js deleted file mode 100644 index 9d528979b..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/decision-task-started.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const DecisionTaskStarted = event => ({ - parent: event.eventFullDetails.scheduledEventId, -}); - -export default DecisionTaskStarted; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/decision-task-timed-out.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/decision-task-timed-out.js deleted file mode 100644 index 99d2aa713..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/decision-task-timed-out.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const DecisionTaskTimedOut = event => ({ - parent: event.eventFullDetails.scheduledEventId, -}); - -export default DecisionTaskTimedOut; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/external-workflow-execution-cancel-requested.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/external-workflow-execution-cancel-requested.js deleted file mode 100644 index 2a157e5a7..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/external-workflow-execution-cancel-requested.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import findChildEvent from '../find-child-event'; - -const ExternalWorkflowExecutionCancelRequested = (event, workflow) => { - const { inferredChild, chronologicalChild } = findChildEvent(event, workflow); - - return { - parent: event.eventFullDetails.initiatedEventId, - inferredChild, - chronologicalChild, - }; -}; - -export default ExternalWorkflowExecutionCancelRequested; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/external-workflow-execution-signaled.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/external-workflow-execution-signaled.js deleted file mode 100644 index 1ed4c8a2a..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/external-workflow-execution-signaled.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import findChildEvent from '../find-child-event'; - -const ExternalWorkflowExecutionSignaled = (event, workflow) => { - const { inferredChild } = findChildEvent(event, workflow); - - return { - parent: event.eventFullDetails.initiatedEventId, - inferredChild, - }; -}; - -export default ExternalWorkflowExecutionSignaled; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/index.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/index.js deleted file mode 100644 index 824faeb47..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/index.js +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import ActivityTaskCancelRequested from './activity-task-cancel-requested'; -import ActivityTaskCanceled from './activity-task-canceled'; -import ActivityTaskCompleted from './activity-task-completed'; -import ActivityTaskFailed from './activity-task-failed'; -import ActivityTaskScheduled from './activity-task-scheduled'; -import ActivityTaskStarted from './activity-task-started'; -import ActivityTaskTimedOut from './activity-task-timed-out'; -import CancelTimerFailed from './cancel-timer-failed'; -import ChildWorkflowExecutionCanceled from './child-workflow-execution-canceled'; -import ChildWorkflowExecutionCompleted from './child-workflow-execution-completed'; -import ChildWorkflowExecutionFailed from './child-workflow-execution-failed'; -import ChildWorkflowExecutionStarted from './child-workflow-execution-started'; -import ChildWorkflowExecutionTerminated from './child-workflow-execution-terminated'; -import ChildWorkflowExecutionTimedOut from './child-workflow-execution-timed-out'; -import DecisionTaskCompleted from './decision-task-completed'; -import DecisionTaskFailed from './decision-task-failed'; -import DecisionTaskStarted from './decision-task-started'; -import DecisionTaskTimedOut from './decision-task-timed-out'; -import ExternalWorkflowExecutionCancelRequested from './external-workflow-execution-cancel-requested'; -import ExternalWorkflowExecutionSignaled from './external-workflow-execution-signaled'; -import MarkerRecorded from './marker-recorded'; -import RequestCancelActivityTaskFailed from './request-cancel-activity-task-failed'; -import RequestCancelExternalWorkflowExecutionFailed from './request-cancel-external-workflow-execution-failed'; -import RequestCancelExternalWorkflowExecutionInitiated from './request-cancel-external-workflow-execution-initiated'; -import SignalExternalWorkflowExecutionFailed from './signal-external-workflow-execution-failed'; -import SignalExternalWorkflowExecutionInitiated from './signal-external-workflow-execution-initiated'; -import StartChildWorkflowExecutionFailed from './start-child-workflow-execution-failed'; -import StartChildWorkflowExecutionInitiated from './start-child-workflow-execution-initiated'; -import TimerCanceled from './timer-canceled'; -import TimerFired from './timer-fired'; -import TimerStarted from './timer-started'; -import UpsertWorkflowSearchAttributes from './upsert-workflow-search-attributes'; -import WorkflowExecutionCancelRequested from './workflow-execution-cancel-requested'; -import WorkflowExecutionCanceled from './workflow-execution-canceled'; -import WorkflowExecutionCompleted from './workflow-execution-completed'; -import WorkflowExecutionContinuedAsNew from './workflow-execution-continued-as-new'; -import WorkflowExecutionFailed from './workflow-execution-failed'; -import WorkflowExecutionSignaled from './workflow-execution-signaled'; -import WorkflowExecutionStarted from './workflow-execution-started'; -import WorkflowExecutionTimedOut from './workflow-execution-timed-out'; - -const eventTypeMap = { - ActivityTaskCancelRequested, - ActivityTaskCanceled, - ActivityTaskCompleted, - ActivityTaskFailed, - ActivityTaskScheduled, - ActivityTaskStarted, - ActivityTaskTimedOut, - CancelTimerFailed, - ChildWorkflowExecutionCanceled, - ChildWorkflowExecutionCompleted, - ChildWorkflowExecutionFailed, - ChildWorkflowExecutionStarted, - ChildWorkflowExecutionTerminated, - ChildWorkflowExecutionTimedOut, - DecisionTaskCompleted, - DecisionTaskFailed, - DecisionTaskScheduled: () => ({}), - DecisionTaskStarted, - DecisionTaskTimedOut, - ExternalWorkflowExecutionCancelRequested, - ExternalWorkflowExecutionSignaled, - MarkerRecorded, - RequestCancelActivityTaskFailed, - RequestCancelExternalWorkflowExecutionFailed, - RequestCancelExternalWorkflowExecutionInitiated, - SignalExternalWorkflowExecutionFailed, - SignalExternalWorkflowExecutionInitiated, - StartChildWorkflowExecutionFailed, - StartChildWorkflowExecutionInitiated, - TimerCanceled, - TimerFired, - TimerStarted, - UpsertWorkflowSearchAttributes, - WorkflowExecutionCancelRequested, - WorkflowExecutionCanceled, - WorkflowExecutionCompleted, - WorkflowExecutionContinuedAsNew, - WorkflowExecutionFailed, - WorkflowExecutionSignaled, - WorkflowExecutionStarted, - WorkflowExecutionTerminated: () => ({}), - WorkflowExecutionTimedOut, -}; - -const getEventConnections = (event, workflow) => - eventTypeMap[event.eventType](event, workflow); - -export default getEventConnections; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/marker-recorded.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/marker-recorded.js deleted file mode 100644 index 8d2a4e753..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/marker-recorded.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const MarkerRecorded = event => ({ - parent: event.eventFullDetails.decisionTaskCompletedEventId, -}); - -export default MarkerRecorded; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/request-cancel-activity-task-failed.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/request-cancel-activity-task-failed.js deleted file mode 100644 index 6083fe47d..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/request-cancel-activity-task-failed.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const RequestCancelActivityTaskFailed = event => ({ - status: 'failed', - parent: event.eventFullDetails.decisionTaskCompletedEventId, -}); - -export default RequestCancelActivityTaskFailed; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/request-cancel-external-workflow-execution-failed.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/request-cancel-external-workflow-execution-failed.js deleted file mode 100644 index bb04a482c..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/request-cancel-external-workflow-execution-failed.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const RequestCancelExternalWorkflowExecutionFailed = event => ({ - status: 'failed', - parent: event.eventFullDetails.decisionTaskCompletedEventId, -}); - -export default RequestCancelExternalWorkflowExecutionFailed; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/request-cancel-external-workflow-execution-initiated.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/request-cancel-external-workflow-execution-initiated.js deleted file mode 100644 index 5f66b207d..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/request-cancel-external-workflow-execution-initiated.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const RequestCancelExternalWorkflowExecutionInitiated = event => ({ - parent: event.eventFullDetails.decisionTaskCompletedEventId, -}); - -export default RequestCancelExternalWorkflowExecutionInitiated; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/signal-external-workflow-execution-failed.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/signal-external-workflow-execution-failed.js deleted file mode 100644 index 164cfe15f..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/signal-external-workflow-execution-failed.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const SignalExternalWorkflowExecutionFailed = event => ({ - status: 'failed', - parent: event.eventFullDetails.decisionTaskCompletedEventId, -}); - -export default SignalExternalWorkflowExecutionFailed; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/signal-external-workflow-execution-initiated.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/signal-external-workflow-execution-initiated.js deleted file mode 100644 index f412e9ccf..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/signal-external-workflow-execution-initiated.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const SignalExternalWorkflowExecutionInitiated = event => ({ - parent: event.eventFullDetails.decisionTaskCompletedEventId, -}); - -export default SignalExternalWorkflowExecutionInitiated; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/start-child-workflow-execution-failed.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/start-child-workflow-execution-failed.js deleted file mode 100644 index f4c4a669d..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/start-child-workflow-execution-failed.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const StartChildWorkflowExecutionFailed = event => ({ - status: 'failed', - parent: event.eventFullDetails.decisionTaskCompletedEventId, -}); - -export default StartChildWorkflowExecutionFailed; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/start-child-workflow-execution-initiated.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/start-child-workflow-execution-initiated.js deleted file mode 100644 index 03924c53b..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/start-child-workflow-execution-initiated.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const StartChildWorkflowExecutionInitiated = event => ({ - parent: event.eventFullDetails.decisionTaskCompletedEventId, -}); - -export default StartChildWorkflowExecutionInitiated; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/timer-canceled.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/timer-canceled.js deleted file mode 100644 index 489ee9541..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/timer-canceled.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const TimerCanceled = event => ({ - parent: event.eventFullDetails.startedEventId, -}); - -export default TimerCanceled; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/timer-fired.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/timer-fired.js deleted file mode 100644 index 125415b76..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/timer-fired.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import findChildEvent from '../find-child-event'; - -const TimerFired = (event, workflow) => { - const { inferredChild } = findChildEvent(event, workflow); - - return { - parent: event.eventFullDetails.startedEventId, - inferredChild, - }; -}; - -export default TimerFired; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/timer-started.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/timer-started.js deleted file mode 100644 index 64da96e96..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/timer-started.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const TimerStarted = event => ({ - parent: event.eventFullDetails.decisionTaskCompletedEventId, -}); - -export default TimerStarted; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/upsert-workflow-search-attributes.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/upsert-workflow-search-attributes.js deleted file mode 100644 index 807c6527c..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/upsert-workflow-search-attributes.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const UpsertWorkflowSearchAttributes = event => ({ - parent: event.eventFullDetails.decisionTaskCompletedEventId, -}); - -export default UpsertWorkflowSearchAttributes; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-cancel-requested.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-cancel-requested.js deleted file mode 100644 index 70e2f5d9d..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-cancel-requested.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import findChildEvent from '../find-child-event'; - -const WorkflowExecutionCancelRequested = (event, workflow) => { - const { inferredChild } = findChildEvent(event, workflow); - - return { - inferredChild, - }; -}; - -export default WorkflowExecutionCancelRequested; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-canceled.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-canceled.js deleted file mode 100644 index 637b8b019..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-canceled.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const WorkflowExecutionCanceled = event => ({ - parent: event.eventFullDetails.decisionTaskCompletedEventId, -}); - -export default WorkflowExecutionCanceled; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-completed.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-completed.js deleted file mode 100644 index cb0f0959d..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-completed.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const WorkflowExecutionCompleted = event => ({ - parent: event.eventFullDetails.decisionTaskCompletedEventId, - status: 'completed', -}); - -export default WorkflowExecutionCompleted; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-continued-as-new.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-continued-as-new.js deleted file mode 100644 index 1cd865c51..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-continued-as-new.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const WorkflowExecutionContinuedAsNew = event => { - const { - decisionTaskCompletedEventId, - newExecutionRunId, - } = event.eventFullDetails; - - return { - parent: decisionTaskCompletedEventId, - newExecutionRunId, - status: 'completed', - }; -}; - -export default WorkflowExecutionContinuedAsNew; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-failed.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-failed.js deleted file mode 100644 index 08f6b616d..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-failed.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const WorkflowExecutionFailed = event => ({ - parent: event.eventFullDetails.decisionTaskCompletedEventId, - status: 'failed', -}); - -export default WorkflowExecutionFailed; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-signaled.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-signaled.js deleted file mode 100644 index 1d74a6f26..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-signaled.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import findChildEvent from '../find-child-event'; - -const WorkflowExecutionSignaled = (event, workflow) => { - const { inferredChild } = findChildEvent(event, workflow); - - return { - inferredChild, - }; -}; - -export default WorkflowExecutionSignaled; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-started.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-started.js deleted file mode 100644 index 974b5a2d6..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-started.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const WorkflowExecutionStarted = event => { - const { - continuedExecutionRunId, - parentWorkflowExecution, - } = event.eventFullDetails; - - return { - inferredChild: event.eventId + 1, - parentWorkflowExecution, - previousExecutionRunId: continuedExecutionRunId, - }; -}; - -export default WorkflowExecutionStarted; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-timed-out.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-timed-out.js deleted file mode 100644 index a8c9dd4cb..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-event-connections/workflow-execution-timed-out.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const WorkflowExecutionTimedOut = event => ({ - parent: event.eventId - 1, -}); - -export default WorkflowExecutionTimedOut; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-graph-pan-center.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-graph-pan-center.js deleted file mode 100644 index c4864a10c..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-graph-pan-center.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { GRAPH_ZOOM_DEFAULT } from '../constants'; - -const getGraphPanCenter = ({ - boundingBox, - height, - width, - zoom = GRAPH_ZOOM_DEFAULT, -}) => ({ - x: (width - zoom * (boundingBox.x1 + boundingBox.x2)) / 2, - y: (height - zoom * (boundingBox.y1 + boundingBox.y2)) / 2, -}); - -export default getGraphPanCenter; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/get-time-index-pair-key.js b/client/containers/workflow-history/components/workflow-graph/helpers/get-time-index-pair-key.js deleted file mode 100644 index 58c3c15b2..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/get-time-index-pair-key.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const getTimeIndexPairKey = (primary, secondary) => `${primary}-${secondary}`; - -export default getTimeIndexPairKey; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/index.js b/client/containers/workflow-history/components/workflow-graph/helpers/index.js deleted file mode 100644 index e699d6764..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/index.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export { default as arrangeGraph } from './arrange-graph'; -export { default as arrangeNodes } from './arrange-nodes'; -export { default as cytoscapeLayout } from './cytoscape-layout'; -export { default as findChildEvent } from './find-child-event'; -export { default as getEventConnections } from './get-event-connections'; -export { default as getGraphPanCenter } from './get-graph-pan-center'; -export { default as getTimeIndexPairKey } from './get-time-index-pair-key'; -export { default as selectNode } from './select-node'; -export { default as setChronologicalChildren } from './set-chronological-children'; -export { default as setDirectAndInferredChildren } from './set-direct-and-inferred-children'; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/select-node.js b/client/containers/workflow-history/components/workflow-graph/helpers/select-node.js deleted file mode 100644 index 1a126cf1e..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/select-node.js +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { findIndex } from 'lodash-es'; -import { GRAPH_SLICE_DELTA_MAX, GRAPH_SLICE_SIZE } from '../constants'; -import getEventConnections from './get-event-connections'; -import setChronologicalChildren from './set-chronological-children'; -import setDirectAndInferredChildren from './set-direct-and-inferred-children'; - -/** - * Build a graph around the `node` - */ -const selectNode = ({ - events, - selectedEventId = null, - sliceIndices = null, -}) => { - // TODO: Improve chrono edge calculations for large workflows - const enableChronologicalEdges = events && events.length < 100; - - // If the selected node index is within (GRAPH_SLICE_SIZE * 100)% of the middle of rendered slice, - // we do not need to redraw the graph, just scroll to the node. - const eventIds = {}; - const nodes = []; - const edges = []; - const results = { - sliceIndices, - shouldRedraw: false, - previousExecutionRoute: null, - parentWorkflowExecution: null, - elements: [], - }; - - if (!events || !events.length) { - return results; - } - - const index = - selectedEventId !== null && selectedEventId !== undefined - ? findIndex( - events, - ({ eventId }) => String(eventId) === String(selectedEventId) - ) - : -1; - - if (sliceIndices) { - // No need to redraw if selected node is in the middle of rendered slice - const { from, to } = sliceIndices; - const center = (to + from) / 2; - const threshold = { - from: from === 0 ? 0 : Math.floor(center - GRAPH_SLICE_DELTA_MAX), - to: - to >= events.length - 1 - ? events.length - : Math.floor(center + GRAPH_SLICE_DELTA_MAX), - }; - - if (index >= 0 && index >= threshold.from && index <= threshold.to) { - return results; - } - } - - results.shouldRedraw = true; - - const from = Math.floor(Math.max(0, index - GRAPH_SLICE_SIZE / 2)); - const to = Math.min(events.length, from + GRAPH_SLICE_SIZE); - const sliceEvents = events.slice(from, to); - - results.sliceIndices = { from, to }; - const parentArray = []; - - sliceEvents.forEach(event => { - eventIds[event.eventId] = true; - const { - parentWorkflowExecution, - previousExecutionRunId, - newExecutionRunId, - status, - childRoute, - } = getEventConnections(event, sliceEvents); - - if (previousExecutionRunId) { - results.previousExecutionRunId = previousExecutionRunId; - } else if (parentWorkflowExecution) { - results.parentWorkflowExecution = parentWorkflowExecution; - } - - nodes.push({ - group: 'nodes', - data: { - id: event.eventId, - name: event.eventType, - childRoute: childRoute, - newExecutionRunId: newExecutionRunId, - status: status, - timestamp: event.timestamp.valueOf(), - }, - }); - }); - - // Set the direct and inferred relationships - sliceEvents.forEach(node => { - setDirectAndInferredChildren({ - edges, - eventIds, - events, - node, - parentArray, - }); - }); - - // Set the chronological relationships. - // If the node is not referred to as a parent it should be connected back to the graph with a chron child - if (enableChronologicalEdges) { - sliceEvents.forEach(node => { - if (!parentArray.includes(node.eventId)) { - setChronologicalChildren({ - edges, - eventIds, - events, - node, - }); - } - }); - } - - results.elements = [...nodes, ...edges]; - - return results; -}; - -export default selectNode; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/set-chronological-children.js b/client/containers/workflow-history/components/workflow-graph/helpers/set-chronological-children.js deleted file mode 100644 index 2a64ddfbf..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/set-chronological-children.js +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getEventConnections from './get-event-connections'; - -const setChronologicalChildren = ({ edges, eventIds, events, node }) => { - const { eventId } = node; - const { chronologicalChild } = getEventConnections(node, events); - - if (chronologicalChild && eventIds[chronologicalChild]) { - edges.push({ - group: 'edges', - data: { - source: eventId, - target: chronologicalChild, - type: 'chronological', - }, - }); - } -}; - -export default setChronologicalChildren; diff --git a/client/containers/workflow-history/components/workflow-graph/helpers/set-direct-and-inferred-children.js b/client/containers/workflow-history/components/workflow-graph/helpers/set-direct-and-inferred-children.js deleted file mode 100644 index 6d1893bcc..000000000 --- a/client/containers/workflow-history/components/workflow-graph/helpers/set-direct-and-inferred-children.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) 2020-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getEventConnections from './get-event-connections'; - -const setDirectAndInferredChildren = ({ - edges, - eventIds, - events, - node, - parentArray, -}) => { - const { eventId } = node; - const { parent, inferredChild } = getEventConnections(node, events); - - if (parent && eventIds[parent] && eventIds[eventId]) { - parentArray.push(parent); - edges.push({ - group: 'edges', - data: { source: parent, target: eventId, type: 'direct' }, - }); - } - - if (inferredChild && eventIds[inferredChild]) { - parentArray.push(eventId); - edges.push({ - group: 'edges', - data: { source: eventId, target: inferredChild, type: 'inferred' }, - }); - } -}; - -export default setDirectAndInferredChildren; diff --git a/client/containers/workflow-history/components/workflow-graph/index.vue b/client/containers/workflow-history/components/workflow-graph/index.vue deleted file mode 100644 index db311016f..000000000 --- a/client/containers/workflow-history/components/workflow-graph/index.vue +++ /dev/null @@ -1,227 +0,0 @@ - - - - - diff --git a/client/containers/workflow-history/connector.js b/client/containers/workflow-history/connector.js deleted file mode 100644 index ba22c0962..000000000 --- a/client/containers/workflow-history/connector.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { connect } from 'vuex-connect'; -import { WORKFLOW_EXECUTION_PENDING_TASK_COUNT } from '../workflow/getter-types'; - -const gettersToProps = { - pendingTaskCount: WORKFLOW_EXECUTION_PENDING_TASK_COUNT, -}; - -const stateToProps = { - graphEnabled: state => state.workflowHistory.graphEnabled, -}; - -export default connect({ - gettersToProps, - stateToProps, -}); diff --git a/client/containers/workflow-history/constants.js b/client/containers/workflow-history/constants.js deleted file mode 100644 index 530d8e667..000000000 --- a/client/containers/workflow-history/constants.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const DEFAULT_SPLIT_SIZE_DAG = [40, 60]; -export const DEFAULT_SPLIT_SIZE_TIMELINE = [20, 80]; -export const DEFAULT_SPLIT_SIZE_NONE = [1, 99]; - -export const GRAPH_VIEW_DAG = 'dag'; -export const GRAPH_VIEW_TIMELINE = 'timeline'; diff --git a/client/containers/workflow-history/get-default-state.js b/client/containers/workflow-history/get-default-state.js deleted file mode 100644 index d8f42d40a..000000000 --- a/client/containers/workflow-history/get-default-state.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const getDefaultState = (state = {}) => ({ - graphEnabled: true, - ...state, -}); - -export default getDefaultState; diff --git a/client/containers/workflow-history/get-default-state.spec.js b/client/containers/workflow-history/get-default-state.spec.js deleted file mode 100644 index 84288fdd0..000000000 --- a/client/containers/workflow-history/get-default-state.spec.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getDefaultState from './get-default-state'; - -describe('workflow history getDefaultState', () => { - describe('when state is not passed', () => { - it('should return graphEnabled = true', () => { - const output = getDefaultState(); - - expect(output.graphEnabled).toEqual(true); - }); - }); - - describe('when state is passed and has graphEnabled = false', () => { - const state = { - graphEnabled: false, - }; - - it('should return graphEnabled = false', () => { - const output = getDefaultState(state); - - expect(output.graphEnabled).toEqual(false); - }); - }); -}); diff --git a/client/containers/workflow-history/helpers.js b/client/containers/workflow-history/helpers.js deleted file mode 100644 index 2bf765890..000000000 --- a/client/containers/workflow-history/helpers.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { - DEFAULT_SPLIT_SIZE_DAG, - DEFAULT_SPLIT_SIZE_TIMELINE, - DEFAULT_SPLIT_SIZE_NONE, - GRAPH_VIEW_DAG, - GRAPH_VIEW_TIMELINE, -} from './constants'; - -export const getDefaultSplitSize = ({ graphView }) => { - switch (graphView) { - case GRAPH_VIEW_DAG: - return DEFAULT_SPLIT_SIZE_DAG; - case GRAPH_VIEW_TIMELINE: - return DEFAULT_SPLIT_SIZE_TIMELINE; - default: - return DEFAULT_SPLIT_SIZE_NONE; - } -}; diff --git a/client/containers/workflow-history/index.js b/client/containers/workflow-history/index.js deleted file mode 100644 index e1d5b65d2..000000000 --- a/client/containers/workflow-history/index.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import Component from './component'; -import Connector from './connector'; -import getDefaultState from './get-default-state'; - -const container = Connector('WorkflowHistory', Component); - -export { container, getDefaultState }; diff --git a/client/containers/workflow-list/action-types.js b/client/containers/workflow-list/action-types.js deleted file mode 100644 index 3dcd66837..000000000 --- a/client/containers/workflow-list/action-types.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const WORKFLOW_LIST_ON_FILTER_CHANGE = 'WORKFLOW_LIST_ON_FILTER_CHANGE'; -export const WORKFLOW_LIST_ON_FILTER_MODE_CLICK = - 'WORKFLOW_LIST_ON_FILTER_MODE_CLICK'; diff --git a/client/containers/workflow-list/actions.js b/client/containers/workflow-list/actions.js deleted file mode 100644 index 40b301ba9..000000000 --- a/client/containers/workflow-list/actions.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { ROUTE_UPDATE_QUERY } from '../route/action-types'; -import { - WORKFLOW_LIST_ON_FILTER_CHANGE, - WORKFLOW_LIST_ON_FILTER_MODE_CLICK, -} from './action-types'; -import { WORKFLOW_LIST_FILTER_MODE } from './getter-types'; -import { toggleFilterMode } from './helpers'; - -const actions = { - [WORKFLOW_LIST_ON_FILTER_CHANGE]: ({ dispatch }, payload) => - dispatch(ROUTE_UPDATE_QUERY, payload), - [WORKFLOW_LIST_ON_FILTER_MODE_CLICK]: ({ dispatch, getters }) => - dispatch(ROUTE_UPDATE_QUERY, { - filterMode: toggleFilterMode(getters[WORKFLOW_LIST_FILTER_MODE]), - }), -}; - -export default actions; diff --git a/client/containers/workflow-list/actions.spec.js b/client/containers/workflow-list/actions.spec.js deleted file mode 100644 index 04d8f8ba5..000000000 --- a/client/containers/workflow-list/actions.spec.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { ROUTE_UPDATE_QUERY } from '../route/action-types'; -import actions from './actions'; -import { WORKFLOW_LIST_ON_FILTER_CHANGE } from './action-types'; -import { STATUS_CLOSED } from './constants'; - -describe('workflow list actions', () => { - describe('when calling actions[WORKFLOW_LIST_ON_FILTER_CHANGE]', () => { - it('should call dispatch with ROUTE_UPDATE_QUERY & payload', () => { - const dispatch = jest.fn(); - const payload = { - status: STATUS_CLOSED, - }; - - actions[WORKFLOW_LIST_ON_FILTER_CHANGE]({ dispatch }, payload); - expect(dispatch).toHaveBeenCalledWith(ROUTE_UPDATE_QUERY, payload); - }); - }); -}); diff --git a/client/containers/workflow-list/component.vue b/client/containers/workflow-list/component.vue deleted file mode 100644 index 465ab97cf..000000000 --- a/client/containers/workflow-list/component.vue +++ /dev/null @@ -1,637 +0,0 @@ - - - - - diff --git a/client/containers/workflow-list/connector.js b/client/containers/workflow-list/connector.js deleted file mode 100644 index 0694f9cee..000000000 --- a/client/containers/workflow-list/connector.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { connect } from 'vuex-connect'; -import { CLUSTER_FETCH } from '../cluster/action-types'; -import { CLUSTER_ADVANCED_VISIBILITY_ENABLED } from '../cluster/getter-types'; -import { - WORKFLOW_LIST_ON_FILTER_CHANGE, - WORKFLOW_LIST_ON_FILTER_MODE_CLICK, -} from './action-types'; -import { - WORKFLOW_LIST_FETCH_WORKFLOW_LIST_URL, - WORKFLOW_LIST_FILTER_BY, - WORKFLOW_LIST_FILTER_MODE, - WORKFLOW_LIST_FILTER_MODE_BUTTON_LABEL, - WORKFLOW_LIST_IS_CRON, - WORKFLOW_LIST_QUERY_STRING, - WORKFLOW_LIST_STATE, - WORKFLOW_LIST_STATUS, - WORKFLOW_LIST_STATUS_NAME, - WORKFLOW_LIST_WORKFLOW_ID, - WORKFLOW_LIST_WORKFLOW_NAME, -} from './getter-types'; - -const actionsToEvents = { - onFilterChange: WORKFLOW_LIST_ON_FILTER_CHANGE, - onFilterModeClick: WORKFLOW_LIST_ON_FILTER_MODE_CLICK, -}; - -const gettersToProps = { - fetchWorkflowListUrl: WORKFLOW_LIST_FETCH_WORKFLOW_LIST_URL, - filterBy: WORKFLOW_LIST_FILTER_BY, - filterMode: WORKFLOW_LIST_FILTER_MODE, - filterModeButtonEnabled: CLUSTER_ADVANCED_VISIBILITY_ENABLED, - filterModeButtonLabel: WORKFLOW_LIST_FILTER_MODE_BUTTON_LABEL, - isCron: WORKFLOW_LIST_IS_CRON, - isCronInputVisible: CLUSTER_ADVANCED_VISIBILITY_ENABLED, - queryString: WORKFLOW_LIST_QUERY_STRING, - state: WORKFLOW_LIST_STATE, - status: WORKFLOW_LIST_STATUS, - statusName: WORKFLOW_LIST_STATUS_NAME, - workflowId: WORKFLOW_LIST_WORKFLOW_ID, - workflowName: WORKFLOW_LIST_WORKFLOW_NAME, -}; - -const lifecycle = { - created: ({ dispatch }) => dispatch(CLUSTER_FETCH), -}; - -export default connect({ - actionsToEvents, - gettersToProps, - lifecycle, -}); diff --git a/client/containers/workflow-list/constants.js b/client/containers/workflow-list/constants.js deleted file mode 100644 index 6bd40420c..000000000 --- a/client/containers/workflow-list/constants.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const FILTER_BY_START_TIME = 'StartTime'; -export const FILTER_BY_CLOSE_TIME = 'CloseTime'; - -export const FILTER_MODE_ADVANCED = 'advanced'; -export const FILTER_MODE_BASIC = 'basic'; - -export const IS_CRON_ALL = ''; -export const IS_CRON_TRUE = 'true'; -export const IS_CRON_FALSE = 'false'; -export const IS_CRON_LIST = [ - { value: IS_CRON_ALL, label: 'All' }, - { value: IS_CRON_TRUE, label: 'Is a cron' }, - { value: IS_CRON_FALSE, label: 'Is not a cron' }, -]; -export const IS_CRON_LIST_OPTION_DEFAULT = IS_CRON_LIST[0]; - -export const STATE_ALL = 'all'; -export const STATE_CLOSED = 'closed'; -export const STATE_OPEN = 'open'; - -export const STATUS_ALL = 'ALL'; -export const STATUS_CANCELED = 'CANCELED'; -export const STATUS_CLOSED = 'CLOSED'; -export const STATUS_COMPLETED = 'COMPLETED'; -export const STATUS_CONTINUED_AS_NEW = 'CONTINUED_AS_NEW'; -export const STATUS_FAILED = 'FAILED'; -export const STATUS_OPEN = 'OPEN'; -export const STATUS_TERMINATED = 'TERMINATED'; -export const STATUS_TIMED_OUT = 'TIMED_OUT'; - -export const STATUS_LIST = [ - { value: STATUS_ALL, label: 'All' }, - { value: STATUS_OPEN, label: 'Open' }, - { value: STATUS_CLOSED, label: 'Closed' }, - { value: STATUS_COMPLETED, label: 'Completed' }, - { value: STATUS_FAILED, label: 'Failed' }, - { value: STATUS_CANCELED, label: 'Cancelled' }, - { value: STATUS_TERMINATED, label: 'Terminated' }, - { value: STATUS_CONTINUED_AS_NEW, label: 'Continued As New' }, - { value: STATUS_TIMED_OUT, label: 'Timed Out' }, -]; - -export const STATUS_LIST_OPTION_DEFAULT = STATUS_LIST[0]; diff --git a/client/containers/workflow-list/getter-types.js b/client/containers/workflow-list/getter-types.js deleted file mode 100644 index 8c3af458e..000000000 --- a/client/containers/workflow-list/getter-types.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const WORKFLOW_LIST_FETCH_WORKFLOW_LIST_URL = - 'WORKFLOW_LIST_FETCH_WORKFLOW_LIST_URL'; -export const WORKFLOW_LIST_FILTER_BY = 'WORKFLOW_LIST_FILTER_BY'; -export const WORKFLOW_LIST_FILTER_MODE = 'WORKFLOW_LIST_FILTER_MODE'; -export const WORKFLOW_LIST_FILTER_MODE_BUTTON_LABEL = - 'WORKFLOW_LIST_FILTER_MODE_BUTTON_LABEL'; -export const WORKFLOW_LIST_IS_CRON = 'WORKFLOW_LIST_IS_CRON'; -export const WORKFLOW_LIST_QUERY_STRING = 'WORKFLOW_LIST_QUERY_STRING'; -export const WORKFLOW_LIST_STATE = 'WORKFLOW_LIST_STATE'; -export const WORKFLOW_LIST_STATUS = 'WORKFLOW_LIST_STATUS'; -export const WORKFLOW_LIST_STATUS_NAME = 'WORKFLOW_LIST_STATUS_NAME'; -export const WORKFLOW_LIST_WORKFLOW_ID = 'WORKFLOW_LIST_WORKFLOW_ID'; -export const WORKFLOW_LIST_WORKFLOW_NAME = 'WORKFLOW_LIST_WORKFLOW_NAME'; diff --git a/client/containers/workflow-list/getters.js b/client/containers/workflow-list/getters.js deleted file mode 100644 index 0547d8437..000000000 --- a/client/containers/workflow-list/getters.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { ROUTE_PARAMS_DOMAIN, ROUTE_QUERY } from '../route/getter-types'; -import { FILTER_MODE_BASIC } from './constants'; -import { - WORKFLOW_LIST_FETCH_WORKFLOW_LIST_URL, - WORKFLOW_LIST_FILTER_BY, - WORKFLOW_LIST_FILTER_MODE, - WORKFLOW_LIST_FILTER_MODE_BUTTON_LABEL, - WORKFLOW_LIST_IS_CRON, - WORKFLOW_LIST_QUERY_STRING, - WORKFLOW_LIST_STATE, - WORKFLOW_LIST_STATUS, - WORKFLOW_LIST_STATUS_NAME, - WORKFLOW_LIST_WORKFLOW_ID, - WORKFLOW_LIST_WORKFLOW_NAME, -} from './getter-types'; -import { - getFetchWorkflowListUrl, - getFilterBy, - getFilterModeButtonLabel, - getIsCron, - getState, - getStatus, -} from './helpers'; - -const getters = { - [WORKFLOW_LIST_FETCH_WORKFLOW_LIST_URL]: (_, getters) => - getFetchWorkflowListUrl({ - domain: getters[ROUTE_PARAMS_DOMAIN], - filterMode: getters[WORKFLOW_LIST_FILTER_MODE], - state: getters[WORKFLOW_LIST_STATE], - }), - [WORKFLOW_LIST_FILTER_BY]: (_, getters) => - getFilterBy(getters[WORKFLOW_LIST_STATUS_NAME]), - [WORKFLOW_LIST_FILTER_MODE]: (_, getters) => - getters[ROUTE_QUERY].filterMode || FILTER_MODE_BASIC, - [WORKFLOW_LIST_FILTER_MODE_BUTTON_LABEL]: (_, getters) => - getFilterModeButtonLabel(getters[WORKFLOW_LIST_FILTER_MODE]), - [WORKFLOW_LIST_IS_CRON]: (_, getters) => - getIsCron(getters[ROUTE_QUERY].isCron), - [WORKFLOW_LIST_QUERY_STRING]: (_, getters) => - getters[ROUTE_QUERY].queryString || '', - [WORKFLOW_LIST_STATE]: (_, getters) => - getState(getters[WORKFLOW_LIST_STATUS_NAME]), - [WORKFLOW_LIST_STATUS]: (_, getters) => - getStatus(getters[ROUTE_QUERY].status), - [WORKFLOW_LIST_STATUS_NAME]: (_, getters) => - getters[WORKFLOW_LIST_STATUS].value, - [WORKFLOW_LIST_WORKFLOW_ID]: (_, getters) => getters[ROUTE_QUERY].workflowId, - [WORKFLOW_LIST_WORKFLOW_NAME]: (_, getters) => - getters[ROUTE_QUERY].workflowName, -}; - -export default getters; diff --git a/client/containers/workflow-list/getters.spec.js b/client/containers/workflow-list/getters.spec.js deleted file mode 100644 index f83f727de..000000000 --- a/client/containers/workflow-list/getters.spec.js +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { ROUTE_QUERY } from '../route/getter-types'; -import { FILTER_MODE_ADVANCED, FILTER_MODE_BASIC } from './constants'; -import wfListGetterFns from './getters'; -import { - WORKFLOW_LIST_FILTER_MODE, - WORKFLOW_LIST_QUERY_STRING, - WORKFLOW_LIST_WORKFLOW_NAME, -} from './getter-types'; -import { initGetters } from '~test'; - -describe('workflow list getters', () => { - describe('when calling getters[WORKFLOW_LIST_FILTER_MODE]', () => { - describe('and getters[ROUTE_QUERY].filterMode is set', () => { - const getterFns = { - ...wfListGetterFns, - [ROUTE_QUERY]: () => ({ - filterMode: FILTER_MODE_ADVANCED, - }), - }; - - it('should return the value set.', () => { - const getters = initGetters({ getterFns }); - const output = getters[WORKFLOW_LIST_FILTER_MODE]; - - expect(output).toEqual(FILTER_MODE_ADVANCED); - }); - }); - - describe('and getters[ROUTE_QUERY].filterMode is not set', () => { - const getterFns = { - ...wfListGetterFns, - [ROUTE_QUERY]: () => ({ - filterMode: null, - }), - }; - - it('should return FILTER_MODE_BASIC.', () => { - const getters = initGetters({ getterFns }); - const output = getters[WORKFLOW_LIST_FILTER_MODE]; - - expect(output).toEqual(FILTER_MODE_BASIC); - }); - }); - }); - - describe('when calling getters[WORKFLOW_LIST_QUERY_STRING]', () => { - describe('and getters[ROUTE_QUERY].queryString is set', () => { - const getterFns = { - ...wfListGetterFns, - [ROUTE_QUERY]: () => ({ - queryString: 'WorkflowId = "1234"', - }), - }; - - it('should return the value set.', () => { - const getters = initGetters({ getterFns }); - const output = getters[WORKFLOW_LIST_QUERY_STRING]; - - expect(output).toEqual('WorkflowId = "1234"'); - }); - }); - - describe('and getters[ROUTE_QUERY].queryString is not set', () => { - const getterFns = { - ...wfListGetterFns, - [ROUTE_QUERY]: () => ({ - queryString: null, - }), - }; - - it('should return "".', () => { - const getters = initGetters({ getterFns }); - const output = getters[WORKFLOW_LIST_QUERY_STRING]; - - expect(output).toEqual(''); - }); - }); - }); - - describe('when calling getters[WORKFLOW_LIST_WORKFLOW_NAME] and getters[ROUTE_QUERY].workflowName = "wf-name"', () => { - const getterFns = { - ...wfListGetterFns, - [ROUTE_QUERY]: () => ({ - workflowName: 'wf-name', - }), - }; - - it('should return "wf-name".', () => { - const getters = initGetters({ getterFns }); - const output = getters[WORKFLOW_LIST_WORKFLOW_NAME]; - - expect(output).toEqual('wf-name'); - }); - }); -}); diff --git a/client/containers/workflow-list/helpers/get-criteria.js b/client/containers/workflow-list/helpers/get-criteria.js deleted file mode 100644 index d7e1580ad..000000000 --- a/client/containers/workflow-list/helpers/get-criteria.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { FILTER_MODE_ADVANCED } from '../constants'; - -const getCriteria = ({ - endTime, - filterMode, - isCron, - queryString, - startTime, - status, - workflowId, - workflowName, -}) => { - if (!endTime || !startTime) { - return null; - } - - if (filterMode === FILTER_MODE_ADVANCED) { - return { - queryString: queryString.trim(), - }; - } - - const criteria = { - startTime, - endTime, - ...(isCron && isCron.value !== '' && { isCron: isCron.value }), - status, - ...(workflowId && { workflowId: workflowId.trim() }), - ...(workflowName && { workflowName: workflowName.trim() }), - }; - - return criteria; -}; - -export default getCriteria; diff --git a/client/containers/workflow-list/helpers/get-criteria.spec.js b/client/containers/workflow-list/helpers/get-criteria.spec.js deleted file mode 100644 index aea9fb251..000000000 --- a/client/containers/workflow-list/helpers/get-criteria.spec.js +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { - FILTER_MODE_ADVANCED, - FILTER_MODE_BASIC, - STATUS_CLOSED, -} from '../constants'; -import getCriteria from './get-criteria'; - -describe('getCriteria', () => { - describe('when startTime = null and endTime = "2021-05-19T06:59:59.999Z"', () => { - const endTime = '2021-05-19T06:59:59.999Z'; - const startTime = null; - - it('should return null.', () => { - const output = getCriteria({ endTime, startTime }); - - expect(output).toEqual(null); - }); - }); - - describe('when endTime = null and startTime = "2021-05-15T07:00:00.000Z"', () => { - const endTime = null; - const startTime = '2021-05-15T07:00:00.000Z'; - - it('should return null.', () => { - const output = getCriteria({ endTime, startTime }); - - expect(output).toEqual(null); - }); - }); - - describe('when startTime = "2021-05-15T07:00:00.000Z", endTime = "2021-05-19T06:59:59.999Z",', () => { - const endTime = '2021-05-19T06:59:59.999Z'; - const startTime = '2021-05-15T07:00:00.000Z'; - - describe('filterMode = FILTER_MODE_ADVANCED and queryString = " WorkflowID = 1234 "', () => { - const filterMode = FILTER_MODE_ADVANCED; - const queryString = ' WorkflowID = 1234 '; - - it('should return { queryString: "WorkflowID = 1234" }.', () => { - const output = getCriteria({ - endTime, - filterMode, - queryString, - startTime, - }); - - expect(output).toEqual({ queryString: 'WorkflowID = 1234' }); - }); - }); - - describe('filterMode = FILTER_MODE_BASIC, status = STATUS_CLOSED', () => { - const filterMode = FILTER_MODE_BASIC; - const status = STATUS_CLOSED; - - it('should return an object with only these fields. workflowId and workflowName keys should not be defined on the object.', () => { - const output = getCriteria({ endTime, filterMode, startTime, status }); - - expect(output).toEqual({ - endTime, - startTime, - status, - }); - }); - - describe(', workflowId = " 1234 " and workflowName = " workflow-name "', () => { - const workflowId = ' 1234 '; - const workflowName = ' workflow-name '; - - it('should return an object with these fields plus workflowId and workflowName are trimmed.', () => { - const output = getCriteria({ - endTime, - filterMode, - startTime, - status, - workflowId, - workflowName, - }); - - expect(output).toEqual({ - endTime, - startTime, - status, - workflowId: '1234', - workflowName: 'workflow-name', - }); - }); - }); - }); - }); -}); diff --git a/client/containers/workflow-list/helpers/get-fetch-workflow-list-url.js b/client/containers/workflow-list/helpers/get-fetch-workflow-list-url.js deleted file mode 100644 index ddffe5091..000000000 --- a/client/containers/workflow-list/helpers/get-fetch-workflow-list-url.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { FILTER_MODE_ADVANCED } from '../constants'; - -const getFetchWorkflowListUrl = ({ domain, filterMode, state }) => { - const workflowsBaseUrl = `/api/domains/${domain}/workflows`; - - return filterMode === FILTER_MODE_ADVANCED - ? `${workflowsBaseUrl}/list` - : `${workflowsBaseUrl}/${state}`; -}; - -export default getFetchWorkflowListUrl; diff --git a/client/containers/workflow-list/helpers/get-fetch-workflow-list-url.spec.js b/client/containers/workflow-list/helpers/get-fetch-workflow-list-url.spec.js deleted file mode 100644 index 8ca72a8c2..000000000 --- a/client/containers/workflow-list/helpers/get-fetch-workflow-list-url.spec.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { - FILTER_MODE_ADVANCED, - FILTER_MODE_BASIC, - STATE_CLOSED, - STATE_OPEN, -} from '../constants'; -import getFetchWorkflowListUrl from './get-fetch-workflow-list-url'; - -describe('getFetchWorkflowListUrl', () => { - describe('domain = "samples-domain"', () => { - const domain = 'samples-domain'; - - describe('filterMode = FILTER_MODE_ADVANCED', () => { - const filterMode = FILTER_MODE_ADVANCED; - - it('should return "/api/domains/samples-domain/workflows/list"', () => { - const output = getFetchWorkflowListUrl({ domain, filterMode }); - - expect(output).toEqual('/api/domains/samples-domain/workflows/list'); - }); - }); - - describe('filterMode = FILTER_MODE_BASIC', () => { - const filterMode = FILTER_MODE_BASIC; - - describe('state = STATE_CLOSED', () => { - const state = STATE_CLOSED; - - it('should return "/api/domains/samples-domain/workflows/closed"', () => { - const output = getFetchWorkflowListUrl({ domain, filterMode, state }); - - expect(output).toEqual( - '/api/domains/samples-domain/workflows/closed' - ); - }); - }); - - describe('state = STATE_OPEN', () => { - const state = STATE_OPEN; - - it('should return "/api/domains/samples-domain/workflows/open"', () => { - const output = getFetchWorkflowListUrl({ domain, filterMode, state }); - - expect(output).toEqual('/api/domains/samples-domain/workflows/open'); - }); - }); - }); - }); -}); diff --git a/client/containers/workflow-list/helpers/get-filter-by.js b/client/containers/workflow-list/helpers/get-filter-by.js deleted file mode 100644 index c1ffff6c7..000000000 --- a/client/containers/workflow-list/helpers/get-filter-by.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { - FILTER_BY_CLOSE_TIME, - FILTER_BY_START_TIME, - STATUS_ALL, - STATUS_OPEN, -} from '../constants'; - -const getFilterBy = statusName => - [STATUS_ALL, STATUS_OPEN].includes(statusName) - ? FILTER_BY_START_TIME - : FILTER_BY_CLOSE_TIME; - -export default getFilterBy; diff --git a/client/containers/workflow-list/helpers/get-filter-by.spec.js b/client/containers/workflow-list/helpers/get-filter-by.spec.js deleted file mode 100644 index 046c160bc..000000000 --- a/client/containers/workflow-list/helpers/get-filter-by.spec.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { - FILTER_BY_CLOSE_TIME, - FILTER_BY_START_TIME, - STATUS_ALL, - STATUS_CLOSED, - STATUS_OPEN, -} from '../constants'; -import getFilterBy from './get-filter-by'; - -describe('getFilterBy', () => { - describe('statusName = STATUS_ALL', () => { - const statusName = STATUS_ALL; - - it('should return FILTER_BY_START_TIME.', () => { - const output = getFilterBy(statusName); - - expect(output).toEqual(FILTER_BY_START_TIME); - }); - }); - - describe('statusName = STATUS_OPEN', () => { - const statusName = STATUS_OPEN; - - it('should return FILTER_BY_START_TIME.', () => { - const output = getFilterBy(statusName); - - expect(output).toEqual(FILTER_BY_START_TIME); - }); - }); - - describe('statusName = STATUS_CLOSED', () => { - const statusName = STATUS_CLOSED; - - it('should return FILTER_BY_CLOSE_TIME.', () => { - const output = getFilterBy(statusName); - - expect(output).toEqual(FILTER_BY_CLOSE_TIME); - }); - }); -}); diff --git a/client/containers/workflow-list/helpers/get-filter-mode-button-label.js b/client/containers/workflow-list/helpers/get-filter-mode-button-label.js deleted file mode 100644 index 3c185451a..000000000 --- a/client/containers/workflow-list/helpers/get-filter-mode-button-label.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { FILTER_MODE_ADVANCED, FILTER_MODE_BASIC } from '../constants'; - -const getFilterModeButtonLabel = filterMode => - filterMode === FILTER_MODE_ADVANCED - ? FILTER_MODE_BASIC - : FILTER_MODE_ADVANCED; - -export default getFilterModeButtonLabel; diff --git a/client/containers/workflow-list/helpers/get-filter-mode-button-label.spec.js b/client/containers/workflow-list/helpers/get-filter-mode-button-label.spec.js deleted file mode 100644 index 81e635cb6..000000000 --- a/client/containers/workflow-list/helpers/get-filter-mode-button-label.spec.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { FILTER_MODE_ADVANCED, FILTER_MODE_BASIC } from '../constants'; -import getFilterModeButtonLabel from './get-filter-mode-button-label'; - -describe('getFilterModeButtonLabel', () => { - describe('when called with "filterMode" = FILTER_MODE_ADVANCED', () => { - const filterMode = FILTER_MODE_ADVANCED; - - it('should return FILTER_MODE_BASIC.', () => { - const output = getFilterModeButtonLabel(filterMode); - - expect(output).toEqual(FILTER_MODE_BASIC); - }); - }); - - describe('when called with "filterMode" = FILTER_MODE_BASIC', () => { - const filterMode = FILTER_MODE_BASIC; - - it('should return FILTER_MODE_ADVANCED.', () => { - const output = getFilterModeButtonLabel(filterMode); - - expect(output).toEqual(FILTER_MODE_ADVANCED); - }); - }); - - describe('when called with "filterMode" = undefined', () => { - const filterMode = undefined; - - it('should return FILTER_MODE_ADVANCED.', () => { - const output = getFilterModeButtonLabel(filterMode); - - expect(output).toEqual(FILTER_MODE_ADVANCED); - }); - }); -}); diff --git a/client/containers/workflow-list/helpers/get-formatted-results.js b/client/containers/workflow-list/helpers/get-formatted-results.js deleted file mode 100644 index 5ed5c37e3..000000000 --- a/client/containers/workflow-list/helpers/get-formatted-results.js +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { STATUS_OPEN } from '../constants'; -import { getDatetimeFormattedString } from '~helpers'; - -const getFormattedResults = ({ - clusterName, - dateFormat, - results, - timeFormat, - timezone, -}) => - results.map(result => { - const status = (result.closeStatus || STATUS_OPEN).toLowerCase(); - - return { - clusterName, - domainName: result.domainName, - endTime: result.closeTime - ? getDatetimeFormattedString({ - date: result.closeTime, - dateFormat, - timeFormat, - timezone, - }) - : '', - runId: result.execution.runId, - startTime: getDatetimeFormattedString({ - date: result.startTime, - dateFormat, - timeFormat, - timezone, - }), - status, - uniqueId: `${result.execution.runId}-${status}`, - workflowId: result.execution.workflowId, - workflowName: result.type.name, - }; - }); - -export default getFormattedResults; diff --git a/client/containers/workflow-list/helpers/get-formatted-results.spec.js b/client/containers/workflow-list/helpers/get-formatted-results.spec.js deleted file mode 100644 index f3b774f72..000000000 --- a/client/containers/workflow-list/helpers/get-formatted-results.spec.js +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { STATUS_COMPLETED } from '../constants'; -import getFormattedResults from './get-formatted-results'; -import { - DATE_FORMAT_YYYY_MM_DD, - DATE_FORMAT_MMM_D_YYYY, - TIME_FORMAT_12, - TIME_FORMAT_24, - TIMEZONE_LOCAL, - TIMEZONE_UTC, -} from '~constants'; - -describe('getFormattedResults', () => { - const resultWithoutCloseStatus = { - execution: { - runId: 'run_id_5678', - workflowId: 'wf_id_1234', - }, - startTime: '2021-05-15T07:00:00.000Z', - type: { - name: 'wf_name', - }, - }; - - const resultWithCloseStatus = { - ...resultWithoutCloseStatus, - closeTime: '2021-05-19T06:59:59.999Z', - closeStatus: STATUS_COMPLETED, - }; - - describe('results = [resultWithoutCloseStatus], dateFormat = DATE_FORMAT_YYYY_MM_DD, timeFormat = TIME_FORMAT_12 and timezone = TIMEZONE_LOCAL', () => { - const results = [resultWithoutCloseStatus]; - const dateFormat = DATE_FORMAT_YYYY_MM_DD; - const timeFormat = TIME_FORMAT_12; - const timezone = TIMEZONE_LOCAL; - - it('should format the results with the specified formats for startTime and endTime = "".', () => { - const output = getFormattedResults({ - dateFormat, - results, - timeFormat, - timezone, - }); - - expect(output).toEqual([ - { - endTime: '', - runId: 'run_id_5678', - startTime: '2021-05-15 7:00:00 AM', - status: 'open', - uniqueId: 'run_id_5678-open', - workflowId: 'wf_id_1234', - workflowName: 'wf_name', - }, - ]); - }); - }); - - describe('results = [resultWithCloseStatus], dateFormat = DATE_FORMAT_MMM_D_YYYY, timeFormat = TIME_FORMAT_24 and timezone = TIMEZONE_UTC', () => { - const results = [resultWithCloseStatus]; - const dateFormat = DATE_FORMAT_MMM_D_YYYY; - const timeFormat = TIME_FORMAT_24; - const timezone = TIMEZONE_UTC; - - it('should format the results with the specified formats for startTime and endTime.', () => { - const output = getFormattedResults({ - dateFormat, - results, - timeFormat, - timezone, - }); - - expect(output).toEqual([ - { - endTime: 'May 19, 2021 06:59:59', - runId: 'run_id_5678', - startTime: 'May 15, 2021 07:00:00', - status: 'completed', - uniqueId: 'run_id_5678-completed', - workflowId: 'wf_id_1234', - workflowName: 'wf_name', - }, - ]); - }); - }); -}); diff --git a/client/containers/workflow-list/helpers/get-is-cron.js b/client/containers/workflow-list/helpers/get-is-cron.js deleted file mode 100644 index 825eea95f..000000000 --- a/client/containers/workflow-list/helpers/get-is-cron.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { IS_CRON_LIST_OPTION_DEFAULT, IS_CRON_LIST } from '../constants'; - -const getIsCron = isCron => { - if (isCron === undefined) { - return IS_CRON_LIST_OPTION_DEFAULT; - } - - const formattedIsCron = isCron.toString().toLowerCase(); - - return ( - IS_CRON_LIST.find(item => item.value === formattedIsCron) || - IS_CRON_LIST_OPTION_DEFAULT - ); -}; - -export default getIsCron; diff --git a/client/containers/workflow-list/helpers/get-min-start-date.js b/client/containers/workflow-list/helpers/get-min-start-date.js deleted file mode 100644 index ce80a0809..000000000 --- a/client/containers/workflow-list/helpers/get-min-start-date.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; -import { STATUS_OPEN, STATUS_ALL } from '../constants'; - -const getMinStartDate = ({ maxRetentionDays, now, statusName }) => { - if ([STATUS_OPEN, STATUS_ALL].includes(statusName)) { - return null; - } - - return moment(now) - .subtract(maxRetentionDays, 'days') - .startOf('days'); -}; - -export default getMinStartDate; diff --git a/client/containers/workflow-list/helpers/get-min-start-date.spec.js b/client/containers/workflow-list/helpers/get-min-start-date.spec.js deleted file mode 100644 index 7b2cd07a1..000000000 --- a/client/containers/workflow-list/helpers/get-min-start-date.spec.js +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { STATUS_ALL, STATUS_CLOSED, STATUS_OPEN } from '../constants'; -import getMinStartDate from './get-min-start-date'; - -describe('getMinStartDate', () => { - describe('when statusName = STATUS_OPEN', () => { - const statusName = STATUS_OPEN; - - it('should return null.', () => { - const output = getMinStartDate({ statusName }); - - expect(output).toEqual(null); - }); - }); - - describe('when statusName = STATUS_ALL', () => { - const statusName = STATUS_ALL; - - it('should return null.', () => { - const output = getMinStartDate({ statusName }); - - expect(output).toEqual(null); - }); - }); - - describe('when statusName = STATUS_CLOSED and maxRetentionDays = 3', () => { - const maxRetentionDays = 3; - const statusName = STATUS_CLOSED; - - it('should return a date 3 days before now.', () => { - const now = new Date(2021, 4, 4); // month is 0 based. 4 = may - const output = getMinStartDate({ maxRetentionDays, now, statusName }); - - expect(output.toISOString()).toEqual('2021-05-01T00:00:00.000Z'); - }); - }); -}); diff --git a/client/containers/workflow-list/helpers/get-state.js b/client/containers/workflow-list/helpers/get-state.js deleted file mode 100644 index 7463c6b70..000000000 --- a/client/containers/workflow-list/helpers/get-state.js +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { - STATE_ALL, - STATE_CLOSED, - STATE_OPEN, - STATUS_ALL, - STATUS_OPEN, -} from '../constants'; - -const getState = statusName => { - if (!statusName || statusName === STATUS_ALL) { - return STATE_ALL; - } - - if (statusName === STATUS_OPEN) { - return STATE_OPEN; - } - - return STATE_CLOSED; -}; - -export default getState; diff --git a/client/containers/workflow-list/helpers/get-state.spec.js b/client/containers/workflow-list/helpers/get-state.spec.js deleted file mode 100644 index 9b529e6b5..000000000 --- a/client/containers/workflow-list/helpers/get-state.spec.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { - STATE_ALL, - STATE_CLOSED, - STATE_OPEN, - STATUS_ALL, - STATUS_CLOSED, - STATUS_COMPLETED, - STATUS_OPEN, -} from '../constants'; -import getState from './get-state'; - -describe('getState', () => { - describe('when statusName = ""', () => { - const statusName = ''; - - it('should return STATE_ALL.', () => { - const output = getState(statusName); - - expect(output).toEqual(STATE_ALL); - }); - }); - - describe('when statusName = STATUS_ALL', () => { - const statusName = STATUS_ALL; - - it('should return STATE_ALL.', () => { - const output = getState(statusName); - - expect(output).toEqual(STATE_ALL); - }); - }); - - describe('when statusName = STATUS_OPEN', () => { - const statusName = STATUS_OPEN; - - it('should return STATE_OPEN.', () => { - const output = getState(statusName); - - expect(output).toEqual(STATE_OPEN); - }); - }); - - describe('when statusName = STATUS_CLOSED', () => { - const statusName = STATUS_CLOSED; - - it('should return STATE_CLOSED.', () => { - const output = getState(statusName); - - expect(output).toEqual(STATE_CLOSED); - }); - }); - - describe('when statusName = STATUS_COMPLETED', () => { - const statusName = STATUS_COMPLETED; - - it('should return STATE_CLOSED.', () => { - const output = getState(statusName); - - expect(output).toEqual(STATE_CLOSED); - }); - }); -}); diff --git a/client/containers/workflow-list/helpers/get-status.js b/client/containers/workflow-list/helpers/get-status.js deleted file mode 100644 index f87972e9d..000000000 --- a/client/containers/workflow-list/helpers/get-status.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { STATUS_LIST, STATUS_LIST_OPTION_DEFAULT } from '../constants'; - -const getStatus = status => { - if (!status) { - return STATUS_LIST_OPTION_DEFAULT; - } - - const formattedStatus = status.toUpperCase(); - - return ( - STATUS_LIST.find(item => item.value === formattedStatus) || - STATUS_LIST_OPTION_DEFAULT - ); -}; - -export default getStatus; diff --git a/client/containers/workflow-list/helpers/get-status.spec.js b/client/containers/workflow-list/helpers/get-status.spec.js deleted file mode 100644 index a42fe1fe1..000000000 --- a/client/containers/workflow-list/helpers/get-status.spec.js +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { - STATUS_ALL, - STATUS_CANCELED, - STATUS_CLOSED, - STATUS_COMPLETED, - STATUS_CONTINUED_AS_NEW, - STATUS_FAILED, - STATUS_OPEN, - STATUS_TERMINATED, - STATUS_TIMED_OUT, -} from '../constants'; -import getStatus from './get-status'; - -describe('getStatus', () => { - describe('when calling getStatus with status = STATUS_ALL', () => { - const status = STATUS_ALL; - - it('should return { value: STATUS_ALL, label: "All" }.', () => { - const output = getStatus(status); - - expect(output.label).toEqual('All'); - expect(output.value).toEqual(STATUS_ALL); - }); - }); - - describe('when calling getStatus with status = STATUS_CANCELED', () => { - const status = STATUS_CANCELED; - - it('should return { value: STATUS_CANCELED, label: "Cancelled" }.', () => { - const output = getStatus(status); - - expect(output.label).toEqual('Cancelled'); - expect(output.value).toEqual(STATUS_CANCELED); - }); - }); - - describe('when calling getStatus with status = STATUS_CLOSED', () => { - const status = STATUS_CLOSED; - - it('should return { value: STATUS_CANCELED, label: "Closed" }.', () => { - const output = getStatus(status); - - expect(output.label).toEqual('Closed'); - expect(output.value).toEqual(STATUS_CLOSED); - }); - }); - - describe('when calling getStatus with status = STATUS_COMPLETED', () => { - const status = STATUS_COMPLETED; - - it('should return { value: STATUS_COMPLETED, label: "Completed" }.', () => { - const output = getStatus(status); - - expect(output.label).toEqual('Completed'); - expect(output.value).toEqual(STATUS_COMPLETED); - }); - }); - - describe('when calling getStatus with status = STATUS_CONTINUED_AS_NEW', () => { - const status = STATUS_CONTINUED_AS_NEW; - - it('should return { value: STATUS_CONTINUED_AS_NEW, label: "Continued As New" }.', () => { - const output = getStatus(status); - - expect(output.label).toEqual('Continued As New'); - expect(output.value).toEqual(STATUS_CONTINUED_AS_NEW); - }); - }); - - describe('when calling getStatus with status = STATUS_FAILED', () => { - const status = STATUS_FAILED; - - it('should return { value: STATUS_FAILED, label: "Failed" }.', () => { - const output = getStatus(status); - - expect(output.label).toEqual('Failed'); - expect(output.value).toEqual(STATUS_FAILED); - }); - }); - - describe('when calling getStatus with status = STATUS_OPEN', () => { - const status = STATUS_OPEN; - - it('should return { value: STATUS_OPEN, label: "Open" }.', () => { - const output = getStatus(status); - - expect(output.label).toEqual('Open'); - expect(output.value).toEqual(STATUS_OPEN); - }); - }); - - describe('when calling getStatus with status = STATUS_TERMINATED', () => { - const status = STATUS_TERMINATED; - - it('should return { value: STATUS_TERMINATED, label: "Terminated" }.', () => { - const output = getStatus(status); - - expect(output.label).toEqual('Terminated'); - expect(output.value).toEqual(STATUS_TERMINATED); - }); - }); - - describe('when calling getStatus with status = STATUS_TIMED_OUT', () => { - const status = STATUS_TIMED_OUT; - - it('should return { value: STATUS_TIMED_OUT, label: "Timed Out" }.', () => { - const output = getStatus(status); - - expect(output.label).toEqual('Timed Out'); - expect(output.value).toEqual(STATUS_TIMED_OUT); - }); - }); - - describe('when calling getStatus with status = ""', () => { - const status = ''; - - it('should return { value: STATUS_ALL, label: "All" }.', () => { - const output = getStatus(status); - - expect(output.label).toEqual('All'); - expect(output.value).toEqual(STATUS_ALL); - }); - }); - - describe('when calling getStatus with status = "open"', () => { - const status = 'open'; - - it('should return { value: STATUS_OPEN, label: "Open" }.', () => { - const output = getStatus(status); - - expect(output.label).toEqual('Open'); - expect(output.value).toEqual(STATUS_OPEN); - }); - }); -}); diff --git a/client/containers/workflow-list/helpers/index.js b/client/containers/workflow-list/helpers/index.js deleted file mode 100644 index fbadf95c1..000000000 --- a/client/containers/workflow-list/helpers/index.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export { default as getCriteria } from './get-criteria'; -export { default as getFetchWorkflowListUrl } from './get-fetch-workflow-list-url'; -export { default as getFilterBy } from './get-filter-by'; -export { default as getFilterModeButtonLabel } from './get-filter-mode-button-label'; -export { default as getFormattedResults } from './get-formatted-results'; -export { default as getIsCron } from './get-is-cron'; -export { default as getMinStartDate } from './get-min-start-date'; -export { default as getState } from './get-state'; -export { default as getStatus } from './get-status'; -export { default as isRangeValid } from './is-range-valid'; -export { default as isRouteRangeValid } from './is-route-range-valid'; -export { default as toggleFilterMode } from './toggle-filter-mode'; diff --git a/client/containers/workflow-list/helpers/is-range-valid.js b/client/containers/workflow-list/helpers/is-range-valid.js deleted file mode 100644 index ee17fcb94..000000000 --- a/client/containers/workflow-list/helpers/is-range-valid.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; - -const isRangeValid = ({ minStartDate, now, range }) => { - if (typeof range === 'string') { - const [, count, unit] = range.split('-'); - let startTime; - - try { - startTime = moment(now) - .subtract(count, unit) - .startOf(unit); - } catch (e) { - return false; - } - - if (minStartDate && startTime < minStartDate) { - return false; - } - - return true; - } - - if (range.startTime && range.endTime) { - const startTime = moment(range.startTime); - const endTime = moment(range.endTime); - - if (startTime > endTime) { - return false; - } - - if (minStartDate && startTime < minStartDate) { - return false; - } - - return true; - } - - return false; -}; - -export default isRangeValid; diff --git a/client/containers/workflow-list/helpers/is-range-valid.spec.js b/client/containers/workflow-list/helpers/is-range-valid.spec.js deleted file mode 100644 index dc7312044..000000000 --- a/client/containers/workflow-list/helpers/is-range-valid.spec.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; -import isRangeValid from './is-range-valid'; - -describe('isRangeValid', () => { - describe('minStartDate = 5 days before now', () => { - const now = '2021-05-06'; - const minStartDate = moment(now).subtract(5, 'days'); - - describe('range = "last-3-days"', () => { - const range = 'last-3-days'; - - it('should return true', () => { - const output = isRangeValid({ minStartDate, now, range }); - - expect(output).toEqual(true); - }); - }); - - describe('range = "last-7-days"', () => { - const range = 'last-7-days'; - - it('should return false', () => { - const output = isRangeValid({ minStartDate, now, range }); - - expect(output).toEqual(false); - }); - }); - - describe('range = { startTime: "2021-05-01", endTime: "2021-05-06" }', () => { - const range = { startTime: '2021-05-01', endTime: '2021-05-06' }; - - it('should return true', () => { - const output = isRangeValid({ minStartDate, now, range }); - - expect(output).toEqual(true); - }); - }); - - describe('range = { startTime: "2021-04-28", endTime: "2021-05-06" }', () => { - const range = { startTime: '2021-04-28', endTime: '2021-05-06' }; - - it('should return false', () => { - const output = isRangeValid({ minStartDate, now, range }); - - expect(output).toEqual(false); - }); - }); - - describe('range = { startTime: "2021-05-06", endTime: "2021-05-01" }', () => { - const range = { startTime: '2021-05-06', endTime: '2021-05-01' }; - - it('should return false', () => { - const output = isRangeValid({ minStartDate, now, range }); - - expect(output).toEqual(false); - }); - }); - }); -}); diff --git a/client/containers/workflow-list/helpers/is-route-range-valid.js b/client/containers/workflow-list/helpers/is-route-range-valid.js deleted file mode 100644 index 0280485fa..000000000 --- a/client/containers/workflow-list/helpers/is-route-range-valid.js +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import isRangeValid from './is-range-valid'; - -const isRouteRangeValid = ({ - endTime, - minStartDate, - now, - range, - startTime, -}) => { - if (range) { - return isRangeValid({ minStartDate, now, range }); - } - - if (startTime && endTime) { - return isRangeValid({ minStartDate, now, range: { endTime, startTime } }); - } - - return false; -}; - -export default isRouteRangeValid; diff --git a/client/containers/workflow-list/helpers/is-route-range-valid.spec.js b/client/containers/workflow-list/helpers/is-route-range-valid.spec.js deleted file mode 100644 index d6164fb56..000000000 --- a/client/containers/workflow-list/helpers/is-route-range-valid.spec.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; -import isRouteRangeValid from './is-route-range-valid'; - -describe('isRouteRangeValid', () => { - describe('minStartDate = 5 days before now', () => { - const now = '2021-05-06'; - const minStartDate = moment(now).subtract(5, 'days'); - - describe('range = "last-3-days"', () => { - const range = 'last-3-days'; - - it('should return true', () => { - const output = isRouteRangeValid({ minStartDate, now, range }); - - expect(output).toEqual(true); - }); - }); - - describe('startTime = "2021-05-01", endTime = "2021-05-06"', () => { - const startTime = '2021-05-01'; - const endTime = '2021-05-06'; - - it('should return true', () => { - const output = isRouteRangeValid({ - endTime, - minStartDate, - now, - startTime, - }); - - expect(output).toEqual(true); - }); - }); - }); -}); diff --git a/client/containers/workflow-list/helpers/toggle-filter-mode.js b/client/containers/workflow-list/helpers/toggle-filter-mode.js deleted file mode 100644 index dc0738d74..000000000 --- a/client/containers/workflow-list/helpers/toggle-filter-mode.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { FILTER_MODE_ADVANCED, FILTER_MODE_BASIC } from '../constants'; - -const toggleFilterMode = filterMode => - filterMode === FILTER_MODE_ADVANCED - ? FILTER_MODE_BASIC - : FILTER_MODE_ADVANCED; - -export default toggleFilterMode; diff --git a/client/containers/workflow-list/helpers/toggle-filter-mode.spec.js b/client/containers/workflow-list/helpers/toggle-filter-mode.spec.js deleted file mode 100644 index d45e4353e..000000000 --- a/client/containers/workflow-list/helpers/toggle-filter-mode.spec.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { FILTER_MODE_ADVANCED, FILTER_MODE_BASIC } from '../constants'; -import toggleFilterMode from './toggle-filter-mode'; - -describe('toggleFilterMode', () => { - describe('filterMode = FILTER_MODE_ADVANCED', () => { - const filterMode = FILTER_MODE_ADVANCED; - - it('should return FILTER_MODE_BASIC', () => { - const output = toggleFilterMode(filterMode); - - expect(output).toEqual(FILTER_MODE_BASIC); - }); - }); - - describe('filterMode = FILTER_MODE_BASIC', () => { - const filterMode = FILTER_MODE_BASIC; - - it('should return FILTER_MODE_ADVANCED', () => { - const output = toggleFilterMode(filterMode); - - expect(output).toEqual(FILTER_MODE_ADVANCED); - }); - }); - - describe('filterMode = null', () => { - const filterMode = null; - - it('should return FILTER_MODE_ADVANCED', () => { - const output = toggleFilterMode(filterMode); - - expect(output).toEqual(FILTER_MODE_ADVANCED); - }); - }); -}); diff --git a/client/containers/workflow-list/index.js b/client/containers/workflow-list/index.js deleted file mode 100644 index 5ac796f46..000000000 --- a/client/containers/workflow-list/index.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import Component from './component'; -import Connector from './connector'; -import actions from './actions'; -import getters from './getters'; - -const container = Connector('WorkflowList', Component); - -export { actions, container, getters }; diff --git a/client/containers/workflow-pending/action-types.js b/client/containers/workflow-pending/action-types.js deleted file mode 100644 index b157333d0..000000000 --- a/client/containers/workflow-pending/action-types.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const WORKFLOW_PENDING_FILTER_CHANGED = - 'WORKFLOW_PENDING_FILTER_CHANGED'; diff --git a/client/containers/workflow-pending/actions.js b/client/containers/workflow-pending/actions.js deleted file mode 100644 index 32f26eecd..000000000 --- a/client/containers/workflow-pending/actions.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { ROUTE_UPDATE_QUERY } from '../route/action-types'; -import { WORKFLOW_PENDING_FILTER_CHANGED } from './action-types'; - -const actions = { - [WORKFLOW_PENDING_FILTER_CHANGED]: ({ dispatch }, filter) => - dispatch(ROUTE_UPDATE_QUERY, { filter }), -}; - -export default actions; diff --git a/client/containers/workflow-pending/actions.spec.js b/client/containers/workflow-pending/actions.spec.js deleted file mode 100644 index c895937d8..000000000 --- a/client/containers/workflow-pending/actions.spec.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { ROUTE_UPDATE_QUERY } from '../route/action-types'; -import actions from './actions'; -import { WORKFLOW_PENDING_FILTER_CHANGED } from './action-types'; - -describe('workflow pending actions', () => { - describe('when actions[WORKFLOW_PENDING_FILTER_CHANGED] is called', () => { - it('should dispatch ROUTE_UPDATE_QUERY with the filter that is changed.', () => { - const dispatch = jest.fn(); - const filter = 'activity'; - - actions[WORKFLOW_PENDING_FILTER_CHANGED]({ dispatch }, filter); - expect(dispatch).toHaveBeenCalledWith(ROUTE_UPDATE_QUERY, { - filter: 'activity', - }); - }); - }); -}); diff --git a/client/containers/workflow-pending/component.vue b/client/containers/workflow-pending/component.vue deleted file mode 100644 index 150e854b5..000000000 --- a/client/containers/workflow-pending/component.vue +++ /dev/null @@ -1,114 +0,0 @@ - - - - - diff --git a/client/containers/workflow-pending/components/index.js b/client/containers/workflow-pending/components/index.js deleted file mode 100644 index ffee23e6e..000000000 --- a/client/containers/workflow-pending/components/index.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export { default as PendingTaskListItem } from './pending-task-list-item'; diff --git a/client/containers/workflow-pending/components/pending-task-list-item.vue b/client/containers/workflow-pending/components/pending-task-list-item.vue deleted file mode 100644 index 260eff7c2..000000000 --- a/client/containers/workflow-pending/components/pending-task-list-item.vue +++ /dev/null @@ -1,75 +0,0 @@ - - - - - diff --git a/client/containers/workflow-pending/connector.js b/client/containers/workflow-pending/connector.js deleted file mode 100644 index 3f2981e48..000000000 --- a/client/containers/workflow-pending/connector.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { connect } from 'vuex-connect'; -import { WORKFLOW_EXECUTION_IS_LOADING } from '../workflow/getter-types'; -import { WORKFLOW_PENDING_FILTER_CHANGED } from './action-types'; -import { - WORKFLOW_PENDING_ACTIVE_FILTER, - WORKFLOW_PENDING_ACTIVE_FILTER_EMPTY_MESSAGE, - WORKFLOW_PENDING_ACTIVE_PENDING_TASK_LIST, -} from './getter-types'; - -const actionsToEvents = { - filterChanged: WORKFLOW_PENDING_FILTER_CHANGED, -}; - -const gettersToProps = { - emptyMessage: WORKFLOW_PENDING_ACTIVE_FILTER_EMPTY_MESSAGE, - filter: WORKFLOW_PENDING_ACTIVE_FILTER, - isLoading: WORKFLOW_EXECUTION_IS_LOADING, - pendingTaskList: WORKFLOW_PENDING_ACTIVE_PENDING_TASK_LIST, -}; - -export default connect({ - actionsToEvents, - gettersToProps, -}); diff --git a/client/containers/workflow-pending/constants.js b/client/containers/workflow-pending/constants.js deleted file mode 100644 index 027530b47..000000000 --- a/client/containers/workflow-pending/constants.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { - PENDING_TASK_TYPE_ACTIVITY, - PENDING_TASK_TYPE_CHILD_WORKFLOW, - PENDING_TASK_TYPE_DECISION, -} from '../workflow/constants'; -import { - WORKFLOW_EXECUTION_PENDING_ACTIVITIES, - WORKFLOW_EXECUTION_PENDING_CHILDREN, - WORKFLOW_EXECUTION_PENDING_TASKS, - WORKFLOW_EXECUTION_PENDING_DECISIONS, -} from '../workflow/getter-types'; - -export const PENDING_TASK_FILTER_ACTIVITIES = 'activities'; -export const PENDING_TASK_FILTER_ALL = 'all'; -export const PENDING_TASK_FILTER_CHILDREN = 'child workflows'; -export const PENDING_TASK_FILTER_DECISIONS = 'decisions'; - -export const PENDING_TASK_FILTERS = [ - PENDING_TASK_FILTER_ALL, - PENDING_TASK_FILTER_ACTIVITIES, - PENDING_TASK_FILTER_CHILDREN, - PENDING_TASK_FILTER_DECISIONS, -]; - -export const PENDING_TASK_FILTER_TO_EMPTY_MESSAGE_MAP = { - [PENDING_TASK_FILTER_ACTIVITIES]: 'No pending activities', - [PENDING_TASK_FILTER_ALL]: 'No pending tasks', - [PENDING_TASK_FILTER_CHILDREN]: 'No pending child workflows', - [PENDING_TASK_FILTER_DECISIONS]: 'No pending decisions', -}; - -export const PENDING_TASK_FILTER_TO_GETTER_TYPE_MAP = { - [PENDING_TASK_FILTER_ACTIVITIES]: WORKFLOW_EXECUTION_PENDING_ACTIVITIES, - [PENDING_TASK_FILTER_ALL]: WORKFLOW_EXECUTION_PENDING_TASKS, - [PENDING_TASK_FILTER_CHILDREN]: WORKFLOW_EXECUTION_PENDING_CHILDREN, - [PENDING_TASK_FILTER_DECISIONS]: WORKFLOW_EXECUTION_PENDING_DECISIONS, -}; - -export const PENDING_TASK_KVPS_EXCLUDE_KEYS = [ - 'pendingTaskId', - 'pendingTaskType', - 'pendingTaskTypeDisplay', -]; - -export const PENDING_TASK_TYPE_TO_ID_MAP = { - [PENDING_TASK_TYPE_ACTIVITY]: 'activityID', - [PENDING_TASK_TYPE_CHILD_WORKFLOW]: 'initiatedID', - [PENDING_TASK_TYPE_DECISION]: 'scheduledTimestamp', -}; - -export const PENDING_TASK_TYPE_TO_DISPLAY_MAP = { - [PENDING_TASK_TYPE_ACTIVITY]: 'PendingActivityTask', - [PENDING_TASK_TYPE_CHILD_WORKFLOW]: 'PendingChildWorkflowTask', - [PENDING_TASK_TYPE_DECISION]: 'PendingDecisionTask', -}; diff --git a/client/containers/workflow-pending/getter-types.js b/client/containers/workflow-pending/getter-types.js deleted file mode 100644 index 500d0cd94..000000000 --- a/client/containers/workflow-pending/getter-types.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const WORKFLOW_PENDING_ACTIVE_FILTER = 'WORKFLOW_PENDING_ACTIVE_FILTER'; -export const WORKFLOW_PENDING_ACTIVE_FILTER_EMPTY_MESSAGE = - 'WORKFLOW_PENDING_ACTIVE_FILTER_EMPTY_MESSAGE'; -export const WORKFLOW_PENDING_ACTIVE_PENDING_TASK_LIST = - 'WORKFLOW_PENDING_ACTIVE_PENDING_TASK_LIST'; diff --git a/client/containers/workflow-pending/getters.js b/client/containers/workflow-pending/getters.js deleted file mode 100644 index 52c109c3e..000000000 --- a/client/containers/workflow-pending/getters.js +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { - ROUTE_PARAMS_CLUSTER_NAME, - ROUTE_PARAMS_DOMAIN, - ROUTE_QUERY, -} from '../route/getter-types'; - -import { PENDING_TASK_FILTER_TO_EMPTY_MESSAGE_MAP } from './constants'; -import { - WORKFLOW_PENDING_ACTIVE_FILTER, - WORKFLOW_PENDING_ACTIVE_FILTER_EMPTY_MESSAGE, - WORKFLOW_PENDING_ACTIVE_PENDING_TASK_LIST, -} from './getter-types'; -import { mapFilterToGetterType, mapPendingTaskList } from './helpers'; - -const getters = { - [WORKFLOW_PENDING_ACTIVE_FILTER]: (_, getters) => - getters[ROUTE_QUERY].filter || 'all', - [WORKFLOW_PENDING_ACTIVE_FILTER_EMPTY_MESSAGE]: (_, getters) => { - const filter = getters[WORKFLOW_PENDING_ACTIVE_FILTER]; - - return PENDING_TASK_FILTER_TO_EMPTY_MESSAGE_MAP[filter] || 'No results'; - }, - [WORKFLOW_PENDING_ACTIVE_PENDING_TASK_LIST]: (_, getters) => { - const clusterName = getters[ROUTE_PARAMS_CLUSTER_NAME]; - const domain = getters[ROUTE_PARAMS_DOMAIN]; - const filter = getters[WORKFLOW_PENDING_ACTIVE_FILTER]; - const getterType = mapFilterToGetterType(filter); - const pendingTaskList = getters[getterType] || []; - - return mapPendingTaskList({ - clusterName, - domain, - pendingTaskList, - }); - }, -}; - -export default getters; diff --git a/client/containers/workflow-pending/getters.spec.js b/client/containers/workflow-pending/getters.spec.js deleted file mode 100644 index 85bf75d38..000000000 --- a/client/containers/workflow-pending/getters.spec.js +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { ROUTE_PARAMS_DOMAIN, ROUTE_QUERY } from '../route/getter-types'; -import { - PENDING_TASK_TYPE_ACTIVITY, - PENDING_TASK_TYPE_CHILD_WORKFLOW, - PENDING_TASK_TYPE_DECISION, -} from '../workflow/constants'; -import { - WORKFLOW_EXECUTION_PENDING_ACTIVITIES, - WORKFLOW_EXECUTION_PENDING_CHILDREN, - WORKFLOW_EXECUTION_PENDING_DECISIONS, -} from '../workflow/getter-types'; -import { - PENDING_TASK_FILTER_ACTIVITIES, - PENDING_TASK_FILTER_ALL, - PENDING_TASK_FILTER_CHILDREN, - PENDING_TASK_FILTER_DECISIONS, -} from './constants'; -import { - WORKFLOW_PENDING_ACTIVE_FILTER, - WORKFLOW_PENDING_ACTIVE_FILTER_EMPTY_MESSAGE, - WORKFLOW_PENDING_ACTIVE_PENDING_TASK_LIST, -} from './getter-types'; -import workflowPendingGetterFns from './getters'; -import { initGetters } from '~test'; - -describe('workflow pending getters', () => { - describe('when calling getters[WORKFLOW_PENDING_ACTIVE_FILTER]', () => { - describe('and getters[ROUTE_QUERY] returns empty object', () => { - it('should return PENDING_TASK_FILTER_ALL.', () => { - const getterFns = { - ...workflowPendingGetterFns, - [ROUTE_QUERY]: () => ({}), - }; - const getters = initGetters({ getterFns }); - const output = getters[WORKFLOW_PENDING_ACTIVE_FILTER]; - - expect(output).toEqual(PENDING_TASK_FILTER_ALL); - }); - }); - - describe('and getters[ROUTE_QUERY] returns { filter: "activity" }', () => { - it('should return "activity".', () => { - const getterFns = { - ...workflowPendingGetterFns, - [ROUTE_QUERY]: () => ({ filter: 'activity' }), - }; - const getters = initGetters({ getterFns }); - const output = getters[WORKFLOW_PENDING_ACTIVE_FILTER]; - - expect(output).toEqual('activity'); - }); - }); - }); - - describe('when calling getters[WORKFLOW_PENDING_ACTIVE_FILTER_EMPTY_MESSAGE]', () => { - describe('and getters[WORKFLOW_PENDING_ACTIVE_FILTER] returns PENDING_TASK_FILTER_ALL', () => { - it('should return "No pending tasks".', () => { - const getterFns = { - ...workflowPendingGetterFns, - [WORKFLOW_PENDING_ACTIVE_FILTER]: () => PENDING_TASK_FILTER_ALL, - }; - const getters = initGetters({ getterFns }); - const output = getters[WORKFLOW_PENDING_ACTIVE_FILTER_EMPTY_MESSAGE]; - - expect(output).toEqual('No pending tasks'); - }); - }); - - describe('and getters[WORKFLOW_PENDING_ACTIVE_FILTER] returns PENDING_TASK_FILTER_ACTIVITIES', () => { - it('should return "No pending activities".', () => { - const getterFns = { - ...workflowPendingGetterFns, - [WORKFLOW_PENDING_ACTIVE_FILTER]: () => - PENDING_TASK_FILTER_ACTIVITIES, - }; - const getters = initGetters({ getterFns }); - const output = getters[WORKFLOW_PENDING_ACTIVE_FILTER_EMPTY_MESSAGE]; - - expect(output).toEqual('No pending activities'); - }); - }); - - describe('and getters[WORKFLOW_PENDING_ACTIVE_FILTER] returns PENDING_TASK_FILTER_CHILDREN', () => { - it('should return "No pending child workflows".', () => { - const getterFns = { - ...workflowPendingGetterFns, - [WORKFLOW_PENDING_ACTIVE_FILTER]: () => PENDING_TASK_FILTER_CHILDREN, - }; - const getters = initGetters({ getterFns }); - const output = getters[WORKFLOW_PENDING_ACTIVE_FILTER_EMPTY_MESSAGE]; - - expect(output).toEqual('No pending child workflows'); - }); - }); - - describe('and getters[WORKFLOW_PENDING_ACTIVE_FILTER] returns PENDING_TASK_FILTER_DECISIONS', () => { - it('should return "No pending decisions".', () => { - const getterFns = { - ...workflowPendingGetterFns, - [WORKFLOW_PENDING_ACTIVE_FILTER]: () => PENDING_TASK_FILTER_DECISIONS, - }; - const getters = initGetters({ getterFns }); - const output = getters[WORKFLOW_PENDING_ACTIVE_FILTER_EMPTY_MESSAGE]; - - expect(output).toEqual('No pending decisions'); - }); - }); - - describe('and getters[WORKFLOW_PENDING_ACTIVE_FILTER] returns undefined', () => { - it('should return "No results".', () => { - const getterFns = { - ...workflowPendingGetterFns, - [WORKFLOW_PENDING_ACTIVE_FILTER]: () => undefined, - }; - const getters = initGetters({ getterFns }); - const output = getters[WORKFLOW_PENDING_ACTIVE_FILTER_EMPTY_MESSAGE]; - - expect(output).toEqual('No results'); - }); - }); - }); - - describe('when calling getters[WORKFLOW_PENDING_ACTIVE_PENDING_TASK_LIST]', () => { - describe( - [ - 'and getters[ROUTE_PARAMS_DOMAIN] returns "samples-domain" and ', - 'getters[WORKFLOW_PENDING_ACTIVE_FILTER] returns PENDING_TASK_FILTER_ACTIVITIES and ', - 'getters[WORKFLOW_EXECUTION_PENDING_ACTIVITIES] returns a pending activity list', - ].join(''), - () => { - it('should return a mapped pending activity list.', () => { - const getterFns = { - ...workflowPendingGetterFns, - [ROUTE_PARAMS_DOMAIN]: () => 'samples-domain', - [WORKFLOW_PENDING_ACTIVE_FILTER]: () => - PENDING_TASK_FILTER_ACTIVITIES, - [WORKFLOW_EXECUTION_PENDING_ACTIVITIES]: () => [ - { - activityID: 'activity-id-1', - pendingTaskType: PENDING_TASK_TYPE_ACTIVITY, - }, - ], - }; - const getters = initGetters({ getterFns }); - const output = getters[WORKFLOW_PENDING_ACTIVE_PENDING_TASK_LIST]; - - expect(output).toEqual([ - { - activityID: 'activity-id-1', - kvps: [ - { - key: 'activityID', - value: 'activity-id-1', - }, - ], - pendingTaskId: 'PENDING_TASK_TYPE_ACTIVITY_activity-id-1', - pendingTaskType: PENDING_TASK_TYPE_ACTIVITY, - pendingTaskTypeDisplay: 'PendingActivityTask', - }, - ]); - }); - } - ); - - describe( - [ - 'and getters[ROUTE_PARAMS_DOMAIN] returns "samples-domain" and ', - 'getters[WORKFLOW_PENDING_ACTIVE_FILTER] returns PENDING_TASK_FILTER_CHILDREN and ', - 'getters[WORKFLOW_EXECUTION_PENDING_CHILDREN] returns a pending child workflow list', - ].join(''), - () => { - it('should return a mapped pending child workflow list.', () => { - const getterFns = { - ...workflowPendingGetterFns, - [ROUTE_PARAMS_DOMAIN]: () => 'samples-domain', - [WORKFLOW_PENDING_ACTIVE_FILTER]: () => - PENDING_TASK_FILTER_CHILDREN, - [WORKFLOW_EXECUTION_PENDING_CHILDREN]: () => [ - { - initiatedID: 'initiated-id-1', - pendingTaskType: PENDING_TASK_TYPE_CHILD_WORKFLOW, - runID: 'run-id-1', - workflowID: 'workflow-id-1', - }, - ], - }; - const getters = initGetters({ getterFns }); - const output = getters[WORKFLOW_PENDING_ACTIVE_PENDING_TASK_LIST]; - - expect(output).toEqual([ - { - initiatedID: 'initiated-id-1', - kvps: [ - { - key: 'initiatedID', - value: 'initiated-id-1', - }, - { - key: 'runID', - routeLink: { - name: 'workflow/summary', - params: { - domain: 'samples-domain', - runId: 'run-id-1', - workflowId: 'workflow-id-1', - }, - }, - value: 'run-id-1', - }, - { - key: 'workflowID', - value: 'workflow-id-1', - }, - ], - pendingTaskId: 'PENDING_TASK_TYPE_CHILD_WORKFLOW_initiated-id-1', - pendingTaskType: PENDING_TASK_TYPE_CHILD_WORKFLOW, - pendingTaskTypeDisplay: 'PendingChildWorkflowTask', - runID: { - routeLink: { - name: 'workflow/summary', - params: { - domain: 'samples-domain', - runId: 'run-id-1', - workflowId: 'workflow-id-1', - }, - }, - text: 'run-id-1', - }, - workflowID: 'workflow-id-1', - }, - ]); - }); - } - ); - - describe( - [ - 'and getters[ROUTE_PARAMS_DOMAIN] returns "samples-domain" and ', - 'getters[WORKFLOW_PENDING_ACTIVE_FILTER] returns PENDING_TASK_FILTER_DECISIONS and ', - 'getters[WORKFLOW_EXECUTION_PENDING_DECISIONS] returns a pending decision list', - ].join(''), - () => { - it('should return a mapped pending decision list.', () => { - const getterFns = { - ...workflowPendingGetterFns, - [ROUTE_PARAMS_DOMAIN]: () => 'samples-domain', - [WORKFLOW_PENDING_ACTIVE_FILTER]: () => - PENDING_TASK_FILTER_DECISIONS, - [WORKFLOW_EXECUTION_PENDING_DECISIONS]: () => [ - { - scheduledTimestamp: 'timestamp-1', - pendingTaskType: PENDING_TASK_TYPE_DECISION, - }, - ], - }; - const getters = initGetters({ getterFns }); - const output = getters[WORKFLOW_PENDING_ACTIVE_PENDING_TASK_LIST]; - - expect(output).toEqual([ - { - scheduledTimestamp: 'timestamp-1', - kvps: [ - { - key: 'scheduledTimestamp', - value: 'timestamp-1', - }, - ], - pendingTaskId: 'PENDING_TASK_TYPE_DECISION_timestamp-1', - pendingTaskType: PENDING_TASK_TYPE_DECISION, - pendingTaskTypeDisplay: 'PendingDecisionTask', - }, - ]); - }); - } - ); - }); -}); diff --git a/client/containers/workflow-pending/helpers/get-workflow-link.js b/client/containers/workflow-pending/helpers/get-workflow-link.js deleted file mode 100644 index 6d114c1dc..000000000 --- a/client/containers/workflow-pending/helpers/get-workflow-link.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const getWorkflowLink = ({ clusterName, domain, runID, workflowID }) => - (domain && - runID && - workflowID && { - routeLink: { - name: 'workflow/summary', - params: { - clusterName, - domain, - workflowId: workflowID, - runId: runID, - }, - }, - text: runID, - }) || - undefined; - -export default getWorkflowLink; diff --git a/client/containers/workflow-pending/helpers/index.js b/client/containers/workflow-pending/helpers/index.js deleted file mode 100644 index c4e3b3e95..000000000 --- a/client/containers/workflow-pending/helpers/index.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export { default as getWorkflowLink } from './get-workflow-link'; -export { default as mapFilterToGetterType } from './map-filter-to-getter-type'; -export { default as mapPendingTaskList } from './map-pending-task-list'; diff --git a/client/containers/workflow-pending/helpers/map-filter-to-getter-type.js b/client/containers/workflow-pending/helpers/map-filter-to-getter-type.js deleted file mode 100644 index 9113b9fc5..000000000 --- a/client/containers/workflow-pending/helpers/map-filter-to-getter-type.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { PENDING_TASK_FILTER_TO_GETTER_TYPE_MAP } from '../constants'; - -const mapFilterToGetterType = filter => - PENDING_TASK_FILTER_TO_GETTER_TYPE_MAP[filter] || ''; - -export default mapFilterToGetterType; diff --git a/client/containers/workflow-pending/helpers/map-pending-task-list.js b/client/containers/workflow-pending/helpers/map-pending-task-list.js deleted file mode 100644 index 778611bec..000000000 --- a/client/containers/workflow-pending/helpers/map-pending-task-list.js +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { - PENDING_TASK_KVPS_EXCLUDE_KEYS, - PENDING_TASK_TYPE_TO_ID_MAP, - PENDING_TASK_TYPE_TO_DISPLAY_MAP, -} from '../constants'; - -import getWorkflowLink from './get-workflow-link'; -import { getKeyValuePairs } from '~helpers'; - -const mapPendingTaskItem = ({ clusterName, domain }) => item => { - const { pendingTaskType, runID } = item; - - const mappedItem = { - ...item, - pendingTaskId: `${pendingTaskType}_${ - item[PENDING_TASK_TYPE_TO_ID_MAP[pendingTaskType]] - }`, - pendingTaskTypeDisplay: PENDING_TASK_TYPE_TO_DISPLAY_MAP[pendingTaskType], - ...(runID && { - runID: getWorkflowLink({ ...item, clusterName, domain }) || runID, - }), - }; - - return { - ...mappedItem, - kvps: getKeyValuePairs({ - clusterName, - excludes: PENDING_TASK_KVPS_EXCLUDE_KEYS, - item: mappedItem, - }), - }; -}; - -const mapPendingTaskList = ({ clusterName, domain, pendingTaskList }) => - pendingTaskList.map(mapPendingTaskItem({ clusterName, domain })); - -export default mapPendingTaskList; diff --git a/client/containers/workflow-pending/index.js b/client/containers/workflow-pending/index.js deleted file mode 100644 index b7c6b12b0..000000000 --- a/client/containers/workflow-pending/index.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import Component from './component'; -import Connector from './connector'; -import actions from './actions'; -import getters from './getters'; - -const container = Connector('WorkflowPending', Component); - -export { actions, container, getters }; diff --git a/client/containers/workflow/component.vue b/client/containers/workflow/component.vue deleted file mode 100644 index af1c1f75c..000000000 --- a/client/containers/workflow/component.vue +++ /dev/null @@ -1,448 +0,0 @@ - - - diff --git a/client/containers/workflow/connector.js b/client/containers/workflow/connector.js deleted file mode 100644 index 768860a3e..000000000 --- a/client/containers/workflow/connector.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { connect } from 'vuex-connect'; -import { - WORKFLOW_EXECUTION, - WORKFLOW_EXECUTION_PENDING_TASK_COUNT, - WORKFLOW_EXECUTION_TASK_LIST_NAME, -} from './getter-types'; -import { - WORKFLOW_CLEAR_EXECUTION, - WORKFLOW_SET_EXECUTION, -} from './mutation-types'; - -const gettersToProps = { - pendingTaskCount: WORKFLOW_EXECUTION_PENDING_TASK_COUNT, - taskListName: WORKFLOW_EXECUTION_TASK_LIST_NAME, - workflow: WORKFLOW_EXECUTION, -}; - -const mutationsToEvents = { - clearWorkflow: WORKFLOW_CLEAR_EXECUTION, - setWorkflow: WORKFLOW_SET_EXECUTION, -}; - -export default connect({ - gettersToProps, - mutationsToEvents, -}); diff --git a/client/containers/workflow/constants.js b/client/containers/workflow/constants.js deleted file mode 100644 index 3c6f1c9d9..000000000 --- a/client/containers/workflow/constants.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const PENDING_TASK_TYPE_ACTIVITY = 'PENDING_TASK_TYPE_ACTIVITY'; -export const PENDING_TASK_TYPE_CHILD_WORKFLOW = - 'PENDING_TASK_TYPE_CHILD_WORKFLOW'; -export const PENDING_TASK_TYPE_DECISION = 'PENDING_TASK_TYPE_DECISION'; -export const RETRY_COUNT_MAX = 3; -export const RETRY_TIMEOUT = 6000; diff --git a/client/containers/workflow/get-default-state.js b/client/containers/workflow/get-default-state.js deleted file mode 100644 index 7351d7762..000000000 --- a/client/containers/workflow/get-default-state.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const getDefaultState = (state = {}) => ({ - execution: null, - isLoading: true, - ...state, -}); - -export default getDefaultState; diff --git a/client/containers/workflow/get-default-state.spec.js b/client/containers/workflow/get-default-state.spec.js deleted file mode 100644 index e8df5e187..000000000 --- a/client/containers/workflow/get-default-state.spec.js +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getDefaultState from './get-default-state'; - -describe('workflow getDefaultState', () => { - describe('when state is not passed', () => { - it('should return execution = null.', () => { - const output = getDefaultState(); - - expect(output.execution).toEqual(null); - }); - - it('should return isLoading = true.', () => { - const output = getDefaultState(); - - expect(output.isLoading).toEqual(true); - }); - }); - - describe('when state is passed with execution defined', () => { - const state = { execution: {} }; - - it('should return execution.', () => { - const output = getDefaultState(state); - - expect(output.execution).toEqual({}); - }); - }); - - describe('when state is passed with isLoading = false', () => { - const state = { isLoading: false }; - - it('should return isLoading = false.', () => { - const output = getDefaultState(state); - - expect(output.isLoading).toEqual(false); - }); - }); -}); diff --git a/client/containers/workflow/getter-types.js b/client/containers/workflow/getter-types.js deleted file mode 100644 index 7b77fe2e2..000000000 --- a/client/containers/workflow/getter-types.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const WORKFLOW_EXECUTION = 'WORKFLOW_EXECUTION'; -export const WORKFLOW_EXECUTION_IS_LOADING = 'WORKFLOW_EXECUTION_IS_LOADING'; -export const WORKFLOW_EXECUTION_PENDING_ACTIVITIES = - 'WORKFLOW_EXECUTION_PENDING_ACTIVITIES'; -export const WORKFLOW_EXECUTION_PENDING_CHILDREN = - 'WORKFLOW_EXECUTION_PENDING_CHILDREN'; -export const WORKFLOW_EXECUTION_PENDING_DECISIONS = - 'WORKFLOW_EXECUTION_PENDING_DECISIONS'; -export const WORKFLOW_EXECUTION_PENDING_TASK_COUNT = - 'WORKFLOW_EXECUTION_PENDING_TASK_COUNT'; -export const WORKFLOW_EXECUTION_PENDING_TASKS = - 'WORKFLOW_EXECUTION_PENDING_TASKS'; -export const WORKFLOW_EXECUTION_TASK_LIST_NAME = - 'WORKFLOW_EXECUTION_TASK_LIST_NAME'; diff --git a/client/containers/workflow/getters.js b/client/containers/workflow/getters.js deleted file mode 100644 index 4b7fc56c2..000000000 --- a/client/containers/workflow/getters.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { get } from 'lodash-es'; -import { - PENDING_TASK_TYPE_ACTIVITY, - PENDING_TASK_TYPE_CHILD_WORKFLOW, - PENDING_TASK_TYPE_DECISION, -} from './constants'; -import { - WORKFLOW_EXECUTION, - WORKFLOW_EXECUTION_IS_LOADING, - WORKFLOW_EXECUTION_PENDING_ACTIVITIES, - WORKFLOW_EXECUTION_PENDING_CHILDREN, - WORKFLOW_EXECUTION_PENDING_DECISIONS, - WORKFLOW_EXECUTION_PENDING_TASK_COUNT, - WORKFLOW_EXECUTION_PENDING_TASKS, - WORKFLOW_EXECUTION_TASK_LIST_NAME, -} from './getter-types'; - -const getters = { - [WORKFLOW_EXECUTION]: state => get(state, 'workflow.execution'), - [WORKFLOW_EXECUTION_IS_LOADING]: state => - get(state, 'workflow.isLoading') || false, - [WORKFLOW_EXECUTION_PENDING_ACTIVITIES]: state => - (get(state, 'workflow.execution.pendingActivities') || []).map(item => ({ - ...item, - pendingTaskType: PENDING_TASK_TYPE_ACTIVITY, - })), - [WORKFLOW_EXECUTION_PENDING_CHILDREN]: state => - (get(state, 'workflow.execution.pendingChildren') || []).map(item => ({ - ...item, - pendingTaskType: PENDING_TASK_TYPE_CHILD_WORKFLOW, - })), - [WORKFLOW_EXECUTION_PENDING_DECISIONS]: state => { - const pendingDecision = get(state, 'workflow.execution.pendingDecision'); - - if (!pendingDecision) { - return []; - } - - return [ - { - ...pendingDecision, - pendingTaskType: PENDING_TASK_TYPE_DECISION, - }, - ]; - }, - [WORKFLOW_EXECUTION_PENDING_TASK_COUNT]: (_, getters) => - getters[WORKFLOW_EXECUTION_PENDING_TASKS].length, - [WORKFLOW_EXECUTION_PENDING_TASKS]: (_, getters) => [ - ...getters[WORKFLOW_EXECUTION_PENDING_ACTIVITIES], - ...getters[WORKFLOW_EXECUTION_PENDING_CHILDREN], - ...getters[WORKFLOW_EXECUTION_PENDING_DECISIONS], - ], - [WORKFLOW_EXECUTION_TASK_LIST_NAME]: state => - get(state, 'workflow.execution.executionConfiguration.taskList.name') || '', -}; - -export default getters; diff --git a/client/containers/workflow/getters.spec.js b/client/containers/workflow/getters.spec.js deleted file mode 100644 index 40f673b31..000000000 --- a/client/containers/workflow/getters.spec.js +++ /dev/null @@ -1,290 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getterFns from './getters'; -import { - WORKFLOW_EXECUTION, - WORKFLOW_EXECUTION_IS_LOADING, - WORKFLOW_EXECUTION_PENDING_ACTIVITIES, - WORKFLOW_EXECUTION_PENDING_CHILDREN, - WORKFLOW_EXECUTION_PENDING_TASK_COUNT, - WORKFLOW_EXECUTION_PENDING_TASKS, - WORKFLOW_EXECUTION_TASK_LIST_NAME, -} from './getter-types'; -import { - PENDING_TASK_TYPE_ACTIVITY, - PENDING_TASK_TYPE_CHILD_WORKFLOW, -} from './constants'; -import { initGetters } from '~test'; - -describe('workflow getters', () => { - describe('when calling getters[WORKFLOW_EXECUTION]', () => { - describe('and state.workflow.execution is defined', () => { - const state = { - workflow: { - execution: { - executionKey: 'executionValue', - }, - }, - }; - - it('should return the value from state.workflow.execution', () => { - const getters = initGetters({ getterFns, state }); - const output = getters[WORKFLOW_EXECUTION]; - - expect(output.executionKey).toEqual('executionValue'); - }); - }); - }); - - describe('when calling getters[WORKFLOW_EXECUTION_IS_LOADING]', () => { - describe('and state.workflow.isLoading = true', () => { - const state = { - workflow: { - isLoading: true, - }, - }; - - it('should return true', () => { - const getters = initGetters({ getterFns, state }); - const output = getters[WORKFLOW_EXECUTION_IS_LOADING]; - - expect(output).toEqual(true); - }); - }); - - describe('and state.workfow.isLoading is not defined', () => { - const state = { - workflow: {}, - }; - - it('should return false', () => { - const getters = initGetters({ getterFns, state }); - const output = getters[WORKFLOW_EXECUTION_IS_LOADING]; - - expect(output).toEqual(false); - }); - }); - }); - - describe('when calling getters[WORKFLOW_EXECUTION_PENDING_ACTIVITIES]', () => { - describe('and state.workflow.execution.pendingActivities is defined', () => { - const state = { - workflow: { - execution: { - pendingActivities: [ - { - activityKey: 'activityValue', - }, - ], - }, - }, - }; - - it('should return the value from state.workflow.execution.pendingActivities with mapped pendingTaskType = PENDING_TASK_TYPE_ACTIVITY.', () => { - const getters = initGetters({ getterFns, state }); - const output = getters[WORKFLOW_EXECUTION_PENDING_ACTIVITIES]; - - expect(output[0].activityKey).toEqual('activityValue'); - expect(output[0].pendingTaskType).toEqual(PENDING_TASK_TYPE_ACTIVITY); - }); - }); - - describe('and state.workflow.execution.pendingActivities is not defined', () => { - const state = { - workflow: {}, - }; - - it('should return an empty array.', () => { - const getters = initGetters({ getterFns, state }); - const output = getters[WORKFLOW_EXECUTION_PENDING_ACTIVITIES]; - - expect(output).toEqual([]); - }); - }); - }); - - describe('when calling getters[WORKFLOW_EXECUTION_PENDING_CHILDREN]', () => { - describe('and state.workflow.execution.pendingChildren is defined', () => { - const state = { - workflow: { - execution: { - pendingChildren: [ - { - childKey: 'childValue', - }, - ], - }, - }, - }; - - it('should return the value from state.workflow.execution.pendingChildren with mapped pendingTaskType = PENDING_TASK_TYPE_CHILD_WORKFLOW.', () => { - const getters = initGetters({ getterFns, state }); - const output = getters[WORKFLOW_EXECUTION_PENDING_CHILDREN]; - - expect(output[0].childKey).toEqual('childValue'); - expect(output[0].pendingTaskType).toEqual( - PENDING_TASK_TYPE_CHILD_WORKFLOW - ); - }); - }); - - describe('and state.workflow.execution.pendingChildren is not defined', () => { - const state = { - workflow: {}, - }; - - it('should return an empty array.', () => { - const getters = initGetters({ getterFns, state }); - const output = getters[WORKFLOW_EXECUTION_PENDING_CHILDREN]; - - expect(output).toEqual([]); - }); - }); - }); - - describe('when calling getters[WORKFLOW_EXECUTION_PENDING_TASK_COUNT]', () => { - describe('and state.workflow.execution.pendingActivities & pendingChildren are defined and has 1 item in each', () => { - const state = { - workflow: { - execution: { - pendingActivities: [ - { - activityKey: 'activityValue', - }, - ], - pendingChildren: [ - { - childKey: 'childValue', - }, - ], - }, - }, - }; - - it('should return 2.', () => { - const getters = initGetters({ getterFns, state }); - const output = getters[WORKFLOW_EXECUTION_PENDING_TASK_COUNT]; - - expect(output).toEqual(2); - }); - }); - - describe('and state.workflow.execution.pendingActivities and pendingChildren are not defined', () => { - const state = { - workflow: {}, - }; - - it('should return 0.', () => { - const getters = initGetters({ getterFns, state }); - const output = getters[WORKFLOW_EXECUTION_PENDING_TASK_COUNT]; - - expect(output).toEqual(0); - }); - }); - }); - - describe('when calling getters[WORKFLOW_EXECUTION_PENDING_TASKS]', () => { - describe('and state.workflow.execution.pendingActivities & pendingChildren are defined and has 1 item in each', () => { - const state = { - workflow: { - execution: { - pendingActivities: [ - { - activityKey: 'activityValue', - }, - ], - pendingChildren: [ - { - childKey: 'childValue', - }, - ], - }, - }, - }; - - it('should return both items.', () => { - const getters = initGetters({ getterFns, state }); - const output = getters[WORKFLOW_EXECUTION_PENDING_TASKS]; - - expect(output).toEqual([ - { - activityKey: 'activityValue', - pendingTaskType: PENDING_TASK_TYPE_ACTIVITY, - }, - { - childKey: 'childValue', - pendingTaskType: PENDING_TASK_TYPE_CHILD_WORKFLOW, - }, - ]); - }); - }); - - describe('and state.workflow.execution.pendingActivities and pendingChildren are not defined', () => { - const state = { - workflow: {}, - }; - - it('should return empty array.', () => { - const getters = initGetters({ getterFns, state }); - const output = getters[WORKFLOW_EXECUTION_PENDING_TASKS]; - - expect(output).toEqual([]); - }); - }); - }); - - describe('when calling getters[WORKFLOW_EXECUTION_TASK_LIST_NAME]', () => { - describe('and state.workflow.execution.executionConfiguration.taskList.name = "taskList"', () => { - const state = { - workflow: { - execution: { - executionConfiguration: { - taskList: { - name: 'taskList', - }, - }, - }, - }, - }; - - it('should return "taskList', () => { - const getters = initGetters({ getterFns, state }); - const output = getters[WORKFLOW_EXECUTION_TASK_LIST_NAME]; - - expect(output).toEqual('taskList'); - }); - }); - - describe('and state.workflow.execution.executionConfiguration.taskList.name is not defined', () => { - const state = { - workflow: {}, - }; - - it('should return ""', () => { - const getters = initGetters({ getterFns, state }); - const output = getters[WORKFLOW_EXECUTION_TASK_LIST_NAME]; - - expect(output).toEqual(''); - }); - }); - }); -}); diff --git a/client/containers/workflow/helpers/event-full-transforms.js b/client/containers/workflow/helpers/event-full-transforms.js deleted file mode 100644 index abf769e84..000000000 --- a/client/containers/workflow/helpers/event-full-transforms.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { WORKFLOW_EVENT_TYPE } from '~constants'; - -export const eventFullTransforms = { - [WORKFLOW_EVENT_TYPE.MarkerRecorded]: d => { - if (d.markerName === 'SideEffect') { - if (!Array.isArray(d.details)) { - // Java client - return { - data: d.details, - decisionTaskCompletedEventId: d.decisionTaskCompletedEventId, - }; - } - - // Go client - return { - sideEffectID: d.details[0], - data: JSON.tryParse(atob(d.details[1])) || d.details[1], - decisionTaskCompletedEventId: d.decisionTaskCompletedEventId, - }; - } - - return d; - }, -}; diff --git a/client/containers/workflow/helpers/event-full-transforms.spec.js b/client/containers/workflow/helpers/event-full-transforms.spec.js deleted file mode 100644 index 45400b163..000000000 --- a/client/containers/workflow/helpers/event-full-transforms.spec.js +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { eventFullTransforms } from './event-full-transforms'; - -describe('eventFullTransforms', () => { - describe('MarkerRecorded', () => { - describe('When passed event.markerName === "SideEffect" from Go Client', () => { - let event; - - beforeEach(() => { - event = { - decisionTaskCompletedEventId: 'decisionTaskCompletedEventIdValue', - details: [ - 'sideEffectIdValue', - 'eyAiaGVsbG8iOiAid29ybGQiIH0', // { "hello": "world" } - ], - markerName: 'SideEffect', - }; - }); - - it('should return an object with property sideEffectID.', () => { - const output = eventFullTransforms.MarkerRecorded(event); - - expect(output.sideEffectID).toEqual('sideEffectIdValue'); - }); - - it('should return an object with property data.', () => { - const output = eventFullTransforms.MarkerRecorded(event); - - expect(output.data).toEqual({ hello: 'world' }); - }); - - it('should return an object with property decisionTaskCompletedEventId.', () => { - const output = eventFullTransforms.MarkerRecorded(event); - - expect(output.decisionTaskCompletedEventId).toEqual( - 'decisionTaskCompletedEventIdValue' - ); - }); - }); - - describe('When passed event.markerName === "SideEffect" from Java Client', () => { - let event; - - beforeEach(() => { - event = { - decisionTaskCompletedEventId: 'decisionTaskCompletedEventIdValue', - details: true, - header: null, - markerName: 'SideEffect', - }; - }); - - it('should return true with property data.', () => { - const output = eventFullTransforms.MarkerRecorded(event); - - expect(output.data).toEqual(true); - }); - - it('should return an object with property decisionTaskCompletedEventId.', () => { - const output = eventFullTransforms.MarkerRecorded(event); - - expect(output.decisionTaskCompletedEventId).toEqual( - 'decisionTaskCompletedEventIdValue' - ); - }); - }); - }); - - describe('When passed event.markerName !== "SideEffect"', () => { - let event; - - beforeEach(() => { - event = { - decisionTaskCompletedEventId: 'decisionTaskCompletedEventIdValue', - details: [ - 'sideEffectIdValue', - 'eyAiaGVsbG8iOiAid29ybGQiIH0', // { "hello": "world" } - ], - markerName: 'NotSideEffect', - }; - }); - - it('should return original event object.', () => { - const output = eventFullTransforms.MarkerRecorded(event); - - expect(output).toEqual(event); - }); - }); -}); diff --git a/client/containers/workflow/helpers/get-event-details.js b/client/containers/workflow/helpers/get-event-details.js deleted file mode 100644 index 170f1a2dd..000000000 --- a/client/containers/workflow/helpers/get-event-details.js +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getEventKvpsHighlight from './get-event-kvps-highlight'; -import { getKeyValuePairs } from '~helpers'; - -const getEventDetails = ({ - clusterName, - event, - workflowHistoryEventHighlightList = [], - workflowHistoryEventHighlightListEnabled = false, -}) => { - const { details, eventId, eventType, timeStampDisplay } = event; - - const { kvps, isHighlighted } = getEventKvpsHighlight({ - eventType, - kvps: getKeyValuePairs({ - clusterName, - item: { - timestamp: timeStampDisplay, - eventId, - ...details, - }, - }), - workflowHistoryEventHighlightList, - workflowHistoryEventHighlightListEnabled, - }); - - return { - ...details, - eventId, - eventType, - isHighlighted, - kvps, - timestamp: timeStampDisplay, - }; -}; - -export default getEventDetails; diff --git a/client/containers/workflow/helpers/get-event-details.spec.js b/client/containers/workflow/helpers/get-event-details.spec.js deleted file mode 100644 index b25de0142..000000000 --- a/client/containers/workflow/helpers/get-event-details.spec.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getEventDetails from './get-event-details'; - -jest.mock('~helpers'); - -describe('getEventDetails', () => { - describe('When passed an event', () => { - let event; - - beforeEach(() => { - event = { - details: { - key: 'value', - }, - eventId: 'eventIdValue', - eventType: 'eventTypeValue', - }; - }); - - it('should return an object with a copy of details.', () => { - const output = getEventDetails({ event }); - - expect(output.key).toEqual('value'); - }); - - it('should return an object with eventId.', () => { - const output = getEventDetails({ event }); - - expect(output.eventId).toEqual('eventIdValue'); - }); - - it('should return an object with eventType.', () => { - const output = getEventDetails({ event }); - - expect(output.eventType).toEqual('eventTypeValue'); - }); - - it('should return an object with kvps.', () => { - const output = getEventDetails({ event }); - - expect(output.kvps).toEqual('kvpsMock'); - }); - }); -}); diff --git a/client/containers/workflow/helpers/get-event-full-details.js b/client/containers/workflow/helpers/get-event-full-details.js deleted file mode 100644 index 46ab6bb98..000000000 --- a/client/containers/workflow/helpers/get-event-full-details.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { eventFullTransforms } from './event-full-transforms'; -import getEventKvpsHighlight from './get-event-kvps-highlight'; -import { getKeyValuePairs } from '~helpers'; - -const getEventFullDetails = ({ - clusterName, - event, - workflowHistoryEventHighlightList, - workflowHistoryEventHighlightListEnabled, -} = {}) => { - if (!event) { - return event; - } - - const { eventId, eventType } = event; - - const maps = eventFullTransforms; - - const item = - event.eventType in maps - ? maps[event.eventType](event.details) - : event.details; - - const { kvps, isHighlighted } = getEventKvpsHighlight({ - eventType, - kvps: getKeyValuePairs({ clusterName, item }), - workflowHistoryEventHighlightList, - workflowHistoryEventHighlightListEnabled, - }); - - return { - ...item, - eventId, - eventType, - isHighlighted, - kvps, - }; -}; - -export default getEventFullDetails; diff --git a/client/containers/workflow/helpers/get-event-full-details.spec.js b/client/containers/workflow/helpers/get-event-full-details.spec.js deleted file mode 100644 index 25d7c862f..000000000 --- a/client/containers/workflow/helpers/get-event-full-details.spec.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getEventFullDetails from './get-event-full-details'; - -jest.mock('~helpers'); - -describe('getEventFullDetails', () => { - describe('When passed no event', () => { - it('should return what was passed.', () => { - const output = getEventFullDetails(); - - expect(output).toEqual(undefined); - }); - }); - - describe('When passed an event', () => { - let event; - - beforeEach(() => { - event = { - details: { - key: 'value', - }, - eventId: 'eventIdValue', - eventType: 'eventTypeValue', - }; - }); - - it('should return an object with a copy of details.', () => { - const output = getEventFullDetails({ event }); - - expect(output.key).toEqual('value'); - }); - - it('should return an object with eventId.', () => { - const output = getEventFullDetails({ event }); - - expect(output.eventId).toEqual('eventIdValue'); - }); - - it('should return an object with eventType.', () => { - const output = getEventFullDetails({ event }); - - expect(output.eventType).toEqual('eventTypeValue'); - }); - - it('should return an object with kvps.', () => { - const output = getEventFullDetails({ event }); - - expect(output.kvps).toEqual('kvpsMock'); - }); - }); -}); diff --git a/client/containers/workflow/helpers/get-event-kvps-highlight.js b/client/containers/workflow/helpers/get-event-kvps-highlight.js deleted file mode 100644 index d4a482b67..000000000 --- a/client/containers/workflow/helpers/get-event-kvps-highlight.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const getEventKvpsHighlight = ({ - eventType, - kvps, - workflowHistoryEventHighlightList, - workflowHistoryEventHighlightListEnabled, -}) => { - let eventIsHighlighted = false; - - if (!workflowHistoryEventHighlightListEnabled) { - return { - kvps, - isHighlighted: false, - }; - } - - const filteredWorkflowHistoryEventHighlightList = workflowHistoryEventHighlightList.filter( - highlight => highlight.isEnabled && highlight.eventType === eventType - ); - - if (!filteredWorkflowHistoryEventHighlightList.length) { - return { - kvps, - isHighlighted: false, - }; - } - - return { - kvps: kvps.map(kvp => { - const isHighlighted = - filteredWorkflowHistoryEventHighlightList.find( - ({ eventParamName }) => eventParamName === kvp.key - ) !== undefined; - - if (isHighlighted) { - eventIsHighlighted = true; - } - - return { - ...kvp, - isHighlighted, - }; - }), - isHighlighted: eventIsHighlighted, - }; -}; - -export default getEventKvpsHighlight; diff --git a/client/containers/workflow/helpers/get-event-kvps-highlight.spec.js b/client/containers/workflow/helpers/get-event-kvps-highlight.spec.js deleted file mode 100644 index 21028eb90..000000000 --- a/client/containers/workflow/helpers/get-event-kvps-highlight.spec.js +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getEventKvpsHighlight from './get-event-kvps-highlight'; - -describe('getEventKvpsHighlight', () => { - it('should return isHighlighted = false when workflowHistoryEventHighlightListEnabled = false.', () => { - const output = getEventKvpsHighlight({ - eventType: 'ActivityTaskScheduled', - kvps: [], - workflowHistoryEventHighlightList: [], - workflowHistoryEventHighlightListEnabled: false, - }); - - expect(output).toEqual({ - kvps: [], - isHighlighted: false, - }); - }); - - it('should return isHighlighted = false when workflowHistoryEventHighlightListEnabled = true and workflowHistoryEventHighlightList items are not enabled.', () => { - const workflowHistoryEventHighlightList = [ - { - eventType: 'ActivityTaskScheduled', - eventParamName: 'eventId', - isEnabled: false, - }, - ]; - - const output = getEventKvpsHighlight({ - eventType: 'ActivityTaskScheduled', - kvps: [], - workflowHistoryEventHighlightList, - workflowHistoryEventHighlightListEnabled: true, - }); - - expect(output).toEqual({ - kvps: [], - isHighlighted: false, - }); - }); - - it('should return isHighlighted = true and kvp.isHighlighted = true when workflowHistoryEventHighlightListEnabled = true and workflowHistoryEventHighlightList items are matching and enabled.', () => { - const workflowHistoryEventHighlightList = [ - { - eventType: 'ActivityTaskScheduled', - eventParamName: 'eventId', - isEnabled: true, - }, - ]; - const kvps = [ - { - key: 'eventId', - value: 1, - }, - { - key: 'scheduledEventId', - value: 0, - }, - ]; - - const output = getEventKvpsHighlight({ - eventType: 'ActivityTaskScheduled', - kvps, - workflowHistoryEventHighlightList, - workflowHistoryEventHighlightListEnabled: true, - }); - - expect(output).toEqual({ - kvps: [ - { - isHighlighted: true, - key: 'eventId', - value: 1, - }, - { - isHighlighted: false, - key: 'scheduledEventId', - value: 0, - }, - ], - isHighlighted: true, - }); - }); - - it('should return isHighlighted = false and kvp.isHighlighted = false when workflowHistoryEventHighlightListEnabled = true and workflowHistoryEventHighlightList items are not matching and enabled.', () => { - const workflowHistoryEventHighlightList = [ - { - eventType: 'ActivityTaskScheduled', - eventParamName: 'eventId', - isEnabled: true, - }, - ]; - const kvps = [ - { - key: 'scheduledEventId', - value: 0, - }, - ]; - - const output = getEventKvpsHighlight({ - eventType: 'ActivityTaskScheduled', - kvps, - workflowHistoryEventHighlightList, - workflowHistoryEventHighlightListEnabled: true, - }); - - expect(output).toEqual({ - kvps: [ - { - isHighlighted: false, - key: 'scheduledEventId', - value: 0, - }, - ], - isHighlighted: false, - }); - }); -}); diff --git a/client/containers/workflow/helpers/get-event-summary.js b/client/containers/workflow/helpers/get-event-summary.js deleted file mode 100644 index 65c042e57..000000000 --- a/client/containers/workflow/helpers/get-event-summary.js +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { summarizeEvents } from './summarize-events'; -import { getKeyValuePairs } from '~helpers'; - -const getEventSummary = ({ clusterName, event }) => { - if (!event) { - return event; - } - - if (!event.details) { - return event.details; - } - - const { eventId, eventType } = event; - - const maps = summarizeEvents({ clusterName }); - - const item = - event.eventType in maps - ? maps[event.eventType](event.details) - : event.details; - - const kvps = getKeyValuePairs({ clusterName, item }); - - return { - ...item, - eventId, - eventType, - kvps, - }; -}; - -export default getEventSummary; diff --git a/client/containers/workflow/helpers/get-event-summary.spec.js b/client/containers/workflow/helpers/get-event-summary.spec.js deleted file mode 100644 index a0cc47ace..000000000 --- a/client/containers/workflow/helpers/get-event-summary.spec.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getEventSummary from './get-event-summary'; - -jest.mock('~helpers'); - -describe('getEventSummary', () => { - describe('When passed no event', () => { - it('should return what was passed.', () => { - const output = getEventSummary({ event: false }); - - expect(output).toEqual(false); - }); - }); - - describe('When passed an event', () => { - let event; - - beforeEach(() => { - event = { - details: { - key: 'value', - }, - eventId: 'eventIdValue', - eventType: 'eventTypeValue', - }; - }); - - it('should return an object with a copy of details.', () => { - const output = getEventSummary({ event }); - - expect(output.key).toEqual('value'); - }); - - it('should return an object with eventId.', () => { - const output = getEventSummary({ event }); - - expect(output.eventId).toEqual('eventIdValue'); - }); - - it('should return an object with eventType.', () => { - const output = getEventSummary({ event }); - - expect(output.eventType).toEqual('eventTypeValue'); - }); - - it('should return an object with kvps.', () => { - const output = getEventSummary({ event }); - - expect(output.kvps).toEqual('kvpsMock'); - }); - }); -}); diff --git a/client/containers/workflow/helpers/get-history-events.js b/client/containers/workflow/helpers/get-history-events.js deleted file mode 100644 index 19b0bc5f6..000000000 --- a/client/containers/workflow/helpers/get-history-events.js +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; -import getTimeElapsedDisplay from './get-time-elapsed-display'; -import getTimeStampDisplay from './get-time-stamp-display'; -import getEventDetails from './get-event-details'; -import getEventFullDetails from './get-event-full-details'; -import getEventSummary from './get-event-summary'; - -const getHistoryEvents = ({ - clusterName, - dateFormat, - events, - timeFormat, - timezone, - workflowHistoryEventHighlightList, - workflowHistoryEventHighlightListEnabled, -}) => { - if (!events) { - return []; - } - - return events - .map(event => { - const timestamp = moment(event.timestamp); - - return { - ...event, - timestamp, - }; - }) - .map((event, index, eventList) => { - const timeStampDisplay = getTimeStampDisplay({ - dateFormat, - event, - index, - timeFormat, - timezone, - }); - const timeElapsedDisplay = getTimeElapsedDisplay({ - dateFormat, - event, - eventList, - index, - timeFormat, - timezone, - }); - - return { - ...event, - timeStampDisplay, - timeElapsedDisplay, - }; - }) - .map(event => { - const details = getEventDetails({ - clusterName, - event, - workflowHistoryEventHighlightList, - workflowHistoryEventHighlightListEnabled, - }); - const eventSummary = getEventSummary({ clusterName, event }); - const eventFullDetails = getEventFullDetails({ - clusterName, - event, - workflowHistoryEventHighlightList, - workflowHistoryEventHighlightListEnabled, - }); - - return { - ...event, - details, - eventSummary, - eventFullDetails, - }; - }); -}; - -export default getHistoryEvents; diff --git a/client/containers/workflow/helpers/get-history-timeline-events.js b/client/containers/workflow/helpers/get-history-timeline-events.js deleted file mode 100644 index f95d44034..000000000 --- a/client/containers/workflow/helpers/get-history-timeline-events.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getEventDetails from './get-event-details'; -import mapTimelineEvents from './map-timeline-events'; - -const getHistoryTimelineEvents = ({ clusterName, historyEvents }) => - mapTimelineEvents({ clusterName, historyEvents }).map(event => { - const details = getEventDetails({ clusterName, event }); - - return { ...event, details }; - }); - -export default getHistoryTimelineEvents; diff --git a/client/containers/workflow/helpers/get-summary-workflow-status.js b/client/containers/workflow/helpers/get-summary-workflow-status.js deleted file mode 100644 index e0203599b..000000000 --- a/client/containers/workflow/helpers/get-summary-workflow-status.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { WORKFLOW_EVENT_TYPE } from '~constants'; - -const getSummaryWorkflowStatus = ({ - clusterName, - isWorkflowRunning, - workflow, - workflowCompletedEvent, -}) => { - if (isWorkflowRunning) { - return 'running'; - } - - if (!workflowCompletedEvent) { - return ( - (workflow && workflow.workflowExecutionInfo.closeStatus) || - 'running' - ).toLowerCase(); - } - - if ( - workflowCompletedEvent.eventType === - WORKFLOW_EVENT_TYPE.WorkflowExecutionContinuedAsNew - ) { - return { - to: { - name: 'workflow/summary', - params: { - clusterName, - runId: workflowCompletedEvent.details.newExecutionRunId, - }, - }, - text: 'Continued As New', - status: 'continued-as-new', - }; - } - - return workflowCompletedEvent.eventType - .replace('WorkflowExecution', '') - .toLowerCase(); -}; - -export default getSummaryWorkflowStatus; diff --git a/client/containers/workflow/helpers/get-summary-workflow-status.spec.js b/client/containers/workflow/helpers/get-summary-workflow-status.spec.js deleted file mode 100644 index 058e1764b..000000000 --- a/client/containers/workflow/helpers/get-summary-workflow-status.spec.js +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getSummaryWorkflowStatus from './get-summary-workflow-status'; - -describe('getSummaryWorkflowStatus', () => { - describe('When passed an event with isWorkflowRunning = true', () => { - it('should return "running".', () => { - const event = { - isWorkflowRunning: true, - }; - const output = getSummaryWorkflowStatus(event); - - expect(output).toEqual('running'); - }); - }); - - describe('When passed an event with workflowCompletedEvent = false and workflow.workflowExecutionInfo.closeStatus is defined', () => { - it('should return workflow.workflowExecutionInfo.closeStatus in lower case.', () => { - const event = { - workflow: { - workflowExecutionInfo: { - closeStatus: 'closeStatusValue', - }, - }, - workflowCompletedEvent: false, - }; - const output = getSummaryWorkflowStatus(event); - - expect(output).toEqual('closestatusvalue'); - }); - }); - - describe('When passed an event with workflowCompletedEvent = false and workflow.workflowExecutionInfo.closeStatus is not defined', () => { - it('should return "running".', () => { - const event = { - workflowCompletedEvent: false, - }; - const output = getSummaryWorkflowStatus(event); - - expect(output).toEqual('running'); - }); - }); - - describe('When passed an event with workflowCompletedEvent.eventType === "WorkflowExecutionContinuedAsNew" and workflowCompletedEvent.details.newExecutionRunId is defined', () => { - let event; - - beforeEach(() => { - event = { - workflowCompletedEvent: { - eventType: 'WorkflowExecutionContinuedAsNew', - details: { - newExecutionRunId: 'newExecutionRunIdValue', - }, - }, - }; - }); - - it('should return an object with to.name = "workflow/summary".', () => { - const output = getSummaryWorkflowStatus(event); - - expect(output.to.name).toEqual('workflow/summary'); - }); - - it('should return an object with to.params.runId.', () => { - const output = getSummaryWorkflowStatus(event); - - expect(output.to.params.runId).toEqual('newExecutionRunIdValue'); - }); - - it('should return an object with text = "Continued As New".', () => { - const output = getSummaryWorkflowStatus(event); - - expect(output.text).toEqual('Continued As New'); - }); - - it('should return an object with status = "continued-as-new".', () => { - const output = getSummaryWorkflowStatus(event); - - expect(output.status).toEqual('continued-as-new'); - }); - }); - - describe('When passed an workflowCompletedEvent.eventType !== "WorkflowExecutionContinuedAsNew"', () => { - it('should return workflowCompletedEvent.eventType without WorkflowExecution and in lower case.', () => { - const event = { - workflowCompletedEvent: { - eventType: 'NotWorkflowExecutionContinuedAsNew', - }, - }; - const output = getSummaryWorkflowStatus(event); - - expect(output).toEqual('notcontinuedasnew'); - }); - }); -}); diff --git a/client/containers/workflow/helpers/get-summary.js b/client/containers/workflow/helpers/get-summary.js deleted file mode 100644 index df69ebdf4..000000000 --- a/client/containers/workflow/helpers/get-summary.js +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getSummaryWorkflowStatus from './get-summary-workflow-status'; -import parentWorkflowLink from './parent-workflow-link'; -import { getJsonStringObject, getKeyValuePairs } from '~helpers'; - -const getSummary = ({ clusterName, events, isWorkflowRunning, workflow }) => { - const formattedWorkflow = workflow.pendingActivities - ? { - ...workflow, - pendingActivities: workflow.pendingActivities.map(item => ({ - ...item, - kvps: getKeyValuePairs({ clusterName, item }), - })), - } - : workflow; - - if (!events || !events.length) { - return { - input: undefined, - isWorkflowRunning, - cronSchedule: undefined, - parentWorkflowRoute: undefined, - result: undefined, - wfStatus: undefined, - workflow: formattedWorkflow, - }; - } - - const firstEvent = events[0]; - const lastEvent = - workflow.workflowExecutionInfo.closeEvent || - (events.length > 1 && events[events.length - 1]); - - const input = getJsonStringObject(firstEvent.details.input); - - const workflowCompletedEvent = - lastEvent && lastEvent.eventType.startsWith('WorkflowExecution') - ? lastEvent - : undefined; - - const result = workflowCompletedEvent - ? getJsonStringObject( - workflowCompletedEvent.details.result || workflowCompletedEvent.details - ) - : undefined; - - const wfStatus = getSummaryWorkflowStatus({ - clusterName, - isWorkflowRunning, - workflow, - workflowCompletedEvent, - }); - - const parentWorkflowRoute = parentWorkflowLink({ - clusterName, - eventDetails: firstEvent.details, - }); - - return { - input, - cronSchedule: firstEvent.details.cronSchedule, - isWorkflowRunning, - parentWorkflowRoute, - result, - wfStatus, - workflow: formattedWorkflow, - }; -}; - -export default getSummary; diff --git a/client/containers/workflow/helpers/get-time-elapsed-display.js b/client/containers/workflow/helpers/get-time-elapsed-display.js deleted file mode 100644 index 8daf65d17..000000000 --- a/client/containers/workflow/helpers/get-time-elapsed-display.js +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; -import { getDatetimeFormattedString } from '~helpers'; - -const getTimeElapsedDisplay = ({ - dateFormat, - event: { timestamp = null }, - eventList, - index, - timeFormat, - timezone, -}) => { - if (!timestamp || index === -1) { - return ''; - } - - if (index === 0) { - return getDatetimeFormattedString({ - date: timestamp, - dateFormat, - timeFormat, - timezone, - }); - } - - const deltaFromPrev = moment.duration( - timestamp - eventList[index - 1].timestamp - ); - let elapsed = moment.duration(timestamp - eventList[0].timestamp).format(); - - if (deltaFromPrev.asSeconds() >= 1) { - elapsed += ` (+${deltaFromPrev.format()})`; - } - - return elapsed; -}; - -export default getTimeElapsedDisplay; diff --git a/client/containers/workflow/helpers/get-time-elapsed-display.spec.js b/client/containers/workflow/helpers/get-time-elapsed-display.spec.js deleted file mode 100644 index 83511fee8..000000000 --- a/client/containers/workflow/helpers/get-time-elapsed-display.spec.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; -import getTimeElapsedDisplay from './get-time-elapsed-display'; - -describe('getTimeElapsedDisplay', () => { - const DATE = '2020-01-01 00:00:00'; - const DATE_PLUS_ONE_HOUR = '2020-01-01 01:00:00'; - - describe('When passed an event with no timestamp', () => { - it('should return "".', () => { - const event = {}; - const output = getTimeElapsedDisplay({ event }); - - expect(output).toEqual(''); - }); - }); - - describe('When passed an event with a timestamp and index = -1', () => { - it('should return "".', () => { - const event = { - timestamp: moment(DATE), - }; - const index = -1; - const output = getTimeElapsedDisplay({ event, index }); - - expect(output).toEqual(''); - }); - }); - - describe('When passed an event with a timestamp and index = 0', () => { - it('should return the date string.', () => { - const event = { - timestamp: moment(DATE), - }; - const index = 0; - const output = getTimeElapsedDisplay({ event, index }); - - expect(output).toEqual('Jan 1, 2020 12:00:00 AM'); - }); - }); - - describe('When passed an event with a timestamp and index = 1 and eventList', () => { - it('should return the elapsed time between the first event and the second.', () => { - const eventList = [ - { - timestamp: moment(DATE), - }, - { - timestamp: moment(DATE_PLUS_ONE_HOUR), - }, - ]; - const index = 1; - const event = eventList[index]; - const output = getTimeElapsedDisplay({ event, eventList, index }); - - expect(output).toEqual('1h (+1h)'); - }); - }); -}); diff --git a/client/containers/workflow/helpers/get-time-stamp-display.js b/client/containers/workflow/helpers/get-time-stamp-display.js deleted file mode 100644 index f6d0247d7..000000000 --- a/client/containers/workflow/helpers/get-time-stamp-display.js +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { getDatetimeFormattedString } from '~helpers'; - -const getTimeStampDisplay = ({ - dateFormat, - event: { timestamp = null }, - index, - timeFormat, - timezone, -}) => - !timestamp || index === -1 - ? '' - : getDatetimeFormattedString({ - date: timestamp, - dateFormat, - timeFormat, - timezone, - }); - -export default getTimeStampDisplay; diff --git a/client/containers/workflow/helpers/get-time-stamp-display.spec.js b/client/containers/workflow/helpers/get-time-stamp-display.spec.js deleted file mode 100644 index c2b96ffe2..000000000 --- a/client/containers/workflow/helpers/get-time-stamp-display.spec.js +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; -import getTimeStampDisplay from './get-time-stamp-display'; - -describe('getTimeStampDisplay', () => { - const DATE = '2020-01-01 00:00:00'; - - describe('When passed an event with no timestamp', () => { - it('should return "".', () => { - const event = {}; - const output = getTimeStampDisplay({ event }); - - expect(output).toEqual(''); - }); - }); - - describe('When passed an event with a timestamp and index = -1', () => { - it('should return "".', () => { - const event = { - timestamp: moment(DATE), - }; - const index = -1; - const output = getTimeStampDisplay({ event, index }); - - expect(output).toEqual(''); - }); - }); - - describe('When passed an event with a timestamp and index = 0', () => { - it('should return the date string.', () => { - const event = { - timestamp: moment(DATE), - }; - const index = 0; - const output = getTimeStampDisplay({ event, index }); - - expect(output).toEqual('Jan 1, 2020 12:00:00 AM'); - }); - }); -}); diff --git a/client/containers/workflow/helpers/index.js b/client/containers/workflow/helpers/index.js deleted file mode 100644 index 4d556351e..000000000 --- a/client/containers/workflow/helpers/index.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export { eventFullTransforms } from './event-full-transforms'; -export { default as getEventDetails } from './get-event-details'; -export { default as getEventFullDetails } from './get-event-full-details'; -export { default as getEventSummary } from './get-event-summary'; -export { default as getHistoryEvents } from './get-history-events'; -export { default as getHistoryTimelineEvents } from './get-history-timeline-events'; -export { default as getSummary } from './get-summary'; -export { default as getSummaryWorkflowStatus } from './get-summary-workflow-status'; -export { default as getTimeElapsedDisplay } from './get-time-elapsed-display'; -export { default as getTimeStampDisplay } from './get-time-stamp-display'; -export { default as mapTimelineEvents } from './map-timeline-events'; -export { default as parentWorkflowLink } from './parent-workflow-link'; -export { summarizeEvents } from './summarize-events'; -export { default as workflowLink } from './workflow-link'; diff --git a/client/containers/workflow/helpers/map-timeline-events.js b/client/containers/workflow/helpers/map-timeline-events.js deleted file mode 100644 index eeb46cd12..000000000 --- a/client/containers/workflow/helpers/map-timeline-events.js +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; -import { summarizeEvents } from './summarize-events'; -import { WORKFLOW_EVENT_TYPE } from '~constants'; -import { shortName } from '~helpers'; - -export default function({ clusterName, historyEvents }) { - const events = []; - const hash = {}; - - const add = i => { - hash[i.id] = i; - events.push(i); - - return i; - }; - - const summarizeEventsMap = summarizeEvents({ clusterName }); - - const assignEnd = (item, end) => { - // eslint-disable-next-line no-param-reassign - item.ongoing = false; - // eslint-disable-next-line no-param-reassign - item.end = moment(end); - }; - - historyEvents.forEach(e => { - if (e.eventType.startsWith('ActivityTask')) { - const scheduledEvent = - 'activityId' in e.details - ? e - : historyEvents[e.details.scheduledEventId - 1]; - const { activityId } = scheduledEvent.details; - let item = hash[`activity${activityId}`]; - - if (!item) { - item = add({ - id: `activity${activityId}`, - className: 'activity', - eventIds: [e.eventId], - start: moment(scheduledEvent.timestamp), - ongoing: true, - content: `Activity ${activityId}: ${shortName( - scheduledEvent.details.activityType && - scheduledEvent.details.activityType.name - )}`, - details: { - input: e.details.input, - scheduleToStartTimeoutSeconds: - e.details.scheduleToStartTimeoutSeconds, - scheduleToCloseTimeoutSeconds: - e.details.scheduleToCloseTimeoutSeconds, - }, - }); - } else { - item.eventIds.push(e.eventId); - - if (e.eventType !== WORKFLOW_EVENT_TYPE.ActivityTaskStarted) { - Object.assign( - item.details, - summarizeEventsMap[e.eventType](e.details) - ); - } - } - - if ( - e.eventType !== WORKFLOW_EVENT_TYPE.ActivityTaskScheduled && - e.eventType !== WORKFLOW_EVENT_TYPE.ActivityTaskStarted - ) { - assignEnd(item, e.timestamp); - item.className = `activity ${e.eventType - .replace('ActivityTask', '') - .toLowerCase()}`; - } - } else if (e.eventType.includes('ChildWorkflowExecution')) { - const initiatedEvent = - 'initiatedEventId' in e.details - ? historyEvents[e.details.initiatedEventId - 1] - : e; - const initiatedEventId = initiatedEvent.eventId; - let item = hash[`childWf${initiatedEventId}`]; - - if (!item) { - item = add({ - id: `childWf${initiatedEventId}`, - className: 'child-workflow', - eventIds: [e.eventId], - start: moment(initiatedEvent.timestamp), - ongoing: true, - content: `Child Workflow: ${shortName(e.details.workflowType.name)}`, - details: { - input: e.details.input, - }, - }); - } else { - item.eventIds.push(e.eventId); - - if (e.eventType in summarizeEventsMap) { - const summary = summarizeEventsMap[e.eventType](e.details); - - if ( - !item.titleLink && - summary.Workflow && - summary.Workflow.routeLink - ) { - item.titleLink = summary.Workflow.routeLink; - } - - Object.assign(item.details); - } - } - - if ( - e.eventType !== - WORKFLOW_EVENT_TYPE.StartChildWorkflowExecutionInitiated && - e.eventType !== WORKFLOW_EVENT_TYPE.ChildWorkflowExecutionStarted - ) { - assignEnd(item, e.timestamp); - item.className = `child-workflow ${e.eventType - .replace('ChildWorkflowExecution', '') - .toLowerCase()}`; - } - } else if (e.eventType === WORKFLOW_EVENT_TYPE.TimerStarted) { - add({ - id: `timer${e.details.timerId}`, - className: 'timer', - eventIds: [e.eventId], - start: moment(e.timestamp), - end: moment(e.timestamp).add( - e.details.startToFireTimeoutSeconds, - 'seconds' - ), - content: `Timer ${e.details.timerId} (${moment - .duration(e.details.startToFireTimeoutSeconds, 'seconds') - .format()})`, - }); - } else if (e.eventType === WORKFLOW_EVENT_TYPE.TimerCanceled) { - const timerStartedEvent = hash[`timer${e.details.timerId}`]; - - if (timerStartedEvent) { - timerStartedEvent.eventIds.push(e.eventId); - } - } else if (e.eventType === WORKFLOW_EVENT_TYPE.TimerFired) { - const timerStartedEvent = hash[`timer${e.details.timerId}`]; - - if (timerStartedEvent) { - timerStartedEvent.eventIds.push(e.eventId); - } - } else if (e.eventType === WORKFLOW_EVENT_TYPE.MarkerRecorded) { - const markerName = - e.details.markerName !== undefined - ? e.details.markerName.toLowerCase() - : ''; - - add({ - id: `marker${e.eventId}`, - className: `marker marker-${markerName}`, - eventIds: [e.eventId], - start: moment(e.timestamp), - content: - { - Version: 'Version Marker', - SideEffect: 'Side Effect', - LocalActivity: 'Local Activity', - }[e.details.markerName] || `${e.details.markerName} Marker`, - details: summarizeEventsMap[WORKFLOW_EVENT_TYPE.MarkerRecorded]( - e.details - ), - }); - } else if (e.eventType === WORKFLOW_EVENT_TYPE.WorkflowExecutionSignaled) { - add({ - id: `signal${e.eventId}`, - className: 'signal', - eventIds: [e.eventId], - start: moment(e.timestamp), - content: 'Workflow Signaled', - details: { - input: e.details.input, - }, - }); - } else if ( - e.eventType === - WORKFLOW_EVENT_TYPE.SignalExternalWorkflowExecutionInitiated - ) { - add({ - id: `extsignal${e.eventId}`, - className: 'external-signal', - eventIds: [e.eventId], - start: moment(e.timestamp), - content: 'External Workflow Signaled', - details: summarizeEventsMap[ - WORKFLOW_EVENT_TYPE.SignalExternalWorkflowExecutionInitiated - ](e.details), - }); - } else if ( - e.eventType === WORKFLOW_EVENT_TYPE.ExternalWorkflowExecutionSignaled - ) { - const initiatedEvent = hash[`extsignal${e.eventId}`]; - - if (initiatedEvent) { - initiatedEvent.eventIds.push(e.eventId); - // TODO - code will break as item is not defined. - // assignEnd(item, e.timestamp); - } - } else if ( - e.eventType === WORKFLOW_EVENT_TYPE.DecisionTaskFailed || - e.eventType === WORKFLOW_EVENT_TYPE.DecisionTaskTimedOut - ) { - add({ - id: `decision${e.eventId}`, - className: `decision ${e.eventType - .replace('DecisionTask', '') - .toLowerCase()}`, - eventIds: [e.eventId], - start: moment(e.timestamp), - content: e.eventType, - details: e.details, - }); - } - }); - - return events; -} diff --git a/client/containers/workflow/helpers/parent-workflow-link.js b/client/containers/workflow/helpers/parent-workflow-link.js deleted file mode 100644 index 7c41e4b7d..000000000 --- a/client/containers/workflow/helpers/parent-workflow-link.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export default function({ clusterName, eventDetails }) { - if (eventDetails && eventDetails.parentWorkflowExecution) { - return { - to: { - name: 'workflow/summary', - params: { - clusterName, - domain: eventDetails.parentWorkflowDomain, - workflowId: eventDetails.parentWorkflowExecution.workflowId, - runId: eventDetails.parentWorkflowExecution.runId, - }, - }, - text: eventDetails.parentWorkflowExecution.workflowId, - }; - } - - return null; -} diff --git a/client/containers/workflow/helpers/parent-workflow-link.spec.js b/client/containers/workflow/helpers/parent-workflow-link.spec.js deleted file mode 100644 index 8df2823e7..000000000 --- a/client/containers/workflow/helpers/parent-workflow-link.spec.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import parentWorkflowLink from './parent-workflow-link'; - -describe('parentWorkflowLink', () => { - describe('When passed wfStartDetails.parentWorkflowExecution', () => { - let eventDetails; - - beforeEach(() => { - eventDetails = { - parentWorkflowDomain: 'parentWorkflowDomainValue', - parentWorkflowExecution: { - workflowId: 'workflowIdValue', - runId: 'runIdValue', - }, - }; - }); - - it('should return an object with to.name.', () => { - const output = parentWorkflowLink({ eventDetails }); - - expect(output.to.name).toEqual('workflow/summary'); - }); - - it('should return an object with to.params.domain.', () => { - const output = parentWorkflowLink({ eventDetails }); - - expect(output.to.params.domain).toEqual('parentWorkflowDomainValue'); - }); - - it('should return an object with to.params.workflowId.', () => { - const output = parentWorkflowLink({ eventDetails }); - - expect(output.to.params.workflowId).toEqual('workflowIdValue'); - }); - - it('should return an object with to.params.runId.', () => { - const output = parentWorkflowLink({ eventDetails }); - - expect(output.to.params.runId).toEqual('runIdValue'); - }); - - it('should return an object with text.', () => { - const output = parentWorkflowLink({ eventDetails }); - - expect(output.text).toEqual('workflowIdValue'); - }); - }); -}); diff --git a/client/containers/workflow/helpers/summarize-events.js b/client/containers/workflow/helpers/summarize-events.js deleted file mode 100644 index 81ab910cd..000000000 --- a/client/containers/workflow/helpers/summarize-events.js +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; -import parentWorkflowLink from './parent-workflow-link'; -import workflowLink from './workflow-link'; -import { WORKFLOW_EVENT_TYPE } from '~constants'; -import { shortName } from '~helpers'; - -export const summarizeEvents = ({ clusterName }) => ({ - [WORKFLOW_EVENT_TYPE.ActivityTaskCanceled]: eventDetails => ({}), - [WORKFLOW_EVENT_TYPE.ActivityTaskCancelRequested]: eventDetails => ({ - ID: eventDetails.activityId, - }), - [WORKFLOW_EVENT_TYPE.ActivityTaskCompleted]: eventDetails => ({ - result: eventDetails.result, - }), - [WORKFLOW_EVENT_TYPE.ActivityTaskFailed]: eventDetails => ({ - details: eventDetails.details, - reason: eventDetails.reason, - }), - [WORKFLOW_EVENT_TYPE.ActivityTaskScheduled]: eventDetails => ({ - 'Close Timeout': moment - .duration(eventDetails.scheduleToCloseTimeoutSeconds, 'seconds') - .format(), - ID: eventDetails.activityId, - input: eventDetails.input, - Name: shortName(eventDetails.activityType.name), - }), - [WORKFLOW_EVENT_TYPE.ActivityTaskStarted]: eventDetails => ({ - attempt: eventDetails.attempt, - identity: eventDetails.identity, - requestId: eventDetails.requestId, - }), - [WORKFLOW_EVENT_TYPE.ActivityTaskTimedOut]: eventDetails => ({ - 'Timeout Type': eventDetails.timeoutType, - }), - [WORKFLOW_EVENT_TYPE.ChildWorkflowExecutionCompleted]: eventDetails => ({ - result: eventDetails.result, - Workflow: workflowLink({ clusterName, eventDetails, short: true }), - }), - [WORKFLOW_EVENT_TYPE.ChildWorkflowExecutionStarted]: eventDetails => ({ - Workflow: workflowLink({ clusterName, eventDetails }), - }), - [WORKFLOW_EVENT_TYPE.DecisionTaskCompleted]: eventDetails => ({ - identity: eventDetails.identity, - }), - [WORKFLOW_EVENT_TYPE.DecisionTaskScheduled]: eventDetails => ({ - Tasklist: eventDetails.taskList.name, - Timeout: moment - .duration(eventDetails.startToCloseTimeoutSeconds, 'seconds') - .format(), - }), - [WORKFLOW_EVENT_TYPE.DecisionTaskStarted]: eventDetails => ({ - requestId: eventDetails.requestId, - }), - [WORKFLOW_EVENT_TYPE.DecisionTaskTimedOut]: eventDetails => ({ - 'Timeout Type': eventDetails.timeoutType, - }), - [WORKFLOW_EVENT_TYPE.ExternalWorkflowExecutionSignaled]: eventDetails => ({ - Workflow: workflowLink({ clusterName, eventDetails }), - }), - [WORKFLOW_EVENT_TYPE.MarkerRecorded]: eventDetails => { - const details = eventDetails.details || {}; - - if (eventDetails.markerName === 'LocalActivity') { - const la = { 'Local Activity ID': details.ActivityID }; - - if (details.ErrJSON) { - la.Error = JSON.tryParse(details.ErrJSON) || details.ErrJSON; - } - - if (details.ErrReason) { - la.reason = details.ErrReason; - } - - if (details.ResultJSON) { - la.result = JSON.tryParse(details.ResultJSON) || details.ResultJSON; - } - - return la; - } - - if (eventDetails.markerName === 'Version') { - return { - Details: details[0], - Version: details[1], - }; - } - - if (eventDetails.markerName === 'SideEffect') { - if (!Array.isArray(details)) { - // Java client - return { - data: details, - }; - } - - // Go client - return { - data: JSON.tryParse(atob(details[1])) || details[1], - 'Side Effect ID': details[0], - }; - } - - return eventDetails; - }, - [WORKFLOW_EVENT_TYPE.SignalExternalWorkflowExecutionInitiated]: eventDetails => ({ - input: eventDetails.input, - signal: eventDetails.signalName, - Workflow: workflowLink({ clusterName, eventDetails }), - }), - [WORKFLOW_EVENT_TYPE.StartChildWorkflowExecutionInitiated]: eventDetails => ({ - input: eventDetails.input, - Tasklist: eventDetails.taskList.name, - Workflow: shortName(eventDetails.workflowType.name), - }), - [WORKFLOW_EVENT_TYPE.TimerStarted]: eventDetails => ({ - 'Fire Timeout': moment - .duration(eventDetails.startToFireTimeoutSeconds, 'seconds') - .format(), - 'Timer ID': eventDetails.timerId, - }), - [WORKFLOW_EVENT_TYPE.WorkflowExecutionStarted]: eventDetails => { - const summary = { - 'Close Timeout': moment - .duration(eventDetails.executionStartToCloseTimeoutSeconds, 'seconds') - .format(), - identity: eventDetails.identity, - input: eventDetails.input, - Parent: undefined, - Workflow: eventDetails.workflowType - ? shortName(eventDetails.workflowType.name) - : '', - }; - const wfLink = parentWorkflowLink({ clusterName, eventDetails }); - - if (wfLink) { - summary.Parent = { - routeLink: wfLink.to, - text: wfLink.text, - }; - } - - return summary; - }, -}); diff --git a/client/containers/workflow/helpers/workflow-link.js b/client/containers/workflow/helpers/workflow-link.js deleted file mode 100644 index d030788d0..000000000 --- a/client/containers/workflow/helpers/workflow-link.js +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { shortName } from '~helpers'; - -const workflowLink = ({ clusterName, eventDetails, short }) => { - const text = [ - eventDetails.workflowType ? shortName(eventDetails.workflowType.name) : '', - short ? '' : eventDetails.workflowExecution.workflowId, - ] - .filter(x => x) - .join(' - '); - - return { - routeLink: { - name: 'workflow/summary', - params: { - clusterName, - domain: eventDetails.domain, - workflowId: eventDetails.workflowExecution.workflowId, - runId: eventDetails.workflowExecution.runId, - }, - }, - text, - }; -}; - -export default workflowLink; diff --git a/client/containers/workflow/index.js b/client/containers/workflow/index.js deleted file mode 100644 index 5bf119532..000000000 --- a/client/containers/workflow/index.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import Component from './component'; -import Connector from './connector'; -import getDefaultState from './get-default-state'; -import getters from './getters'; -import mutations from './mutations'; - -const container = Connector('Workflow', Component); - -export { container, getDefaultState, getters, mutations }; diff --git a/client/containers/workflow/mutation-types.js b/client/containers/workflow/mutation-types.js deleted file mode 100644 index 54aa5ecc4..000000000 --- a/client/containers/workflow/mutation-types.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const WORKFLOW_CLEAR_EXECUTION = 'WORKFLOW_CLEAR_EXECUTION'; -export const WORKFLOW_SET_EXECUTION = 'WORKFLOW_SET_EXECUTION'; diff --git a/client/containers/workflow/mutations.js b/client/containers/workflow/mutations.js deleted file mode 100644 index 0d7a203c5..000000000 --- a/client/containers/workflow/mutations.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { - WORKFLOW_CLEAR_EXECUTION, - WORKFLOW_SET_EXECUTION, -} from './mutation-types'; - -const mutations = { - [WORKFLOW_CLEAR_EXECUTION]: state => { - state.workflow.execution = null; - state.workflow.isLoading = true; - }, - [WORKFLOW_SET_EXECUTION]: (state, payload) => { - state.workflow.execution = payload; - state.workflow.isLoading = false; - }, -}; - -export default mutations; diff --git a/client/containers/workflow/mutations.spec.js b/client/containers/workflow/mutations.spec.js deleted file mode 100644 index 86269db52..000000000 --- a/client/containers/workflow/mutations.spec.js +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { - WORKFLOW_CLEAR_EXECUTION, - WORKFLOW_SET_EXECUTION, -} from './mutation-types'; -import mutations from './mutations'; - -const initState = (workflow = {}) => { - return { - workflow, - }; -}; - -describe('workflow mutations', () => { - describe('when calling mutations[WORKFLOW_CLEAR_EXECUTION]', () => { - describe('and state.workflow.execution is defined and state.workflow.isLoading is false', () => { - let state; - - beforeEach(() => { - state = initState({ - execution: {}, - isLoading: false, - }); - }); - - it('should set state.workflow.execution to null', () => { - expect(state.workflow.execution).toEqual({}); - mutations[WORKFLOW_CLEAR_EXECUTION](state); - expect(state.workflow.execution).toEqual(null); - }); - - it('should set state.workflow.isLoading to true', () => { - expect(state.workflow.isLoading).toEqual(false); - mutations[WORKFLOW_CLEAR_EXECUTION](state); - expect(state.workflow.isLoading).toEqual(true); - }); - }); - }); - - describe('when calling mutations[WORKFLOW_SET_EXECUTION]', () => { - describe('and state.workflow.execution is not defined and state.workflow.isLoading is true', () => { - let state; - - beforeEach(() => { - state = initState({ - execution: null, - isLoading: true, - }); - }); - - it('should set state.workflow.execution to what is in the payload', () => { - expect(state.workflow.execution).toEqual(null); - mutations[WORKFLOW_SET_EXECUTION](state, { key: 'value' }); - expect(state.workflow.execution).toEqual({ key: 'value' }); - }); - - it('should set state.workflow.isLoading to false', () => { - expect(state.workflow.isLoading).toEqual(true); - mutations[WORKFLOW_SET_EXECUTION](state, { key: 'value' }); - expect(state.workflow.isLoading).toEqual(false); - }); - }); - }); -}); diff --git a/client/directives/snapscroll.js b/client/directives/snapscroll.js deleted file mode 100644 index bc008e668..000000000 --- a/client/directives/snapscroll.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export default { - bind(el) { - el.addEventListener('scroll', () => { - // eslint-disable-next-line no-param-reassign - el.scrolledToBottom = - el.scrollHeight - el.scrollTop - el.offsetHeight < 10; - }); - }, - update(el) { - if (el.scrolledToBottom) { - setTimeout(() => { - // eslint-disable-next-line no-param-reassign - el.scrollTop = el.scrollHeight - el.offsetHeight; - }); - } - }, -}; diff --git a/client/helpers/__mocks__/index.js b/client/helpers/__mocks__/index.js deleted file mode 100644 index 69276f555..000000000 --- a/client/helpers/__mocks__/index.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const getKeyValuePairs = jest.fn().mockImplementation(() => 'kvpsMock'); diff --git a/client/helpers/combine.js b/client/helpers/combine.js deleted file mode 100644 index fc901861a..000000000 --- a/client/helpers/combine.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const combine = (...callbacks) => data => - callbacks.reduce( - (accumulator, callback) => (accumulator = callback(accumulator)), - data - ); - -export default combine; diff --git a/client/helpers/delay.js b/client/helpers/delay.js deleted file mode 100644 index 2f0ceaf85..000000000 --- a/client/helpers/delay.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const delay = time => new Promise(resolve => setTimeout(resolve, time)); - -export default delay; diff --git a/client/helpers/get-datetime-formatted-string.js b/client/helpers/get-datetime-formatted-string.js deleted file mode 100644 index f33752495..000000000 --- a/client/helpers/get-datetime-formatted-string.js +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; -import { - DATE_FORMAT_YYYY_MM_DD, - DATE_FORMAT_MMM_D_YYYY, - DATE_FORMAT_D_MMM_YYYY, - TIME_FORMAT_12, - TIME_FORMAT_24, - TIMEZONE_LOCAL, - TIMEZONE_UTC, -} from '../constants'; - -export const getDateFormat = dateFormat => { - switch (dateFormat) { - case DATE_FORMAT_YYYY_MM_DD: - return 'YYYY-MM-DD'; - case DATE_FORMAT_D_MMM_YYYY: - return 'D MMM, YYYY'; - case DATE_FORMAT_MMM_D_YYYY: - default: - return 'MMM D, YYYY'; - } -}; - -export const getTimeFormat = timeFormat => { - switch (timeFormat) { - case TIME_FORMAT_24: - return 'HH:mm:ss'; - case TIME_FORMAT_12: - default: - return 'h:mm:ss A'; - } -}; - -export const getDateTimeFormat = (dateFormat, timeFormat) => - `${getDateFormat(dateFormat)} ${getTimeFormat(timeFormat)}`; - -export const getMomentFn = timezone => { - switch (timezone) { - case TIMEZONE_UTC: - return moment.utc; - case TIMEZONE_LOCAL: - default: - return moment; - } -}; - -export default ({ date, dateFormat, timeFormat, timezone }) => { - const dateTimeFormat = getDateTimeFormat(dateFormat, timeFormat); - const momentFn = getMomentFn(timezone); - - return momentFn(date).format(dateTimeFormat); -}; diff --git a/client/helpers/get-datetime-formatted-string.spec.js b/client/helpers/get-datetime-formatted-string.spec.js deleted file mode 100644 index 0d33cd445..000000000 --- a/client/helpers/get-datetime-formatted-string.spec.js +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { - DATE_FORMAT_MMM_D_YYYY, - DATE_FORMAT_D_MMM_YYYY, - DATE_FORMAT_YYYY_MM_DD, - TIME_FORMAT_12, - TIME_FORMAT_24, - TIMEZONE_LOCAL, - TIMEZONE_UTC, -} from '../constants'; -import getDateTimeFormattedString, { - getDateFormat, - getTimeFormat, - getDateTimeFormat, -} from './get-datetime-formatted-string'; - -describe('getDateTimeFormattedString', () => { - describe('getDateFormat', () => { - it('should return "YYYY-MM-DD" when dateFormat = DATE_FORMAT_YYYY_MM_DD.', () => { - const dateFormat = DATE_FORMAT_YYYY_MM_DD; - const output = getDateFormat(dateFormat); - - expect(output).toEqual('YYYY-MM-DD'); - }); - - it('should return "D MMM, YYYY" when dateFormat = DATE_FORMAT_D_MMM_YYYY.', () => { - const dateFormat = DATE_FORMAT_D_MMM_YYYY; - const output = getDateFormat(dateFormat); - - expect(output).toEqual('D MMM, YYYY'); - }); - - it('should return "MMM D, YYYY" when dateFormat = DATE_FORMAT_MMM_D_YYYY.', () => { - const dateFormat = DATE_FORMAT_MMM_D_YYYY; - const output = getDateFormat(dateFormat); - - expect(output).toEqual('MMM D, YYYY'); - }); - }); - - describe('getTimeFormat', () => { - it('should return "HH:mm:ss" when timeFormat = TIME_FORMAT_24.', () => { - const timeFormat = TIME_FORMAT_24; - const output = getTimeFormat(timeFormat); - - expect(output).toEqual('HH:mm:ss'); - }); - - it('should return "h:mm:ss A" when timeFormat = TIME_FORMAT_12.', () => { - const timeFormat = TIME_FORMAT_12; - const output = getTimeFormat(timeFormat); - - expect(output).toEqual('h:mm:ss A'); - }); - }); - - describe('getDateTimeFormat', () => { - it('should return "YYYY-MM-DD HH:mm:ss" when dateFormat = DATE_FORMAT_YYYY_MM_DD and timeFormat = TIME_FORMAT_24.', () => { - const dateFormat = DATE_FORMAT_YYYY_MM_DD; - const timeFormat = TIME_FORMAT_24; - const output = getDateTimeFormat(dateFormat, timeFormat); - - expect(output).toEqual('YYYY-MM-DD HH:mm:ss'); - }); - - it('should return "D MMM, YYYY h:mm:ss A" when dateFormat = DATE_FORMAT_D_MMM_YYYY and timeFormat = TIME_FORMAT_12.', () => { - const dateFormat = DATE_FORMAT_D_MMM_YYYY; - const timeFormat = TIME_FORMAT_12; - const output = getDateTimeFormat(dateFormat, timeFormat); - - expect(output).toEqual('D MMM, YYYY h:mm:ss A'); - }); - }); - - describe('getDateTimeFormattedString', () => { - it('should return "2020-01-01 00:00:00" when date = Date("2020-01-01T00:00:00.000Z"), dateFormat = DATE_FORMAT_YYYY_MM_DD, timeFormat = TIME_FORMAT_24, timezone = TIMEZONE_UTC.', () => { - const date = new Date('2020-01-01T00:00:00.000Z'); - const dateFormat = DATE_FORMAT_YYYY_MM_DD; - const timeFormat = TIME_FORMAT_24; - const timezone = TIMEZONE_UTC; - const output = getDateTimeFormattedString({ - date, - dateFormat, - timeFormat, - timezone, - }); - - expect(output).toEqual('2020-01-01 00:00:00'); - }); - - it('should return "1 Jan, 2020 12:00:00 AM" when date = Date("2020-01-01T00:00:00.000Z"), dateFormat = DATE_FORMAT_D_MMM_YYYY, timeFormat = TIME_FORMAT_12, timezone = TIMEZONE_LOCAL.', () => { - const date = new Date('2020-01-01T00:00:00.000Z'); - const dateFormat = DATE_FORMAT_D_MMM_YYYY; - const timeFormat = TIME_FORMAT_12; - const timezone = TIMEZONE_LOCAL; - const output = getDateTimeFormattedString({ - date, - dateFormat, - timeFormat, - timezone, - }); - - expect(output).toEqual('1 Jan, 2020 12:00:00 AM'); - }); - }); -}); diff --git a/client/helpers/get-end-time-iso-string.js b/client/helpers/get-end-time-iso-string.js deleted file mode 100644 index fa4fb31a9..000000000 --- a/client/helpers/get-end-time-iso-string.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; - -export default (range, endTimeString) => { - if (range && typeof range === 'string') { - const [, , unit] = range.split('-'); - - return moment() - .endOf(unit) - .toISOString(); - } - - return endTimeString; -}; diff --git a/client/helpers/get-end-time-iso-string.spec.js b/client/helpers/get-end-time-iso-string.spec.js deleted file mode 100644 index fac4dd6a0..000000000 --- a/client/helpers/get-end-time-iso-string.spec.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getEndTimeIsoString from './get-end-time-iso-string'; - -describe('getEndTimeIsoString', () => { - describe('When range = undefined', () => { - it('should return endTimeString.', () => { - const range = undefined; - const endTimeString = '2020-03-30T00:00:00Z'; - const output = getEndTimeIsoString(range, endTimeString); - - expect(output).toEqual(endTimeString); - }); - }); - - describe('When moment is set to March 1st 2020 and range = "last-30-days"', () => { - it('should return "2020-03-01T23:59:59.999Z".', () => { - jest - .spyOn(Date, 'now') - .mockImplementation(() => new Date(Date.UTC(2020, 2, 1)).getTime()); - const range = 'last-30-days'; - const endTimeString = ''; - const output = getEndTimeIsoString(range, endTimeString); - - expect(output).toEqual('2020-03-01T23:59:59.999Z'); - }); - }); -}); diff --git a/client/helpers/get-environment-list.js b/client/helpers/get-environment-list.js deleted file mode 100644 index 8c8768176..000000000 --- a/client/helpers/get-environment-list.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export default ({ environmentList, origin }) => - environmentList.filter(({ value }) => value !== origin); diff --git a/client/helpers/get-environment-list.spec.js b/client/helpers/get-environment-list.spec.js deleted file mode 100644 index 3d3a41cc0..000000000 --- a/client/helpers/get-environment-list.spec.js +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getEnvironmentList from './get-environment-list'; - -describe('getEnvironmentList', () => { - it('should exclude the current environment from the list.', () => { - const environmentList = [ - { - value: 'https://production-environment.com', - }, - { - value: 'https://staging-environment.com', - }, - { - value: 'https://development-environment.com', - }, - ]; - const origin = 'https://production-environment.com'; - const output = getEnvironmentList({ environmentList, origin }); - - expect(output.length).toEqual(2); - expect(output[0]).toEqual({ - value: 'https://staging-environment.com', - }); - expect(output[1]).toEqual({ - value: 'https://development-environment.com', - }); - }); -}); diff --git a/client/helpers/get-environment.js b/client/helpers/get-environment.js deleted file mode 100644 index 822c32109..000000000 --- a/client/helpers/get-environment.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export default ({ environmentList, origin }) => - environmentList.find(({ value }) => value === origin) || { - label: 'Unknown', - value: origin, - }; diff --git a/client/helpers/get-environment.spec.js b/client/helpers/get-environment.spec.js deleted file mode 100644 index 19eff822c..000000000 --- a/client/helpers/get-environment.spec.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getEnvironment from './get-environment'; - -describe('getEnvironment', () => { - const LOCALHOST_DOMAIN = 'http://localhost:8088'; - const LOCALHOST_OPTION = { - label: 'Localhost', - value: LOCALHOST_DOMAIN, - }; - - const UNKNOWN_DOMAIN = 'http://unknown.domain.com'; - const UNKNOWN_OPTION = { - label: 'Unknown', - value: UNKNOWN_DOMAIN, - }; - - const ENVIRONMENT_LIST = [LOCALHOST_OPTION]; - - it('should return UNKNOWN_OPTION when origin = UNKNOWN_DOMAIN and is not part of environmentList.', () => { - const output = getEnvironment({ - environmentList: ENVIRONMENT_LIST, - origin: UNKNOWN_DOMAIN, - }); - - expect(output).toEqual(UNKNOWN_OPTION); - }); - - it('should return LOCALHOST_OPTION when origin = LOCALHOST_DOMAIN and environmentList = [LOCALHOST_OPTION].', () => { - const output = getEnvironment({ - environmentList: ENVIRONMENT_LIST, - origin: LOCALHOST_DOMAIN, - }); - - expect(output).toEqual(LOCALHOST_OPTION); - }); -}); diff --git a/client/helpers/get-error-message.js b/client/helpers/get-error-message.js deleted file mode 100644 index 9c4a9430c..000000000 --- a/client/helpers/get-error-message.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { NOTIFICATION_TYPE_ERROR_MESSAGE_DEFAULT } from '~constants'; - -export default ( - error, - defaultMessage = NOTIFICATION_TYPE_ERROR_MESSAGE_DEFAULT -) => - (error && - ((error.json && error.json.message) || error.status || error.message)) || - defaultMessage; diff --git a/client/helpers/get-error-message.spec.js b/client/helpers/get-error-message.spec.js deleted file mode 100644 index 443cf6fde..000000000 --- a/client/helpers/get-error-message.spec.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getErrorMessage from './get-error-message'; -import { NOTIFICATION_TYPE_ERROR_MESSAGE_DEFAULT } from '~constants'; - -describe('getErrorMessage', () => { - describe('When passing error.json.message', () => { - it('should return error.json.message', () => { - const error = { - json: { - message: 'error.json.message value', - }, - }; - const output = getErrorMessage(error); - - expect(output).toEqual('error.json.message value'); - }); - }); - - describe('When passing error.status', () => { - it('should return error.status', () => { - const error = { - status: 'error.status value', - }; - const output = getErrorMessage(error); - - expect(output).toEqual('error.status value'); - }); - }); - - describe('When passing error.message', () => { - it('should return error.message', () => { - const error = { - message: 'error.message value', - }; - const output = getErrorMessage(error); - - expect(output).toEqual('error.message value'); - }); - }); - - describe('When passing no error', () => { - it('should return NOTIFICATION_TYPE_ERROR_MESSAGE_DEFAULT', () => { - const error = undefined; - const output = getErrorMessage(error); - - expect(output).toEqual(NOTIFICATION_TYPE_ERROR_MESSAGE_DEFAULT); - }); - }); -}); diff --git a/client/helpers/get-expiry-date-time-from-now.js b/client/helpers/get-expiry-date-time-from-now.js deleted file mode 100644 index cada39c4f..000000000 --- a/client/helpers/get-expiry-date-time-from-now.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; -import { ONE_HOUR_IN_MILLISECONDS } from '../constants'; - -const getExpiryDateTimeFromNow = (time = ONE_HOUR_IN_MILLISECONDS) => - moment() - .add(ONE_HOUR_IN_MILLISECONDS) - .toISOString(); - -export default getExpiryDateTimeFromNow; diff --git a/client/helpers/get-expiry-date-time-from-now.spec.js b/client/helpers/get-expiry-date-time-from-now.spec.js deleted file mode 100644 index 93307fb12..000000000 --- a/client/helpers/get-expiry-date-time-from-now.spec.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import MockDate from 'mockdate'; -import getExpiryDateTimeFromNow from './get-expiry-date-time-from-now'; - -describe('getExpiryDateTimeFromNow', () => { - beforeEach(() => { - MockDate.set(new Date('2020-01-01T00:00:00.000Z')); - }); - - afterEach(() => { - MockDate.reset(); - }); - - it('should return a date 1 hour in the future', () => { - const output = getExpiryDateTimeFromNow(); - - expect(output).toEqual('2020-01-01T01:00:00.000Z'); - }); -}); diff --git a/client/helpers/get-json-string-object.js b/client/helpers/get-json-string-object.js deleted file mode 100644 index 04ca0bdff..000000000 --- a/client/helpers/get-json-string-object.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getStringElipsis from './get-string-elipsis'; - -const getJsonStringObject = value => { - const jsonStringFull = - value !== undefined ? JSON.stringify(value, null, 2) : ''; - const jsonStringDisplay = getStringElipsis(jsonStringFull); - - return { - jsonStringDisplay, - jsonStringFull, - value, - }; -}; - -export default getJsonStringObject; diff --git a/client/helpers/get-key-value-pairs.js b/client/helpers/get-key-value-pairs.js deleted file mode 100644 index d5ffba7c4..000000000 --- a/client/helpers/get-key-value-pairs.js +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; -import getJsonStringObject from './get-json-string-object'; -import { jsonKeys, preKeys } from '~constants'; - -const getKeyValuePairs = ({ clusterName, excludes = [], item }) => { - const kvps = []; - const flatten = (prefix, obj, root) => { - Object.entries(obj).forEach(([k, value]) => { - if (value === null || value === undefined) { - return; - } - - const key = prefix ? `${prefix}.${k}` : k; - - if (excludes.includes(key)) { - return; - } - - if (value.routeLink) { - kvps.push({ - key, - routeLink: value.routeLink, - value: value.text, - }); - } else if (typeof value === 'object' && !jsonKeys.includes(key)) { - flatten(key, value, root); - } else if (key === 'newExecutionRunId') { - kvps.push({ - key, - routeLink: { - name: 'workflow/summary', - params: { - clusterName, - runId: value, - }, - }, - value, - }); - } else if (key === 'parentWorkflowExecution.runId') { - kvps.push({ - key, - routeLink: { - name: 'workflow/summary', - params: { - clusterName, - domain: root.parentWorkflowDomain, - runId: value, - workflowId: root.parentWorkflowExecution.workflowId, - }, - }, - value, - }); - } else if (key === 'workflowExecution.runId') { - kvps.push({ - key, - routeLink: { - name: 'workflow/summary', - params: { - clusterName, - domain: root.domain, - runId: value, - workflowId: root.workflowExecution.workflowId, - }, - }, - value, - }); - } else if (key === 'taskList.name' || key === 'Tasklist') { - kvps.push({ - key, - routeLink: { - name: 'task-list', - params: { - clusterName, - taskList: value, - }, - }, - value, - }); - } else if (/.+TimeoutSeconds/.test(key)) { - kvps.push({ - key: key.replace(/Seconds$/, ''), - value: moment.duration(value, 'seconds').format(), - }); - } else if (preKeys.includes(k)) { - kvps.push({ - key, - value: getJsonStringObject(value), - }); - } else { - kvps.push({ - key, - value, - }); - } - }); - }; - - flatten('', item || {}, item); - - return kvps; -}; - -export default getKeyValuePairs; diff --git a/client/helpers/get-latest-news-items.js b/client/helpers/get-latest-news-items.js deleted file mode 100644 index 2a4f33874..000000000 --- a/client/helpers/get-latest-news-items.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import get from 'lodash-es/get'; - -export default ({ newsLastUpdated, response }) => { - const newsItems = get(response, 'items', []).map(({ url, ...newsItem }) => ({ - ...newsItem, - url: `/${url.replace(/^\/_|[/]$/g, '')}`, - })); - - return !newsLastUpdated - ? newsItems - : newsItems.filter(({ date_modified }) => date_modified > newsLastUpdated); -}; diff --git a/client/helpers/get-latest-news-items.spec.js b/client/helpers/get-latest-news-items.spec.js deleted file mode 100644 index 75e09dc81..000000000 --- a/client/helpers/get-latest-news-items.spec.js +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getLatestNewsItems from './get-latest-news-items'; - -describe('getLatestNewsItems', () => { - const response = { - items: [ - { - url: '/_news/news-item-1', - date_modified: '2020-04-29T00:00:00.000Z', - }, - { - url: '/_news/news-item-2', - date_modified: '2020-04-28T00:00:00.000Z', - }, - { - url: '/_news/news-item-3', - date_modified: '2020-04-27T00:00:00.000Z', - }, - ], - }; - - it('should return all newsItems from response when newsLastUpdated is undefined.', () => { - const newsLastUpdated = undefined; - const output = getLatestNewsItems({ newsLastUpdated, response }); - - expect(output).toEqual([ - { - url: '/news/news-item-1', - date_modified: '2020-04-29T00:00:00.000Z', - }, - { - url: '/news/news-item-2', - date_modified: '2020-04-28T00:00:00.000Z', - }, - { - url: '/news/news-item-3', - date_modified: '2020-04-27T00:00:00.000Z', - }, - ]); - }); - - it('should return a subset of newsItems from response when newsLastUpdated is a date before the latest item in the newsItems list.', () => { - const newsLastUpdated = '2020-04-27T00:00:00.000Z'; - const output = getLatestNewsItems({ newsLastUpdated, response }); - - expect(output).toEqual([ - { - url: '/news/news-item-1', - date_modified: '2020-04-29T00:00:00.000Z', - }, - { - url: '/news/news-item-2', - date_modified: '2020-04-28T00:00:00.000Z', - }, - ]); - }); - - it('should return an empty newsItems from response when newsLastUpdated matches the date of the latest item.', () => { - const newsLastUpdated = '2020-04-29T00:00:00.000Z'; - const output = getLatestNewsItems({ newsLastUpdated, response }); - - expect(output).toEqual([]); - }); -}); diff --git a/client/helpers/get-query-string-from-object.js b/client/helpers/get-query-string-from-object.js deleted file mode 100644 index ffff0f272..000000000 --- a/client/helpers/get-query-string-from-object.js +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const getQueryStringFromObject = (params = {}) => { - const paramKeys = Object.keys(params); - - if (paramKeys.length === 0) { - return ''; - } - - return ( - '?' + - paramKeys - .filter( - queryName => - params[queryName] !== null && params[queryName] !== undefined - ) - .map( - queryName => - encodeURIComponent(queryName) + - '=' + - encodeURIComponent(params[queryName]) - ) - .join('&') - ); -}; - -export default getQueryStringFromObject; diff --git a/client/helpers/get-query-string-from-object.spec.js b/client/helpers/get-query-string-from-object.spec.js deleted file mode 100644 index 92db5c9c2..000000000 --- a/client/helpers/get-query-string-from-object.spec.js +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getQueryStringFromObject from './get-query-string-from-object'; - -describe('getQueryStringFromObject', () => { - it('should return empty string when no params are passed.', () => { - const output = getQueryStringFromObject(); - - expect(output).toEqual(''); - }); - - it('should return an url encoded query param string when params are passed.', () => { - const output = getQueryStringFromObject({ - stringParam: 'string', - booleanParam: true, - numberParam: 20, - }); - - expect(output).toEqual( - '?stringParam=string&booleanParam=true&numberParam=20' - ); - }); -}); diff --git a/client/helpers/get-start-time-iso-string.js b/client/helpers/get-start-time-iso-string.js deleted file mode 100644 index df5a3464a..000000000 --- a/client/helpers/get-start-time-iso-string.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; - -export default (range, startTimeString) => { - if (range && typeof range === 'string') { - const [, count, unit] = range.split('-'); - - return moment() - .subtract(count, unit) - .startOf(unit) - .toISOString(); - } - - return startTimeString; -}; diff --git a/client/helpers/get-start-time-iso-string.spec.js b/client/helpers/get-start-time-iso-string.spec.js deleted file mode 100644 index b14c1911d..000000000 --- a/client/helpers/get-start-time-iso-string.spec.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getStartTimeIsoString from './get-start-time-iso-string'; - -describe('getStartTimeIsoString', () => { - describe('When range = undefined and startTimeString = "2020-03-30T00:00:00Z"', () => { - it('should return "2020-03-30T00:00:00Z".', () => { - const range = undefined; - const startTimeString = '2020-03-30T00:00:00Z'; - const output = getStartTimeIsoString(range, startTimeString); - - expect(output).toEqual(startTimeString); - }); - }); - - describe('When moment is set to March 31th 2020 and range = "last-30-days"', () => { - it('should return "2020-03-01T00:00:00.000Z".', () => { - jest - .spyOn(Date, 'now') - .mockImplementation(() => new Date(Date.UTC(2020, 2, 31)).getTime()); - const range = 'last-30-days'; - const startTimeString = ''; - const output = getStartTimeIsoString(range, startTimeString); - - expect(output).toEqual('2020-03-01T00:00:00.000Z'); - }); - }); -}); diff --git a/client/helpers/get-string-elipsis.js b/client/helpers/get-string-elipsis.js deleted file mode 100644 index 47f15356c..000000000 --- a/client/helpers/get-string-elipsis.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { MAXIMUM_JSON_CHARACTER_LIMIT, MAXIMUM_JSON_MESSAGE } from '~constants'; - -const getStringElipsis = input => - input.length < MAXIMUM_JSON_CHARACTER_LIMIT - ? input - : input.substring(0, MAXIMUM_JSON_CHARACTER_LIMIT) + MAXIMUM_JSON_MESSAGE; - -export default getStringElipsis; diff --git a/client/helpers/get-string-elipsis.spec.js b/client/helpers/get-string-elipsis.spec.js deleted file mode 100644 index 84ee22ed2..000000000 --- a/client/helpers/get-string-elipsis.spec.js +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getStringElipsis from './get-string-elipsis'; -import { MAXIMUM_JSON_CHARACTER_LIMIT, MAXIMUM_JSON_MESSAGE } from '~constants'; - -describe('getStringElipsis', () => { - describe('when passed a string that has a length less than MAXIMUM_JSON_CHARACTER_LIMIT', () => { - it('should return the original string', () => { - const input = 'a-short-string'; - const output = getStringElipsis(input); - - expect(output).toEqual('a-short-string'); - }); - }); - describe('when passed the empty string', () => { - it('should return the empty string', () => { - const input = ''; - const output = getStringElipsis(input); - - expect(output).toEqual(''); - }); - }); - describe('when passed a string that has a length equal to MAXIMUM_JSON_CHARACTER_LIMIT', () => { - it('should return a substring of the original string up until the limit and display a message.', () => { - const input = ''.padEnd(MAXIMUM_JSON_CHARACTER_LIMIT, '_'); - const output = getStringElipsis(input); - - expect(output).toEqual(input + MAXIMUM_JSON_MESSAGE); - }); - }); -}); diff --git a/client/helpers/has-expired.js b/client/helpers/has-expired.js deleted file mode 100644 index 4e95df7e7..000000000 --- a/client/helpers/has-expired.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; - -const hasExpired = expiryDateTime => { - if (!expiryDateTime) { - return true; - } - - return moment().isAfter(expiryDateTime); -}; - -export default hasExpired; diff --git a/client/helpers/has-expired.spec.js b/client/helpers/has-expired.spec.js deleted file mode 100644 index cee2a6c52..000000000 --- a/client/helpers/has-expired.spec.js +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2021-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import MockDate from 'mockdate'; -import hasExpired from './has-expired'; - -describe('hasExpired', () => { - beforeEach(() => { - MockDate.set(new Date('2020-01-01T00:00:00.000Z')); - }); - - afterEach(() => { - MockDate.reset(); - }); - - describe('when expiryDateTime is not passed', () => { - it('should return true.', () => { - const output = hasExpired(); - - expect(output).toEqual(true); - }); - }); - - describe('when expiryDateTime is in the past', () => { - it('should return true.', () => { - const output = hasExpired(new Date('2019-12-30T00:00:00.000Z')); - - expect(output).toEqual(true); - }); - }); - - describe('when expiryDateTime is in the future', () => { - it('should return false.', () => { - const output = hasExpired(new Date('2020-01-01T01:00:00.000Z')); - - expect(output).toEqual(false); - }); - }); -}); diff --git a/client/helpers/index.js b/client/helpers/index.js deleted file mode 100644 index db08d971e..000000000 --- a/client/helpers/index.js +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export { default as combine } from './combine'; -export { default as delay } from './delay'; -export { default as getDatetimeFormattedString } from './get-datetime-formatted-string'; -export { default as getEndTimeIsoString } from './get-end-time-iso-string'; -export { default as getEnvironment } from './get-environment'; -export { default as getEnvironmentList } from './get-environment-list'; -export { default as getErrorMessage } from './get-error-message'; -export { default as getExpiryDateTimeFromNow } from './get-expiry-date-time-from-now'; -export { default as getJsonStringObject } from './get-json-string-object'; -export { default as getKeyValuePairs } from './get-key-value-pairs'; -export { default as getLatestNewsItems } from './get-latest-news-items'; -export { default as getQueryStringFromObject } from './get-query-string-from-object'; -export { default as getStartTimeIsoString } from './get-start-time-iso-string'; -export { default as getStringElipsis } from './get-string-elipsis'; -export { default as hasExpired } from './has-expired'; -export { default as injectMomentDurationFormat } from './inject-moment-duration-format'; -export { default as jsonTryParse } from './json-try-parse'; -export { default as mapDomainDescription } from './map-domain-description'; -export { default as parseStringToBoolean } from './parse-string-to-boolean'; -export { default as shortName } from './short-name'; -export { default as workflowHistoryEventHighlightListAddOrUpdate } from './workflow-history-event-highlight-list-add-or-update'; -export { default as workflowHistoryEventHighlightListRemove } from './workflow-history-event-highlight-list-remove'; diff --git a/client/helpers/inject-moment-duration-format.js b/client/helpers/inject-moment-duration-format.js deleted file mode 100644 index 0ef81946f..000000000 --- a/client/helpers/inject-moment-duration-format.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; - -const injectMomentDurationFormat = () => { - Object.getPrototypeOf( - moment.duration(2, 'seconds') - ).format = function format() { - return this.toString() - .toLowerCase() - .replace(/[pt]/g, '') - .replace(/([hmd])/g, '$1 ') - .replace(/\.\d{1,3}s/, 's') - .replace('0d ', '') - .trim(); - }; -}; - -export default injectMomentDurationFormat; diff --git a/client/helpers/json-try-parse.js b/client/helpers/json-try-parse.js deleted file mode 100644 index fbbfa14c2..000000000 --- a/client/helpers/json-try-parse.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -function jsonTryParse(...args) { - try { - return JSON.parse.apply(this, args); - } catch (e) { - // eslint-disable-next-line no-console - console.warn('JSON.parse failed for args:', args); - } - - return undefined; -} - -export default jsonTryParse; diff --git a/client/helpers/map-domain-description.js b/client/helpers/map-domain-description.js deleted file mode 100644 index dc274b064..000000000 --- a/client/helpers/map-domain-description.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export default function(domain) { - const { - configuration: { - emitMetric, - historyArchivalStatus, - workflowExecutionRetentionPeriodInDays, - visibilityArchivalStatus, - } = {}, - domainInfo: { description, ownerEmail } = {}, - failoverVersion, - isGlobalDomain, - replicationConfiguration: { activeClusterName, clusters = [] } = {}, - } = domain || {}; - - return { - description: description || 'No description available', - owner: ownerEmail || 'Unknown', - 'Global?': isGlobalDomain ? 'Yes' : 'No', - 'Retention Period': workflowExecutionRetentionPeriodInDays - ? `${workflowExecutionRetentionPeriodInDays} days` - : 'Unknown', - 'Emit Metrics': emitMetric ? 'Yes' : 'No', - 'History Archival': - historyArchivalStatus === 'ENABLED' ? 'Enabled' : 'Disabled', - 'Visibility Archival': - visibilityArchivalStatus === 'ENABLED' ? 'Enabled' : 'Disabled', - ...(failoverVersion !== undefined && { - 'Failover Version': failoverVersion, - }), - clusters: clusters.length - ? clusters - .map(({ clusterName }) => - clusterName === activeClusterName - ? `${clusterName} (active)` - : clusterName - ) - .join(', ') - : 'Unknown', - }; -} diff --git a/client/helpers/map-domain-description.spec.js b/client/helpers/map-domain-description.spec.js deleted file mode 100644 index a9de25615..000000000 --- a/client/helpers/map-domain-description.spec.js +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import mapDomainDescription from './map-domain-description'; - -describe('mapDomainDescription', () => { - describe('When domain is empty', () => { - let domain; - - beforeEach(() => { - domain = undefined; - }); - - it('should return "Emit Metrics" = "No".', () => { - const output = mapDomainDescription(domain); - - expect(output['Emit Metrics']).toEqual('No'); - }); - - it('should return "Global?" = "No".', () => { - const output = mapDomainDescription(domain); - - expect(output['Global?']).toEqual('No'); - }); - - it('should return "History Archival" = "Disabled".', () => { - const output = mapDomainDescription(domain); - - expect(output['History Archival']).toEqual('Disabled'); - }); - - it('should return "Retention Period" = "Unknown".', () => { - const output = mapDomainDescription(domain); - - expect(output['Retention Period']).toEqual('Unknown'); - }); - - it('should return "Visibility Archival" = "Disabled".', () => { - const output = mapDomainDescription(domain); - - expect(output['History Archival']).toEqual('Disabled'); - }); - - it('should return "clusters" = "Unknown".', () => { - const output = mapDomainDescription(domain); - - expect(output.clusters).toEqual('Unknown'); - }); - - it('should return "description" = "No description available".', () => { - const output = mapDomainDescription(domain); - - expect(output.description).toEqual('No description available'); - }); - - it('should return "owner" = "Unknown".', () => { - const output = mapDomainDescription(domain); - - expect(output.owner).toEqual('Unknown'); - }); - }); - - describe('When domain.domainInfo.description = "DomainDescription"', () => { - it('should return "description" = "DomainDescription".', () => { - const domain = { - domainInfo: { - description: 'DomainDescription', - }, - }; - - const output = mapDomainDescription(domain); - - expect(output.description).toEqual('DomainDescription'); - }); - }); - - describe('When domain.domainInfo.ownerEmail = "OwnerEmail"', () => { - it('should return "owner" = "OwnerEmail".', () => { - const domain = { - domainInfo: { - ownerEmail: 'OwnerEmail', - }, - }; - - const output = mapDomainDescription(domain); - - expect(output.owner).toEqual('OwnerEmail'); - }); - }); - - describe('When domain.isGlobalDomain = true', () => { - it('should return "Global?" = "Yes".', () => { - const domain = { - isGlobalDomain: true, - }; - - const output = mapDomainDescription(domain); - - expect(output['Global?']).toEqual('Yes'); - }); - }); - - describe('When domain.configuration.workflowExecutionRetentionPeriodInDays = 3', () => { - it('should return "Retention Period" = "3 days".', () => { - const domain = { - configuration: { - workflowExecutionRetentionPeriodInDays: 3, - }, - }; - - const output = mapDomainDescription(domain); - - expect(output['Retention Period']).toEqual('3 days'); - }); - }); - - describe('When domain.configuration.emitMetric = true', () => { - it('should return "Emit Metrics" = "Yes".', () => { - const domain = { - configuration: { - emitMetric: true, - }, - }; - - const output = mapDomainDescription(domain); - - expect(output['Emit Metrics']).toEqual('Yes'); - }); - }); - - describe('When domain.configuration.historyArchivalStatus = "ENABLED"', () => { - it('should return "History Archival" = "Enabled".', () => { - const domain = { - configuration: { - historyArchivalStatus: 'ENABLED', - }, - }; - - const output = mapDomainDescription(domain); - - expect(output['History Archival']).toEqual('Enabled'); - }); - }); - - describe('When domain.configuration.visibilityArchivalStatus = "ENABLED"', () => { - it('should return "Visibility Archival" = "Enabled".', () => { - const domain = { - configuration: { - visibilityArchivalStatus: 'ENABLED', - }, - }; - - const output = mapDomainDescription(domain); - - expect(output['Visibility Archival']).toEqual('Enabled'); - }); - }); - - describe('When domain.failoverVersion = 1', () => { - it('should return "Failover Version" = 1', () => { - const domain = { - failoverVersion: 1, - }; - - const output = mapDomainDescription(domain); - - expect(output['Failover Version']).toEqual(1); - }); - }); - - describe(`Multiple clusters with one active cluster`, () => { - it('should return "clusters" = "cluster1 (active), cluster2".', () => { - const domain = { - replicationConfiguration: { - activeClusterName: 'cluster1', - clusters: [{ clusterName: 'cluster1' }, { clusterName: 'cluster2' }], - }, - }; - - const output = mapDomainDescription(domain); - - expect(output.clusters).toEqual('cluster1 (active), cluster2'); - }); - }); -}); diff --git a/client/helpers/parse-string-to-boolean.js b/client/helpers/parse-string-to-boolean.js deleted file mode 100644 index 37a1ed5e8..000000000 --- a/client/helpers/parse-string-to-boolean.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const parseStringToBoolean = (value, defaultValue = false) => { - if (value === 'true') { - return true; - } - - if (value === 'false') { - return false; - } - - return defaultValue; -}; - -export default parseStringToBoolean; diff --git a/client/helpers/parse-string-to-boolean.spec.js b/client/helpers/parse-string-to-boolean.spec.js deleted file mode 100644 index 9cf3230f1..000000000 --- a/client/helpers/parse-string-to-boolean.spec.js +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import parseStringToBoolean from './parse-string-to-boolean'; - -describe('parseStringToBoolean', () => { - it('should return true when passed value = "true".', () => { - const output = parseStringToBoolean('true'); - - expect(output).toEqual(true); - }); - - it('should return false when passed value = "false".', () => { - const output = parseStringToBoolean('false'); - - expect(output).toEqual(false); - }); - - it('should return false when nothing is passed.', () => { - const output = parseStringToBoolean(); - - expect(output).toEqual(false); - }); - - it('should return true when passed value = null and defaultValue = true.', () => { - const output = parseStringToBoolean(null, true); - - expect(output).toEqual(true); - }); -}); diff --git a/client/helpers/short-name.js b/client/helpers/short-name.js deleted file mode 100644 index 0ea89a3ea..000000000 --- a/client/helpers/short-name.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export default a => (a || '').split(/[./]/g).pop(); diff --git a/client/helpers/workflow-history-event-highlight-list-add-or-update.js b/client/helpers/workflow-history-event-highlight-list-add-or-update.js deleted file mode 100644 index 0f6008476..000000000 --- a/client/helpers/workflow-history-event-highlight-list-add-or-update.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import findIndexById from './workflow-history-event-highlight-list-find-index-by-id'; - -const findIndexByTypeAndParamName = ({ - eventType, - eventParamName, -}) => eventParam => - eventParam.eventType === eventType && - eventParam.eventParamName === eventParamName; - -const workflowHistoryEventHighlightListAddOrUpdate = ({ - eventParamName, - eventType, - id, - isEnabled, - workflowHistoryEventHighlightList, -}) => { - const findIndexHandler = id - ? findIndexById({ id }) - : findIndexByTypeAndParamName({ eventParamName, eventType }); - - const index = workflowHistoryEventHighlightList.findIndex(findIndexHandler); - - if (index === -1) { - return [ - { - eventParamName, - eventType, - id: Date.now(), - isEnabled, - }, - ...workflowHistoryEventHighlightList, - ]; - } - - const event = workflowHistoryEventHighlightList[index]; - - return [ - ...workflowHistoryEventHighlightList.slice(0, index), - { - ...event, - eventParamName, - eventType, - isEnabled, - }, - ...workflowHistoryEventHighlightList.slice(index + 1), - ]; -}; - -export default workflowHistoryEventHighlightListAddOrUpdate; diff --git a/client/helpers/workflow-history-event-highlight-list-add-or-update.spec.js b/client/helpers/workflow-history-event-highlight-list-add-or-update.spec.js deleted file mode 100644 index 6a95b4de9..000000000 --- a/client/helpers/workflow-history-event-highlight-list-add-or-update.spec.js +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import addOrUpdate from './workflow-history-event-highlight-list-add-or-update'; - -describe('workflowHistoryEventHighlightListAddOrUpdate', () => { - it('should add an item to start of list if not found with id = 1.', () => { - jest.spyOn(Date, 'now').mockImplementationOnce(() => 1); - - const workflowHistoryEventHighlightList = [ - { - id: 0, - eventParamName: 'eventId', - eventType: 'ActivityTaskCanceled', - isEnabled: false, - }, - { - id: 2, - eventParamName: 'eventId', - eventType: 'ActivityTaskCompleted', - isEnabled: false, - }, - { - id: 3, - eventParamName: 'eventId', - eventType: 'DecisionTaskCompleted', - isEnabled: false, - }, - { - id: 4, - eventParamName: 'eventId', - eventType: 'DecisionTaskScheduled', - isEnabled: false, - }, - ]; - - const output = addOrUpdate({ - eventParamName: 'eventId', - eventType: 'ActivityTaskScheduled', - id: 1, - isEnabled: true, - workflowHistoryEventHighlightList, - }); - - expect(output.length).toEqual(5); - expect(output[0]).toEqual({ - eventParamName: 'eventId', - eventType: 'ActivityTaskScheduled', - id: 1, - isEnabled: true, - }); - }); - - it('should update item in list with id = 1.', () => { - const workflowHistoryEventHighlightList = [ - { - id: 0, - eventParamName: 'eventId', - eventType: 'ActivityTaskCanceled', - isEnabled: false, - }, - { - id: 1, - eventParamName: 'eventId', - eventType: 'ActivityTaskScheduled', - isEnabled: false, - }, - { - id: 2, - eventParamName: 'eventId', - eventType: 'ActivityTaskCompleted', - isEnabled: false, - }, - { - id: 3, - eventParamName: 'eventId', - eventType: 'DecisionTaskCompleted', - isEnabled: false, - }, - { - id: 4, - eventParamName: 'eventId', - eventType: 'DecisionTaskScheduled', - isEnabled: false, - }, - ]; - - const output = addOrUpdate({ - eventParamName: 'eventId', - eventType: 'ActivityTaskScheduled', - id: 1, - isEnabled: true, - workflowHistoryEventHighlightList, - }); - - expect(output.length).toEqual(5); - expect(output[1]).toEqual({ - eventParamName: 'eventId', - eventType: 'ActivityTaskScheduled', - id: 1, - isEnabled: true, - }); - }); - - it('should update item in list with eventType = "ActivityTaskScheduled" and eventParamName = "eventId" (no id specified).', () => { - const workflowHistoryEventHighlightList = [ - { - id: 0, - eventParamName: 'eventId', - eventType: 'ActivityTaskCanceled', - isEnabled: false, - }, - { - id: 1, - eventParamName: 'eventId', - eventType: 'ActivityTaskScheduled', - isEnabled: false, - }, - { - id: 2, - eventParamName: 'eventId', - eventType: 'ActivityTaskCompleted', - isEnabled: false, - }, - { - id: 3, - eventParamName: 'eventId', - eventType: 'DecisionTaskCompleted', - isEnabled: false, - }, - { - id: 4, - eventParamName: 'eventId', - eventType: 'DecisionTaskScheduled', - isEnabled: false, - }, - ]; - - const output = addOrUpdate({ - eventParamName: 'eventId', - eventType: 'ActivityTaskScheduled', - isEnabled: true, - workflowHistoryEventHighlightList, - }); - - expect(output.length).toEqual(5); - expect(output[1]).toEqual({ - eventParamName: 'eventId', - eventType: 'ActivityTaskScheduled', - id: 1, - isEnabled: true, - }); - }); -}); diff --git a/client/helpers/workflow-history-event-highlight-list-find-index-by-id.js b/client/helpers/workflow-history-event-highlight-list-find-index-by-id.js deleted file mode 100644 index 5a6f2e00e..000000000 --- a/client/helpers/workflow-history-event-highlight-list-find-index-by-id.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -const workflowHistoryEventHighlightListFindIndexById = ({ id }) => eventParam => - eventParam.id === id; - -export default workflowHistoryEventHighlightListFindIndexById; diff --git a/client/helpers/workflow-history-event-highlight-list-find-index-by-id.spec.js b/client/helpers/workflow-history-event-highlight-list-find-index-by-id.spec.js deleted file mode 100644 index ba2f44f0d..000000000 --- a/client/helpers/workflow-history-event-highlight-list-find-index-by-id.spec.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import findIndexById from './workflow-history-event-highlight-list-find-index-by-id'; - -describe('workflowHistoryEventHighlightListFindIndexById', () => { - it('should return -1 if it cant find item in the list.', () => { - const workflowHistoryEventHighlightList = [ - { id: 0 }, - { id: 2 }, - { id: 3 }, - { id: 4 }, - ]; - - const output = workflowHistoryEventHighlightList.findIndex( - findIndexById({ id: 1 }) - ); - - expect(output).toEqual(-1); - }); - - it('should return index = 1 when id = 1 and matching item with id = 1 is the second in the list.', () => { - const workflowHistoryEventHighlightList = [ - { id: 0 }, - { id: 1 }, - { id: 2 }, - { id: 3 }, - { id: 4 }, - ]; - - const output = workflowHistoryEventHighlightList.findIndex( - findIndexById({ id: 1 }) - ); - - expect(output).toEqual(1); - }); -}); diff --git a/client/helpers/workflow-history-event-highlight-list-remove.js b/client/helpers/workflow-history-event-highlight-list-remove.js deleted file mode 100644 index 5a44e2ba2..000000000 --- a/client/helpers/workflow-history-event-highlight-list-remove.js +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import findIndexById from './workflow-history-event-highlight-list-find-index-by-id'; - -const workflowHistoryEventHighlightListRemove = ({ - id, - workflowHistoryEventHighlightList, -}) => { - const index = workflowHistoryEventHighlightList.findIndex( - findIndexById({ id }) - ); - - if (index === -1) { - return workflowHistoryEventHighlightList; - } - - return [ - ...workflowHistoryEventHighlightList.slice(0, index), - ...workflowHistoryEventHighlightList.slice(index + 1), - ]; -}; - -export default workflowHistoryEventHighlightListRemove; diff --git a/client/helpers/workflow-history-event-highlight-list-remove.spec.js b/client/helpers/workflow-history-event-highlight-list-remove.spec.js deleted file mode 100644 index 438af2bc3..000000000 --- a/client/helpers/workflow-history-event-highlight-list-remove.spec.js +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import remove from './workflow-history-event-highlight-list-remove'; - -describe('workflowHistoryEventHighlightListRemove', () => { - it('list is unchanged when no item with id = 1 in list and passed id = 1.', () => { - const workflowHistoryEventHighlightList = [ - { id: 0 }, - { id: 2 }, - { id: 3 }, - { id: 4 }, - ]; - - const output = remove({ - id: 1, - workflowHistoryEventHighlightList, - }); - - expect(output).toEqual(workflowHistoryEventHighlightList); - }); - - it('removes item with id = 1 from list when passed id = 1.', () => { - const workflowHistoryEventHighlightList = [ - { id: 0 }, - { id: 1 }, - { id: 2 }, - { id: 3 }, - { id: 4 }, - ]; - - const output = remove({ - id: 1, - workflowHistoryEventHighlightList, - }); - - expect(output).toEqual([{ id: 0 }, { id: 2 }, { id: 3 }, { id: 4 }]); - }); -}); diff --git a/client/main.js b/client/main.js deleted file mode 100644 index 8b852074d..000000000 --- a/client/main.js +++ /dev/null @@ -1,401 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import Vue from 'vue'; -import Router from 'vue-router'; -import infiniteScroll from 'vue-infinite-scroll'; -import vueModal from 'vue-js-modal'; -import vueSplit from 'vue-split-panel'; -import qs from 'friendly-querystring'; -import promiseFinally from 'promise.prototype.finally'; - -import copyButton from './components/copy'; - -import snapscroll from './directives/snapscroll'; - -import App from './App'; -import Domain from './routes/domain'; -import DomainSearch from './routes/domain-search'; -import DomainMetrics from './routes/domain/domain-metrics'; -import DomainSettings from './routes/domain/domain-settings'; -import Help from './routes/help'; -import News from './routes/news'; -import Query from './routes/workflow/query'; -import Root from './routes'; -import StackTrace from './routes/workflow/stack-trace'; -import TaskList from './routes/task-list'; -import TaskListMetrics from './routes/task-list/metrics'; -import TaskListPartition from './routes/task-list/partition'; -import TaskListPollers from './routes/task-list/pollers'; -import WorkflowArchival from './routes/domain/workflow-archival'; -import WorkflowArchivalAdvanced from './routes/domain/workflow-archival/advanced'; -import WorkflowArchivalBasic from './routes/domain/workflow-archival/basic'; -import WorkflowSummary from './routes/workflow/summary'; -import initStore from './store'; -import { - Workflow, - WorkflowHistory, - WorkflowList, - WorkflowPending, -} from '~containers'; - -import { injectMomentDurationFormat, jsonTryParse } from '~helpers'; - -const routeOpts = { - mode: 'history', - routes: [ - { - path: '/', - redirect: '/domains', - component: Root, - children: [ - { - name: 'domain-search', - path: '/domains', - components: { - 'domain-search': DomainSearch, - }, - }, - { - name: 'help', - path: '/help', - components: { - help: Help, - }, - }, - { - name: 'news', - path: '/news/:year?/:month?/:date?/:article?', - components: { - news: News, - }, - props: { - news: ({ params: { article, date, month, year } }) => ({ - article, - date, - month, - year, - }), - }, - }, - ], - }, - { - name: 'domain', - path: '/domains/:domain/:clusterName?', - redirect: '/domains/:domain/:clusterName?/workflows', - component: Domain, - props: ({ params }) => ({ - clusterName: params.clusterName, - domain: params.domain, - }), - children: [ - { - name: 'workflow-list', - path: '/domains/:domain/:clusterName?/workflows', - components: { - 'workflow-list': WorkflowList, - }, - }, - { - name: 'domain-metrics', - path: '/domains/:domain/:clusterName?/metrics', - components: { - 'domain-metrics': DomainMetrics, - }, - }, - { - name: 'domain-settings', - path: '/domains/:domain/:clusterName?/settings', - components: { - 'domain-settings': DomainSettings, - }, - }, - { - name: 'workflow-archival', - path: '/domains/:domain/:clusterName?/archival', - redirect: '/domains/:domain/:clusterName?/archival/basic', - components: { - 'workflow-archival': WorkflowArchival, - }, - children: [ - { - name: 'workflow-archival-advanced', - path: '/domains/:domain/:clusterName?/archival/advanced', - components: { - 'workflow-archival-advanced': WorkflowArchivalAdvanced, - }, - }, - { - name: 'workflow-archival-basic', - path: '/domains/:domain/:clusterName?/archival/basic', - components: { - 'workflow-archival-basic': WorkflowArchivalBasic, - }, - }, - ], - }, - ], - }, - { - name: 'workflow', - path: '/domains/:domain/:clusterName?/workflows/:workflowId/:runId', - component: Workflow, - props: ({ params }) => ({ - clusterName: params.clusterName, - displayWorkflowId: params.workflowId, - domain: params.domain, - runId: params.runId, - workflowId: encodeURIComponent(params.workflowId), - }), - children: [ - { - name: 'workflow/summary', - path: - '/domains/:domain/:clusterName?/workflows/:workflowId/:runId/summary', - components: { - summary: WorkflowSummary, - }, - props: { - summary: ({ params }) => ({ - clusterName: params.clusterName, - runId: params.runId, - workflowId: encodeURIComponent(params.workflowId), - }), - }, - }, - { - name: 'workflow/history', - path: - '/domains/:domain/:clusterName?/workflows/:workflowId/:runId/history', - components: { - history: WorkflowHistory, - }, - props: { - history: ({ params, query }) => ({ - clusterName: params.clusterName, - domain: params.domain, - eventId: Number(query.eventId) || undefined, - format: query.format, - runId: params.runId, - showGraph: Boolean(query.showGraph) === true, - graphView: query.graphView, - workflowId: encodeURIComponent(params.workflowId), - }), - }, - }, - { - name: 'workflow/pending', - path: - '/domains/:domain/:clusterName?/workflows/:workflowId/:runId/pending', - components: { - pending: WorkflowPending, - }, - props: { - pending: ({ params }) => ({ - clusterName: params.clusterName, - }), - }, - }, - { - name: 'workflow/stack-trace', - path: - '/domains/:domain/:clusterName?/workflows/:workflowId/:runId/stack-trace', - components: { - stacktrace: StackTrace, - }, - props: { - stacktrace: ({ params }) => ({ - clusterName: params.clusterName, - }), - }, - }, - { - name: 'workflow/query', - path: - '/domains/:domain/:clusterName?/workflows/:workflowId/:runId/query', - components: { - query: Query, - }, - props: { - query: ({ params }) => ({ - clusterName: params.clusterName, - }), - }, - }, - ], - }, - { - name: 'task-list', - path: '/domains/:domain/:clusterName?/task-lists/:taskList', - redirect: '/domains/:domain/:clusterName?/task-lists/:taskList/pollers', - component: TaskList, - props: ({ params }) => ({ - clusterName: params.clusterName, - domain: params.domain, - taskList: params.taskList, - }), - children: [ - { - name: 'task-list/pollers', - path: '/domains/:domain/:clusterName?/task-lists/:taskList/pollers', - components: { - pollers: TaskListPollers, - }, - }, - { - name: 'task-list/partition', - path: '/domains/:domain/:clusterName?/task-lists/:taskList/partition', - components: { - partition: TaskListPartition, - }, - }, - { - name: 'task-list/metrics', - path: '/domains/:domain/:clusterName?/task-lists/:taskList/metrics', - components: { - partition: TaskListMetrics, - }, - }, - ], - }, - - // redirects - - { - name: 'domains-redirect', - path: '/domain/*', - redirect: '/domains/*', - }, - { - name: 'domain-config-redirect', - path: '/domains/:domain/:clusterName?/config', - redirect: '/domains/:domain/:clusterName?/settings', - }, - { - path: '/domains/:domain/:clusterName?/history', - redirect: ({ params, query }) => { - if (!query.runId || !query.workflowId) { - return { - name: 'workflow-list', - params, - }; - } - - const { runId, workflowId, ...queryWhitelist } = query; - - const newParams = { - clusterName: params.clusterName, - runId, - workflowId, - domain: params.domain, - }; - - return { - name: 'workflow/history', - params: newParams, - query: queryWhitelist, - }; - }, - }, - ], - parseQuery: qs.parse.bind(qs), - stringifyQuery: query => { - const q = qs.stringify(query); - - return q ? `?${q}` : ''; - }, -}; - -const router = new Router(routeOpts); - -Object.getPrototypeOf(router).replaceQueryParam = function replaceQueryParam( - prop, - val -) { - const newQuery = { - ...this.currentRoute.query, - [prop]: val, - }; - - if (!newQuery[prop]) { - delete newQuery[prop]; - } - - this.replace({ query: newQuery }); -}; - -injectMomentDurationFormat(); - -JSON.tryParse = jsonTryParse; - -promiseFinally.shim(); - -Vue.use(Router); -Vue.use(infiniteScroll); -Vue.use(vueModal, { - dialog: true, - dynamic: true, -}); -Vue.use(vueSplit); -Vue.component('copy', copyButton); -Vue.directive('snapscroll', snapscroll); -Vue.config.ignoredElements = ['loader']; - -if (typeof mocha === 'undefined') { - if (!document.querySelector('main')) { - document.body.appendChild(document.createElement('main')); - } - - const store = initStore({ router }); - - // eslint-disable-next-line no-new - new Vue({ - el: 'main', - router, - store, - template: '', - components: { App }, - }); - - if (module.hot) { - module.hot.addStatusHandler(status => { - if (status === 'apply') { - document - .querySelectorAll('link[href][rel=stylesheet]') - .forEach(link => { - const nextStyleHref = link.href.replace( - /(\?\d+)?$/, - `?${Date.now()}` - ); - - // eslint-disable-next-line no-param-reassign - link.href = nextStyleHref; - }); - } - }); - } -} - -export default { - App, - routeOpts, -}; diff --git a/client/routes/domain-search/index.vue b/client/routes/domain-search/index.vue deleted file mode 100644 index 95b4d7230..000000000 --- a/client/routes/domain-search/index.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - - - diff --git a/client/routes/domain/domain-metrics.vue b/client/routes/domain/domain-metrics.vue deleted file mode 100644 index 459eef849..000000000 --- a/client/routes/domain/domain-metrics.vue +++ /dev/null @@ -1,31 +0,0 @@ - - - diff --git a/client/routes/domain/domain-service.js b/client/routes/domain/domain-service.js deleted file mode 100644 index 807b83141..000000000 --- a/client/routes/domain/domain-service.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { httpService } from '~services'; - -export default () => { - return { - getDomainSettings: domainName => { - return httpService.get(`/api/domains/${domainName}`); - }, - }; -}; diff --git a/client/routes/domain/domain-settings.vue b/client/routes/domain/domain-settings.vue deleted file mode 100644 index 9f7976f44..000000000 --- a/client/routes/domain/domain-settings.vue +++ /dev/null @@ -1,112 +0,0 @@ - - - - - diff --git a/client/routes/domain/index.vue b/client/routes/domain/index.vue deleted file mode 100644 index 2a1c86cc8..000000000 --- a/client/routes/domain/index.vue +++ /dev/null @@ -1,97 +0,0 @@ - - - - - diff --git a/client/routes/domain/workflow-archival/advanced.vue b/client/routes/domain/workflow-archival/advanced.vue deleted file mode 100644 index aa4e6d319..000000000 --- a/client/routes/domain/workflow-archival/advanced.vue +++ /dev/null @@ -1,232 +0,0 @@ - - - - - diff --git a/client/routes/domain/workflow-archival/basic.vue b/client/routes/domain/workflow-archival/basic.vue deleted file mode 100644 index 67d9fcf48..000000000 --- a/client/routes/domain/workflow-archival/basic.vue +++ /dev/null @@ -1,335 +0,0 @@ - - - - - diff --git a/client/routes/domain/workflow-archival/components/archival-disabled-messaging/constants.js b/client/routes/domain/workflow-archival/components/archival-disabled-messaging/constants.js deleted file mode 100644 index 4bb69e240..000000000 --- a/client/routes/domain/workflow-archival/components/archival-disabled-messaging/constants.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const archivalDisabledMessage = [ - 'This domain is currently not enabled for archival.', - 'To enable archival:', -]; - -export const historyArchivalDisabledMessage = - 'Set HistoryArchivalStatus to ENABLED by running command:'; - -export const historyArchivalEnableCommand = `cadence --do {domain} domain update --has enabled`; - -export const historyArchivalLinks = null; - -export const visibilityArchivalDisabledMessage = - 'Set VisibilityArchivalStatus to ENABLED by running command:'; - -export const visibilityArchivalEnableCommand = `cadence --do {domain} domain update --vas enabled`; diff --git a/client/routes/domain/workflow-archival/components/archival-disabled-messaging/index.vue b/client/routes/domain/workflow-archival/components/archival-disabled-messaging/index.vue deleted file mode 100644 index 6ca019509..000000000 --- a/client/routes/domain/workflow-archival/components/archival-disabled-messaging/index.vue +++ /dev/null @@ -1,123 +0,0 @@ - - - - - diff --git a/client/routes/domain/workflow-archival/components/archival-table-row.vue b/client/routes/domain/workflow-archival/components/archival-table-row.vue deleted file mode 100644 index 35a1b818d..000000000 --- a/client/routes/domain/workflow-archival/components/archival-table-row.vue +++ /dev/null @@ -1,71 +0,0 @@ - - - diff --git a/client/routes/domain/workflow-archival/components/archival-table.vue b/client/routes/domain/workflow-archival/components/archival-table.vue deleted file mode 100644 index 988158cb8..000000000 --- a/client/routes/domain/workflow-archival/components/archival-table.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - - - diff --git a/client/routes/domain/workflow-archival/components/index.js b/client/routes/domain/workflow-archival/components/index.js deleted file mode 100644 index 891219850..000000000 --- a/client/routes/domain/workflow-archival/components/index.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export { default as ArchivalDisabledMessaging } from './archival-disabled-messaging'; -export { default as ArchivalTable } from './archival-table'; -export { default as ArchivalTableRow } from './archival-table-row'; diff --git a/client/routes/domain/workflow-archival/constants.js b/client/routes/domain/workflow-archival/constants.js deleted file mode 100644 index a34eb68f6..000000000 --- a/client/routes/domain/workflow-archival/constants.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const ARCHIVAL_STATUS_LIST = [ - { value: '-1', label: 'Closed' }, - { value: '0', label: 'Completed' }, - { value: '1', label: 'Failed' }, - { value: '2', label: 'Cancelled' }, - { value: '3', label: 'Terminated' }, - { value: '4', label: 'Continued As New' }, - { value: '5', label: 'Timed Out' }, -]; - -export const DEFAULT_RANGE = 'last-24-hours'; - -export const LOADING_MESSAGE_DELAY = 3000; diff --git a/client/routes/domain/workflow-archival/helpers/get-domain.js b/client/routes/domain/workflow-archival/helpers/get-domain.js deleted file mode 100644 index 9114ca8f1..000000000 --- a/client/routes/domain/workflow-archival/helpers/get-domain.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import get from 'lodash-es/get'; - -export default domainSettings => get(domainSettings, 'domainInfo.name', ''); diff --git a/client/routes/domain/workflow-archival/helpers/get-domain.spec.js b/client/routes/domain/workflow-archival/helpers/get-domain.spec.js deleted file mode 100644 index a42adc3e1..000000000 --- a/client/routes/domain/workflow-archival/helpers/get-domain.spec.js +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getDomain from './get-domain'; - -describe('getDomain', () => { - describe('When domainSettings is not defined', () => { - it('should return "".', () => { - const domainSettings = undefined; - const output = getDomain(domainSettings); - - expect(output).toEqual(''); - }); - }); - - describe('When domainSettings.domainInfo.name = "DomainName"', () => { - it('should return "DomainName".', () => { - const domainSettings = { - domainInfo: { - name: 'DomainName', - }, - }; - const output = getDomain(domainSettings); - - expect(output).toEqual('DomainName'); - }); - }); -}); diff --git a/client/routes/domain/workflow-archival/helpers/get-history-archival-status.js b/client/routes/domain/workflow-archival/helpers/get-history-archival-status.js deleted file mode 100644 index 504f0a8b0..000000000 --- a/client/routes/domain/workflow-archival/helpers/get-history-archival-status.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import get from 'lodash-es/get'; - -export default domainSettings => - get(domainSettings, 'configuration.historyArchivalStatus', ''); diff --git a/client/routes/domain/workflow-archival/helpers/get-history-archival-status.spec.js b/client/routes/domain/workflow-archival/helpers/get-history-archival-status.spec.js deleted file mode 100644 index d80ec2bb6..000000000 --- a/client/routes/domain/workflow-archival/helpers/get-history-archival-status.spec.js +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getHistoryArchivalStatus from './get-history-archival-status'; - -describe('getHistoryArchivalStatus', () => { - describe('When domainSettings is not defined', () => { - it('should return "".', () => { - const domainSettings = undefined; - const output = getHistoryArchivalStatus(domainSettings); - - expect(output).toEqual(''); - }); - }); - - describe('When domainSettings.configuration.historyArchivalStatus = "ENABLED"', () => { - it('should return "ENABLED".', () => { - const domainSettings = { - configuration: { - historyArchivalStatus: 'ENABLED', - }, - }; - const output = getHistoryArchivalStatus(domainSettings); - - expect(output).toEqual('ENABLED'); - }); - }); -}); diff --git a/client/routes/domain/workflow-archival/helpers/get-query-params.js b/client/routes/domain/workflow-archival/helpers/get-query-params.js deleted file mode 100644 index b8aa20e22..000000000 --- a/client/routes/domain/workflow-archival/helpers/get-query-params.js +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export default ({ - endTime, - workflowName, - statusValue, - startTime, - workflowId, -}) => { - if (!startTime || !endTime) { - return null; - } - - const includeStatus = statusValue !== '-1'; - - return { - endTime, - startTime, - ...(includeStatus && { status: statusValue }), - ...(workflowId && { workflowId }), - ...(workflowName && { workflowName }), - }; -}; diff --git a/client/routes/domain/workflow-archival/helpers/get-query-params.spec.js b/client/routes/domain/workflow-archival/helpers/get-query-params.spec.js deleted file mode 100644 index cb0df685c..000000000 --- a/client/routes/domain/workflow-archival/helpers/get-query-params.spec.js +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getQueryParams from './get-query-params'; - -describe('getQueryParams', () => { - describe('When startTime = undefined and endTime = "2020-03-30T00:00:00Z"', () => { - it('should return null.', () => { - const startTime = undefined; - const endTime = '2020-03-30T00:00:00Z'; - const output = getQueryParams({ endTime, startTime }); - - expect(output).toEqual(null); - }); - }); - - describe('When startTime = "2020-03-01T00:00:00Z" and endTime = undefined', () => { - it('should return null.', () => { - const startTime = '2020-03-01T00:00:00Z'; - const endTime = undefined; - const output = getQueryParams({ endTime, startTime }); - - expect(output).toEqual(null); - }); - }); - - describe('When startTime = "2020-03-01T00:00:00Z" and endTime = "2020-03-30T00:00:00Z"', () => { - let startTime; - let endTime; - - beforeEach(() => { - startTime = '2020-03-01T00:00:00Z'; - endTime = '2020-03-30T00:00:00Z'; - }); - - it('should return startTime.', () => { - const output = getQueryParams({ endTime, startTime }); - - expect(output.startTime).toEqual(startTime); - }); - - it('should return endTime.', () => { - const output = getQueryParams({ endTime, startTime }); - - expect(output.endTime).toEqual(endTime); - }); - - describe('and statusValue = "-1"', () => { - it('should not include status.', () => { - const statusValue = '-1'; - const output = getQueryParams({ endTime, startTime, statusValue }); - - expect(output.status).toEqual(undefined); - }); - }); - - describe('and statusValue = "0"', () => { - it('should return status = "0".', () => { - const statusValue = '0'; - const output = getQueryParams({ endTime, startTime, statusValue }); - - expect(output.status).toEqual('0'); - }); - }); - - describe('and workflowId = "abcd"', () => { - it('should return workflowId = "abcd".', () => { - const workflowId = 'abcd'; - const output = getQueryParams({ endTime, startTime, workflowId }); - - expect(output.workflowId).toEqual('abcd'); - }); - }); - - describe('and workflowName = "workflow.name"', () => { - it('should return workflowName = "workflow.name".', () => { - const workflowName = 'workflow.name'; - const output = getQueryParams({ endTime, startTime, workflowName }); - - expect(output.workflowName).toEqual('workflow.name'); - }); - }); - }); -}); diff --git a/client/routes/domain/workflow-archival/helpers/get-query-params.spec.js b/client/routes/domain/workflow-archival/helpers/get-query-params.spec.js deleted file mode 100644 index acf786a8f..000000000 --- a/client/routes/domain/workflow-archival/helpers/get-query-params.spec.js +++ /dev/null @@ -1,81 +0,0 @@ -import getQueryParams from './get-query-params'; - -describe('getQueryParams', () => { - describe('When startTime = undefined and endTime = "2020-03-30T00:00:00Z"', () => { - it('should return null.', () => { - const startTime = undefined; - const endTime = '2020-03-30T00:00:00Z'; - const output = getQueryParams({ endTime, startTime }); - - expect(output).toEqual(null); - }); - }); - - describe('When startTime = "2020-03-01T00:00:00Z" and endTime = undefined', () => { - it('should return null.', () => { - const startTime = '2020-03-01T00:00:00Z'; - const endTime = undefined; - const output = getQueryParams({ endTime, startTime }); - - expect(output).toEqual(null); - }); - }); - - describe('When startTime = "2020-03-01T00:00:00Z" and endTime = "2020-03-30T00:00:00Z"', () => { - let startTime; - let endTime; - - beforeEach(() => { - startTime = '2020-03-01T00:00:00Z'; - endTime = '2020-03-30T00:00:00Z'; - }); - - it('should return startTime.', () => { - const output = getQueryParams({ endTime, startTime }); - - expect(output.startTime).toEqual(startTime); - }); - - it('should return endTime.', () => { - const output = getQueryParams({ endTime, startTime }); - - expect(output.endTime).toEqual(endTime); - }); - - describe('and statusValue = "-1"', () => { - it('should not include status.', () => { - const statusValue = '-1'; - const output = getQueryParams({ endTime, startTime, statusValue }); - - expect(output.status).toEqual(undefined); - }); - }); - - describe('and statusValue = "0"', () => { - it('should return status = "0".', () => { - const statusValue = '0'; - const output = getQueryParams({ endTime, startTime, statusValue }); - - expect(output.status).toEqual('0'); - }); - }); - - describe('and workflowId = "abcd"', () => { - it('should return workflowId = "abcd".', () => { - const workflowId = 'abcd'; - const output = getQueryParams({ endTime, startTime, workflowId }); - - expect(output.workflowId).toEqual('abcd'); - }); - }); - - describe('and workflowName = "workflow.name"', () => { - it('should return workflowName = "workflow.name".', () => { - const workflowName = 'workflow.name'; - const output = getQueryParams({ endTime, startTime, workflowName }); - - expect(output.workflowName).toEqual('workflow.name'); - }); - }); - }); -}); diff --git a/client/routes/domain/workflow-archival/helpers/get-range.js b/client/routes/domain/workflow-archival/helpers/get-range.js deleted file mode 100644 index 261a903a4..000000000 --- a/client/routes/domain/workflow-archival/helpers/get-range.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; -import { DEFAULT_RANGE } from '../constants'; - -export default ({ endTime, range = DEFAULT_RANGE, startTime } = {}) => - startTime && endTime - ? { - endTime: moment(endTime), - startTime: moment(startTime), - } - : range; diff --git a/client/routes/domain/workflow-archival/helpers/get-range.spec.js b/client/routes/domain/workflow-archival/helpers/get-range.spec.js deleted file mode 100644 index 7d708783e..000000000 --- a/client/routes/domain/workflow-archival/helpers/get-range.spec.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import moment from 'moment'; -import getRange from './get-range'; - -describe('getRange', () => { - describe('When nothing is passed', () => { - it('should return "last-24-hours".', () => { - const output = getRange(); - - expect(output).toEqual('last-24-hours'); - }); - }); - - describe('When range = "last-10-days"', () => { - it('should return "last-10-days".', () => { - const range = 'last-10-days'; - const output = getRange({ range }); - - expect(output).toEqual('last-10-days'); - }); - }); - - describe('When startTime = "2020-03-01T00:00:00Z" and endTime = "2020-03-30T00:00:00Z"', () => { - let startTime; - let endTime; - - beforeEach(() => { - startTime = '2020-03-01T00:00:00Z'; - endTime = '2020-03-30T00:00:00Z'; - }); - - it('should return startTime = moment("2020-03-01T00:00:00Z").', () => { - const output = getRange({ endTime, startTime }); - - expect(output.startTime).toEqual(moment('2020-03-01T00:00:00Z')); - }); - - it('should return endTime = moment("2020-03-30T00:00:00Z").', () => { - const output = getRange({ endTime, startTime }); - - expect(output.endTime).toEqual(moment('2020-03-30T00:00:00Z')); - }); - }); -}); diff --git a/client/routes/domain/workflow-archival/helpers/get-status-value.js b/client/routes/domain/workflow-archival/helpers/get-status-value.js deleted file mode 100644 index 4c73ef33a..000000000 --- a/client/routes/domain/workflow-archival/helpers/get-status-value.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export default ({ status, statusList }) => - status ? status.value : statusList[0].value; diff --git a/client/routes/domain/workflow-archival/helpers/get-status-value.spec.js b/client/routes/domain/workflow-archival/helpers/get-status-value.spec.js deleted file mode 100644 index ece3567df..000000000 --- a/client/routes/domain/workflow-archival/helpers/get-status-value.spec.js +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getStatusValue from './get-status-value'; - -describe('getStatusValue', () => { - describe('When status = { value: 5 }', () => { - it('should return 5.', () => { - const status = { value: 5 }; - const output = getStatusValue({ status }); - - expect(output).toEqual(5); - }); - }); - - describe('When statusList = [{ value: "CLOSED" }]', () => { - it('should return "CLOSED".', () => { - const statusList = [{ value: 'CLOSED' }]; - const output = getStatusValue({ statusList }); - - expect(output).toEqual('CLOSED'); - }); - }); -}); diff --git a/client/routes/domain/workflow-archival/helpers/get-status.js b/client/routes/domain/workflow-archival/helpers/get-status.js deleted file mode 100644 index 9a5340b3c..000000000 --- a/client/routes/domain/workflow-archival/helpers/get-status.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export default ({ statusList, statusValue }) => { - if (statusValue === undefined) { - return statusList[0]; - } - - const parsedStatusValue = String(statusValue); - - return statusList.find(({ value }) => value === parsedStatusValue); -}; diff --git a/client/routes/domain/workflow-archival/helpers/get-status.spec.js b/client/routes/domain/workflow-archival/helpers/get-status.spec.js deleted file mode 100644 index 8f90aad55..000000000 --- a/client/routes/domain/workflow-archival/helpers/get-status.spec.js +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getStatus from './get-status'; - -describe('getStatus', () => { - describe('When statusList = [{ value: "-1" }, { value: "0" }]', () => { - const statusList = [{ value: '-1' }, { value: '0' }]; - - describe('and statusValue = undefined', () => { - it('should return value = "-1" }.', () => { - const statusValue = undefined; - const output = getStatus({ statusList, statusValue }); - - expect(output.value).toEqual('-1'); - }); - }); - - describe('and statusValue = "0"', () => { - it('should return value = "0" }.', () => { - const statusValue = '0'; - const output = getStatus({ statusList, statusValue }); - - expect(output.value).toEqual('0'); - }); - }); - }); -}); diff --git a/client/routes/domain/workflow-archival/helpers/get-visibility-archival-status.js b/client/routes/domain/workflow-archival/helpers/get-visibility-archival-status.js deleted file mode 100644 index baf77c780..000000000 --- a/client/routes/domain/workflow-archival/helpers/get-visibility-archival-status.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import get from 'lodash-es/get'; - -export default domainSettings => - get(domainSettings, 'configuration.visibilityArchivalStatus', ''); diff --git a/client/routes/domain/workflow-archival/helpers/get-visibility-archival-status.spec.js b/client/routes/domain/workflow-archival/helpers/get-visibility-archival-status.spec.js deleted file mode 100644 index 03c88c059..000000000 --- a/client/routes/domain/workflow-archival/helpers/get-visibility-archival-status.spec.js +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getVisibilityArchivalStatus from './get-visibility-archival-status'; - -describe('getVisibilityArchivalStatus', () => { - describe('When domainSettings is not defined', () => { - it('should return "".', () => { - const domainSettings = undefined; - const output = getVisibilityArchivalStatus(domainSettings); - - expect(output).toEqual(''); - }); - }); - - describe('When domainSettings.configuration.visibilityArchivalStatus = "ENABLED"', () => { - it('should return "ENABLED".', () => { - const domainSettings = { - configuration: { - visibilityArchivalStatus: 'ENABLED', - }, - }; - const output = getVisibilityArchivalStatus(domainSettings); - - expect(output).toEqual('ENABLED'); - }); - }); -}); diff --git a/client/routes/domain/workflow-archival/helpers/index.js b/client/routes/domain/workflow-archival/helpers/index.js deleted file mode 100644 index 53b1dd805..000000000 --- a/client/routes/domain/workflow-archival/helpers/index.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export { default as getDomain } from './get-domain'; -export { default as getHistoryArchivalStatus } from './get-history-archival-status'; -export { default as getQueryParams } from './get-query-params'; -export { default as getRange } from './get-range'; -export { default as getStatus } from './get-status'; -export { default as getStatusValue } from './get-status-value'; -export { default as getVisibilityArchivalStatus } from './get-visibility-archival-status'; -export { default as isArchivalEnabled } from './is-archival-enabled'; -export { default as isHistoryArchivalEnabled } from './is-history-archival-enabled'; -export { default as isVisibilityArchivalEnabled } from './is-visibility-archival-enabled'; -export { default as mapArchivedWorkflowResponse } from './map-archived-workflow-response'; -export { default as replaceDomain } from './replace-domain'; -export { default as updateQueryFromRange } from './update-query-from-range'; diff --git a/client/routes/domain/workflow-archival/helpers/is-archival-enabled.js b/client/routes/domain/workflow-archival/helpers/is-archival-enabled.js deleted file mode 100644 index 1c6866c0f..000000000 --- a/client/routes/domain/workflow-archival/helpers/is-archival-enabled.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import isHistoryArchivalEnabled from './is-history-archival-enabled'; -import isVisibilityArchivalEnabled from './is-visibility-archival-enabled'; - -export default domainSettings => - isHistoryArchivalEnabled(domainSettings) && - isVisibilityArchivalEnabled(domainSettings); diff --git a/client/routes/domain/workflow-archival/helpers/is-archival-enabled.spec.js b/client/routes/domain/workflow-archival/helpers/is-archival-enabled.spec.js deleted file mode 100644 index cc2ad3687..000000000 --- a/client/routes/domain/workflow-archival/helpers/is-archival-enabled.spec.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import isArchivalEnabled from './is-archival-enabled'; - -describe('isArchivalEnabled', () => { - describe('When historyArchivalStatus = "DISABLED" and visibilityArchivalStatus = "DISABLED"', () => { - it('should return false.', () => { - const domainSettings = { - configuration: { - historyArchivalStatus: 'DISABLED', - visibilityArchivalStatus: 'DISABLED', - }, - }; - const output = isArchivalEnabled(domainSettings); - - expect(output).toEqual(false); - }); - }); - - describe('When historyArchivalStatus = "ENABLED" and visibilityArchivalStatus = "DISABLED"', () => { - it('should return false.', () => { - const domainSettings = { - configuration: { - historyArchivalStatus: 'ENABLED', - visibilityArchivalStatus: 'DISABLED', - }, - }; - const output = isArchivalEnabled(domainSettings); - - expect(output).toEqual(false); - }); - }); - - describe('When historyArchivalStatus = "DISABLED" and visibilityArchivalStatus = "ENABLED"', () => { - it('should return false.', () => { - const domainSettings = { - configuration: { - historyArchivalStatus: 'DISABLED', - visibilityArchivalStatus: 'ENABLED', - }, - }; - const output = isArchivalEnabled(domainSettings); - - expect(output).toEqual(false); - }); - }); - - describe('When historyArchivalStatus = "ENABLED" and visibilityArchivalStatus = "ENABLED"', () => { - it('should return true.', () => { - const domainSettings = { - configuration: { - historyArchivalStatus: 'ENABLED', - visibilityArchivalStatus: 'ENABLED', - }, - }; - const output = isArchivalEnabled(domainSettings); - - expect(output).toEqual(true); - }); - }); -}); diff --git a/client/routes/domain/workflow-archival/helpers/is-history-archival-enabled.js b/client/routes/domain/workflow-archival/helpers/is-history-archival-enabled.js deleted file mode 100644 index 70fb2062a..000000000 --- a/client/routes/domain/workflow-archival/helpers/is-history-archival-enabled.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getHistoryArchivalStatus from './get-history-archival-status'; - -export default domainSettings => - getHistoryArchivalStatus(domainSettings) === 'ENABLED'; diff --git a/client/routes/domain/workflow-archival/helpers/is-history-archival-enabled.spec.js b/client/routes/domain/workflow-archival/helpers/is-history-archival-enabled.spec.js deleted file mode 100644 index 3d122478d..000000000 --- a/client/routes/domain/workflow-archival/helpers/is-history-archival-enabled.spec.js +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import isHistoryArchivalEnabled from './is-history-archival-enabled'; - -describe('isHistoryArchivalEnabled', () => { - describe('When domainSettings is not defined', () => { - it('should return false.', () => { - const domainSettings = undefined; - const output = isHistoryArchivalEnabled(domainSettings); - - expect(output).toEqual(false); - }); - }); - - describe('When domainSettings.configuration.historyArchivalStatus = "DISABLED"', () => { - it('should return false.', () => { - const domainSettings = { - configuration: { - historyArchivalStatus: 'DISABLED', - }, - }; - const output = isHistoryArchivalEnabled(domainSettings); - - expect(output).toEqual(false); - }); - }); - - describe('When domainSettings.configuration.historyArchivalStatus = "ENABLED"', () => { - it('should return true.', () => { - const domainSettings = { - configuration: { - historyArchivalStatus: 'ENABLED', - }, - }; - const output = isHistoryArchivalEnabled(domainSettings); - - expect(output).toEqual(true); - }); - }); -}); diff --git a/client/routes/domain/workflow-archival/helpers/is-visibility-archival-enabled.js b/client/routes/domain/workflow-archival/helpers/is-visibility-archival-enabled.js deleted file mode 100644 index ba451645e..000000000 --- a/client/routes/domain/workflow-archival/helpers/is-visibility-archival-enabled.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getVisibilityArchivalStatus from './get-visibility-archival-status'; - -export default domainSettings => - getVisibilityArchivalStatus(domainSettings) === 'ENABLED'; diff --git a/client/routes/domain/workflow-archival/helpers/is-visibility-archival-enabled.spec.js b/client/routes/domain/workflow-archival/helpers/is-visibility-archival-enabled.spec.js deleted file mode 100644 index 0cd4daffd..000000000 --- a/client/routes/domain/workflow-archival/helpers/is-visibility-archival-enabled.spec.js +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import isVisibilityArchivalEnabled from './is-visibility-archival-enabled'; - -describe('isVisibilityArchivalEnabled', () => { - describe('When domainSettings is not defined', () => { - it('should return false.', () => { - const domainSettings = undefined; - const output = isVisibilityArchivalEnabled(domainSettings); - - expect(output).toEqual(false); - }); - }); - - describe('When domainSettings.configuration.visibilityArchivalStatus = "DISABLED"', () => { - it('should return false.', () => { - const domainSettings = { - configuration: { - visibilityArchivalStatus: 'DISABLED', - }, - }; - const output = isVisibilityArchivalEnabled(domainSettings); - - expect(output).toEqual(false); - }); - }); - - describe('When domainSettings.configuration.visibilityArchivalStatus = "ENABLED"', () => { - it('should return true.', () => { - const domainSettings = { - configuration: { - visibilityArchivalStatus: 'ENABLED', - }, - }; - const output = isVisibilityArchivalEnabled(domainSettings); - - expect(output).toEqual(true); - }); - }); -}); diff --git a/client/routes/domain/workflow-archival/helpers/map-archived-workflow-response.js b/client/routes/domain/workflow-archival/helpers/map-archived-workflow-response.js deleted file mode 100644 index 7231de327..000000000 --- a/client/routes/domain/workflow-archival/helpers/map-archived-workflow-response.js +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { getDatetimeFormattedString } from '~helpers'; - -export default ({ dateFormat, results, timeFormat, timezone }) => - !results - ? [] - : results.map( - ({ - closeStatus, - closeTime, - domainName, - execution: { runId, workflowId }, - startTime, - type: { name }, - }) => ({ - closeStatus, - closeTime: getDatetimeFormattedString({ - date: closeTime, - dateFormat, - timeFormat, - timezone, - }), - domainName, - runId, - startTime: getDatetimeFormattedString({ - date: startTime, - dateFormat, - timeFormat, - timezone, - }), - workflowId, - workflowName: name, - }) - ); diff --git a/client/routes/domain/workflow-archival/helpers/map-archived-workflow-response.spec.js b/client/routes/domain/workflow-archival/helpers/map-archived-workflow-response.spec.js deleted file mode 100644 index 3ed469541..000000000 --- a/client/routes/domain/workflow-archival/helpers/map-archived-workflow-response.spec.js +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import mapArchivedWorkflowResponse from './map-archived-workflow-response'; - -describe('mapArchivedWorkflowResponse', () => { - it('should return a flattened results array when passed executions with 1 item', () => { - const results = [ - { - closeStatus: 'closeStatusValue', - closeTime: '2020-03-30T00:00:00Z', - execution: { - runId: 'runIdValue', - workflowId: 'workflowIdValue', - }, - startTime: '2020-03-01T00:00:00Z', - type: { - name: 'workflowNameValue', - }, - }, - ]; - const output = mapArchivedWorkflowResponse({ results }); - - expect(output[0].closeStatus).toEqual('closeStatusValue'); - expect(output[0].closeTime).toEqual('Mar 30, 2020 12:00:00 AM'); - expect(output[0].runId).toEqual('runIdValue'); - expect(output[0].startTime).toEqual('Mar 1, 2020 12:00:00 AM'); - expect(output[0].workflowId).toEqual('workflowIdValue'); - expect(output[0].workflowName).toEqual('workflowNameValue'); - }); -}); diff --git a/client/routes/domain/workflow-archival/helpers/replace-domain.js b/client/routes/domain/workflow-archival/helpers/replace-domain.js deleted file mode 100644 index 80f732e51..000000000 --- a/client/routes/domain/workflow-archival/helpers/replace-domain.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import getDomain from './get-domain'; - -export default (message, domainSettings) => - message.replace(/\{domain\}/, getDomain(domainSettings)); diff --git a/client/routes/domain/workflow-archival/helpers/replace-domain.spec.js b/client/routes/domain/workflow-archival/helpers/replace-domain.spec.js deleted file mode 100644 index 6ec381158..000000000 --- a/client/routes/domain/workflow-archival/helpers/replace-domain.spec.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import replaceDomain from './replace-domain'; - -describe('replaceDomain', () => { - describe('When message = "message containing {domain}" and domainSettings.domainInfo.name = "DomainName"', () => { - it('should return "message containing DomainName".', () => { - const message = 'message containing {domain}'; - const domainSettings = { - domainInfo: { - name: 'DomainName', - }, - }; - - const output = replaceDomain(message, domainSettings); - - expect(output).toEqual('message containing DomainName'); - }); - }); -}); diff --git a/client/routes/domain/workflow-archival/helpers/update-query-from-range.js b/client/routes/domain/workflow-archival/helpers/update-query-from-range.js deleted file mode 100644 index 7073a7e77..000000000 --- a/client/routes/domain/workflow-archival/helpers/update-query-from-range.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export default ({ - query: { endTime, startTime, range, ...query } = {}, - updatedRange, -}) => { - if (typeof updatedRange === 'string') { - query.range = updatedRange; - } else if ( - typeof updatedRange === 'object' && - updatedRange.endTime && - updatedRange.startTime - ) { - query.endTime = updatedRange.endTime.toISOString(); - query.startTime = updatedRange.startTime.toISOString(); - } - - return query; -}; diff --git a/client/routes/domain/workflow-archival/helpers/update-query-from-range.spec.js b/client/routes/domain/workflow-archival/helpers/update-query-from-range.spec.js deleted file mode 100644 index b0bff3eed..000000000 --- a/client/routes/domain/workflow-archival/helpers/update-query-from-range.spec.js +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import updateQueryFromRange from './update-query-from-range'; - -describe('updateQueryFromRange', () => { - describe('When updatedRange = "last-30-days"', () => { - it('should return range = "last-30-days".', () => { - const updatedRange = 'last-30-days'; - const output = updateQueryFromRange({ updatedRange }); - - expect(output.range).toEqual('last-30-days'); - }); - }); - - describe('When updatedRange = { endTime: Date("2020-03-30T00:00:00.000Z"), startTime: Date("2020-03-01T00:00:00.000Z") }', () => { - const updatedRange = { - endTime: new Date('2020-03-30T00:00:00.000Z'), - startTime: new Date('2020-03-01T00:00:00.000Z'), - }; - - it('should return endTime = "2020-03-30T00:00:00.000Z".', () => { - const output = updateQueryFromRange({ updatedRange }); - - expect(output.endTime).toEqual('2020-03-30T00:00:00.000Z'); - }); - - it('should return startTime = "2020-03-01T00:00:00.000Z".', () => { - const output = updateQueryFromRange({ updatedRange }); - - expect(output.startTime).toEqual('2020-03-01T00:00:00.000Z'); - }); - }); -}); diff --git a/client/routes/domain/workflow-archival/index.vue b/client/routes/domain/workflow-archival/index.vue deleted file mode 100644 index cc72f3a90..000000000 --- a/client/routes/domain/workflow-archival/index.vue +++ /dev/null @@ -1,87 +0,0 @@ - - - - - diff --git a/client/routes/domain/workflow-archival/workflow-archival-service.js b/client/routes/domain/workflow-archival/workflow-archival-service.js deleted file mode 100644 index 3d207dc19..000000000 --- a/client/routes/domain/workflow-archival/workflow-archival-service.js +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import { httpService } from '~services'; - -export default ({ domain }) => { - const requests = { - fetchArchivalRecords: null, - }; - - return { - fetchArchivalRecords: async query => { - if (requests.fetchArchivalRecords) { - requests.fetchArchivalRecords.abort(); - } - - const controller = new window.AbortController(); - const { signal } = controller; - - requests.fetchArchivalRecords = controller; - - const { executions: results, nextPageToken } = await httpService.get( - `/api/domains/${domain}/workflows/archived`, - { - query, - signal, - } - ); - - requests.fetchArchivalRecords = null; - - return { results, nextPageToken }; - }, - }; -}; diff --git a/client/routes/domain/workflow-archival/workflow-archival-service.spec.js b/client/routes/domain/workflow-archival/workflow-archival-service.spec.js deleted file mode 100644 index 693fbb6f7..000000000 --- a/client/routes/domain/workflow-archival/workflow-archival-service.spec.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import WorkflowArchivalService from './workflow-archival-service'; - -describe('WorkflowArchivalService', () => { - it('should make an API request when fetchArchivalRecords is called', async () => { - const workflowArchivalService = WorkflowArchivalService({ - domain: 'samples-domain', - }); - - fetch.mockResponseOnce( - JSON.stringify({ - executions: [ - { - closeStatus: 'closeStatusValue', - closeTime: '2020-03-30T00:00:00Z', - execution: { - runId: 'runIdValue', - workflowId: 'workflowIdValue', - }, - startTime: '2020-03-01T00:00:00Z', - type: { - name: 'workflowNameValue', - }, - }, - ], - nextPageToken: 'nextPageTokenValue', - }) - ); - const output = await workflowArchivalService.fetchArchivalRecords({ - query: 'queryString', - }); - - expect(output).toEqual({ - nextPageToken: 'nextPageTokenValue', - results: [ - { - closeStatus: 'closeStatusValue', - closeTime: '2020-03-30T00:00:00Z', - execution: { - runId: 'runIdValue', - workflowId: 'workflowIdValue', - }, - startTime: '2020-03-01T00:00:00Z', - type: { - name: 'workflowNameValue', - }, - }, - ], - }); - }); -}); diff --git a/client/routes/help/constants.js b/client/routes/help/constants.js deleted file mode 100644 index 75166e51a..000000000 --- a/client/routes/help/constants.js +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) 2017-2024 Uber Technologies Inc. -// -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export const cliCommands = [ - { - header: 'Domain commands', - commands: [ - { - id: 'cli-command-domain-register', - label: 'Register a domain (local only)', - value: - 'cadence --domain {domain-name} domain register --global_domain false', - }, - { - id: 'cli-command-domain-describe', - label: 'List domain settings', - value: - 'cadence --env {staging|prod|prod02} --domain {domain-name} domain describe', - }, - { - id: 'cli-command-domain-update-cluster', - label: - 'Update domain active cluster (Make sure the domain_data has UberIgnoringLisa:true)', - value: - 'cadence --env {staging|prod|prod02} --domain {domain-name} domain update -active_cluster {cluster-name}', - }, - { - id: 'cli-command-domain-update-bad-binary', - label: 'Update domain bad binary', - value: - 'cadence --env {staging|prod|prod02} --domain {domain-name} domain update --add_bad_binary {bad-binary-SHA} --reason \'"{reason}"\'', - }, - ], - }, - { - header: 'workflow commands', - commands: [ - { - id: 'cli-command-workflow-run', - label: 'Run a workflow', - value: - 'cadence --env {staging|prod|prod02} --domain {domain-name} workflow run --tl {task-list-name} --wt {workflow-type-name} --et 60 -i \'"{input-string}"\'', - }, - { - id: 'cli-command-workflow-describe', - label: 'See workflow settings', - value: - 'cadence --env {staging|prod|prod02} --domain {domain-name} workflow describe -w {workflow-id} -r {run-id}', - }, - { - id: 'cli-command-workflow-show', - label: 'See workflow history', - value: - 'cadence --env {staging|prod|prod02} --domain {domain-name} workflow show -w {workflow-id} -r {run-id}', - }, - { - id: 'cli-command-workflow-signal', - label: 'Signal a workflow', - value: - 'cadence --env {staging|prod|prod02} --domain {domain-name} workflow signal -w {workflow-id} -r {run-id} --name {signal-name} --input \'"{signal-payload}"\'', - }, - - { - description: [ - 'Where event_id is the event to reset from', - 'and reset_type can be FirstDecisionTaskCompleted, LastDecisionTaskCompleted, LastContinueAsNew, BadBinary', - ], - id: 'cli-command-workflow-reset', - label: 'Reset a workflow', - value: - 'cadence workflow reset -w {workflow-id} -r {run-id} --event_id {event-id} --reason \'"{reason}"\' --reset_type {reset-type} --reset_bad_binary_checksum {bad-binary-SHA}', - }, - { - description: [ - 'Where query can be any query that returns a list of workflows', - 'and reset_type can be FirstDecisionTaskCompleted, LastDecisionTaskCompleted, LastContinueAsNew, BadBinary', - ], - id: 'cli-command-workflow-reset-batch', - label: 'Reset a batch of workflows', - value: - 'cadence workflow reset-batch --query \'"{query}"\' --only_non_deterministic --reason \'"{reason}"\' --reset_type {reset-type}', - }, - { - id: 'cli-command-workflow-list', - label: 'List closed workflows', - value: - 'cadence --env {staging|prod|prod02} --domain {domain-name} workflow {list|listall}', - }, - { - id: 'cli-command-workflow-list-open', - label: 'List open workflows', - value: - 'cadence --env {staging|prod|prod02} --domain {domain-name} workflow {list|listall} --open', - }, - { - id: 'cli-command-workflow-query', - label: 'Query for a workflow', - value: - 'cadence workflow {list|listall} --query \'(CustomKeywordField = "keyword1" and CustomIntField >= 5) or CustomKeywordField = "keyword2" and CloseTime = missing\'', - }, - ], - }, -]; diff --git a/client/routes/help/index.vue b/client/routes/help/index.vue deleted file mode 100644 index 988055bd6..000000000 --- a/client/routes/help/index.vue +++ /dev/null @@ -1,295 +0,0 @@ - - -