@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.
- package/CHANGELOG.md +56 -0
- package/dist/config/settings.d.ts +1 -1
- package/dist/core.module.d.ts +1 -1
- package/dist/index.js +89 -47
- package/dist/index.js.map +1 -1
- package/dist/instance/instanceType.service.d.ts +3 -2
- package/dist/managed/artifactActions/ArtifactActions.d.ts +24 -0
- package/dist/managed/constraints/registry.d.ts +13 -2
- package/dist/managed/environmentBaseElements/EnvironmentItem.d.ts +3 -2
- package/dist/managed/graphql/graphql-sdk.d.ts +123 -11
- package/dist/managed/overview/Resource.d.ts +5 -2
- package/dist/managed/overview/artifact/Artifact.d.ts +2 -1
- package/dist/managed/overview/artifact/ArtifactActionModal.d.ts +20 -9
- package/dist/managed/overview/artifact/ArtifactCollapsibleSection.d.ts +7 -0
- package/dist/managed/overview/artifact/ArtifactVersions.d.ts +9 -0
- package/dist/managed/overview/artifact/CurrentVersion.d.ts +7 -6
- package/dist/managed/overview/artifact/VersionTitle.d.ts +9 -0
- package/dist/managed/overview/artifact/hooks.d.ts +6 -11
- package/dist/managed/overview/artifact/useCreateRollbackActions.hook.d.ts +3 -0
- package/dist/managed/overview/artifact/utils.d.ts +15 -14
- package/dist/managed/overview/useIsUpdatingResources.hook.d.ts +1 -0
- package/dist/managed/resources/ResourceTitle.d.ts +3 -3
- package/dist/managed/resources/resourceRegistry.d.ts +1 -1
- package/dist/managed/utils/ActionModal.d.ts +1 -0
- package/dist/managed/utils/defaults.d.ts +1 -0
- package/dist/managed/versionMetadata/MetadataComponents.d.ts +18 -19
- package/dist/managed/versionMetadata/VersionMetadata.d.ts +6 -2
- package/dist/search/infrastructure/infrastructureSearch.service.d.ts +2 -1
- package/dist/securityGroup/index.d.ts +2 -1
- package/package.json +7 -7
- package/src/account/AccountSelectInput.spec.tsx +9 -4
- package/src/account/AccountService.spec.ts +6 -6
- package/src/api/ApiService.spec.ts +2 -2
- package/src/api/ApiServiceDeprecated.spec.ts +5 -2
- package/src/application/application.model.spec.ts +78 -79
- package/src/application/config/applicationAttributes.directive.html +6 -2
- package/src/application/config/applicationAttributes.directive.js +4 -0
- package/src/application/config/applicationConfig.view.html +14 -1
- package/src/application/config/customBanner/CustomBannerConfig.spec.tsx +3 -3
- package/src/application/config/dataSources/applicationDataSourceEditor.component.spec.ts +4 -3
- package/src/application/config/footer/configSectionFooter.component.spec.ts +2 -1
- package/src/application/listExtractor/AppListExtractor.spec.ts +4 -4
- package/src/application/modal/PermissionsConfigurer.spec.tsx +3 -2
- package/src/application/modal/editApplication.controller.modal.js +1 -0
- package/src/application/modal/editApplication.html +2 -2
- package/src/application/modal/validation/ApplicationNameValidator.spec.ts +2 -1
- package/src/application/modal/validation/validateApplicationName.directive.spec.ts +3 -2
- package/src/application/nav/ApplicationNavigation.spec.tsx +12 -11
- package/src/application/nav/NavItem.spec.tsx +7 -5
- package/src/application/nav/NavSection.spec.tsx +3 -2
- package/src/application/service/ApplicationReader.spec.ts +13 -8
- package/src/application/service/ApplicationWriter.spec.ts +4 -2
- package/src/application/service/InferredApplicationWarningService.spec.ts +2 -3
- package/src/artifact/expectedArtifact.service.spec.ts +2 -1
- package/src/artifact/react/ExpectedArtifactSelector.spec.tsx +2 -3
- package/src/authentication/AuthenticationInitializer.spec.ts +2 -1
- package/src/authentication/AuthenticationService.spec.ts +2 -1
- package/src/authentication/authentication.interceptor.spec.ts +4 -2
- package/src/cache/cacheInitializer.service.spec.ts +7 -4
- package/src/cache/infrastructureCaches.spec.ts +4 -4
- package/src/chaosMonkey/chaosMonkeyExceptions.component.spec.ts +4 -2
- package/src/cloudProvider/providerSelection/ProviderSelectionService.spec.ts +23 -21
- package/src/cluster/ClusterRuleMatcher.spec.ts +2 -1
- package/src/cluster/cluster.service.spec.ts +7 -7
- package/src/cluster/filter/ClusterFilterService.spec.ts +15 -14
- package/src/cluster/filter/LabelFilter.spec.tsx +3 -3
- package/src/cluster/filter/MultiselectModel.spec.ts +2 -2
- package/src/cluster/filter/labelFilterUtils.spec.ts +3 -7
- package/src/config/settings.ts +1 -3
- package/src/core.module.ts +1 -1
- package/src/filterModel/dependentFilter/DependentFilterService.spec.ts +1 -1
- package/src/function/filter/FunctionFilterService.spec.ts +5 -3
- package/src/function/function.read.service.spec.ts +4 -3
- package/src/header/customBanner/CustomBanner.spec.tsx +3 -4
- package/src/healthCounts/HealthCounts.spec.tsx +2 -2
- package/src/history/recentHistory.service.spec.ts +2 -1
- package/src/insight/InsightMenu.spec.tsx +9 -6
- package/src/instance/instance.write.service.spec.ts +8 -7
- package/src/instance/instanceType.service.ts +12 -2
- package/src/instance/instanceTypeService.spec.ts +2 -1
- package/src/loadBalancer/LoadBalancersTag.spec.tsx +8 -6
- package/src/loadBalancer/filter/LoadBalancerFilterService.spec.ts +2 -2
- package/src/managed/Environments.less +4 -4
- package/src/managed/Environments.tsx +1 -1
- package/src/managed/RelativeTimestamp.tsx +8 -6
- package/src/managed/artifactActions/ArtifactActions.tsx +77 -0
- package/src/managed/constraints/AllowedTimes.spec.ts +2 -1
- package/src/managed/constraints/registry.tsx +27 -1
- package/src/managed/environmentBaseElements/BaseEnvironment.less +3 -3
- package/src/managed/environmentBaseElements/EnvironmentItem.tsx +11 -4
- package/src/managed/graphql/graphql-sdk.ts +218 -29
- package/src/managed/graphql/schema.graphql +14 -1
- package/src/managed/overview/EnvironmentOverview.tsx +12 -15
- package/src/managed/overview/EnvironmentsOverview.less +6 -5
- package/src/managed/overview/PreviewEnvironments.tsx +0 -3
- package/src/managed/overview/Resource.less +1 -1
- package/src/managed/overview/Resource.tsx +62 -47
- package/src/managed/overview/artifact/Artifact.less +27 -52
- package/src/managed/overview/artifact/Artifact.tsx +86 -22
- package/src/managed/overview/artifact/ArtifactActionModal.less +19 -0
- package/src/managed/overview/artifact/ArtifactActionModal.tsx +150 -68
- package/src/managed/overview/artifact/ArtifactCollapsibleSection.tsx +32 -0
- package/src/managed/overview/artifact/ArtifactVersionTasks.tsx +2 -0
- package/src/managed/overview/artifact/{PendingVersion.tsx → ArtifactVersions.tsx} +35 -25
- package/src/managed/overview/artifact/Constraints.tsx +61 -21
- package/src/managed/overview/artifact/CurrentVersion.tsx +42 -27
- package/src/managed/overview/artifact/VersionTitle.tsx +18 -0
- package/src/managed/overview/artifact/hooks.ts +71 -34
- package/src/managed/overview/artifact/useCreateRollbackActions.hook.ts +75 -0
- package/src/managed/overview/artifact/utils.spec.ts +1 -1
- package/src/managed/overview/artifact/utils.ts +47 -80
- package/src/managed/overview/baseStyles.less +124 -88
- package/src/managed/overview/queries.graphql +54 -13
- package/src/managed/overview/useIsUpdatingResources.hook.ts +9 -0
- package/src/managed/resources/ResourceTitle.tsx +12 -5
- package/src/managed/utils/ActionModal.tsx +4 -1
- package/src/managed/utils/defaults.ts +3 -0
- package/src/managed/utils/useNotifyOnError.hook.ts +1 -1
- package/src/managed/versionMetadata/MetadataComponents.tsx +102 -70
- package/src/managed/versionMetadata/VersionMetadata.less +17 -18
- package/src/managed/versionMetadata/VersionMetadata.tsx +23 -31
- package/src/managed/versionsHistory/VersionContent.tsx +20 -13
- package/src/managed/versionsHistory/VersionHeading.tsx +2 -1
- package/src/managed/versionsHistory/VersionsHistory.less +11 -3
- package/src/manifest/PodNameProvider.spec.ts +1 -1
- package/src/navigation/customParamTypes.spec.ts +1 -1
- package/src/pagerDuty/pagerDuty.read.service.spec.ts +4 -2
- package/src/pagerDuty/pagerDutyTag.component.spec.ts +7 -3
- package/src/pipeline/config/PipelineRegistry.spec.ts +38 -37
- package/src/pipeline/config/actions/templateJson/ShowPipelineTemplateJsonModal.spec.tsx +3 -3
- package/src/pipeline/config/pipelineConfigurer.controller.spec.ts +3 -3
- package/src/pipeline/config/services/PipelineConfigService.spec.ts +4 -3
- package/src/pipeline/config/stages/bakeManifest/helm/BakeHelmConfigForm.spec.tsx +51 -8
- package/src/pipeline/config/stages/bakeManifest/helm/BakeHelmConfigForm.tsx +36 -6
- package/src/pipeline/config/stages/findArtifactFromExecution/findArtifactFromExecution.controller.spec.ts +2 -1
- package/src/pipeline/config/stages/manualJudgment/manualJudgment.service.spec.ts +6 -4
- package/src/pipeline/config/stages/travis/travisExecutionDetails.controller.spec.ts +5 -2
- package/src/pipeline/config/stages/travis/travisStage.controller.spec.ts +3 -2
- package/src/pipeline/config/stages/unmatchedStageTypeStage/unmatchedStageTypeStage.controller.spec.ts +2 -1
- package/src/pipeline/config/stages/wait/SkipWait.tsx +3 -1
- package/src/pipeline/config/stages/wercker/werckerExecutionDetails.controller.spec.ts +5 -2
- package/src/pipeline/config/stages/wercker/werckerStage.controller.spec.ts +3 -2
- package/src/pipeline/config/templates/Variable.spec.tsx +6 -5
- package/src/pipeline/config/templates/configurePipelineTemplateModal.controller.spec.ts +7 -8
- package/src/pipeline/config/templates/v2/configurePipelineTemplateModalV2.controller.spec.ts +7 -8
- package/src/pipeline/config/templates/v2/pipelineTemplateV2.service.spec.ts +1 -1
- package/src/pipeline/config/triggers/TriggersPageContent.spec.tsx +4 -4
- package/src/pipeline/config/triggers/TriggersPageContent.tsx +1 -2
- package/src/pipeline/config/triggers/artifacts/docker/defaultDocker.artifact.spec.ts +1 -2
- package/src/pipeline/config/validation/pipelineConfig.validator.spec.ts +14 -15
- package/src/pipeline/create/CreatePipelineModal.spec.tsx +9 -7
- package/src/pipeline/details/executionDetailsSection.service.spec.ts +3 -2
- package/src/pipeline/executions/Executions.spec.tsx +9 -6
- package/src/pipeline/executions/executionAction/ExecutionAction.spec.tsx +1 -1
- package/src/pipeline/executions/executionGroup/ExecutionGroup.tsx +2 -1
- package/src/pipeline/filter/executionFilter.service.spec.ts +1 -1
- package/src/pipeline/pipeline.dataSource.spec.ts +8 -7
- package/src/pipeline/service/ExecutionsTransformer.spec.ts +2 -2
- package/src/pipeline/service/execution.service.spec.ts +7 -5
- package/src/pipeline/status/Artifact.spec.tsx +7 -6
- package/src/pipeline/status/ArtifactList.spec.tsx +7 -6
- package/src/pipeline/status/ExecutionParameters.spec.tsx +5 -4
- package/src/pipeline/status/ResolvedArtifactList.spec.tsx +7 -6
- package/src/plugins/deck.plugin.spec.ts +4 -2
- package/src/plugins/plugin.registry.spec.ts +6 -4
- package/src/presentation/forms/SpinFormik.spec.tsx +3 -2
- package/src/presentation/forms/fields/FormikFormField.spec.tsx +3 -3
- package/src/presentation/forms/hooks/useSaveRestoreMutuallyExclusiveFields.hook.spec.tsx +4 -3
- package/src/presentation/forms/inputs/ChecklistInput.spec.tsx +1 -1
- package/src/presentation/forms/inputs/RadioButtonInput.spec.tsx +2 -1
- package/src/presentation/forms/inputs/SelectInput.spec.tsx +2 -1
- package/src/presentation/forms/inputs/hooks/useInternalValidator.hook.spec.tsx +4 -3
- package/src/presentation/forms/validation/FormValidator.spec.ts +2 -2
- package/src/presentation/forms/validation/useValidationData.spec.tsx +4 -3
- package/src/presentation/hooks/useContainerClassNames.hook.spec.tsx +2 -1
- package/src/presentation/hooks/useData.hook.spec.tsx +3 -2
- package/src/presentation/hooks/useDebouncedValue.hook.spec.tsx +1 -1
- package/src/presentation/hooks/useDeepObjectDiff.hook.spec.tsx +2 -1
- package/src/presentation/hooks/useEventListener.hook.spec.tsx +2 -1
- package/src/presentation/hooks/useForceUpdate.hook.spec.tsx +2 -1
- package/src/presentation/hooks/useInterval.hook.spec.tsx +2 -1
- package/src/presentation/hooks/useIsMountedRef.hook.spec.tsx +1 -1
- package/src/presentation/hooks/useLatestCallback.hook.spec.tsx +2 -1
- package/src/presentation/hooks/useLatestPromise.hook.spec.tsx +9 -3
- package/src/presentation/hooks/useMountStatusRef.hook.spec.tsx +3 -1
- package/src/presentation/hooks/usePollingData.hook.spec.tsx +3 -2
- package/src/presentation/hooks/usePrevious.hook.spec.tsx +2 -1
- package/src/presentation/navigation/pageNavigator.component.spec.ts +6 -6
- package/src/presentation/spel/SpelInput.spec.tsx +9 -4
- package/src/presentation/spel/SpelService.spec.ts +1 -1
- package/src/scheduler/SchedulerFactory.spec.ts +2 -1
- package/src/search/infrastructure/infrastructureSearch.service.ts +3 -2
- package/src/search/widgets/Filter.spec.tsx +5 -3
- package/src/search/widgets/Filters.spec.tsx +5 -3
- package/src/search/widgets/Search.spec.tsx +4 -2
- package/src/securityGroup/index.ts +2 -1
- package/src/securityGroup/securityGroupReader.service.spec.ts +8 -10
- package/src/serverGroup/configure/common/deployInitializer.component.spec.ts +7 -3
- package/src/serverGroup/configure/common/v2instanceArchetypeSelector.component.ts +1 -1
- package/src/serverGroup/details/capacity/CapacityDetailsSection.spec.tsx +1 -1
- package/src/serverGroup/details/scalingActivities/ScalingActivitiesModal.spec.ts +2 -1
- package/src/serverGroup/details/serverGroupWarningMessage.service.spec.ts +4 -4
- package/src/serverGroup/serverGroupWriter.service.spec.ts +10 -8
- package/src/slack/SlackReader.spec.ts +2 -1
- package/src/subnet/subnet.read.service.spec.ts +4 -3
- package/src/task/monitor/taskMonitor.spec.ts +6 -5
- package/src/task/task.dataSource.spec.ts +5 -4
- package/src/task/task.write.service.spec.ts +3 -1
- package/src/utils/clipboard/CopyToClipboard.spec.tsx +2 -1
- package/src/utils/json/json.utility.service.spec.ts +2 -1
- package/src/utils/timeFormatters.spec.ts +3 -2
- package/src/utils/workerPool.spec.ts +2 -1
- package/src/widgets/ApplicationsPickerInput.spec.tsx +3 -2
- package/src/widgets/spelText/SpelAutocompleteService.spec.ts +4 -3
- package/src/widgets/tags/Tag.spec.tsx +4 -2
- package/src/widgets/tags/TagList.spec.tsx +5 -3
- package/src/yamlEditor/yamlEditorUtils.spec.ts +1 -1
- package/dist/managed/overview/artifact/PendingVersion.d.ts +0 -7
|
@@ -55,6 +55,8 @@ export interface MdArtifact {
|
|
|
55
55
|
reference: Scalars['String'];
|
|
56
56
|
versions?: Maybe<Array<MdArtifactVersionInEnvironment>>;
|
|
57
57
|
pinnedVersion?: Maybe<MdPinnedVersion>;
|
|
58
|
+
latestApprovedVersion?: Maybe<MdArtifactVersionInEnvironment>;
|
|
59
|
+
resources?: Maybe<Array<MdResource>>;
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
export interface MdArtifactVersionsArgs {
|
|
@@ -87,7 +89,6 @@ export interface MdArtifactVersionInEnvironment {
|
|
|
87
89
|
buildNumber?: Maybe<Scalars['String']>;
|
|
88
90
|
createdAt?: Maybe<Scalars['InstantTime']>;
|
|
89
91
|
deployedAt?: Maybe<Scalars['InstantTime']>;
|
|
90
|
-
resources?: Maybe<Array<MdResource>>;
|
|
91
92
|
gitMetadata?: Maybe<MdGitMetadata>;
|
|
92
93
|
packageDiff?: Maybe<MdPackageDiff>;
|
|
93
94
|
environment?: Maybe<Scalars['String']>;
|
|
@@ -330,6 +331,7 @@ export interface MdResource {
|
|
|
330
331
|
|
|
331
332
|
export interface MdResourceActuationState {
|
|
332
333
|
__typename?: 'MdResourceActuationState';
|
|
334
|
+
resourceId: Scalars['String'];
|
|
333
335
|
status: MdResourceActuationStatus;
|
|
334
336
|
reason?: Maybe<Scalars['String']>;
|
|
335
337
|
event?: Maybe<Scalars['String']>;
|
|
@@ -342,9 +344,18 @@ export interface MdResourceTask {
|
|
|
342
344
|
__typename?: 'MdResourceTask';
|
|
343
345
|
id: Scalars['String'];
|
|
344
346
|
name: Scalars['String'];
|
|
347
|
+
running: Scalars['Boolean'];
|
|
345
348
|
summary?: Maybe<MdExecutionSummary>;
|
|
346
349
|
}
|
|
347
350
|
|
|
351
|
+
export interface MdRestartConstraintEvaluationPayload {
|
|
352
|
+
application: Scalars['String'];
|
|
353
|
+
environment: Scalars['String'];
|
|
354
|
+
type: Scalars['String'];
|
|
355
|
+
reference: Scalars['String'];
|
|
356
|
+
version: Scalars['String'];
|
|
357
|
+
}
|
|
358
|
+
|
|
348
359
|
export interface MdRetryArtifactActionPayload {
|
|
349
360
|
application: Scalars['String'];
|
|
350
361
|
environment: Scalars['String'];
|
|
@@ -409,6 +420,7 @@ export interface MdVersionVeto {
|
|
|
409
420
|
export interface Mutation {
|
|
410
421
|
__typename?: 'Mutation';
|
|
411
422
|
updateConstraintStatus?: Maybe<Scalars['Boolean']>;
|
|
423
|
+
restartConstraintEvaluation?: Maybe<Scalars['Boolean']>;
|
|
412
424
|
toggleManagement?: Maybe<Scalars['Boolean']>;
|
|
413
425
|
pinArtifactVersion?: Maybe<Scalars['Boolean']>;
|
|
414
426
|
markArtifactVersionAsBad?: Maybe<Scalars['Boolean']>;
|
|
@@ -425,6 +437,10 @@ export interface MutationUpdateConstraintStatusArgs {
|
|
|
425
437
|
payload: MdConstraintStatusPayload;
|
|
426
438
|
}
|
|
427
439
|
|
|
440
|
+
export interface MutationRestartConstraintEvaluationArgs {
|
|
441
|
+
payload: MdRestartConstraintEvaluationPayload;
|
|
442
|
+
}
|
|
443
|
+
|
|
428
444
|
export interface MutationToggleManagementArgs {
|
|
429
445
|
application: Scalars['ID'];
|
|
430
446
|
isPaused: Scalars['Boolean'];
|
|
@@ -538,6 +554,14 @@ export type BaseEnvironmentFieldsFragment = { __typename?: 'MdEnvironment' } & P
|
|
|
538
554
|
>;
|
|
539
555
|
};
|
|
540
556
|
|
|
557
|
+
export type BaesResourceFieldsFragment = { __typename?: 'MdResource' } & Pick<
|
|
558
|
+
MdResource,
|
|
559
|
+
'id' | 'kind' | 'displayName' | 'rawDefinition'
|
|
560
|
+
> & {
|
|
561
|
+
moniker?: Maybe<{ __typename?: 'MdMoniker' } & Pick<MdMoniker, 'app' | 'stack' | 'detail'>>;
|
|
562
|
+
location?: Maybe<{ __typename?: 'MdLocation' } & Pick<MdLocation, 'account' | 'regions'>>;
|
|
563
|
+
};
|
|
564
|
+
|
|
541
565
|
export type FetchApplicationQueryVariables = Exact<{
|
|
542
566
|
appName: Scalars['String'];
|
|
543
567
|
statuses?: Maybe<Array<MdArtifactStatusInEnvironment> | MdArtifactStatusInEnvironment>;
|
|
@@ -545,7 +569,7 @@ export type FetchApplicationQueryVariables = Exact<{
|
|
|
545
569
|
|
|
546
570
|
export type FetchApplicationQuery = { __typename?: 'Query' } & {
|
|
547
571
|
application?: Maybe<
|
|
548
|
-
{ __typename?: 'MdApplication' } & Pick<MdApplication, 'id' | 'name'
|
|
572
|
+
{ __typename?: 'MdApplication' } & Pick<MdApplication, 'id' | 'name'> & {
|
|
549
573
|
config?: Maybe<{ __typename?: 'MdConfig' } & Pick<MdConfig, 'id' | 'previewEnvironmentsConfigured'>>;
|
|
550
574
|
environments: Array<
|
|
551
575
|
{ __typename?: 'MdEnvironment' } & Pick<MdEnvironment, 'isDeleting'> & {
|
|
@@ -559,20 +583,11 @@ export type FetchApplicationQuery = { __typename?: 'Query' } & {
|
|
|
559
583
|
versions?: Maybe<
|
|
560
584
|
Array<{ __typename?: 'MdArtifactVersionInEnvironment' } & DetailedVersionFieldsFragment>
|
|
561
585
|
>;
|
|
586
|
+
resources?: Maybe<Array<{ __typename?: 'MdResource' } & BaesResourceFieldsFragment>>;
|
|
562
587
|
} & ArtifactPinnedVersionFieldsFragment
|
|
563
588
|
>
|
|
564
589
|
>;
|
|
565
|
-
resources?: Maybe<
|
|
566
|
-
Array<
|
|
567
|
-
{ __typename?: 'MdResource' } & Pick<
|
|
568
|
-
MdResource,
|
|
569
|
-
'id' | 'kind' | 'displayName' | 'rawDefinition'
|
|
570
|
-
> & {
|
|
571
|
-
moniker?: Maybe<{ __typename?: 'MdMoniker' } & Pick<MdMoniker, 'app' | 'stack' | 'detail'>>;
|
|
572
|
-
location?: Maybe<{ __typename?: 'MdLocation' } & Pick<MdLocation, 'account' | 'regions'>>;
|
|
573
|
-
}
|
|
574
|
-
>
|
|
575
|
-
>;
|
|
590
|
+
resources?: Maybe<Array<{ __typename?: 'MdResource' } & BaesResourceFieldsFragment>>;
|
|
576
591
|
};
|
|
577
592
|
} & BaseEnvironmentFieldsFragment
|
|
578
593
|
>;
|
|
@@ -580,6 +595,45 @@ export type FetchApplicationQuery = { __typename?: 'Query' } & {
|
|
|
580
595
|
>;
|
|
581
596
|
};
|
|
582
597
|
|
|
598
|
+
export type FetchCurrentVersionQueryVariables = Exact<{
|
|
599
|
+
appName: Scalars['String'];
|
|
600
|
+
}>;
|
|
601
|
+
|
|
602
|
+
export type FetchCurrentVersionQuery = { __typename?: 'Query' } & {
|
|
603
|
+
application?: Maybe<
|
|
604
|
+
{ __typename?: 'MdApplication' } & Pick<MdApplication, 'id' | 'name'> & {
|
|
605
|
+
environments: Array<
|
|
606
|
+
{ __typename?: 'MdEnvironment' } & Pick<MdEnvironment, 'id' | 'name'> & {
|
|
607
|
+
state: { __typename?: 'MdEnvironmentState' } & {
|
|
608
|
+
artifacts?: Maybe<
|
|
609
|
+
Array<
|
|
610
|
+
{ __typename?: 'MdArtifact' } & Pick<MdArtifact, 'id' | 'name' | 'reference' | 'environment'> & {
|
|
611
|
+
versions?: Maybe<
|
|
612
|
+
Array<
|
|
613
|
+
{ __typename?: 'MdArtifactVersionInEnvironment' } & Pick<
|
|
614
|
+
MdArtifactVersionInEnvironment,
|
|
615
|
+
'id' | 'version' | 'buildNumber' | 'createdAt'
|
|
616
|
+
> & {
|
|
617
|
+
gitMetadata?: Maybe<
|
|
618
|
+
{ __typename?: 'MdGitMetadata' } & Pick<MdGitMetadata, 'commit'> & {
|
|
619
|
+
commitInfo?: Maybe<
|
|
620
|
+
{ __typename?: 'MdCommitInfo' } & Pick<MdCommitInfo, 'sha' | 'message'>
|
|
621
|
+
>;
|
|
622
|
+
}
|
|
623
|
+
>;
|
|
624
|
+
}
|
|
625
|
+
>
|
|
626
|
+
>;
|
|
627
|
+
}
|
|
628
|
+
>
|
|
629
|
+
>;
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
>;
|
|
633
|
+
}
|
|
634
|
+
>;
|
|
635
|
+
};
|
|
636
|
+
|
|
583
637
|
export type FetchVersionsHistoryQueryVariables = Exact<{
|
|
584
638
|
appName: Scalars['String'];
|
|
585
639
|
limit?: Maybe<Scalars['Int']>;
|
|
@@ -587,7 +641,7 @@ export type FetchVersionsHistoryQueryVariables = Exact<{
|
|
|
587
641
|
|
|
588
642
|
export type FetchVersionsHistoryQuery = { __typename?: 'Query' } & {
|
|
589
643
|
application?: Maybe<
|
|
590
|
-
{ __typename?: 'MdApplication' } & Pick<MdApplication, 'id' | 'name'
|
|
644
|
+
{ __typename?: 'MdApplication' } & Pick<MdApplication, 'id' | 'name'> & {
|
|
591
645
|
environments: Array<
|
|
592
646
|
{ __typename?: 'MdEnvironment' } & {
|
|
593
647
|
state: { __typename?: 'MdEnvironmentState' } & Pick<MdEnvironmentState, 'id'> & {
|
|
@@ -836,6 +890,15 @@ export type ToggleResourceManagementMutationVariables = Exact<{
|
|
|
836
890
|
|
|
837
891
|
export type ToggleResourceManagementMutation = { __typename?: 'Mutation' } & Pick<Mutation, 'toggleResourceManagement'>;
|
|
838
892
|
|
|
893
|
+
export type RestartConstraintEvaluationMutationVariables = Exact<{
|
|
894
|
+
payload: MdRestartConstraintEvaluationPayload;
|
|
895
|
+
}>;
|
|
896
|
+
|
|
897
|
+
export type RestartConstraintEvaluationMutation = { __typename?: 'Mutation' } & Pick<
|
|
898
|
+
Mutation,
|
|
899
|
+
'restartConstraintEvaluation'
|
|
900
|
+
>;
|
|
901
|
+
|
|
839
902
|
export const ActionDetailsFragmentDoc = gql`
|
|
840
903
|
fragment actionDetails on MdAction {
|
|
841
904
|
id
|
|
@@ -933,12 +996,28 @@ export const BaseEnvironmentFieldsFragmentDoc = gql`
|
|
|
933
996
|
basedOn
|
|
934
997
|
}
|
|
935
998
|
`;
|
|
999
|
+
export const BaesResourceFieldsFragmentDoc = gql`
|
|
1000
|
+
fragment baesResourceFields on MdResource {
|
|
1001
|
+
id
|
|
1002
|
+
kind
|
|
1003
|
+
displayName
|
|
1004
|
+
moniker {
|
|
1005
|
+
app
|
|
1006
|
+
stack
|
|
1007
|
+
detail
|
|
1008
|
+
}
|
|
1009
|
+
location {
|
|
1010
|
+
account
|
|
1011
|
+
regions
|
|
1012
|
+
}
|
|
1013
|
+
rawDefinition
|
|
1014
|
+
}
|
|
1015
|
+
`;
|
|
936
1016
|
export const FetchApplicationDocument = gql`
|
|
937
1017
|
query fetchApplication($appName: String!, $statuses: [MdArtifactStatusInEnvironment!]) {
|
|
938
1018
|
application(appName: $appName) {
|
|
939
1019
|
id
|
|
940
1020
|
name
|
|
941
|
-
account
|
|
942
1021
|
config {
|
|
943
1022
|
id
|
|
944
1023
|
previewEnvironmentsConfigured
|
|
@@ -958,21 +1037,12 @@ export const FetchApplicationDocument = gql`
|
|
|
958
1037
|
...detailedVersionFields
|
|
959
1038
|
}
|
|
960
1039
|
...artifactPinnedVersionFields
|
|
1040
|
+
resources {
|
|
1041
|
+
...baesResourceFields
|
|
1042
|
+
}
|
|
961
1043
|
}
|
|
962
1044
|
resources {
|
|
963
|
-
|
|
964
|
-
kind
|
|
965
|
-
displayName
|
|
966
|
-
moniker {
|
|
967
|
-
app
|
|
968
|
-
stack
|
|
969
|
-
detail
|
|
970
|
-
}
|
|
971
|
-
location {
|
|
972
|
-
account
|
|
973
|
-
regions
|
|
974
|
-
}
|
|
975
|
-
rawDefinition
|
|
1045
|
+
...baesResourceFields
|
|
976
1046
|
}
|
|
977
1047
|
}
|
|
978
1048
|
}
|
|
@@ -981,6 +1051,7 @@ export const FetchApplicationDocument = gql`
|
|
|
981
1051
|
${BaseEnvironmentFieldsFragmentDoc}
|
|
982
1052
|
${DetailedVersionFieldsFragmentDoc}
|
|
983
1053
|
${ArtifactPinnedVersionFieldsFragmentDoc}
|
|
1054
|
+
${BaesResourceFieldsFragmentDoc}
|
|
984
1055
|
`;
|
|
985
1056
|
|
|
986
1057
|
/**
|
|
@@ -1015,12 +1086,85 @@ export function useFetchApplicationLazyQuery(
|
|
|
1015
1086
|
export type FetchApplicationQueryHookResult = ReturnType<typeof useFetchApplicationQuery>;
|
|
1016
1087
|
export type FetchApplicationLazyQueryHookResult = ReturnType<typeof useFetchApplicationLazyQuery>;
|
|
1017
1088
|
export type FetchApplicationQueryResult = Apollo.QueryResult<FetchApplicationQuery, FetchApplicationQueryVariables>;
|
|
1089
|
+
export const FetchCurrentVersionDocument = gql`
|
|
1090
|
+
query fetchCurrentVersion($appName: String!) {
|
|
1091
|
+
application(appName: $appName) {
|
|
1092
|
+
id
|
|
1093
|
+
name
|
|
1094
|
+
environments {
|
|
1095
|
+
id
|
|
1096
|
+
name
|
|
1097
|
+
state {
|
|
1098
|
+
artifacts {
|
|
1099
|
+
id
|
|
1100
|
+
name
|
|
1101
|
+
reference
|
|
1102
|
+
environment
|
|
1103
|
+
versions(statuses: [CURRENT]) {
|
|
1104
|
+
id
|
|
1105
|
+
version
|
|
1106
|
+
buildNumber
|
|
1107
|
+
createdAt
|
|
1108
|
+
gitMetadata {
|
|
1109
|
+
commit
|
|
1110
|
+
commitInfo {
|
|
1111
|
+
sha
|
|
1112
|
+
message
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
`;
|
|
1122
|
+
|
|
1123
|
+
/**
|
|
1124
|
+
* __useFetchCurrentVersionQuery__
|
|
1125
|
+
*
|
|
1126
|
+
* To run a query within a React component, call `useFetchCurrentVersionQuery` and pass it any options that fit your needs.
|
|
1127
|
+
* When your component renders, `useFetchCurrentVersionQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
1128
|
+
* you can use to render your UI.
|
|
1129
|
+
*
|
|
1130
|
+
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
1131
|
+
*
|
|
1132
|
+
* @example
|
|
1133
|
+
* const { data, loading, error } = useFetchCurrentVersionQuery({
|
|
1134
|
+
* variables: {
|
|
1135
|
+
* appName: // value for 'appName'
|
|
1136
|
+
* },
|
|
1137
|
+
* });
|
|
1138
|
+
*/
|
|
1139
|
+
export function useFetchCurrentVersionQuery(
|
|
1140
|
+
baseOptions: Apollo.QueryHookOptions<FetchCurrentVersionQuery, FetchCurrentVersionQueryVariables>,
|
|
1141
|
+
) {
|
|
1142
|
+
const options = { ...defaultOptions, ...baseOptions };
|
|
1143
|
+
return Apollo.useQuery<FetchCurrentVersionQuery, FetchCurrentVersionQueryVariables>(
|
|
1144
|
+
FetchCurrentVersionDocument,
|
|
1145
|
+
options,
|
|
1146
|
+
);
|
|
1147
|
+
}
|
|
1148
|
+
export function useFetchCurrentVersionLazyQuery(
|
|
1149
|
+
baseOptions?: Apollo.LazyQueryHookOptions<FetchCurrentVersionQuery, FetchCurrentVersionQueryVariables>,
|
|
1150
|
+
) {
|
|
1151
|
+
const options = { ...defaultOptions, ...baseOptions };
|
|
1152
|
+
return Apollo.useLazyQuery<FetchCurrentVersionQuery, FetchCurrentVersionQueryVariables>(
|
|
1153
|
+
FetchCurrentVersionDocument,
|
|
1154
|
+
options,
|
|
1155
|
+
);
|
|
1156
|
+
}
|
|
1157
|
+
export type FetchCurrentVersionQueryHookResult = ReturnType<typeof useFetchCurrentVersionQuery>;
|
|
1158
|
+
export type FetchCurrentVersionLazyQueryHookResult = ReturnType<typeof useFetchCurrentVersionLazyQuery>;
|
|
1159
|
+
export type FetchCurrentVersionQueryResult = Apollo.QueryResult<
|
|
1160
|
+
FetchCurrentVersionQuery,
|
|
1161
|
+
FetchCurrentVersionQueryVariables
|
|
1162
|
+
>;
|
|
1018
1163
|
export const FetchVersionsHistoryDocument = gql`
|
|
1019
1164
|
query fetchVersionsHistory($appName: String!, $limit: Int) {
|
|
1020
1165
|
application(appName: $appName) {
|
|
1021
1166
|
id
|
|
1022
1167
|
name
|
|
1023
|
-
account
|
|
1024
1168
|
environments {
|
|
1025
1169
|
...baseEnvironmentFields
|
|
1026
1170
|
state {
|
|
@@ -1942,3 +2086,48 @@ export type ToggleResourceManagementMutationOptions = Apollo.BaseMutationOptions
|
|
|
1942
2086
|
ToggleResourceManagementMutation,
|
|
1943
2087
|
ToggleResourceManagementMutationVariables
|
|
1944
2088
|
>;
|
|
2089
|
+
export const RestartConstraintEvaluationDocument = gql`
|
|
2090
|
+
mutation RestartConstraintEvaluation($payload: MdRestartConstraintEvaluationPayload!) {
|
|
2091
|
+
restartConstraintEvaluation(payload: $payload)
|
|
2092
|
+
}
|
|
2093
|
+
`;
|
|
2094
|
+
export type RestartConstraintEvaluationMutationFn = Apollo.MutationFunction<
|
|
2095
|
+
RestartConstraintEvaluationMutation,
|
|
2096
|
+
RestartConstraintEvaluationMutationVariables
|
|
2097
|
+
>;
|
|
2098
|
+
|
|
2099
|
+
/**
|
|
2100
|
+
* __useRestartConstraintEvaluationMutation__
|
|
2101
|
+
*
|
|
2102
|
+
* To run a mutation, you first call `useRestartConstraintEvaluationMutation` within a React component and pass it any options that fit your needs.
|
|
2103
|
+
* When your component renders, `useRestartConstraintEvaluationMutation` returns a tuple that includes:
|
|
2104
|
+
* - A mutate function that you can call at any time to execute the mutation
|
|
2105
|
+
* - An object with fields that represent the current status of the mutation's execution
|
|
2106
|
+
*
|
|
2107
|
+
* @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
|
|
2108
|
+
*
|
|
2109
|
+
* @example
|
|
2110
|
+
* const [restartConstraintEvaluationMutation, { data, loading, error }] = useRestartConstraintEvaluationMutation({
|
|
2111
|
+
* variables: {
|
|
2112
|
+
* payload: // value for 'payload'
|
|
2113
|
+
* },
|
|
2114
|
+
* });
|
|
2115
|
+
*/
|
|
2116
|
+
export function useRestartConstraintEvaluationMutation(
|
|
2117
|
+
baseOptions?: Apollo.MutationHookOptions<
|
|
2118
|
+
RestartConstraintEvaluationMutation,
|
|
2119
|
+
RestartConstraintEvaluationMutationVariables
|
|
2120
|
+
>,
|
|
2121
|
+
) {
|
|
2122
|
+
const options = { ...defaultOptions, ...baseOptions };
|
|
2123
|
+
return Apollo.useMutation<RestartConstraintEvaluationMutation, RestartConstraintEvaluationMutationVariables>(
|
|
2124
|
+
RestartConstraintEvaluationDocument,
|
|
2125
|
+
options,
|
|
2126
|
+
);
|
|
2127
|
+
}
|
|
2128
|
+
export type RestartConstraintEvaluationMutationHookResult = ReturnType<typeof useRestartConstraintEvaluationMutation>;
|
|
2129
|
+
export type RestartConstraintEvaluationMutationResult = Apollo.MutationResult<RestartConstraintEvaluationMutation>;
|
|
2130
|
+
export type RestartConstraintEvaluationMutationOptions = Apollo.BaseMutationOptions<
|
|
2131
|
+
RestartConstraintEvaluationMutation,
|
|
2132
|
+
RestartConstraintEvaluationMutationVariables
|
|
2133
|
+
>;
|
|
@@ -77,6 +77,8 @@ type MdArtifact {
|
|
|
77
77
|
reference: String!
|
|
78
78
|
versions(statuses: [MdArtifactStatusInEnvironment!], versions: [String!], limit: Int): [MdArtifactVersionInEnvironment!]
|
|
79
79
|
pinnedVersion: MdPinnedVersion
|
|
80
|
+
latestApprovedVersion: MdArtifactVersionInEnvironment
|
|
81
|
+
resources: [MdResource!]
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
type MdArtifactVersionInEnvironment {
|
|
@@ -85,7 +87,6 @@ type MdArtifactVersionInEnvironment {
|
|
|
85
87
|
buildNumber: String
|
|
86
88
|
createdAt: InstantTime
|
|
87
89
|
deployedAt: InstantTime
|
|
88
|
-
resources: [MdResource!]
|
|
89
90
|
gitMetadata: MdGitMetadata
|
|
90
91
|
packageDiff: MdPackageDiff
|
|
91
92
|
environment: String
|
|
@@ -189,6 +190,7 @@ enum MdResourceActuationStatus {
|
|
|
189
190
|
}
|
|
190
191
|
|
|
191
192
|
type MdResourceActuationState {
|
|
193
|
+
resourceId: String!
|
|
192
194
|
status: MdResourceActuationStatus!
|
|
193
195
|
reason: String
|
|
194
196
|
event: String
|
|
@@ -198,6 +200,7 @@ type MdResourceActuationState {
|
|
|
198
200
|
type MdResourceTask {
|
|
199
201
|
id: String!
|
|
200
202
|
name: String!
|
|
203
|
+
running: Boolean!
|
|
201
204
|
summary: MdExecutionSummary
|
|
202
205
|
}
|
|
203
206
|
|
|
@@ -312,6 +315,7 @@ type MdAction {
|
|
|
312
315
|
|
|
313
316
|
type Mutation @extends {
|
|
314
317
|
updateConstraintStatus(payload: MdConstraintStatusPayload!): Boolean
|
|
318
|
+
restartConstraintEvaluation(payload: MdRestartConstraintEvaluationPayload!): Boolean
|
|
315
319
|
toggleManagement(application: ID!, isPaused: Boolean!, comment: String): Boolean
|
|
316
320
|
pinArtifactVersion(payload: MdArtifactVersionActionPayload!): Boolean
|
|
317
321
|
markArtifactVersionAsBad(payload: MdArtifactVersionActionPayload!): Boolean
|
|
@@ -324,6 +328,15 @@ type Mutation @extends {
|
|
|
324
328
|
importDeliveryConfig(application: String!): Boolean
|
|
325
329
|
}
|
|
326
330
|
|
|
331
|
+
input MdRestartConstraintEvaluationPayload {
|
|
332
|
+
application: String!
|
|
333
|
+
environment: String!
|
|
334
|
+
type: String!
|
|
335
|
+
reference: String!
|
|
336
|
+
version: String!
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
|
|
327
340
|
input MdToggleResourceManagementPayload {
|
|
328
341
|
id: ID!
|
|
329
342
|
isPaused: Boolean!
|
|
@@ -3,9 +3,8 @@ import React from 'react';
|
|
|
3
3
|
import { Resource } from './Resource';
|
|
4
4
|
import { Artifact } from './artifact/Artifact';
|
|
5
5
|
import { BaseEnvironment } from '../environmentBaseElements/BaseEnvironment';
|
|
6
|
-
import { useFetchResourceStatusQuery } from '../graphql/graphql-sdk';
|
|
7
6
|
import type { ICollapsibleSectionProps } from '../../presentation';
|
|
8
|
-
import { CollapsibleSection
|
|
7
|
+
import { CollapsibleSection } from '../../presentation';
|
|
9
8
|
import type { QueryEnvironment } from './types';
|
|
10
9
|
|
|
11
10
|
const sectionProps: Partial<ICollapsibleSectionProps> = {
|
|
@@ -19,11 +18,8 @@ interface IEnvironmentProps {
|
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
export const EnvironmentOverview = ({ environment }: IEnvironmentProps) => {
|
|
22
|
-
const app = useApplicationContextSafe();
|
|
23
|
-
const { data } = useFetchResourceStatusQuery({ variables: { appName: app.name } });
|
|
24
|
-
const resources = data?.application?.environments.find((env) => env.name === environment.name)?.state.resources;
|
|
25
|
-
const hasResourcesWithIssues = resources?.some((resource) => resource.state?.status !== 'UP_TO_DATE');
|
|
26
21
|
const state = environment.state;
|
|
22
|
+
|
|
27
23
|
return (
|
|
28
24
|
<BaseEnvironment
|
|
29
25
|
name={environment.name}
|
|
@@ -32,20 +28,21 @@ export const EnvironmentOverview = ({ environment }: IEnvironmentProps) => {
|
|
|
32
28
|
isPreview={environment.isPreview}
|
|
33
29
|
isDeleting={environment.isDeleting}
|
|
34
30
|
>
|
|
35
|
-
<CollapsibleSection
|
|
31
|
+
<CollapsibleSection
|
|
32
|
+
heading="Code deployments"
|
|
33
|
+
{...sectionProps}
|
|
34
|
+
defaultExpanded
|
|
35
|
+
cacheKey={`${environment.name}-artifacts`}
|
|
36
|
+
>
|
|
36
37
|
{state.artifacts?.length ? (
|
|
37
|
-
state.artifacts.map((artifact) =>
|
|
38
|
+
state.artifacts.map((artifact) => (
|
|
39
|
+
<Artifact key={artifact.reference} artifact={artifact} isPreview={environment.isPreview} />
|
|
40
|
+
))
|
|
38
41
|
) : (
|
|
39
42
|
<NoItemsMessage>No artifacts found</NoItemsMessage>
|
|
40
43
|
)}
|
|
41
44
|
</CollapsibleSection>
|
|
42
|
-
<CollapsibleSection
|
|
43
|
-
heading="Resources"
|
|
44
|
-
key={`resources-section-${Boolean(data)}`} // This is used remount the section for defaultExpanded to work
|
|
45
|
-
{...sectionProps}
|
|
46
|
-
enableCaching={false}
|
|
47
|
-
defaultExpanded={hasResourcesWithIssues}
|
|
48
|
-
>
|
|
45
|
+
<CollapsibleSection heading="Infrastructure" {...sectionProps} enableCaching={false}>
|
|
49
46
|
{state.resources?.length ? (
|
|
50
47
|
state.resources.map((resource) => (
|
|
51
48
|
<Resource key={resource.id} resource={resource} environment={environment.name} />
|
|
@@ -11,21 +11,22 @@
|
|
|
11
11
|
align-items: center;
|
|
12
12
|
cursor: pointer;
|
|
13
13
|
padding: var(--l-spacing) var(--base-horizontal-padding);
|
|
14
|
-
|
|
14
|
+
text-transform: uppercase;
|
|
15
|
+
color: var(--color-primary);
|
|
15
16
|
margin: 0;
|
|
16
|
-
font-weight:
|
|
17
|
-
font-size:
|
|
17
|
+
font-weight: 700;
|
|
18
|
+
font-size: 16px;
|
|
19
|
+
letter-spacing: 0.3px;
|
|
18
20
|
line-height: 1;
|
|
19
21
|
border-bottom: 1px solid var(--color-cirrus);
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
.environment-section-body {
|
|
23
|
-
padding-bottom: var(--
|
|
25
|
+
padding-bottom: var(--l-spacing);
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
&:not(:last-of-type) {
|
|
27
29
|
.environment-section-body {
|
|
28
|
-
padding-bottom: var(--xl-spacing);
|
|
29
30
|
border-bottom: 1px solid var(--color-cirrus);
|
|
30
31
|
}
|
|
31
32
|
}
|
|
@@ -28,9 +28,6 @@ export const PreviewEnvironments = ({ orderedEnvironments, isConfigured }: IPrev
|
|
|
28
28
|
{isConfigured && !hasActivePreviewEnvironments && (
|
|
29
29
|
<div className="self-left">
|
|
30
30
|
No PRs matching your branch filter were found.
|
|
31
|
-
<br />
|
|
32
|
-
Your preview environments will automatically appear here once you create a PR from a branch matching your
|
|
33
|
-
config definition.{' '}
|
|
34
31
|
{docsLink && (
|
|
35
32
|
<a target="_blank" onClick={() => logClick({ action: 'Learn More' })} href={docsLink}>
|
|
36
33
|
Learn More
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import classnames from 'classnames';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
|
|
3
4
|
import { ResourceTask } from './ResourceTask';
|
|
4
5
|
import { ConfirmationModalService } from '../../confirmationModal/confirmationModal.service';
|
|
6
|
+
import type { IEnvironmentItemProps } from '../environmentBaseElements/EnvironmentItem';
|
|
5
7
|
import { EnvironmentItem } from '../environmentBaseElements/EnvironmentItem';
|
|
6
8
|
import type { MdResourceActuationState } from '../graphql/graphql-sdk';
|
|
7
9
|
import {
|
|
@@ -14,7 +16,6 @@ import { showManagedResourceHistoryModal } from '../resourceHistory/ManagedResou
|
|
|
14
16
|
import { showResourceDefinitionModal } from '../resources/ResourceDefinitionModal';
|
|
15
17
|
import { ResourceTitle } from '../resources/ResourceTitle';
|
|
16
18
|
import { ToggleResourceManagement } from '../resources/ToggleResourceManagement';
|
|
17
|
-
import type { IResourceLinkProps } from '../resources/resourceRegistry';
|
|
18
19
|
import { resourceManager } from '../resources/resourceRegistry';
|
|
19
20
|
import type { QueryResource } from './types';
|
|
20
21
|
import { getIsDebugMode } from '../utils/debugMode';
|
|
@@ -116,68 +117,82 @@ const Status = ({ appName, environmentName, resourceId, regions, account }: ISta
|
|
|
116
117
|
);
|
|
117
118
|
};
|
|
118
119
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
interface IBaseResourceProps {
|
|
121
|
+
resource: QueryResource;
|
|
122
|
+
environment: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const ResourceMetadata = ({ resource }: IBaseResourceProps) => {
|
|
122
126
|
const logEvent = useLogEvent('Resource');
|
|
123
127
|
const isDebug = getIsDebugMode();
|
|
124
128
|
|
|
125
129
|
const account = resource.location?.account;
|
|
126
|
-
|
|
127
|
-
const resourceLinkProps: IResourceLinkProps = {
|
|
128
|
-
kind: resource.kind,
|
|
129
|
-
displayName: resource.displayName,
|
|
130
|
-
account,
|
|
131
|
-
detail: resource.moniker?.detail,
|
|
132
|
-
stack: resource.moniker?.stack,
|
|
133
|
-
};
|
|
134
|
-
|
|
135
130
|
const regions = resource.location?.regions || [];
|
|
136
131
|
|
|
137
132
|
return (
|
|
138
|
-
<
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
)
|
|
152
|
-
|
|
153
|
-
|
|
133
|
+
<div className="resource-metadata delimited-elements">
|
|
134
|
+
<span>
|
|
135
|
+
{regions.map((region, index) => (
|
|
136
|
+
<span key={region}>
|
|
137
|
+
{region}
|
|
138
|
+
{index < regions.length - 1 && ', '}
|
|
139
|
+
</span>
|
|
140
|
+
))}
|
|
141
|
+
</span>
|
|
142
|
+
{account && <span>{account}</span>}
|
|
143
|
+
<span>
|
|
144
|
+
<a
|
|
145
|
+
href="#"
|
|
146
|
+
onClick={(e) => {
|
|
147
|
+
e.preventDefault();
|
|
148
|
+
showManagedResourceHistoryModal({ id: resource.id, displayName: resource.displayName || resource.id });
|
|
149
|
+
logEvent({ action: 'ViewHistory' });
|
|
150
|
+
}}
|
|
151
|
+
>
|
|
152
|
+
View history
|
|
153
|
+
</a>
|
|
154
|
+
</span>
|
|
155
|
+
{isDebug && (
|
|
154
156
|
<span>
|
|
155
157
|
<a
|
|
156
158
|
href="#"
|
|
157
159
|
onClick={(e) => {
|
|
158
160
|
e.preventDefault();
|
|
159
|
-
|
|
160
|
-
logEvent({ action: '
|
|
161
|
+
showResourceDefinitionModal({ resource: resource });
|
|
162
|
+
logEvent({ action: 'ViewDefinition' });
|
|
161
163
|
}}
|
|
162
164
|
>
|
|
163
|
-
View
|
|
165
|
+
View definition
|
|
164
166
|
</a>
|
|
165
167
|
</span>
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
168
|
+
)}
|
|
169
|
+
</div>
|
|
170
|
+
);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export const Resource = ({
|
|
174
|
+
resource,
|
|
175
|
+
environment,
|
|
176
|
+
withPadding,
|
|
177
|
+
size,
|
|
178
|
+
className,
|
|
179
|
+
}: IBaseResourceProps & Pick<IEnvironmentItemProps, 'size' | 'withPadding' | 'className'>) => {
|
|
180
|
+
const icon = resourceManager.getIcon(resource.kind);
|
|
181
|
+
const app = useApplicationContextSafe();
|
|
182
|
+
|
|
183
|
+
const account = resource.location?.account;
|
|
184
|
+
const regions = resource.location?.regions || [];
|
|
185
|
+
|
|
186
|
+
return (
|
|
187
|
+
<EnvironmentItem
|
|
188
|
+
iconName={icon}
|
|
189
|
+
iconTooltip={resource.kind}
|
|
190
|
+
className={classnames('Resource', className)}
|
|
191
|
+
title={<ResourceTitle resource={resource} />}
|
|
192
|
+
size={size}
|
|
193
|
+
withPadding={withPadding}
|
|
194
|
+
>
|
|
195
|
+
<ResourceMetadata environment={environment} resource={resource} />
|
|
181
196
|
<div>
|
|
182
197
|
<Status
|
|
183
198
|
appName={app.name}
|