Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
96878300
Commit
96878300
authored
Aug 30, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
88ffb080
84064567
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
101 additions
and
2 deletions
+101
-2
app/assets/javascripts/project_find_file.js
app/assets/javascripts/project_find_file.js
+1
-1
changelogs/unreleased/62055-find-file-links-encoding.yml
changelogs/unreleased/62055-find-file-links-encoding.yml
+5
-0
changelogs/unreleased/65251-default-clusters-namespace_per_environment-column-to-true.yml
...ult-clusters-namespace_per_environment-column-to-true.yml
+5
-0
db/migrate/20190823055948_change_clusters_namespace_per_environment_default.rb
...5948_change_clusters_namespace_per_environment_default.rb
+12
-0
db/schema.rb
db/schema.rb
+1
-1
spec/frontend/project_find_file_spec.js
spec/frontend/project_find_file_spec.js
+77
-0
No files found.
app/assets/javascripts/project_find_file.js
View file @
96878300
...
@@ -113,7 +113,7 @@ export default class ProjectFindFile {
...
@@ -113,7 +113,7 @@ export default class ProjectFindFile {
if
(
searchText
)
{
if
(
searchText
)
{
matches
=
fuzzaldrinPlus
.
match
(
filePath
,
searchText
);
matches
=
fuzzaldrinPlus
.
match
(
filePath
,
searchText
);
}
}
blobItemUrl
=
this
.
options
.
blobUrlTemplate
+
'
/
'
+
filePath
;
blobItemUrl
=
this
.
options
.
blobUrlTemplate
+
'
/
'
+
encodeURIComponent
(
filePath
)
;
html
=
ProjectFindFile
.
makeHtml
(
filePath
,
matches
,
blobItemUrl
);
html
=
ProjectFindFile
.
makeHtml
(
filePath
,
matches
,
blobItemUrl
);
results
.
push
(
this
.
element
.
find
(
'
.tree-table > tbody
'
).
append
(
html
));
results
.
push
(
this
.
element
.
find
(
'
.tree-table > tbody
'
).
append
(
html
));
}
}
...
...
changelogs/unreleased/62055-find-file-links-encoding.yml
0 → 100644
View file @
96878300
---
title
:
Fix encoding of special characters in "Find File"
merge_request
:
31311
author
:
Jan Beckmann
type
:
fixed
changelogs/unreleased/65251-default-clusters-namespace_per_environment-column-to-true.yml
0 → 100644
View file @
96878300
---
title
:
Default clusters namespace_per_environment column to
true
merge_request
:
32139
author
:
type
:
other
db/migrate/20190823055948_change_clusters_namespace_per_environment_default.rb
0 → 100644
View file @
96878300
# frozen_string_literal: true
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
ChangeClustersNamespacePerEnvironmentDefault
<
ActiveRecord
::
Migration
[
5.2
]
DOWNTIME
=
false
def
change
change_column_default
:clusters
,
:namespace_per_environment
,
from:
false
,
to:
true
end
end
db/schema.rb
View file @
96878300
...
@@ -935,7 +935,7 @@ ActiveRecord::Schema.define(version: 2019_08_28_083843) do
...
@@ -935,7 +935,7 @@ ActiveRecord::Schema.define(version: 2019_08_28_083843) do
t
.
integer
"cluster_type"
,
limit:
2
,
default:
3
,
null:
false
t
.
integer
"cluster_type"
,
limit:
2
,
default:
3
,
null:
false
t
.
string
"domain"
t
.
string
"domain"
t
.
boolean
"managed"
,
default:
true
,
null:
false
t
.
boolean
"managed"
,
default:
true
,
null:
false
t
.
boolean
"namespace_per_environment"
,
default:
fals
e
,
null:
false
t
.
boolean
"namespace_per_environment"
,
default:
tru
e
,
null:
false
t
.
index
[
"enabled"
],
name:
"index_clusters_on_enabled"
t
.
index
[
"enabled"
],
name:
"index_clusters_on_enabled"
t
.
index
[
"user_id"
],
name:
"index_clusters_on_user_id"
t
.
index
[
"user_id"
],
name:
"index_clusters_on_user_id"
end
end
...
...
spec/frontend/project_find_file_spec.js
0 → 100644
View file @
96878300
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
$
from
'
jquery
'
;
import
ProjectFindFile
from
'
~/project_find_file
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
const
BLOB_URL_TEMPLATE
=
`
${
TEST_HOST
}
/namespace/project/blob/master`
;
const
FILE_FIND_URL
=
`
${
TEST_HOST
}
/namespace/project/files/master?format=json`
;
const
FIND_TREE_URL
=
`
${
TEST_HOST
}
/namespace/project/tree/master`
;
const
TEMPLATE
=
`<div class="file-finder-holder tree-holder js-file-finder" data-blob-url-template="
${
BLOB_URL_TEMPLATE
}
" data-file-find-url="
${
FILE_FIND_URL
}
" data-find-tree-url="
${
FIND_TREE_URL
}
">
<input class="file-finder-input" id="file_find" />
<div class="tree-content-holder">
<div class="table-holder">
<table class="files-slider tree-table">
<tbody />
</table>
</div>
</div>
</div>`
;
describe
(
'
ProjectFindFile
'
,
()
=>
{
let
element
;
let
mock
;
const
getProjectFindFileInstance
=
()
=>
new
ProjectFindFile
(
element
,
{
url
:
FILE_FIND_URL
,
treeUrl
:
FIND_TREE_URL
,
blobUrlTemplate
:
BLOB_URL_TEMPLATE
,
});
const
findFiles
=
()
=>
element
.
find
(
'
.tree-table tr
'
)
.
toArray
()
.
map
(
el
=>
({
text
:
el
.
textContent
,
href
:
el
.
querySelector
(
'
a
'
).
href
,
}));
beforeEach
(()
=>
{
// Create a mock adapter for stubbing axios API requests
mock
=
new
MockAdapter
(
axios
);
element
=
$
(
TEMPLATE
);
});
afterEach
(()
=>
{
// Reset the mock adapter
mock
.
restore
();
});
it
(
'
loads and renders elements from remote server
'
,
done
=>
{
const
files
=
[
'
fileA.txt
'
,
'
fileB.txt
'
,
'
fi#leC.txt
'
,
'
folderA/fileD.txt
'
,
'
folder#B/fileE.txt
'
,
'
folde?rC/fil#F.txt
'
,
];
mock
.
onGet
(
FILE_FIND_URL
).
replyOnce
(
200
,
files
);
getProjectFindFileInstance
();
// This triggers a load / axios call + subsequent render in the constructor
setImmediate
(()
=>
{
expect
(
findFiles
()).
toEqual
(
files
.
map
(
text
=>
({
text
,
href
:
`
${
BLOB_URL_TEMPLATE
}
/
${
encodeURIComponent
(
text
)}
`
,
})),
);
done
();
});
});
});
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