Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
array-field
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dimitris Tsironis
array-field
Commits
59ba433d
Commit
59ba433d
authored
Aug 31, 2020
by
Dimitris Tsironis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add directors using Digigov Steps
parent
55a1ee80
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
268 additions
and
0 deletions
+268
-0
src/pages/directors-steps.js
src/pages/directors-steps.js
+268
-0
No files found.
src/pages/directors-steps.js
0 → 100644
View file @
59ba433d
import
{
useContext
}
from
'
react
'
import
Questions
,
{
QuestionsContext
,
Step
,
StepForm
,
StepQuote
,
StepTitle
,
Field
,
}
from
'
@digigov/ui/app/Questions
'
;
import
{
SummaryList
,
SummaryListItem
,
SummaryListItemKey
,
SummaryListItemValue
,
SummaryListItemAction
}
from
'
@digigov/ui/core/SummaryList
'
;
const
steps
=
[
{
name
:
'
directors
'
,
caption
:
'
Multiple directors
'
,
title
:
'
What are the details for the director you want to add?
'
,
description
:
'
lalal
'
,
fields
:
[
{
key
:
'
full_name
'
,
label
:
{
primary
:
'
Full name
'
},
required
:
true
,
type
:
'
string
'
,
},
{
key
:
'
phone
'
,
label
:
{
primary
:
'
Mobile phone
'
,
secondary
:
'
A valid mobile number, eg. +306988848888
'
,
},
required
:
true
,
type
:
'
mobile_phone
'
,
},
{
key
:
'
afm
'
,
label
:
{
primary
:
'
AFM
'
},
required
:
true
,
width
:
'
100px
'
,
type
:
'
int
'
,
},
],
type
:
'
array
'
,
review
:
{
caption
:
'
multiple directors
'
,
title
:
'
You added the following directors
'
,
addMore
:
{
title
:
'
Do you want to add more directors?
'
,
answers
:
{
positive
:
{
primary
:
'
Yes
'
},
negative
:
{
primary
:
'
No
'
}
}
},
},
},
{
name
:
'
intro
'
,
caption
:
'
intro.caption
'
,
title
:
'
intro.title
'
,
description
:
'
intro.description
'
,
fields
:
[
{
key
:
'
name
'
,
label
:
{
primary
:
'
name.field.primary
'
,
secondary
:
'
name.field.secondary
'
,
},
required
:
true
,
type
:
'
string
'
,
},
],
},
{
name
:
'
time
'
,
nextStep
:
(
data
)
=>
{
if
(
data
.
time
.
age
<
26
)
{
return
'
review
'
;
}
},
caption
:
'
time.caption
'
,
title
:
'
time.title
'
,
description
:
'
time.description
'
,
fields
:
[
{
key
:
'
age
'
,
label
:
{
primary
:
'
age.field.primary
'
,
secondary
:
'
age.field.secondary
'
,
},
required
:
true
,
type
:
'
int
'
,
},
],
},
{
name
:
'
boomer
'
,
show
:
(
data
)
=>
{
return
data
.
time
.
age
>=
56
;
},
caption
:
'
boomer.caption
'
,
title
:
'
boomer.title
'
,
description
:
'
boomer.description
'
,
fields
:
[
{
key
:
'
adult
'
,
label
:
{
primary
:
'
adult.field.primary
'
,
secondary
:
'
adult.field.secondary
'
,
},
required
:
true
,
type
:
'
string
'
,
},
],
},
{
name
:
'
genx
'
,
show
:
(
data
)
=>
{
return
data
.
time
.
age
>=
41
&&
data
.
time
.
age
<
56
;
},
caption
:
'
genx.caption
'
,
title
:
'
genx.title
'
,
description
:
'
genx.description
'
,
fields
:
[
{
key
:
'
adult
'
,
label
:
{
primary
:
'
adult.field.primary
'
,
secondary
:
'
adult.field.secondary
'
,
},
required
:
true
,
type
:
'
string
'
,
},
],
},
{
name
:
'
millenial
'
,
show
:
(
data
)
=>
{
return
data
.
time
.
age
>=
26
&&
data
.
time
.
age
<
41
;
},
caption
:
'
millenial.caption
'
,
title
:
'
millenial.title
'
,
description
:
'
millenial.description
'
,
fields
:
[
{
key
:
'
adult
'
,
label
:
{
primary
:
'
adult.field.primary
'
,
secondary
:
'
adult.field.secondary
'
,
},
required
:
true
,
type
:
'
string
'
,
},
],
},
{
name
:
'
generic
'
,
caption
:
'
generic.caption
'
,
title
:
'
generic.title
'
,
description
:
'
generic.description
'
,
fields
:
[
{
key
:
'
info
'
,
label
:
{
primary
:
'
info.field.primary
'
,
secondary
:
'
info.field.secondary
'
,
},
required
:
true
,
type
:
'
string
'
,
},
],
},
];
export
default
function
DirectorsSteps
(
props
)
{
return
(
<
Questions
steps
=
{
steps
}
onActiveStep
=
{(
step
)
=>
{
console
.
log
(
step
);
}}
translate
=
{(
key
)
=>
key
}
initialData
=
{{
intro
:
{
name
:
'
Νίκος Παπαδόπουλος
'
},
time
:
{
age
:
33
}
}}
initialStep
=
{
steps
[
0
]}
onChange
=
{(
data
)
=>
{
console
.
log
(
data
);
}}
onSubmit
=
{(
data
)
=>
{
console
.
log
(
data
,
'
submit
'
);
}}
>
<
Step
name
=
"
directors
"
>
<
StepTitle
/>
<
StepQuote
>
This
is
the
intro
<
/StepQuote
>
<
StepForm
submitButton
=
{
true
}
>
<
Field
name
=
"
full_name
"
/>
<
Field
name
=
"
phone
"
/>
<
Field
name
=
"
afm
"
/>
<
/StepForm
>
<
/Step
>
<
Step
name
=
"
intro
"
>
<
StepTitle
/>
<
StepQuote
>
This
is
the
intro
<
/StepQuote
>
<
StepForm
submitButton
=
{
true
}
>
<
Field
name
=
"
name
"
/>
<
/StepForm
>
<
/Step
>
<
Step
name
=
"
time
"
>
<
StepTitle
/>
<
StepQuote
>
This
is
the
age
<
/StepQuote
>
<
StepForm
submitButton
=
{
true
}
>
<
Field
name
=
"
age
"
/>
<
/StepForm
>
<
/Step
>
<
Step
name
=
"
boomer
"
>
<
StepTitle
/>
<
StepQuote
>
This
is
the
conditioned
step
<
/StepQuote
>
<
StepForm
submitButton
=
{
true
}
>
<
Field
name
=
"
adult
"
/>
<
/StepForm
>
<
/Step
>
<
Step
name
=
"
genx
"
>
<
StepTitle
/>
<
StepQuote
>
This
is
the
conditioned
step
<
/StepQuote
>
<
StepForm
submitButton
=
{
true
}
>
<
Field
name
=
"
adult
"
/>
<
/StepForm
>
<
/Step
>
<
Step
name
=
"
millenial
"
>
<
StepTitle
/>
<
StepQuote
>
This
is
the
conditioned
step
<
/StepQuote
>
<
StepForm
submitButton
=
{
true
}
>
<
Field
name
=
"
adult
"
/>
<
/StepForm
>
<
/Step
>
<
Step
name
=
"
generic
"
>
<
StepTitle
/>
<
StepQuote
>
This
is
a
normal
step
<
/StepQuote
>
<
StepForm
submitButton
=
{
true
}
>
<
Field
name
=
"
info
"
/>
<
/StepForm
>
<
/Step
>
<
/Questions
>
)
}
const
StepDirectors
=
()
=>
{
const
{
currentStep
,
submitStep
,
data
,
translate
}
=
useContext
(
QuestionsContext
);
const
directors
=
data
.
directors
||
[];
return
(
<>
<
Step
name
=
"
review-directors
"
>
<
StepTitle
/>
<
SummaryList
>
{
directors
.
map
((
director
,
idx
)
=>
(
<
SummaryListItem
key
=
{
idx
}
>
<
SummaryListItemKey
>
Full
Name
<
/SummaryListItemKey
>
<
SummaryListItemValue
>
{
director
.
full_name
}
<
/SummaryListItemValue
>
<
SummaryListItemAction
>
Change
<
/SummaryListItemAction
>
<
SummaryListItemAction
>
Delete
<
/SummaryListItemAction
>
<
/SummaryListItem>
))
}
<
/SummaryList
>
<
/Step
>
<
/
>
)
}
\ No newline at end of file
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