UNCLASSIFIED
Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Platform One
P
Party Bus
Launchboard
launchboard-fe
Commits
72508796
Commit
72508796
authored
Sep 03, 2021
by
Michael Winberry
Browse files
Update missionappdns fields to only be required if one or more fields is filled out.
parent
e624c051
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
9 deletions
+34
-9
src/components/MissionAppDns.vue
src/components/MissionAppDns.vue
+18
-9
tests/unit/components/MissionAppDns.spec.js
tests/unit/components/MissionAppDns.spec.js
+16
-0
No files found.
src/components/MissionAppDns.vue
View file @
72508796
...
@@ -7,29 +7,26 @@
...
@@ -7,29 +7,26 @@
class=
"mb-8"
class=
"mb-8"
label=
"Dns Credential Name"
label=
"Dns Credential Name"
v-model=
"dns.credentialName"
v-model=
"dns.credentialName"
hint=
"
* Required
"
:
hint=
"
hint
"
persistent-hint
persistent-hint
required
:required=
"isRequired"
:rules=
"[inputRules.required]"
/>
/>
<v-text-field
<v-text-field
class=
"mb-8"
class=
"mb-8"
label=
"App Host Name"
label=
"App Host Name"
v-model=
"dns.appHostname"
v-model=
"dns.appHostname"
hint=
"
* Required
"
:
hint=
"
hint
"
persistent-hint
persistent-hint
required
:required=
"isRequired"
:rules=
"[inputRules.required]"
/>
/>
<v-select
<v-select
class=
"stagingSelect"
class=
"stagingSelect"
v-model=
"dns.targetEnvironment"
v-model=
"dns.targetEnvironment"
:items=
"environments"
:items=
"environments"
label=
"Target Environment"
label=
"Target Environment"
hint=
"
* Required
"
:
hint=
"
hint
"
persistent-hint
persistent-hint
required
:required=
"isRequired"
:rules=
"[inputRules.required]"
solo
solo
/>
/>
</div>
</div>
...
@@ -48,6 +45,18 @@ export default {
...
@@ -48,6 +45,18 @@ export default {
inputRules
,
inputRules
,
environments
:
[
"
IL2
"
,
"
IL4
"
,
"
IL5
"
],
environments
:
[
"
IL2
"
,
"
IL4
"
,
"
IL5
"
],
}),
}),
computed
:
{
isRequired
()
{
return
(
this
.
dns
.
credentialName
||
this
.
dns
.
appHostname
||
this
.
dns
.
targetEnvironment
);
},
hint
()
{
return
this
.
isRequired
?
"
* Required
"
:
""
;
},
},
watch
:
{
watch
:
{
dns
()
{
dns
()
{
this
.
$emit
(
"
input
"
,
this
.
dns
);
this
.
$emit
(
"
input
"
,
this
.
dns
);
...
...
tests/unit/components/MissionAppDns.spec.js
View file @
72508796
...
@@ -42,4 +42,20 @@ describe("Mission App Dns Form Section", () => {
...
@@ -42,4 +42,20 @@ describe("Mission App Dns Form Section", () => {
wrapper
.
vm
.
environments
[
0
]
wrapper
.
vm
.
environments
[
0
]
);
);
});
});
describe
(
"
Required behavior | all or none
"
,
()
=>
{
it
(
"
sets required to true if any of the fields are defined
"
,
()
=>
{
inputs
.
at
(
0
).
setValue
(
"
dns-credentials
"
);
expect
(
wrapper
.
vm
.
isRequired
).
toBeTruthy
();
});
it
(
"
sets the hint to required if any of the fields are defined
"
,
()
=>
{
inputs
.
at
(
0
).
setValue
(
"
dns-credentials
"
);
expect
(
wrapper
.
vm
.
hint
).
toBe
(
"
* Required
"
);
});
it
(
"
Does not return a hint if none of the fields are defined
"
,
()
=>
{
expect
(
wrapper
.
vm
.
hint
).
toBe
(
""
);
});
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment