diff options
Diffstat (limited to 'src/components/settings/services/EditServiceForm.js')
-rw-r--r-- | src/components/settings/services/EditServiceForm.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/components/settings/services/EditServiceForm.js b/src/components/settings/services/EditServiceForm.js index 4458c4c5a..b5300f605 100644 --- a/src/components/settings/services/EditServiceForm.js +++ b/src/components/settings/services/EditServiceForm.js | |||
@@ -71,6 +71,14 @@ const messages = defineMessages({ | |||
71 | id: 'settings.service.form.isMutedInfo', | 71 | id: 'settings.service.form.isMutedInfo', |
72 | defaultMessage: '!!!When disabled, all notification sounds and audio playback are muted', | 72 | defaultMessage: '!!!When disabled, all notification sounds and audio playback are muted', |
73 | }, | 73 | }, |
74 | buttonClearCache: { | ||
75 | id: 'settings.service.form.buttonClearCache', | ||
76 | defaultMessage: '!!!Clear cache', | ||
77 | }, | ||
78 | buttonClearingCache: { | ||
79 | id: 'settings.service.form.buttonClearingCache', | ||
80 | defaultMessage: '!!!Clearing cache', | ||
81 | }, | ||
74 | headlineNotifications: { | 82 | headlineNotifications: { |
75 | id: 'settings.service.form.headlineNotifications', | 83 | id: 'settings.service.form.headlineNotifications', |
76 | defaultMessage: '!!!Notifications', | 84 | defaultMessage: '!!!Notifications', |
@@ -102,8 +110,10 @@ export default class EditServiceForm extends Component { | |||
102 | form: PropTypes.instanceOf(Form).isRequired, | 110 | form: PropTypes.instanceOf(Form).isRequired, |
103 | onSubmit: PropTypes.func.isRequired, | 111 | onSubmit: PropTypes.func.isRequired, |
104 | onDelete: PropTypes.func.isRequired, | 112 | onDelete: PropTypes.func.isRequired, |
113 | onClearCache: PropTypes.func.isRequired, | ||
105 | isSaving: PropTypes.bool.isRequired, | 114 | isSaving: PropTypes.bool.isRequired, |
106 | isDeleting: PropTypes.bool.isRequired, | 115 | isDeleting: PropTypes.bool.isRequired, |
116 | isClearingCache: PropTypes.bool.isRequired, | ||
107 | }; | 117 | }; |
108 | 118 | ||
109 | static defaultProps = { | 119 | static defaultProps = { |
@@ -158,7 +168,9 @@ export default class EditServiceForm extends Component { | |||
158 | form, | 168 | form, |
159 | isSaving, | 169 | isSaving, |
160 | isDeleting, | 170 | isDeleting, |
171 | isClearingCache, | ||
161 | onDelete, | 172 | onDelete, |
173 | onClearCache, | ||
162 | } = this.props; | 174 | } = this.props; |
163 | const { intl } = this.context; | 175 | const { intl } = this.context; |
164 | 176 | ||
@@ -181,6 +193,23 @@ export default class EditServiceForm extends Component { | |||
181 | /> | 193 | /> |
182 | ); | 194 | ); |
183 | 195 | ||
196 | const clearCacheButton = isClearingCache ? ( | ||
197 | <Button | ||
198 | buttonType="secondary" | ||
199 | className="settings__clear-cache-button" | ||
200 | loaded={false} | ||
201 | label={intl.formatMessage(messages.buttonClearingCache)} | ||
202 | disabled | ||
203 | /> | ||
204 | ) : ( | ||
205 | <Button | ||
206 | buttonType="warning" | ||
207 | className="settings__clear-cache-button" | ||
208 | label={intl.formatMessage(messages.buttonClearCache)} | ||
209 | onClick={onClearCache} | ||
210 | /> | ||
211 | ); | ||
212 | |||
184 | let activeTabIndex = 0; | 213 | let activeTabIndex = 0; |
185 | if (recipe.hasHostedOption && service.team) { | 214 | if (recipe.hasHostedOption && service.team) { |
186 | activeTabIndex = 1; | 215 | activeTabIndex = 1; |
@@ -287,6 +316,7 @@ export default class EditServiceForm extends Component { | |||
287 | <div className="settings__settings-group"> | 316 | <div className="settings__settings-group"> |
288 | <h3>{intl.formatMessage(messages.headlineGeneral)}</h3> | 317 | <h3>{intl.formatMessage(messages.headlineGeneral)}</h3> |
289 | <Toggle field={form.$('isEnabled')} /> | 318 | <Toggle field={form.$('isEnabled')} /> |
319 | {clearCacheButton} | ||
290 | </div> | 320 | </div> |
291 | </div> | 321 | </div> |
292 | {recipe.message && ( | 322 | {recipe.message && ( |