Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
Resin
Client
Commits
da0b9386
Commit
da0b9386
authored
2 years ago
by
Hugo SUBTIL
Browse files
Options
Downloads
Patches
Plain Diff
fix(form): protection against no formation selection for pricing
parent
13f0ef3a
Loading
Loading
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/form/footer-form/footer-form.component.ts
+37
-10
37 additions, 10 deletions
src/app/form/footer-form/footer-form.component.ts
with
37 additions
and
10 deletions
src/app/form/footer-form/footer-form.component.ts
+
37
−
10
View file @
da0b9386
...
...
@@ -16,7 +16,7 @@ import { structureFormStep } from '../form-view/structure-form/structureFormStep
@
Component
({
selector
:
'
app-footer-form
'
,
templateUrl
:
'
./footer-form.component.html
'
,
styleUrls
:
[
'
./footer-form.component.scss
'
]
,
styleUrls
:
[
'
./footer-form.component.scss
'
]
})
export
class
FooterFormComponent
implements
OnChanges
{
@
Input
()
currentForm
:
formType
;
...
...
@@ -73,8 +73,7 @@ export class FooterFormComponent implements OnChanges {
}
if
(
this
.
currentForm
===
formType
.
structure
&&
(
this
.
currentStep
===
structureFormStep
.
noStructure
||
this
.
currentStep
===
structureFormStep
.
StructureInfoUnknown
)
(
this
.
currentStep
===
structureFormStep
.
noStructure
||
this
.
currentStep
===
structureFormStep
.
StructureInfoUnknown
)
)
{
this
.
isLastFormStep
=
true
;
}
...
...
@@ -96,17 +95,39 @@ export class FooterFormComponent implements OnChanges {
this
.
router
.
navigateByUrl
(
'
news
'
);
}
/**
* Check if trainings are selected in order to ask for pricing
*/
public
isTrainingsSelected
():
boolean
{
return
(
this
.
form
.
value
.
accessRight
.
length
>
0
||
this
.
form
.
value
.
baseSkills
.
length
>
0
||
this
.
form
.
value
.
digitalCultureSecurity
.
length
>
0
||
this
.
form
.
value
.
parentingHelp
.
length
>
0
||
this
.
form
.
value
.
socialAndProfessional
.
length
>
0
);
}
public
prevPage
():
void
{
if
(
!
this
.
isEditMode
)
{
if
(
this
.
currentForm
===
formType
.
structure
&&
this
.
currentStep
===
structureFormStep
.
structureType
)
{
if
(
!
this
.
isEditMode
&&
this
.
currentForm
===
formType
.
structure
)
{
if
(
this
.
currentStep
===
structureFormStep
.
structureType
)
{
this
.
changeCurrentStep
.
emit
(
structureFormStep
.
structureFormTime
);
return
;
}
if
(
this
.
currentStep
===
structureFormStep
.
structureWifi
)
{
if
(
this
.
isTrainingsSelected
())
{
this
.
changeCurrentStep
.
emit
(
structureFormStep
.
structureTrainingPrice
);
}
else
{
this
.
changeCurrentStep
.
emit
(
structureFormStep
.
structureTrainingType
);
}
return
;
}
this
.
goToPreviousPage
();
}
else
{
history
.
back
();
}
}
public
async
nextPage
():
Promise
<
void
>
{
if
(
this
.
currentForm
===
formType
.
account
&&
this
.
currentStep
===
accountFormStep
.
accountNewsletter
)
{
const
user
=
new
User
(
this
.
form
.
value
);
...
...
@@ -139,6 +160,15 @@ export class FooterFormComponent implements OnChanges {
this
.
changeCurrentStep
.
emit
(
structureFormStep
.
structureType
);
return
;
}
// Check if trainings are selected in order to ask for pricing
if
(
this
.
currentStep
===
structureFormStep
.
structureTrainingType
)
{
if
(
this
.
isTrainingsSelected
())
{
this
.
changeCurrentStep
.
emit
(
structureFormStep
.
structureTrainingPrice
);
}
else
{
this
.
changeCurrentStep
.
emit
(
structureFormStep
.
structureWifi
);
}
return
;
}
if
(
this
.
currentStep
===
structureFormStep
.
structureContactCompletion
)
{
//TODO Go to send mail page and send the mail
return
;
...
...
@@ -164,9 +194,7 @@ export class FooterFormComponent implements OnChanges {
private
isStructureChoiceValid
():
boolean
{
return
(
this
.
currentForm
===
formType
.
structure
&&
this
.
currentStep
===
structureFormStep
.
structureChoice
&&
this
.
form
.
value
.
_id
this
.
currentForm
===
formType
.
structure
&&
this
.
currentStep
===
structureFormStep
.
structureChoice
&&
this
.
form
.
value
.
_id
);
}
...
...
@@ -186,8 +214,7 @@ export class FooterFormComponent implements OnChanges {
private
isPersonalOfferpage
():
boolean
{
return
(
this
.
currentForm
===
formType
.
personaloffer
&&
this
.
currentStep
===
personalOfferFormStep
.
personalOfferStructureChoice
this
.
currentForm
===
formType
.
personaloffer
&&
this
.
currentStep
===
personalOfferFormStep
.
personalOfferStructureChoice
);
}
public
isPersonalOfferFirstPage
():
boolean
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment