diff options
author | 2017-12-15 14:00:17 +0100 | |
---|---|---|
committer | 2017-12-15 14:00:17 +0100 | |
commit | 03610f2dd6833b3b6358790d044b852c154b4bf3 (patch) | |
tree | a48a18458304a10f63c16ed108ccd2d87b91823b /src/containers | |
parent | fix(Recipes): Enable `urlInputPrefix` for team and customURL (diff) | |
download | ferdium-app-03610f2dd6833b3b6358790d044b852c154b4bf3.tar.gz ferdium-app-03610f2dd6833b3b6358790d044b852c154b4bf3.tar.zst ferdium-app-03610f2dd6833b3b6358790d044b852c154b4bf3.zip |
feat(Recipes): Add `hasHostedOption` to enable hosted & self hosted services
Diffstat (limited to 'src/containers')
-rw-r--r-- | src/containers/settings/EditServiceScreen.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/containers/settings/EditServiceScreen.js b/src/containers/settings/EditServiceScreen.js index 191ef447b..c4228ec03 100644 --- a/src/containers/settings/EditServiceScreen.js +++ b/src/containers/settings/EditServiceScreen.js | |||
@@ -118,11 +118,22 @@ export default class EditServiceScreen extends Component { | |||
118 | }); | 118 | }); |
119 | } | 119 | } |
120 | 120 | ||
121 | // More fine grained and use case specific validation rules | ||
121 | if (recipe.hasTeamId && recipe.hasCustomUrl) { | 122 | if (recipe.hasTeamId && recipe.hasCustomUrl) { |
122 | config.fields.team.validate = [oneRequired(['team', 'customUrl'])]; | 123 | config.fields.team.validate = [oneRequired(['team', 'customUrl'])]; |
123 | config.fields.customUrl.validate = [url, oneRequired(['team', 'customUrl'])]; | 124 | config.fields.customUrl.validate = [url, oneRequired(['team', 'customUrl'])]; |
124 | } | 125 | } |
125 | 126 | ||
127 | // If a service can be hosted and has a teamId or customUrl | ||
128 | if (recipe.hasHostedOption && (recipe.hasTeamId || recipe.hasCustomUrl)) { | ||
129 | if (config.fields.team) { | ||
130 | config.fields.team.validate = []; | ||
131 | } | ||
132 | if (config.fields.customUrl) { | ||
133 | config.fields.customUrl.validate = [url]; | ||
134 | } | ||
135 | } | ||
136 | |||
126 | if (recipe.hasIndirectMessages) { | 137 | if (recipe.hasIndirectMessages) { |
127 | Object.assign(config.fields, { | 138 | Object.assign(config.fields, { |
128 | isIndirectMessageBadgeEnabled: { | 139 | isIndirectMessageBadgeEnabled: { |