Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
anis
anis-client
Commits
7c7eea0a
Commit
7c7eea0a
authored
Aug 23, 2019
by
François Agneray
Browse files
Update search type list
parent
70cfbf50
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/app/search/components/criteria/criteria-by-family.component.html
View file @
7c7eea0a
<div
*ngFor=
"let attribute of getAttributeByFamily(criteriaFamily.id)"
>
<div
[ngSwitch]=
"attribute.search_type"
>
<div
*ngSwitchCase=
"'fd'"
>
<div
*ngSwitchCase=
"'f
iel
d'"
>
<app-field
class=
"criteria"
[id]=
"attribute.id"
[operator]=
"attribute.operator"
[label]=
"attribute.form_label"
[placeholder]=
"attribute.placeholder_min"
[attributeType]=
"attribute.type"
[criterion]=
"getCriterion(attribute.id)"
(add)=
"add($event)"
(delete)=
"delete($event)"
>
</app-field>
</div>
<div
*ngSwitchCase=
"'b
w
'"
>
<div
*ngSwitchCase=
"'b
etween
'"
>
<app-between
class=
"criteria"
[id]=
"attribute.id"
[label]=
"attribute.form_label"
[placeholderMin]=
"attribute.placeholder_min"
[placeholderMax]=
"attribute.placeholder_max"
[criterion]=
"getCriterion(attribute.id)"
(add)=
"add($event)"
(delete)=
"delete($event)"
>
</app-between>
</div>
<div
*ngSwitchCase=
"'se'"
>
<div
*ngSwitchCase=
"'se
lect
'"
>
<app-select
class=
"criteria"
[id]=
"attribute.id"
[operator]=
"attribute.operator"
[label]=
"attribute.form_label"
[options]=
"getOptions(attribute.id)"
[criterion]=
"getCriterion(attribute.id)"
(add)=
"add($event)"
(delete)=
"delete($event)"
>
</app-select>
</div>
<div
*ngSwitchCase=
"'
m
s'"
>
<div
*ngSwitchCase=
"'s
elect-multiple
'"
>
<app-select-multiple
class=
"criteria"
[id]=
"attribute.id"
[operator]=
"attribute.operator"
[label]=
"attribute.form_label"
[options]=
"getOptions(attribute.id)"
[criterion]=
"getCriterion(attribute.id)"
(add)=
"add($event)"
(delete)=
"delete($event)"
>
</app-select-multiple>
</div>
<div
*ngSwitchCase=
"'d
l
'"
>
<div
*ngSwitchCase=
"'d
atalist
'"
>
<app-datalist
class=
"criteria"
[id]=
"attribute.id"
[operator]=
"attribute.operator"
[label]=
"attribute.form_label"
[placeholder]=
"attribute.placeholder_min"
[options]=
"getOptions(attribute.id)"
[criterion]=
"getCriterion(attribute.id)"
(add)=
"add($event)"
(delete)=
"delete($event)"
>
</app-datalist>
</div>
<div
*ngSwitchCase=
"'r
d
'"
>
<div
*ngSwitchCase=
"'r
adio
'"
>
<app-radio
class=
"criteria"
[id]=
"attribute.id"
[operator]=
"attribute.operator"
[label]=
"attribute.form_label"
[options]=
"getOptions(attribute.id)"
[criterion]=
"getCriterion(attribute.id)"
(add)=
"add($event)"
(delete)=
"delete($event)"
>
</app-radio>
</div>
<div
*ngSwitchCase=
"'c
b
'"
>
<div
*ngSwitchCase=
"'c
heckbox
'"
>
<app-checkbox
class=
"criteria"
[id]=
"attribute.id"
[operator]=
"attribute.operator"
[label]=
"attribute.form_label"
[options]=
"getOptions(attribute.id)"
[criterion]=
"getCriterion(attribute.id)"
(add)=
"add($event)"
(delete)=
"delete($event)"
>
</app-checkbox>
</div>
<div
*ngSwitchCase=
"'d
t
'"
>
<div
*ngSwitchCase=
"'d
ate
'"
>
<app-date
class=
"criteria"
[id]=
"attribute.id"
[operator]=
"attribute.operator"
[label]=
"attribute.form_label"
[placeholder]=
"attribute.placeholder_min"
[criterion]=
"getCriterion(attribute.id)"
(add)=
"add($event)"
(delete)=
"delete($event)"
>
</app-date>
</div>
<div
*ngSwitchCase=
"'b
d
'"
>
<div
*ngSwitchCase=
"'b
etween-date
'"
>
<app-between-date
class=
"criteria"
[id]=
"attribute.id"
[operator]=
"attribute.operator"
[label]=
"attribute.form_label"
[criterion]=
"getCriterion(attribute.id)"
(add)=
"add($event)"
(delete)=
"delete($event)"
>
</app-between-date>
</div>
<div
*ngSwitchCase=
"'t
m
'"
>
<div
*ngSwitchCase=
"'t
ime
'"
>
<app-time
class=
"criteria"
[id]=
"attribute.id"
[label]=
"attribute.form_label"
[operator]=
"attribute.operator"
[criterion]=
"getCriterion(attribute.id)"
(add)=
"add($event)"
(delete)=
"delete($event)"
>
</app-time>
</div>
<div
*ngSwitchCase=
"'
ts
'"
>
<div
*ngSwitchCase=
"'
date-time
'"
>
<app-datetime
class=
"criteria"
[id]=
"attribute.id"
[label]=
"attribute.form_label"
[operator]=
"attribute.operator"
[criterion]=
"getCriterion(attribute.id)"
(add)=
"add($event)"
(delete)=
"delete($event)"
>
</app-datetime>
</div>
<div
*ngSwitchCase=
"'js'"
>
<div
*ngSwitchCase=
"'js
on
'"
>
<app-json
class=
"criteria"
[id]=
"attribute.id"
[label]=
"attribute.form_label"
[criterion]=
"getCriterion(attribute.id)"
(add)=
"add($event)"
(delete)=
"delete($event)"
>
</app-json>
...
...
src/app/search/store/search.effects.ts
View file @
7c7eea0a
...
...
@@ -84,24 +84,24 @@ export class SearchEffects {
const
params
=
c
.
split
(
'
::
'
);
const
attribute
=
loadAttributeSearchMetaSuccessAction
.
payload
.
find
(
a
=>
a
.
id
===
parseInt
(
params
[
0
],
10
));
switch
(
attribute
.
search_type
)
{
case
'
fd
'
:
case
'
se
'
:
case
'
d
l
'
:
case
'
r
d
'
:
case
'
d
t
'
:
case
'
ts
'
:
case
'
t
m
'
:
case
'
f
iel
d
'
:
case
'
se
lect
'
:
case
'
d
atalist
'
:
case
'
r
adio
'
:
case
'
d
ate
'
:
case
'
date-time
'
:
case
'
t
ime
'
:
return
new
FieldCriterion
(
parseInt
(
params
[
0
],
10
),
params
[
1
],
params
[
2
]);
case
'
b
w
'
:
case
'
b
d
'
:
case
'
b
etween
'
:
case
'
b
etween-date
'
:
const
bwValues
=
params
[
2
].
split
(
'
|
'
);
return
new
BetweenCriterion
(
parseInt
(
params
[
0
],
10
),
bwValues
[
0
],
bwValues
[
1
]);
case
'
m
s
'
:
case
'
c
b
'
:
case
'
s
elect-multiple
'
:
case
'
c
heckbox
'
:
const
msValues
=
params
[
2
].
split
(
'
|
'
);
const
options
=
attribute
.
options
.
filter
(
option
=>
msValues
.
includes
(
option
.
value
));
return
new
SelectMultipleCriterion
(
parseInt
(
params
[
0
],
10
),
params
[
1
],
options
);
case
'
js
'
:
case
'
js
on
'
:
const
[
path
,
operator
,
value
]
=
params
[
2
].
split
(
'
|
'
);
return
new
JsonCriterion
(
parseInt
(
params
[
0
],
10
),
path
,
operator
,
value
);
...
...
Write
Preview
Supports
Markdown
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