File tree Expand file tree Collapse file tree 4 files changed +13
-8
lines changed Expand file tree Collapse file tree 4 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 16
16
17
17
import { PluginDataStoreType } from '../Shared'
18
18
import { VariableType } from './CIPipeline.Types'
19
+ import { ServerErrors } from './ServerError'
19
20
import { ResponseType } from './Types'
20
21
21
22
export enum ApplyPolicyToStage {
@@ -62,6 +63,7 @@ export interface MandatoryPluginDataType {
62
63
export interface ProcessPluginDataReturnType {
63
64
mandatoryPluginData : MandatoryPluginDataType
64
65
pluginDataStore : PluginDataStoreType
66
+ mandatoryPluginsError ?: ServerErrors
65
67
}
66
68
67
69
export enum ConsequenceAction {
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export const getPluginsDetail = async ({
16
16
appId,
17
17
parentPluginIds,
18
18
pluginIds,
19
+ shouldShowError = true ,
19
20
} : PluginDetailServiceParamsType ) : Promise < Pick < GetPluginStoreDataReturnType , 'pluginStore' > > => {
20
21
try {
21
22
const payload : PluginDetailPayloadType = {
@@ -34,7 +35,9 @@ export const getPluginsDetail = async ({
34
35
pluginStore,
35
36
}
36
37
} catch ( error ) {
37
- showError ( error )
38
+ if ( shouldShowError ) {
39
+ showError ( error )
40
+ }
38
41
throw error
39
42
}
40
43
}
Original file line number Diff line number Diff line change @@ -62,6 +62,10 @@ export interface PluginDetailServiceParamsType {
62
62
appId : number
63
63
pluginIds ?: number [ ]
64
64
parentPluginIds ?: number [ ]
65
+ /**
66
+ * @default true
67
+ */
68
+ shouldShowError ?: boolean
65
69
}
66
70
67
71
export interface PluginDetailPayloadType extends Pick < PluginDetailServiceParamsType , 'appId' > {
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ export const pluginTagSelectStyles = {
99
99
}
100
100
101
101
/**
102
- * @description This method takes the initial plugin data store and updates only keys that are not present in the initial store with the values from the target store.
102
+ * @description This method takes the initial plugin data store and updates the keys with the target parent plugin store and plugin version store
103
103
*/
104
104
export const getUpdatedPluginStore = (
105
105
initialPluginDataStore : PluginDataStoreType ,
@@ -109,15 +109,11 @@ export const getUpdatedPluginStore = (
109
109
const clonedPluginDataStore = structuredClone ( initialPluginDataStore )
110
110
111
111
Object . keys ( targetParentPluginStore ) . forEach ( ( key ) => {
112
- if ( ! clonedPluginDataStore . parentPluginStore [ key ] ) {
113
- clonedPluginDataStore . parentPluginStore [ key ] = targetParentPluginStore [ key ]
114
- }
112
+ clonedPluginDataStore . parentPluginStore [ key ] = targetParentPluginStore [ key ]
115
113
} )
116
114
117
115
Object . keys ( targetPluginVersionStore ) . forEach ( ( key ) => {
118
- if ( ! clonedPluginDataStore . pluginVersionStore [ key ] ) {
119
- clonedPluginDataStore . pluginVersionStore [ key ] = targetPluginVersionStore [ key ]
120
- }
116
+ clonedPluginDataStore . pluginVersionStore [ key ] = targetPluginVersionStore [ key ]
121
117
} )
122
118
123
119
return clonedPluginDataStore
You can’t perform that action at this time.
0 commit comments