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
4d28ac48
Commit
4d28ac48
authored
Nov 01, 2019
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UX improvements to Vue file listing refactor
Improves the loading state of the table Fixes some tooltip placements
parent
91e1e5cb
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
16 deletions
+34
-16
app/assets/javascripts/repository/components/last_commit.vue
app/assets/javascripts/repository/components/last_commit.vue
+1
-1
app/assets/javascripts/repository/components/table/index.vue
app/assets/javascripts/repository/components/table/index.vue
+19
-9
app/assets/javascripts/repository/components/table/row.vue
app/assets/javascripts/repository/components/table/row.vue
+7
-2
app/assets/javascripts/vue_shared/components/time_ago_tooltip.vue
...ts/javascripts/vue_shared/components/time_ago_tooltip.vue
+1
-1
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/frontend/repository/components/table/index_spec.js
spec/frontend/repository/components/table/index_spec.js
+3
-3
No files found.
app/assets/javascripts/repository/components/last_commit.vue
View file @
4d28ac48
...
...
@@ -128,7 +128,7 @@ export default {
<div
class=
"ci-status-link"
>
<gl-link
v-if=
"commit.latestPipeline"
v-gl-tooltip
v-gl-tooltip
.
left
:href=
"commit.latestPipeline.detailedStatus.detailsPath"
:title=
"statusTitle"
class=
"js-commit-pipeline"
...
...
app/assets/javascripts/repository/components/table/index.vue
View file @
4d28ac48
<
script
>
import
{
Gl
LoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
Gl
SkeletonLoading
}
from
'
@gitlab/ui
'
;
import
createFlash
from
'
~/flash
'
;
import
{
sprintf
,
__
}
from
'
../../../locale
'
;
import
getRefMixin
from
'
../../mixins/get_ref
'
;
...
...
@@ -13,7 +13,7 @@ const PAGE_SIZE = 100;
export
default
{
components
:
{
Gl
LoadingIcon
,
Gl
SkeletonLoading
,
TableHeader
,
TableRow
,
ParentRow
,
...
...
@@ -44,6 +44,15 @@ export default {
},
computed
:
{
tableCaption
()
{
if
(
this
.
isLoadingFiles
)
{
return
sprintf
(
__
(
'
Loading files, directories, and submodules in the path %{path} for commit reference %{ref}
'
,
),
{
path
:
this
.
path
,
ref
:
this
.
ref
},
);
}
return
sprintf
(
__
(
'
Files, directories, and submodules in the path %{path} for commit reference %{ref}
'
),
{
path
:
this
.
path
,
ref
:
this
.
ref
},
...
...
@@ -117,12 +126,7 @@ export default {
<
template
>
<div
class=
"tree-content-holder"
>
<div
class=
"table-holder bordered-box"
>
<table
class=
"table tree-table qa-file-tree"
aria-live=
"polite"
>
<caption
class=
"sr-only"
>
{{
tableCaption
}}
</caption>
<table
:aria-label=
"tableCaption"
class=
"table tree-table qa-file-tree"
aria-live=
"polite"
>
<table-header
v-once
/>
<tbody>
<parent-row
v-show=
"showParentRow"
:commit-ref=
"ref"
:path=
"path"
/>
...
...
@@ -141,9 +145,15 @@ export default {
:lfs-oid="entry.lfsOid"
/>
</
template
>
<
template
v-if=
"isLoadingFiles"
>
<tr
v-for=
"i in 5"
:key=
"i"
aria-hidden=
"true"
>
<td><gl-skeleton-loading
:lines=
"1"
class=
"h-auto"
/></td>
<td><gl-skeleton-loading
:lines=
"1"
class=
"h-auto"
/></td>
<td><gl-skeleton-loading
:lines=
"1"
class=
"ml-auto h-auto w-50"
/></td>
</tr>
</
template
>
</tbody>
</table>
<gl-loading-icon
v-show=
"isLoadingFiles"
class=
"my-3"
size=
"md"
/>
</div>
</div>
</template>
app/assets/javascripts/repository/components/table/row.vue
View file @
4d28ac48
...
...
@@ -124,13 +124,18 @@ export default {
</
template
>
</td>
<td
class=
"d-none d-sm-table-cell tree-commit"
>
<gl-link
v-if=
"commit"
:href=
"commit.commitPath"
class=
"str-truncated-100 tree-commit-link"
>
<gl-link
v-if=
"commit"
:href=
"commit.commitPath"
:title=
"commit.message"
class=
"str-truncated-100 tree-commit-link"
>
{{ commit.message }}
</gl-link>
<gl-skeleton-loading
v-else
:lines=
"1"
class=
"h-auto"
/>
</td>
<td
class=
"tree-time-ago text-right"
>
<timeago-tooltip
v-if=
"commit"
:time=
"commit.committedDate"
tooltip-placement=
"bottom"
/>
<timeago-tooltip
v-if=
"commit"
:time=
"commit.committedDate"
/>
<gl-skeleton-loading
v-else
:lines=
"1"
class=
"ml-auto h-auto w-50"
/>
</td>
</tr>
...
...
app/assets/javascripts/vue_shared/components/time_ago_tooltip.vue
View file @
4d28ac48
...
...
@@ -32,7 +32,7 @@ export default {
</
script
>
<
template
>
<time
v-gl-tooltip=
"
{ placement: tooltipPlacement }"
v-gl-tooltip
.viewport
=
"
{ placement: tooltipPlacement }"
:class="cssClass"
:title="tooltipTitle(time)"
v-text="timeFormated(time)"
...
...
locale/gitlab.pot
View file @
4d28ac48
...
...
@@ -9954,6 +9954,9 @@ msgstr ""
msgid "Loading contribution stats for group members"
msgstr ""
msgid "Loading files, directories, and submodules in the path %{path} for commit reference %{ref}"
msgstr ""
msgid "Loading functions timed out. Please reload the page to try again."
msgstr ""
...
...
spec/frontend/repository/components/table/index_spec.js
View file @
4d28ac48
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
Gl
LoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
Gl
SkeletonLoading
}
from
'
@gitlab/ui
'
;
import
Table
from
'
~/repository/components/table/index.vue
'
;
let
vm
;
...
...
@@ -35,7 +35,7 @@ describe('Repository table component', () => {
vm
.
setData
({
ref
});
expect
(
vm
.
find
(
'
caption
'
).
text
(
)).
toEqual
(
expect
(
vm
.
find
(
'
.table
'
).
attributes
(
'
aria-label
'
)).
toEqual
(
`Files, directories, and submodules in the path
${
path
}
for commit reference
${
ref
}
`
,
);
});
...
...
@@ -45,7 +45,7 @@ describe('Repository table component', () => {
vm
.
setData
({
isLoadingFiles
:
true
});
expect
(
vm
.
find
(
Gl
LoadingIcon
).
isVisible
()).
toBe
(
true
);
expect
(
vm
.
find
(
Gl
SkeletonLoading
).
exists
()).
toBe
(
true
);
});
describe
(
'
normalizeData
'
,
()
=>
{
...
...
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