BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
93f8ad8d
Unverified
Commit
93f8ad8d
authored
Apr 20, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
created HOC for the tree list to cover both edit & review mode
parent
fc11520e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
110 additions
and
91 deletions
+110
-91
ide_review.vue
app/assets/javascripts/ide/components/ide_review.vue
+13
-51
ide_tree.vue
app/assets/javascripts/ide/components/ide_tree.vue
+15
-40
ide_tree_list.vue
app/assets/javascripts/ide/components/ide_tree_list.vue
+73
-0
repo.scss
app/assets/stylesheets/pages/repo.scss
+9
-0
No files found.
app/assets/javascripts/ide/components/ide_review.vue
View file @
93f8ad8d
<
script
>
import
{
mapActions
,
mapGetters
,
mapState
}
from
'vuex'
;
import
Icon
from
'~/vue_shared/components/icon.vue'
;
import
SkeletonLoadingContainer
from
'~/vue_shared/components/skeleton_loading_container.vue'
;
import
RepoFile
from
'./repo_file.vue'
;
import
NewDropdown
from
'./new_dropdown/index.vue'
;
import
IdeTreeList
from
'./ide_tree_list.vue'
;
export
default
{
components
:
{
Icon
,
RepoFile
,
SkeletonLoadingContainer
,
NewDropdown
,
},
computed
:
{
...
mapState
([
'currentBranchId'
]),
...
mapGetters
([
'currentProject'
,
'currentTree'
]),
},
mounted
()
{
this
.
updateViewer
(
'diff'
);
},
methods
:
{
...
mapActions
([
'updateViewer'
]),
IdeTreeList
,
},
};
</
script
>
<
template
>
<div
class=
"ide-file-list"
<ide-tree-list
viewer-type=
"diff"
header-class=
"ide-review-header"
:disable-action-dropdown=
"true"
>
<template
v-if=
"!currentTree || currentTree.loading"
>
<div
class=
"multi-file-loading-container"
v-for=
"n in 3"
:key=
"n"
>
<skeleton-loading-container
/>
<template
slot=
"header"
>
{{
__
(
'Review'
)
}}
<div
class=
"prepend-top-5 ide-review-sub-header"
>
{{
__
(
'Lastest changed'
)
}}
</div>
</
template
>
<
template
v-else
>
<header
class=
"ide-tree-header ide-review-header"
>
{{
__
(
'Review'
)
}}
<div
class=
"prepend-top-5 clgray"
>
{{
__
(
'Lastest changed'
)
}}
</div>
</header>
<repo-file
v-for=
"file in currentTree.tree"
:key=
"file.key"
:file=
"file"
:level=
"0"
:disable-action-dropdown=
"true"
/>
</
template
>
</div>
</ide-tree-list>
</template>
<
style
>
.ide-review-header
{
flex-direction
:
column
;
align-items
:
flex-start
;
}
</
style
>
app/assets/javascripts/ide/components/ide_tree.vue
View file @
93f8ad8d
<
script
>
import
{
mapActions
,
mapGetters
,
mapState
}
from
'vuex'
;
import
Icon
from
'~/vue_shared/components/icon.vue'
;
import
SkeletonLoadingContainer
from
'~/vue_shared/components/skeleton_loading_container.vue'
;
import
RepoFile
from
'./repo_file.vue'
;
import
{
mapState
,
mapGetters
}
from
'vuex'
;
import
NewDropdown
from
'./new_dropdown/index.vue'
;
import
IdeTreeList
from
'./ide_tree_list.vue'
;
export
default
{
components
:
{
Icon
,
RepoFile
,
SkeletonLoadingContainer
,
NewDropdown
,
IdeTreeList
,
},
computed
:
{
...
mapState
([
'currentBranchId'
]),
...
mapGetters
([
'currentProject'
,
'currentTree'
]),
},
mounted
()
{
this
.
updateViewer
(
'editor'
);
},
methods
:
{
...
mapActions
([
'updateViewer'
]),
...
mapGetters
([
'currentProject'
]),
},
};
</
script
>
<
template
>
<
div
class=
"ide-file-list
"
<
ide-tree-list
viewer-type=
"editor
"
>
<template
v-if=
"!currentTree || currentTree.loading"
>
<div
class=
"multi-file-loading-container"
v-for=
"n in 3"
:key=
"n"
>
<skeleton-loading-container
/>
</div>
</
template
>
<
template
v-else
>
<header
class=
"ide-tree-header"
>
{{
__
(
'Edit'
)
}}
<new-dropdown
:project-id=
"currentProject.name_with_namespace"
:branch=
"currentBranchId"
path=
""
/>
</header>
<repo-file
v-for=
"file in currentTree.tree"
:key=
"file.key"
:file=
"file"
:level=
"0"
<template
slot=
"header"
>
{{
__
(
'Edit'
)
}}
<new-dropdown
:project-id=
"currentProject.name_with_namespace"
:branch=
"currentBranchId"
path=
""
/>
</
template
>
</
div
>
</
ide-tree-list
>
</template>
app/assets/javascripts/ide/components/ide_tree_list.vue
0 → 100644
View file @
93f8ad8d
<
script
>
import
{
mapActions
,
mapGetters
,
mapState
}
from
'vuex'
;
import
Icon
from
'~/vue_shared/components/icon.vue'
;
import
SkeletonLoadingContainer
from
'~/vue_shared/components/skeleton_loading_container.vue'
;
import
RepoFile
from
'./repo_file.vue'
;
import
NewDropdown
from
'./new_dropdown/index.vue'
;
export
default
{
components
:
{
Icon
,
RepoFile
,
SkeletonLoadingContainer
,
NewDropdown
,
},
props
:
{
viewerType
:
{
type
:
String
,
required
:
true
,
},
headerClass
:
{
type
:
String
,
required
:
false
,
default
:
null
,
},
disableActionDropdown
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
},
computed
:
{
...
mapState
([
'currentBranchId'
]),
...
mapGetters
([
'currentProject'
,
'currentTree'
]),
},
mounted
()
{
this
.
updateViewer
(
this
.
viewerType
);
},
methods
:
{
...
mapActions
([
'updateViewer'
]),
},
};
</
script
>
<
template
>
<div
class=
"ide-file-list"
>
<template
v-if=
"!currentTree || currentTree.loading"
>
<div
class=
"multi-file-loading-container"
v-for=
"n in 3"
:key=
"n"
>
<skeleton-loading-container
/>
</div>
</
template
>
<
template
v-else
>
<header
class=
"ide-tree-header"
:class=
"headerClass"
>
<slot
name=
"header"
></slot>
</header>
<repo-file
v-for=
"file in currentTree.tree"
:key=
"file.key"
:file=
"file"
:level=
"0"
:disable-action-dropdown=
"disableActionDropdown"
/>
</
template
>
</div>
</template>
app/assets/stylesheets/pages/repo.scss
View file @
93f8ad8d
...
...
@@ -902,3 +902,12 @@
margin-top
:
-1px
;
}
}
.ide-review-header
{
flex-direction
:
column
;
align-items
:
flex-start
;
}
.ide-review-sub-header
{
color
:
$gl-text-color-secondary
;
}
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