Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cto
g1
Commits
31eee02a
Commit
31eee02a
authored
Feb 26, 2019
by
S Anand
Browse files
BUG: URLEncode FormHandler cell link. Fixes
#42
@tejesh.p
parent
b57ab9dd
Pipeline
#77879
passed with stage
in 2 minutes and 17 seconds
Changes
4
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
src/formhandler.template.html
View file @
31eee02a
...
...
@@ -102,7 +102,7 @@ Each template receives these variables:
<div
class=
"dropdown-divider"
></div>
<
%
}
%
>
<
%
if
(
colinfo.hideable
)
{
%
>
<a
class=
"dropdown-item urlfilter"
href=
"?_c=-<%- colinfo.name %>"
data-mode=
"add"
>
Hide
</a>
<a
class=
"dropdown-item urlfilter"
href=
"?_c=-<%-
encodeURIComponent(
colinfo.name
)
%>"
data-mode=
"add"
>
Hide
</a>
<
%
}
%
>
</div>
<!-- .dropdown-menu -->
</div>
<!-- .dropdown -->
...
...
@@ -161,7 +161,7 @@ Each template receives these variables:
</td>
<
%
}
else
{
%
>
<td>
<a
class=
"urlfilter"
href=
"?<%- colinfo.name %>=<%- val %>&_offset="
>
<a
class=
"urlfilter"
href=
"?<%-
encodeURIComponent(
colinfo.name
)
%>=<%-
encodeURIComponent(
val
)
%>&_offset="
>
<
%=
disp
%
>
</a>
</td>
...
...
@@ -322,7 +322,7 @@ Each template receives these variables:
qparts.update
({
_c:
col_name
},
'
add
')
var
hide_col =
col_name[0]
==
'
-
'
var
display_name =
hide_col
?
col_name.slice
(1)
:
col_name
%
>
<a
href=
"?_c=<%- col_name %>"
data-mode=
"del"
class=
"badge badge-pill <%- hide_col ? 'badge-dark' : 'badge-danger' %> urlfilter"
<a
href=
"?_c=<%-
encodeURIComponent(
col_name
)
%>"
data-mode=
"del"
class=
"badge badge-pill <%- hide_col ? 'badge-dark' : 'badge-danger' %> urlfilter"
title=
"<%- hide_col ? 'Show' : 'Hide' %> column <%- display_name %>"
>
<
%
-
display_name
%
>
</a>
...
...
@@ -333,7 +333,7 @@ Each template receives these variables:
var
update =
{}
update[key] =
col_name
qparts.update
(
update
,
'
add
')
%
>
<a
href=
"?<%- key %>=<%- col_name %>"
data-mode=
"del"
class=
"badge badge-pill badge-dark urlfilter"
title=
"Clear <%- key %> filter"
>
<a
href=
"?<%-
encodeURIComponent(
key
)
%>=<%-
encodeURIComponent(
col_name
)
%>"
data-mode=
"del"
class=
"badge badge-pill badge-dark urlfilter"
title=
"Clear <%- key %> filter"
>
<
%
-
key
%
>
=
<
%
-
col_name
%
>
</a>
<
%
})
...
...
@@ -391,7 +391,7 @@ Each template receives these variables:
var
col_link =
typeof
colinfo.link =
=
'
function
'
?
colinfo.link
({
row:
row
,
value:
val
,
index:
rowIndex
,
name:
colinfo.name
,
data:
data
,
format:
disp
})
:
_.template
(
colinfo.link
)({
row:
row
,
value:
val
,
index:
rowIndex
,
name:
colinfo.name
,
data:
data
,
format:
disp
})
%
>
<a
href=
"<%- col_link %>"
target=
"_blank"
><
%=
disp
%
></a>
<
%
}
else
{
%
>
<a
class=
"urlfilter"
href=
"?<%- colinfo.name %>=<%- val %>&_offset="
>
<a
class=
"urlfilter"
href=
"?<%-
encodeURIComponent(
colinfo.name
)
%>=<%-
encodeURIComponent(
val
)
%>&_offset="
>
<
%=
disp
%
>
</a>
<
%
}
%
>
...
...
test/formhandler.csv
View file @
31eee02a
Continent,Cross,ID,Name,Shapes,Stripes,Symbols,Text,Union-Flag,c1,c2,c3,c4,c5,c6,c7,c8,date col
Continent,Cross,ID,Name,Shapes,Stripes,Symbols,Text
&
,Union-Flag,c1,c2,c3,c4,c5,c6,c7,c8,date col
Europe,,AND,Andorra,,Horizontal,,,,35,1,26,0,32,0,0,4,16-01-2013
Asia,,ARE,United Arab Emirates,,Horizontal,,,,24.0,0.0,0.0,25.0,0.0,0.0,25.0,24.0,17-02-2013
Asia,,AFG,Afghanistan,,Vertical,,Country,,28.0,1.0,0.0,33.0,0.0,0.0,33.0,3.0,06-02-2013
Asia,,AFG,Afghanistan,,Vertical,,Country
&
,,28.0,1.0,0.0,33.0,0.0,0.0,33.0,3.0,06-02-2013
North America,,ATG,Antigua Barbuda,,,,,,50.0,0.0,5.0,0.0,0.0,10.0,25.0,7.0,11-02-2013
Europe,,ALB,Albania,,,Bird,,,87.0,0.0,0.0,0.0,0.0,0.0,12.0,0.0,18-01-2013
Asia,,ARM,Armenia,,Horizontal,,,,33.0,33.0,0.0,0.0,33.0,0.0,0.0,0.0,12-01-2013
...
...
test/formhandler_csv.json
View file @
31eee02a
This diff is collapsed.
Click to expand it.
test/test-formhandler-unit.html
View file @
31eee02a
...
...
@@ -80,6 +80,8 @@
edit
:
true
})
.
on
(
'
load
'
,
function
()
{
// Test if column name and value filtered are URIEncoded
t
.
equals
(
$
(
'
.delete_btn tr:nth-child(3) td:nth-child(8) a
'
).
attr
(
'
href
'
),
'
?Text%26=Country%26&_offset=
'
)
$
(
'
.edit-btn
'
).
click
()
t
.
ok
(
$
(
'
.add-btn
'
).
prop
(
'
disabled
'
))
$
(
'
.edit-btn
'
).
click
()
...
...
S Anand
@s.anand
mentioned in merge request
!68 (closed)
·
Feb 26, 2019
mentioned in merge request
!68 (closed)
mentioned in merge request !68
Toggle commit list
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