diff options
author | 2023-05-27 18:48:38 +0530 | |
---|---|---|
committer | 2023-05-27 18:48:38 +0530 | |
commit | eaa8e80efadc55d42462af0a5381f2552acc3c88 (patch) | |
tree | b54868af925e2db3fc6d5444475cd14bd3255f1c /src/components/settings/services | |
parent | update react version to 18.2.0 and it related changes (diff) | |
download | ferdium-app-eaa8e80efadc55d42462af0a5381f2552acc3c88.tar.gz ferdium-app-eaa8e80efadc55d42462af0a5381f2552acc3c88.tar.zst ferdium-app-eaa8e80efadc55d42462af0a5381f2552acc3c88.zip |
Expose "Clear service cache" in the service settings screen and the sidebar context menu for individual services (#1053)
Diffstat (limited to 'src/components/settings/services')
-rw-r--r-- | src/components/settings/services/EditServiceForm.tsx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/components/settings/services/EditServiceForm.tsx b/src/components/settings/services/EditServiceForm.tsx index c04a53b50..520cb3c46 100644 --- a/src/components/settings/services/EditServiceForm.tsx +++ b/src/components/settings/services/EditServiceForm.tsx | |||
@@ -156,6 +156,7 @@ interface IProps extends WrappedComponentProps { | |||
156 | form: Form; | 156 | form: Form; |
157 | onSubmit: (...args: any[]) => void; | 157 | onSubmit: (...args: any[]) => void; |
158 | onDelete: () => void; | 158 | onDelete: () => void; |
159 | onClearCache: () => void; | ||
159 | openRecipeFile: (recipeFile: string) => void; | 160 | openRecipeFile: (recipeFile: string) => void; |
160 | isSaving: boolean; | 161 | isSaving: boolean; |
161 | isDeleting: boolean; | 162 | isDeleting: boolean; |
@@ -223,6 +224,7 @@ class EditServiceForm extends Component<IProps, IState> { | |||
223 | isSaving, | 224 | isSaving, |
224 | isDeleting, | 225 | isDeleting, |
225 | onDelete, | 226 | onDelete, |
227 | onClearCache, | ||
226 | openRecipeFile, | 228 | openRecipeFile, |
227 | isProxyFeatureEnabled, | 229 | isProxyFeatureEnabled, |
228 | intl, | 230 | intl, |
@@ -246,6 +248,15 @@ class EditServiceForm extends Component<IProps, IState> { | |||
246 | /> | 248 | /> |
247 | ); | 249 | ); |
248 | 250 | ||
251 | const clearCacheButton = ( | ||
252 | <Button | ||
253 | buttonType="secondary" | ||
254 | label={intl.formatMessage(globalMessages.clearCache)} | ||
255 | className="settings__open-settings-cache-button" | ||
256 | onClick={onClearCache} | ||
257 | /> | ||
258 | ); | ||
259 | |||
249 | let activeTabIndex = 0; | 260 | let activeTabIndex = 0; |
250 | if (recipe.hasHostedOption && service?.team) { | 261 | if (recipe.hasHostedOption && service?.team) { |
251 | activeTabIndex = 1; | 262 | activeTabIndex = 1; |
@@ -502,6 +513,7 @@ class EditServiceForm extends Component<IProps, IState> { | |||
502 | <div className="settings__controls"> | 513 | <div className="settings__controls"> |
503 | {/* Delete Button */} | 514 | {/* Delete Button */} |
504 | <div>{action === 'edit' && deleteButton}</div> | 515 | <div>{action === 'edit' && deleteButton}</div> |
516 | <div>{action === 'edit' && clearCacheButton}</div> | ||
505 | 517 | ||
506 | {/* Save Button */} | 518 | {/* Save Button */} |
507 | {isSaving || isValidatingCustomUrl ? ( | 519 | {isSaving || isValidatingCustomUrl ? ( |