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
93f8ad8d
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
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
110 additions
and
91 deletions
+110
-91
app/assets/javascripts/ide/components/ide_review.vue
app/assets/javascripts/ide/components/ide_review.vue
+13
-51
app/assets/javascripts/ide/components/ide_tree.vue
app/assets/javascripts/ide/components/ide_tree.vue
+15
-40
app/assets/javascripts/ide/components/ide_tree_list.vue
app/assets/javascripts/ide/components/ide_tree_list.vue
+73
-0
app/assets/stylesheets/pages/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
>
<
script
>
import
{
mapActions
,
mapGetters
,
mapState
}
from
'
vuex
'
;
import
IdeTreeList
from
'
./ide_tree_list.vue
'
;
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
{
export
default
{
components
:
{
components
:
{
Icon
,
IdeTreeList
,
RepoFile
,
SkeletonLoadingContainer
,
NewDropdown
,
},
computed
:
{
...
mapState
([
'
currentBranchId
'
]),
...
mapGetters
([
'
currentProject
'
,
'
currentTree
'
]),
},
mounted
()
{
this
.
updateViewer
(
'
diff
'
);
},
methods
:
{
...
mapActions
([
'
updateViewer
'
]),
},
},
};
};
</
script
>
</
script
>
<
template
>
<
template
>
<div
<ide-tree-list
class=
"ide-file-list"
viewer-type=
"diff"
header-class=
"ide-review-header"
:disable-action-dropdown=
"true"
>
>
<template
v-if=
"!currentTree || currentTree.loading"
>
<template
<div
slot=
"header"
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 ide-review-header"
>
{{
__
(
'
Review
'
)
}}
{{
__
(
'
Review
'
)
}}
<div
class=
"prepend-top-5 clgray
"
>
<div
class=
"prepend-top-5 ide-review-sub-header
"
>
{{
__
(
'
Lastest changed
'
)
}}
{{
__
(
'
Lastest changed
'
)
}}
</div>
</div>
</header>
<repo-file
v-for=
"file in currentTree.tree"
:key=
"file.key"
:file=
"file"
:level=
"0"
:disable-action-dropdown=
"true"
/>
</
template
>
</
template
>
</
div
>
</
ide-tree-list
>
</template>
</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
>
<
script
>
import
{
mapActions
,
mapGetters
,
mapState
}
from
'
vuex
'
;
import
{
mapState
,
mapGetters
}
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
NewDropdown
from
'
./new_dropdown/index.vue
'
;
import
IdeTreeList
from
'
./ide_tree_list.vue
'
;
export
default
{
export
default
{
components
:
{
components
:
{
Icon
,
RepoFile
,
SkeletonLoadingContainer
,
NewDropdown
,
NewDropdown
,
IdeTreeList
,
},
},
computed
:
{
computed
:
{
...
mapState
([
'
currentBranchId
'
]),
...
mapState
([
'
currentBranchId
'
]),
...
mapGetters
([
'
currentProject
'
,
'
currentTree
'
]),
...
mapGetters
([
'
currentProject
'
]),
},
mounted
()
{
this
.
updateViewer
(
'
editor
'
);
},
methods
:
{
...
mapActions
([
'
updateViewer
'
]),
},
},
};
};
</
script
>
</
script
>
<
template
>
<
template
>
<
div
<
ide-tree-list
class=
"ide-file-list
"
viewer-type=
"editor
"
>
>
<template
v-if=
"!currentTree || currentTree.loading"
>
<template
<div
slot=
"header"
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
'
)
}}
{{
__
(
'
Edit
'
)
}}
<new-dropdown
<new-dropdown
:project-id=
"currentProject.name_with_namespace"
:project-id=
"currentProject.name_with_namespace"
:branch=
"currentBranchId"
:branch=
"currentBranchId"
path=
""
path=
""
/>
/>
</header>
<repo-file
v-for=
"file in currentTree.tree"
:key=
"file.key"
:file=
"file"
:level=
"0"
/>
</
template
>
</
template
>
</
div
>
</
ide-tree-list
>
</template>
</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 @@
...
@@ -902,3 +902,12 @@
margin-top
:
-1px
;
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