@spinnaker/core 0.14.0 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/config/settings.d.ts +1 -1
  3. package/dist/core.module.d.ts +1 -1
  4. package/dist/index.js +89 -47
  5. package/dist/index.js.map +1 -1
  6. package/dist/instance/instanceType.service.d.ts +3 -2
  7. package/dist/managed/artifactActions/ArtifactActions.d.ts +24 -0
  8. package/dist/managed/constraints/registry.d.ts +13 -2
  9. package/dist/managed/environmentBaseElements/EnvironmentItem.d.ts +3 -2
  10. package/dist/managed/graphql/graphql-sdk.d.ts +123 -11
  11. package/dist/managed/overview/Resource.d.ts +5 -2
  12. package/dist/managed/overview/artifact/Artifact.d.ts +2 -1
  13. package/dist/managed/overview/artifact/ArtifactActionModal.d.ts +20 -9
  14. package/dist/managed/overview/artifact/ArtifactCollapsibleSection.d.ts +7 -0
  15. package/dist/managed/overview/artifact/ArtifactVersions.d.ts +9 -0
  16. package/dist/managed/overview/artifact/CurrentVersion.d.ts +7 -6
  17. package/dist/managed/overview/artifact/VersionTitle.d.ts +9 -0
  18. package/dist/managed/overview/artifact/hooks.d.ts +6 -11
  19. package/dist/managed/overview/artifact/useCreateRollbackActions.hook.d.ts +3 -0
  20. package/dist/managed/overview/artifact/utils.d.ts +15 -14
  21. package/dist/managed/overview/useIsUpdatingResources.hook.d.ts +1 -0
  22. package/dist/managed/resources/ResourceTitle.d.ts +3 -3
  23. package/dist/managed/resources/resourceRegistry.d.ts +1 -1
  24. package/dist/managed/utils/ActionModal.d.ts +1 -0
  25. package/dist/managed/utils/defaults.d.ts +1 -0
  26. package/dist/managed/versionMetadata/MetadataComponents.d.ts +18 -19
  27. package/dist/managed/versionMetadata/VersionMetadata.d.ts +6 -2
  28. package/dist/search/infrastructure/infrastructureSearch.service.d.ts +2 -1
  29. package/dist/securityGroup/index.d.ts +2 -1
  30. package/package.json +7 -7
  31. package/src/account/AccountSelectInput.spec.tsx +9 -4
  32. package/src/account/AccountService.spec.ts +6 -6
  33. package/src/api/ApiService.spec.ts +2 -2
  34. package/src/api/ApiServiceDeprecated.spec.ts +5 -2
  35. package/src/application/application.model.spec.ts +78 -79
  36. package/src/application/config/applicationAttributes.directive.html +6 -2
  37. package/src/application/config/applicationAttributes.directive.js +4 -0
  38. package/src/application/config/applicationConfig.view.html +14 -1
  39. package/src/application/config/customBanner/CustomBannerConfig.spec.tsx +3 -3
  40. package/src/application/config/dataSources/applicationDataSourceEditor.component.spec.ts +4 -3
  41. package/src/application/config/footer/configSectionFooter.component.spec.ts +2 -1
  42. package/src/application/listExtractor/AppListExtractor.spec.ts +4 -4
  43. package/src/application/modal/PermissionsConfigurer.spec.tsx +3 -2
  44. package/src/application/modal/editApplication.controller.modal.js +1 -0
  45. package/src/application/modal/editApplication.html +2 -2
  46. package/src/application/modal/validation/ApplicationNameValidator.spec.ts +2 -1
  47. package/src/application/modal/validation/validateApplicationName.directive.spec.ts +3 -2
  48. package/src/application/nav/ApplicationNavigation.spec.tsx +12 -11
  49. package/src/application/nav/NavItem.spec.tsx +7 -5
  50. package/src/application/nav/NavSection.spec.tsx +3 -2
  51. package/src/application/service/ApplicationReader.spec.ts +13 -8
  52. package/src/application/service/ApplicationWriter.spec.ts +4 -2
  53. package/src/application/service/InferredApplicationWarningService.spec.ts +2 -3
  54. package/src/artifact/expectedArtifact.service.spec.ts +2 -1
  55. package/src/artifact/react/ExpectedArtifactSelector.spec.tsx +2 -3
  56. package/src/authentication/AuthenticationInitializer.spec.ts +2 -1
  57. package/src/authentication/AuthenticationService.spec.ts +2 -1
  58. package/src/authentication/authentication.interceptor.spec.ts +4 -2
  59. package/src/cache/cacheInitializer.service.spec.ts +7 -4
  60. package/src/cache/infrastructureCaches.spec.ts +4 -4
  61. package/src/chaosMonkey/chaosMonkeyExceptions.component.spec.ts +4 -2
  62. package/src/cloudProvider/providerSelection/ProviderSelectionService.spec.ts +23 -21
  63. package/src/cluster/ClusterRuleMatcher.spec.ts +2 -1
  64. package/src/cluster/cluster.service.spec.ts +7 -7
  65. package/src/cluster/filter/ClusterFilterService.spec.ts +15 -14
  66. package/src/cluster/filter/LabelFilter.spec.tsx +3 -3
  67. package/src/cluster/filter/MultiselectModel.spec.ts +2 -2
  68. package/src/cluster/filter/labelFilterUtils.spec.ts +3 -7
  69. package/src/config/settings.ts +1 -3
  70. package/src/core.module.ts +1 -1
  71. package/src/filterModel/dependentFilter/DependentFilterService.spec.ts +1 -1
  72. package/src/function/filter/FunctionFilterService.spec.ts +5 -3
  73. package/src/function/function.read.service.spec.ts +4 -3
  74. package/src/header/customBanner/CustomBanner.spec.tsx +3 -4
  75. package/src/healthCounts/HealthCounts.spec.tsx +2 -2
  76. package/src/history/recentHistory.service.spec.ts +2 -1
  77. package/src/insight/InsightMenu.spec.tsx +9 -6
  78. package/src/instance/instance.write.service.spec.ts +8 -7
  79. package/src/instance/instanceType.service.ts +12 -2
  80. package/src/instance/instanceTypeService.spec.ts +2 -1
  81. package/src/loadBalancer/LoadBalancersTag.spec.tsx +8 -6
  82. package/src/loadBalancer/filter/LoadBalancerFilterService.spec.ts +2 -2
  83. package/src/managed/Environments.less +4 -4
  84. package/src/managed/Environments.tsx +1 -1
  85. package/src/managed/RelativeTimestamp.tsx +8 -6
  86. package/src/managed/artifactActions/ArtifactActions.tsx +77 -0
  87. package/src/managed/constraints/AllowedTimes.spec.ts +2 -1
  88. package/src/managed/constraints/registry.tsx +27 -1
  89. package/src/managed/environmentBaseElements/BaseEnvironment.less +3 -3
  90. package/src/managed/environmentBaseElements/EnvironmentItem.tsx +11 -4
  91. package/src/managed/graphql/graphql-sdk.ts +218 -29
  92. package/src/managed/graphql/schema.graphql +14 -1
  93. package/src/managed/overview/EnvironmentOverview.tsx +12 -15
  94. package/src/managed/overview/EnvironmentsOverview.less +6 -5
  95. package/src/managed/overview/PreviewEnvironments.tsx +0 -3
  96. package/src/managed/overview/Resource.less +1 -1
  97. package/src/managed/overview/Resource.tsx +62 -47
  98. package/src/managed/overview/artifact/Artifact.less +27 -52
  99. package/src/managed/overview/artifact/Artifact.tsx +86 -22
  100. package/src/managed/overview/artifact/ArtifactActionModal.less +19 -0
  101. package/src/managed/overview/artifact/ArtifactActionModal.tsx +150 -68
  102. package/src/managed/overview/artifact/ArtifactCollapsibleSection.tsx +32 -0
  103. package/src/managed/overview/artifact/ArtifactVersionTasks.tsx +2 -0
  104. package/src/managed/overview/artifact/{PendingVersion.tsx → ArtifactVersions.tsx} +35 -25
  105. package/src/managed/overview/artifact/Constraints.tsx +61 -21
  106. package/src/managed/overview/artifact/CurrentVersion.tsx +42 -27
  107. package/src/managed/overview/artifact/VersionTitle.tsx +18 -0
  108. package/src/managed/overview/artifact/hooks.ts +71 -34
  109. package/src/managed/overview/artifact/useCreateRollbackActions.hook.ts +75 -0
  110. package/src/managed/overview/artifact/utils.spec.ts +1 -1
  111. package/src/managed/overview/artifact/utils.ts +47 -80
  112. package/src/managed/overview/baseStyles.less +124 -88
  113. package/src/managed/overview/queries.graphql +54 -13
  114. package/src/managed/overview/useIsUpdatingResources.hook.ts +9 -0
  115. package/src/managed/resources/ResourceTitle.tsx +12 -5
  116. package/src/managed/utils/ActionModal.tsx +4 -1
  117. package/src/managed/utils/defaults.ts +3 -0
  118. package/src/managed/utils/useNotifyOnError.hook.ts +1 -1
  119. package/src/managed/versionMetadata/MetadataComponents.tsx +102 -70
  120. package/src/managed/versionMetadata/VersionMetadata.less +17 -18
  121. package/src/managed/versionMetadata/VersionMetadata.tsx +23 -31
  122. package/src/managed/versionsHistory/VersionContent.tsx +20 -13
  123. package/src/managed/versionsHistory/VersionHeading.tsx +2 -1
  124. package/src/managed/versionsHistory/VersionsHistory.less +11 -3
  125. package/src/manifest/PodNameProvider.spec.ts +1 -1
  126. package/src/navigation/customParamTypes.spec.ts +1 -1
  127. package/src/pagerDuty/pagerDuty.read.service.spec.ts +4 -2
  128. package/src/pagerDuty/pagerDutyTag.component.spec.ts +7 -3
  129. package/src/pipeline/config/PipelineRegistry.spec.ts +38 -37
  130. package/src/pipeline/config/actions/templateJson/ShowPipelineTemplateJsonModal.spec.tsx +3 -3
  131. package/src/pipeline/config/pipelineConfigurer.controller.spec.ts +3 -3
  132. package/src/pipeline/config/services/PipelineConfigService.spec.ts +4 -3
  133. package/src/pipeline/config/stages/bakeManifest/helm/BakeHelmConfigForm.spec.tsx +51 -8
  134. package/src/pipeline/config/stages/bakeManifest/helm/BakeHelmConfigForm.tsx +36 -6
  135. package/src/pipeline/config/stages/findArtifactFromExecution/findArtifactFromExecution.controller.spec.ts +2 -1
  136. package/src/pipeline/config/stages/manualJudgment/manualJudgment.service.spec.ts +6 -4
  137. package/src/pipeline/config/stages/travis/travisExecutionDetails.controller.spec.ts +5 -2
  138. package/src/pipeline/config/stages/travis/travisStage.controller.spec.ts +3 -2
  139. package/src/pipeline/config/stages/unmatchedStageTypeStage/unmatchedStageTypeStage.controller.spec.ts +2 -1
  140. package/src/pipeline/config/stages/wait/SkipWait.tsx +3 -1
  141. package/src/pipeline/config/stages/wercker/werckerExecutionDetails.controller.spec.ts +5 -2
  142. package/src/pipeline/config/stages/wercker/werckerStage.controller.spec.ts +3 -2
  143. package/src/pipeline/config/templates/Variable.spec.tsx +6 -5
  144. package/src/pipeline/config/templates/configurePipelineTemplateModal.controller.spec.ts +7 -8
  145. package/src/pipeline/config/templates/v2/configurePipelineTemplateModalV2.controller.spec.ts +7 -8
  146. package/src/pipeline/config/templates/v2/pipelineTemplateV2.service.spec.ts +1 -1
  147. package/src/pipeline/config/triggers/TriggersPageContent.spec.tsx +4 -4
  148. package/src/pipeline/config/triggers/TriggersPageContent.tsx +1 -2
  149. package/src/pipeline/config/triggers/artifacts/docker/defaultDocker.artifact.spec.ts +1 -2
  150. package/src/pipeline/config/validation/pipelineConfig.validator.spec.ts +14 -15
  151. package/src/pipeline/create/CreatePipelineModal.spec.tsx +9 -7
  152. package/src/pipeline/details/executionDetailsSection.service.spec.ts +3 -2
  153. package/src/pipeline/executions/Executions.spec.tsx +9 -6
  154. package/src/pipeline/executions/executionAction/ExecutionAction.spec.tsx +1 -1
  155. package/src/pipeline/executions/executionGroup/ExecutionGroup.tsx +2 -1
  156. package/src/pipeline/filter/executionFilter.service.spec.ts +1 -1
  157. package/src/pipeline/pipeline.dataSource.spec.ts +8 -7
  158. package/src/pipeline/service/ExecutionsTransformer.spec.ts +2 -2
  159. package/src/pipeline/service/execution.service.spec.ts +7 -5
  160. package/src/pipeline/status/Artifact.spec.tsx +7 -6
  161. package/src/pipeline/status/ArtifactList.spec.tsx +7 -6
  162. package/src/pipeline/status/ExecutionParameters.spec.tsx +5 -4
  163. package/src/pipeline/status/ResolvedArtifactList.spec.tsx +7 -6
  164. package/src/plugins/deck.plugin.spec.ts +4 -2
  165. package/src/plugins/plugin.registry.spec.ts +6 -4
  166. package/src/presentation/forms/SpinFormik.spec.tsx +3 -2
  167. package/src/presentation/forms/fields/FormikFormField.spec.tsx +3 -3
  168. package/src/presentation/forms/hooks/useSaveRestoreMutuallyExclusiveFields.hook.spec.tsx +4 -3
  169. package/src/presentation/forms/inputs/ChecklistInput.spec.tsx +1 -1
  170. package/src/presentation/forms/inputs/RadioButtonInput.spec.tsx +2 -1
  171. package/src/presentation/forms/inputs/SelectInput.spec.tsx +2 -1
  172. package/src/presentation/forms/inputs/hooks/useInternalValidator.hook.spec.tsx +4 -3
  173. package/src/presentation/forms/validation/FormValidator.spec.ts +2 -2
  174. package/src/presentation/forms/validation/useValidationData.spec.tsx +4 -3
  175. package/src/presentation/hooks/useContainerClassNames.hook.spec.tsx +2 -1
  176. package/src/presentation/hooks/useData.hook.spec.tsx +3 -2
  177. package/src/presentation/hooks/useDebouncedValue.hook.spec.tsx +1 -1
  178. package/src/presentation/hooks/useDeepObjectDiff.hook.spec.tsx +2 -1
  179. package/src/presentation/hooks/useEventListener.hook.spec.tsx +2 -1
  180. package/src/presentation/hooks/useForceUpdate.hook.spec.tsx +2 -1
  181. package/src/presentation/hooks/useInterval.hook.spec.tsx +2 -1
  182. package/src/presentation/hooks/useIsMountedRef.hook.spec.tsx +1 -1
  183. package/src/presentation/hooks/useLatestCallback.hook.spec.tsx +2 -1
  184. package/src/presentation/hooks/useLatestPromise.hook.spec.tsx +9 -3
  185. package/src/presentation/hooks/useMountStatusRef.hook.spec.tsx +3 -1
  186. package/src/presentation/hooks/usePollingData.hook.spec.tsx +3 -2
  187. package/src/presentation/hooks/usePrevious.hook.spec.tsx +2 -1
  188. package/src/presentation/navigation/pageNavigator.component.spec.ts +6 -6
  189. package/src/presentation/spel/SpelInput.spec.tsx +9 -4
  190. package/src/presentation/spel/SpelService.spec.ts +1 -1
  191. package/src/scheduler/SchedulerFactory.spec.ts +2 -1
  192. package/src/search/infrastructure/infrastructureSearch.service.ts +3 -2
  193. package/src/search/widgets/Filter.spec.tsx +5 -3
  194. package/src/search/widgets/Filters.spec.tsx +5 -3
  195. package/src/search/widgets/Search.spec.tsx +4 -2
  196. package/src/securityGroup/index.ts +2 -1
  197. package/src/securityGroup/securityGroupReader.service.spec.ts +8 -10
  198. package/src/serverGroup/configure/common/deployInitializer.component.spec.ts +7 -3
  199. package/src/serverGroup/configure/common/v2instanceArchetypeSelector.component.ts +1 -1
  200. package/src/serverGroup/details/capacity/CapacityDetailsSection.spec.tsx +1 -1
  201. package/src/serverGroup/details/scalingActivities/ScalingActivitiesModal.spec.ts +2 -1
  202. package/src/serverGroup/details/serverGroupWarningMessage.service.spec.ts +4 -4
  203. package/src/serverGroup/serverGroupWriter.service.spec.ts +10 -8
  204. package/src/slack/SlackReader.spec.ts +2 -1
  205. package/src/subnet/subnet.read.service.spec.ts +4 -3
  206. package/src/task/monitor/taskMonitor.spec.ts +6 -5
  207. package/src/task/task.dataSource.spec.ts +5 -4
  208. package/src/task/task.write.service.spec.ts +3 -1
  209. package/src/utils/clipboard/CopyToClipboard.spec.tsx +2 -1
  210. package/src/utils/json/json.utility.service.spec.ts +2 -1
  211. package/src/utils/timeFormatters.spec.ts +3 -2
  212. package/src/utils/workerPool.spec.ts +2 -1
  213. package/src/widgets/ApplicationsPickerInput.spec.tsx +3 -2
  214. package/src/widgets/spelText/SpelAutocompleteService.spec.ts +4 -3
  215. package/src/widgets/tags/Tag.spec.tsx +4 -2
  216. package/src/widgets/tags/TagList.spec.tsx +5 -3
  217. package/src/yamlEditor/yamlEditorUtils.spec.ts +1 -1
  218. package/dist/managed/overview/artifact/PendingVersion.d.ts +0 -7
@@ -1,15 +1,18 @@
1
- import React from 'react';
2
- import { ReactWrapper, mount } from 'enzyme';
1
+ import type { IScope } from 'angular';
2
+ import { mock, noop } from 'angular';
3
+ import type { ReactWrapper } from 'enzyme';
4
+ import { mount } from 'enzyme';
3
5
  import { set } from 'lodash';
4
- import { IScope, mock, noop } from 'angular';
6
+ import React from 'react';
5
7
 
6
- import { Application } from '../../application';
8
+ import type { IExecutionsProps, IExecutionsState } from './Executions';
9
+ import { Executions } from './Executions';
10
+ import type { Application } from '../../application';
7
11
  import { ApplicationModelBuilder } from '../../application/applicationModel.builder';
8
12
  import { INSIGHT_FILTER_STATE_MODEL } from '../../insight/insightFilterState.model';
9
- import { REACT_MODULE } from '../../reactShims';
10
13
  import { OVERRIDE_REGISTRY } from '../../overrideRegistry';
14
+ import { REACT_MODULE } from '../../reactShims';
11
15
  import * as State from '../../state';
12
- import { IExecutionsProps, IExecutionsState, Executions } from './Executions';
13
16
  import { Spinner } from '../../widgets/spinners/Spinner';
14
17
 
15
18
  describe('<Executions/>', () => {
@@ -1,5 +1,5 @@
1
+ import { mount, shallow } from 'enzyme';
1
2
  import React from 'react';
2
- import { shallow, mount } from 'enzyme';
3
3
 
4
4
  import { ExecutionAction } from './ExecutionAction';
5
5
 
@@ -9,6 +9,7 @@ import { MigrationTag } from './MigrationTag';
9
9
  import { AccountTag } from '../../../account';
10
10
  import type { Application } from '../../../application/application.model';
11
11
  import { CollapsibleSectionStateCache } from '../../../cache';
12
+ import { SETTINGS } from '../../../config/settings';
12
13
  import { PipelineTemplateReader, PipelineTemplateV2Service } from '../../config/templates';
13
14
  import type {
14
15
  IExecution,
@@ -36,7 +37,7 @@ import { Spinner } from '../../../widgets/spinners/Spinner';
36
37
 
37
38
  import './executionGroup.less';
38
39
 
39
- const ACCOUNT_TAG_OVERFLOW_LIMIT = 1;
40
+ const ACCOUNT_TAG_OVERFLOW_LIMIT = SETTINGS.accountTagLimit ?? 1;
40
41
 
41
42
  export interface IExecutionGroupProps {
42
43
  group: IExecutionGroup;
@@ -1,5 +1,5 @@
1
+ import type { ExecutionFilterModel } from './ExecutionFilterModel';
1
2
  import { ExecutionFilterService } from './executionFilter.service';
2
- import { ExecutionFilterModel } from './ExecutionFilterModel';
3
3
  import { ExecutionState } from '../../state';
4
4
 
5
5
  describe('ExecutionFilterService', function () {
@@ -1,10 +1,11 @@
1
- import { IQProvider, mock } from 'angular';
1
+ import type { IQProvider } from 'angular';
2
+ import { mock } from 'angular';
2
3
 
3
- import { Application } from '../application/application.model';
4
+ import type { Application } from '../application/application.model';
4
5
  import { ApplicationModelBuilder } from '../application/applicationModel.builder';
5
6
  import { ApplicationDataSourceRegistry } from '../application/service/ApplicationDataSourceRegistry';
6
- import { EXECUTION_SERVICE } from './service/execution.service';
7
7
  import { PipelineConfigService } from './config/services/PipelineConfigService';
8
+ import { EXECUTION_SERVICE } from './service/execution.service';
8
9
 
9
10
  describe('Pipeline Data Source', function () {
10
11
  let application: Application, executionService: any, $scope: ng.IScope, $q: ng.IQService;
@@ -93,8 +94,8 @@ describe('Pipeline Data Source', function () {
93
94
 
94
95
  it('sets appropriate flags when executions reload fails; subscriber is responsible for error checking', function () {
95
96
  spyOn(executionService, 'getExecutions').and.returnValue($q.reject(null));
96
- let errorsHandled = 0,
97
- successesHandled = 0;
97
+ let errorsHandled = 0;
98
+ let successesHandled = 0;
98
99
  configureApplication();
99
100
  application.getDataSource('executions').activate();
100
101
 
@@ -141,8 +142,8 @@ describe('Pipeline Data Source', function () {
141
142
  it('sets appropriate flags when pipeline config reload fails; subscriber is responsible for error checking', function () {
142
143
  spyOn(PipelineConfigService, 'getPipelinesForApplication').and.returnValue($q.when([]));
143
144
  spyOn(PipelineConfigService, 'getStrategiesForApplication').and.returnValue($q.reject([]));
144
- let errorsHandled = 0,
145
- successesHandled = 0;
145
+ let errorsHandled = 0;
146
+ let successesHandled = 0;
146
147
  configureApplication();
147
148
  application.getDataSource('pipelineConfigs').activate();
148
149
 
@@ -1,8 +1,8 @@
1
1
  import { map } from 'lodash';
2
2
 
3
- import { Application } from '../../application';
4
3
  import { ExecutionsTransformer } from './ExecutionsTransformer';
5
- import { IExecution } from '../../domain';
4
+ import type { Application } from '../../application';
5
+ import type { IExecution } from '../../domain';
6
6
 
7
7
  describe('ExecutionTransformerService', function () {
8
8
  describe('transformExecution', () => {
@@ -1,10 +1,12 @@
1
+ import type { IQProvider, IQService, ITimeoutService } from 'angular';
2
+ import { mock, noop } from 'angular';
3
+
1
4
  import { mockHttpClient } from '../../api/mock/jasmine';
2
- import { IQProvider, IQService, ITimeoutService, mock, noop } from 'angular';
5
+ import type { Application } from '../../application';
6
+ import type { IExecution } from '../../domain';
7
+ import type { ExecutionService } from './execution.service';
8
+ import { EXECUTION_SERVICE } from './execution.service';
3
9
  import { REACT_MODULE } from '../../reactShims';
4
-
5
- import { EXECUTION_SERVICE, ExecutionService } from './execution.service';
6
- import { IExecution } from '../../domain';
7
- import { Application } from '../../application';
8
10
  import * as State from '../../state';
9
11
 
10
12
  describe('Service: executionService', () => {
@@ -1,11 +1,12 @@
1
- import React from 'react';
2
- import { ShallowWrapper, shallow } from 'enzyme';
3
1
  import { mock } from 'angular';
4
- import { REACT_MODULE } from '../../reactShims';
5
-
6
- import { IArtifact } from '../../domain';
2
+ import type { ShallowWrapper } from 'enzyme';
3
+ import { shallow } from 'enzyme';
4
+ import React from 'react';
7
5
 
8
- import { Artifact, IArtifactProps } from './Artifact';
6
+ import type { IArtifactProps } from './Artifact';
7
+ import { Artifact } from './Artifact';
8
+ import type { IArtifact } from '../../domain';
9
+ import { REACT_MODULE } from '../../reactShims';
9
10
 
10
11
  const ARTIFACT_TYPE = 'docker/image';
11
12
  const ARTIFACT_NAME = 'example.com/container';
@@ -1,12 +1,13 @@
1
- import React from 'react';
2
- import { ShallowWrapper, shallow } from 'enzyme';
3
1
  import { mock } from 'angular';
4
- import { REACT_MODULE } from '../../reactShims';
5
-
6
- import { IArtifact } from '../../domain';
2
+ import type { ShallowWrapper } from 'enzyme';
3
+ import { shallow } from 'enzyme';
4
+ import React from 'react';
7
5
 
8
6
  import { Artifact } from './Artifact';
9
- import { ArtifactList, IArtifactListProps } from './ArtifactList';
7
+ import type { IArtifactListProps } from './ArtifactList';
8
+ import { ArtifactList } from './ArtifactList';
9
+ import type { IArtifact } from '../../domain';
10
+ import { REACT_MODULE } from '../../reactShims';
10
11
 
11
12
  const ARTIFACT_TYPE = 'docker/image';
12
13
  const ARTIFACT_NAME = 'example.com/container';
@@ -1,11 +1,12 @@
1
- import React from 'react';
2
- import { ShallowWrapper, shallow } from 'enzyme';
3
1
  import { mock } from 'angular';
2
+ import type { ShallowWrapper } from 'enzyme';
3
+ import { shallow } from 'enzyme';
4
+ import React from 'react';
4
5
 
6
+ import type { IDisplayableParameter, IExecutionParametersProps } from './ExecutionParameters';
7
+ import { ExecutionParameters } from './ExecutionParameters';
5
8
  import { REACT_MODULE } from '../../reactShims';
6
9
 
7
- import { IExecutionParametersProps, ExecutionParameters, IDisplayableParameter } from './ExecutionParameters';
8
-
9
10
  describe('<ExecutionParameters/>', () => {
10
11
  let component: ShallowWrapper<IExecutionParametersProps>;
11
12
 
@@ -1,12 +1,13 @@
1
- import React from 'react';
2
- import { ShallowWrapper, shallow } from 'enzyme';
3
1
  import { mock } from 'angular';
4
- import { REACT_MODULE } from '../../reactShims';
2
+ import type { ShallowWrapper } from 'enzyme';
3
+ import { shallow } from 'enzyme';
4
+ import React from 'react';
5
5
 
6
- import { IArtifact, IExpectedArtifact } from '../../domain';
7
6
  import { Artifact } from './Artifact';
8
-
9
- import { ResolvedArtifactList, IResolvedArtifactListProps } from './ResolvedArtifactList';
7
+ import type { IResolvedArtifactListProps } from './ResolvedArtifactList';
8
+ import { ResolvedArtifactList } from './ResolvedArtifactList';
9
+ import type { IArtifact, IExpectedArtifact } from '../../domain';
10
+ import { REACT_MODULE } from '../../reactShims';
10
11
 
11
12
  const ARTIFACT_TYPE = 'docker/image';
12
13
  const ARTIFACT_NAME = 'example.com/container';
@@ -1,7 +1,9 @@
1
- import { SearchResultType, searchResultTypeRegistry } from '../search/searchResult';
2
- import { IDeckPlugin, registerPluginExtensions } from './deck.plugin';
1
+ import type { IDeckPlugin } from './deck.plugin';
2
+ import { registerPluginExtensions } from './deck.plugin';
3
3
  import { HelpContentsRegistry } from '../help';
4
4
  import { Registry } from '../registry';
5
+ import type { SearchResultType } from '../search/searchResult';
6
+ import { searchResultTypeRegistry } from '../search/searchResult';
5
7
 
6
8
  describe('deck plugin registerPluginExtensions', () => {
7
9
  it('returns a promise', async () => {
@@ -1,9 +1,11 @@
1
- import { IStageTypeConfig } from '../domain';
2
- import { IDeckPlugin } from './deck.plugin';
1
+ import { mock } from 'angular';
2
+
3
3
  import { RequestBuilder } from '../api';
4
- import { IPluginMetaData, PluginRegistry } from './plugin.registry';
4
+ import type { IDeckPlugin } from './deck.plugin';
5
+ import type { IStageTypeConfig } from '../domain';
6
+ import type { IPluginMetaData } from './plugin.registry';
7
+ import { PluginRegistry } from './plugin.registry';
5
8
  import { Registry } from '../registry';
6
- import { mock } from 'angular';
7
9
 
8
10
  const fakePromise = (result: any = undefined) => () => new Promise((resolve) => resolve(result));
9
11
 
@@ -1,6 +1,7 @@
1
- import React from 'react';
2
1
  import { mount } from 'enzyme';
3
- import { FormikProps } from 'formik';
2
+ import type { FormikProps } from 'formik';
3
+ import React from 'react';
4
+
4
5
  import { SpinFormik } from './SpinFormik';
5
6
 
6
7
  describe('SpinFormik', () => {
@@ -1,11 +1,11 @@
1
- import { FormikProps } from 'formik/dist/types';
2
- import React from 'react';
3
1
  import { mount } from 'enzyme';
2
+ import type { FormikProps } from 'formik/dist/types';
3
+ import React from 'react';
4
4
 
5
+ import type { IFormInputProps } from '../..';
5
6
  import {
6
7
  FormikFormField,
7
8
  FormikSpelContextProvider,
8
- IFormInputProps,
9
9
  ReactSelectInput,
10
10
  SpelToggle,
11
11
  SpinFormik,
@@ -1,10 +1,11 @@
1
1
  import { mount } from 'enzyme';
2
- import { useSaveRestoreMutuallyExclusiveFields } from './useSaveRestoreMutuallyExclusiveFields.hook';
3
- import { Formik, FormikProps } from 'formik';
2
+ import type { Formik, FormikProps } from 'formik';
4
3
  import React from 'react';
4
+
5
+ import { SpinFormik } from '../SpinFormik';
5
6
  import { FormikFormField } from '../fields';
6
7
  import { SelectInput } from '../inputs';
7
- import { SpinFormik } from '../SpinFormik';
8
+ import { useSaveRestoreMutuallyExclusiveFields } from './useSaveRestoreMutuallyExclusiveFields.hook';
8
9
 
9
10
  function PizzaComponent() {
10
11
  return (
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
1
  import { mount } from 'enzyme';
2
+ import React from 'react';
3
3
 
4
4
  import { ChecklistInput } from './ChecklistInput';
5
5
 
@@ -1,5 +1,6 @@
1
- import React from 'react';
2
1
  import { mount } from 'enzyme';
2
+ import React from 'react';
3
+
3
4
  import { RadioButtonInput } from './RadioButtonInput';
4
5
 
5
6
  const noop = () => {};
@@ -1,5 +1,6 @@
1
- import React from 'react';
2
1
  import { mount } from 'enzyme';
2
+ import React from 'react';
3
+
3
4
  import { SelectInput } from './SelectInput';
4
5
 
5
6
  const noop = () => {};
@@ -1,7 +1,8 @@
1
- import React from 'react';
2
1
  import { mount } from 'enzyme';
3
- import { IValidator } from '../../../forms/validation';
4
- import { IFormInputProps, IFormInputValidation } from '../interface';
2
+ import React from 'react';
3
+
4
+ import type { IValidator } from '../../../forms/validation';
5
+ import type { IFormInputProps, IFormInputValidation } from '../interface';
5
6
  import { useInternalValidator } from './useInternalValidator.hook';
6
7
 
7
8
  function TestInputComponent(props: IFormInputProps & { validator?: IValidator; revalidateDeps?: any[] }) {
@@ -1,6 +1,6 @@
1
- import { Validators } from './validators';
2
1
  import { FormValidator } from './FormValidator';
3
- import { IValidator, IArrayItemValidator } from './validation';
2
+ import type { IArrayItemValidator, IValidator } from './validation';
3
+ import { Validators } from './validators';
4
4
 
5
5
  const { maxValue, arrayNotEmpty } = Validators;
6
6
 
@@ -1,8 +1,9 @@
1
- import { asyncMessage, errorMessage, infoMessage, messageMessage, successMessage, warningMessage } from './categories';
1
+ import { mount } from 'enzyme';
2
2
  import React from 'react';
3
3
 
4
- import { mount } from 'enzyme';
5
- import { IValidationData, useValidationData } from './useValidationData';
4
+ import { asyncMessage, errorMessage, infoMessage, messageMessage, successMessage, warningMessage } from './categories';
5
+ import type { IValidationData } from './useValidationData';
6
+ import { useValidationData } from './useValidationData';
6
7
 
7
8
  interface IComponentProps {
8
9
  validationMessage: React.ReactNode;
@@ -1,5 +1,6 @@
1
- import React from 'react';
2
1
  import { mount } from 'enzyme';
2
+ import React from 'react';
3
+
3
4
  import { useContainerClassNames } from './useContainerClassNames.hook';
4
5
 
5
6
  const TestComponent = ({ classNames }: { classNames: string[] }) => {
@@ -1,7 +1,8 @@
1
- import React from 'react';
2
1
  import { mount } from 'enzyme';
3
- import { IUseLatestPromiseResult } from './useLatestPromise.hook';
2
+ import React from 'react';
3
+
4
4
  import { useData } from './useData.hook';
5
+ import type { IUseLatestPromiseResult } from './useLatestPromise.hook';
5
6
 
6
7
  describe('useData hook', () => {
7
8
  function TestComponent(props: any) {
@@ -1,7 +1,7 @@
1
+ import { mount } from 'enzyme';
1
2
  import React from 'react';
2
3
 
3
4
  import { useDebouncedValue } from './useDebouncedValue.hook';
4
- import { mount } from 'enzyme';
5
5
 
6
6
  describe('useDebouncedValue hook', () => {
7
7
  beforeEach(() => jasmine.clock().install());
@@ -1,5 +1,6 @@
1
- import React from 'react';
2
1
  import { mount } from 'enzyme';
2
+ import React from 'react';
3
+
3
4
  import { useDeepObjectDiff } from './useDeepObjectDiff.hook';
4
5
 
5
6
  const { useEffect } = React;
@@ -1,5 +1,6 @@
1
- import React from 'react';
2
1
  import { mount } from 'enzyme';
2
+ import React from 'react';
3
+
3
4
  import { useEventListener } from './useEventListener.hook';
4
5
 
5
6
  const TestComponent = ({
@@ -1,6 +1,7 @@
1
- import React from 'react';
2
1
  import { mount } from 'enzyme';
2
+ import React from 'react';
3
3
  import { Subject } from 'rxjs';
4
+
4
5
  import { useForceUpdate } from '..';
5
6
 
6
7
  describe('useForceUpdate', () => {
@@ -1,5 +1,6 @@
1
- import React from 'react';
2
1
  import { mount } from 'enzyme';
2
+ import React from 'react';
3
+
3
4
  import { useInterval } from './useInterval.hook';
4
5
 
5
6
  describe('useInterval hook', () => {
@@ -1,7 +1,7 @@
1
+ import { mount } from 'enzyme';
1
2
  import React from 'react';
2
3
 
3
4
  import { useIsMountedRef } from '..';
4
- import { mount } from 'enzyme';
5
5
 
6
6
  describe('useIsMountedRef hook', () => {
7
7
  let useIsMountedRefSpy: jasmine.Spy;
@@ -1,5 +1,6 @@
1
- import React from 'react';
2
1
  import { mount } from 'enzyme';
2
+ import React from 'react';
3
+
3
4
  import { useLatestCallback } from './useLatestCallback.hook';
4
5
 
5
6
  const TestComponent = ({
@@ -1,6 +1,8 @@
1
- import React from 'react';
2
1
  import { mount } from 'enzyme';
3
- import { IUseLatestPromiseResult, useLatestPromise } from './useLatestPromise.hook';
2
+ import React from 'react';
3
+
4
+ import type { IUseLatestPromiseResult } from './useLatestPromise.hook';
5
+ import { useLatestPromise } from './useLatestPromise.hook';
4
6
 
5
7
  describe('useLatestPromise hook', () => {
6
8
  // Remove the the refresh function for .isEqual assertions
@@ -68,9 +70,13 @@ describe('useLatestPromise hook', () => {
68
70
  expect(spy).toHaveBeenCalledTimes(2);
69
71
 
70
72
  deferred.reject('error');
73
+ let caught = false;
71
74
  try {
72
75
  await deferred.promise;
73
- } catch (error) {}
76
+ } catch (error) {
77
+ caught = true;
78
+ }
79
+ expect(caught).toBe(true);
74
80
  component.setProps({});
75
81
 
76
82
  expect(spy).toHaveBeenCalledTimes(3);
@@ -1,5 +1,7 @@
1
- import React, { RefObject } from 'react';
2
1
  import { mount } from 'enzyme';
2
+ import type { RefObject } from 'react';
3
+ import React from 'react';
4
+
3
5
  import { useMountStatusRef } from './useMountStatusRef.hook';
4
6
 
5
7
  describe('useMountStatusRef', () => {
@@ -1,6 +1,7 @@
1
- import React, { useEffect } from 'react';
2
1
  import { mount } from 'enzyme';
3
- import { IUseLatestPromiseResult } from './useLatestPromise.hook';
2
+ import React, { useEffect } from 'react';
3
+
4
+ import type { IUseLatestPromiseResult } from './useLatestPromise.hook';
4
5
  import { usePollingData } from './usePollingData.hook';
5
6
 
6
7
  describe('usePollingData hook', () => {
@@ -1,5 +1,6 @@
1
- import React from 'react';
2
1
  import { mount } from 'enzyme';
2
+ import React from 'react';
3
+
3
4
  import { usePrevious } from './usePrevious.hook';
4
5
 
5
6
  const TestComponent = ({ value, valueCallback }: { value: any; valueCallback: (value: any) => any }) => {
@@ -1,10 +1,10 @@
1
- import $ from 'jquery';
1
+ import UI_ROUTER from '@uirouter/angularjs';
2
2
  import { mock } from 'angular';
3
+ import $ from 'jquery';
3
4
 
5
+ import type { INavigationPage } from './PageNavigationState';
4
6
  import { PAGE_NAVIGATOR_COMPONENT } from './pageNavigator.component';
5
- import { INavigationPage } from './PageNavigationState';
6
7
  import { ScrollToService } from '../../utils/scrollTo/scrollTo.service';
7
- import UI_ROUTER from '@uirouter/angularjs';
8
8
 
9
9
  describe('Component: Page Navigator', () => {
10
10
  let $compile: ng.ICompileService, $scope: ng.IScope, $timeout: ng.ITimeoutService, elem: JQuery;
@@ -46,8 +46,8 @@ describe('Component: Page Navigator', () => {
46
46
  ];
47
47
  initialize(pages);
48
48
  expect(elem.find('h4').length).toBe(2);
49
- expect(elem.find('h4:eq(0)')).textMatch('Page 1');
50
- expect(elem.find('h4:eq(1)')).textMatch('Page 2');
49
+ expect(elem.find('h4:eq(0)').text()).toContain('Page 1');
50
+ expect(elem.find('h4:eq(1)').text()).toContain('Page 2');
51
51
  });
52
52
 
53
53
  it('renders pages conditionally based on visible flag', () => {
@@ -57,7 +57,7 @@ describe('Component: Page Navigator', () => {
57
57
  ];
58
58
  initialize(pages);
59
59
  expect(elem.find('h4').length).toBe(1);
60
- expect(elem.find('h4:eq(0)')).textMatch('Page 1');
60
+ expect(elem.find('h4:eq(0)').text()).toContain('Page 1');
61
61
 
62
62
  pages[1].visible = true;
63
63
  $scope.$digest();
@@ -1,8 +1,9 @@
1
- import React from 'react';
2
1
  import { mount } from 'enzyme';
3
- import { IFormInputProps, IStageForSpelPreview, IValidator } from '..';
4
- import { SpelService } from './SpelService';
2
+ import React from 'react';
3
+
4
+ import type { IFormInputProps, IStageForSpelPreview, IValidator } from '..';
5
5
  import { SpelInput } from './SpelInput';
6
+ import { SpelService } from './SpelService';
6
7
 
7
8
  function defer() {
8
9
  let resolve: Function, reject: Function;
@@ -208,10 +209,14 @@ describe('<SpelInput/>', () => {
208
209
  expect(mockValidate).toHaveBeenCalledTimes(1);
209
210
  expect(mockValidate.calls.mostRecent().returnValue).toMatch('Async: ');
210
211
 
212
+ let caught = false;
211
213
  deferred.reject('something bad happened');
212
214
  try {
213
215
  await deferred.promise;
214
- } catch (error) {}
216
+ } catch (error) {
217
+ caught = true;
218
+ }
219
+ expect(caught).toBe(true);
215
220
  component.setProps({});
216
221
 
217
222
  expect(mockValidate).toHaveBeenCalledTimes(2);
@@ -1,5 +1,5 @@
1
- import { RequestBuilder } from '../../api';
2
1
  import { SpelService } from './SpelService';
2
+ import { RequestBuilder } from '../../api';
3
3
 
4
4
  describe('SpelService', () => {
5
5
  it('extracts "result" from the payload', async () => {
@@ -1,5 +1,6 @@
1
1
  import * as angular from 'angular';
2
- import { ITimeoutService, mock } from 'angular';
2
+ import type { ITimeoutService } from 'angular';
3
+ import { mock } from 'angular';
3
4
  import { SchedulerFactory } from './SchedulerFactory';
4
5
 
5
6
  describe('scheduler', function () {
@@ -20,8 +20,9 @@ export interface ISearchResultSet<T extends ISearchResult = ISearchResult> {
20
20
  query?: string;
21
21
  }
22
22
 
23
+ export type ISearchResultFormatter = (entry: ISearchResult, fromRoute?: boolean) => string | PromiseLike<string>;
23
24
  export interface IProviderResultFormatter {
24
- [category: string]: (entry: ISearchResult, fromRoute?: boolean) => string;
25
+ [category: string]: ISearchResultFormatter;
25
26
  }
26
27
 
27
28
  export class InfrastructureSearcher {
@@ -65,7 +66,7 @@ export class InfrastructureSearcher {
65
66
  if (!type) {
66
67
  return this.$q.when('');
67
68
  }
68
- let formatter = type.displayFormatter;
69
+ let formatter: ISearchResultFormatter = type.displayFormatter;
69
70
 
70
71
  if (this.providerServiceDelegate.hasDelegate(entry.provider, 'search.resultFormatter')) {
71
72
  const providerFormatter: IProviderResultFormatter = this.providerServiceDelegate.getDelegate<
@@ -1,8 +1,10 @@
1
+ import type { ReactWrapper } from 'enzyme';
2
+ import { mount } from 'enzyme';
1
3
  import React from 'react';
2
- import { ReactWrapper, mount } from 'enzyme';
3
4
 
4
- import { IFilterProps, Filter } from './Filter';
5
- import { IFilterType } from './SearchFilterTypeRegistry';
5
+ import type { IFilterProps } from './Filter';
6
+ import { Filter } from './Filter';
7
+ import type { IFilterType } from './SearchFilterTypeRegistry';
6
8
 
7
9
  describe('<Filter/>', () => {
8
10
  let component: ReactWrapper<IFilterProps, any>;
@@ -1,8 +1,10 @@
1
+ import type { ReactWrapper } from 'enzyme';
2
+ import { mount } from 'enzyme';
1
3
  import React from 'react';
2
- import { ReactWrapper, mount } from 'enzyme';
3
4
 
4
- import { IFilterType } from './SearchFilterTypeRegistry';
5
- import { IFiltersLayout, IFiltersProps, Filters } from './Filters';
5
+ import type { IFiltersLayout, IFiltersProps } from './Filters';
6
+ import { Filters } from './Filters';
7
+ import type { IFilterType } from './SearchFilterTypeRegistry';
6
8
 
7
9
  describe('<Filters/>', () => {
8
10
  let component: ReactWrapper<IFiltersProps, any>;
@@ -1,8 +1,10 @@
1
+ import type { ReactWrapper } from 'enzyme';
2
+ import { mount } from 'enzyme';
1
3
  import React from 'react';
2
- import { ReactWrapper, mount } from 'enzyme';
3
4
 
5
+ import type { ISearchProps } from './Search';
6
+ import { Search } from './Search';
4
7
  import { SearchFilterTypeRegistry } from './SearchFilterTypeRegistry';
5
- import { ISearchProps, Search } from './Search';
6
8
 
7
9
  describe('<Search/>', () => {
8
10
  SearchFilterTypeRegistry.register({ key: 'account', name: 'Account' });