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
f0e23800
Commit
f0e23800
authored
Jul 20, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Covert vue components to single file components
parent
bf2210c1
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
142 additions
and
85 deletions
+142
-85
app/assets/javascripts/repo/repo_file.vue
app/assets/javascripts/repo/repo_file.vue
+38
-0
app/assets/javascripts/repo/repo_file_options.js
app/assets/javascripts/repo/repo_file_options.js
+0
-28
app/assets/javascripts/repo/repo_file_options.vue
app/assets/javascripts/repo/repo_file_options.vue
+33
-0
app/assets/javascripts/repo/repo_loading_file.js
app/assets/javascripts/repo/repo_loading_file.js
+0
-34
app/assets/javascripts/repo/repo_loading_file.vue
app/assets/javascripts/repo/repo_loading_file.vue
+39
-0
app/assets/javascripts/repo/repo_prev_directory.vue
app/assets/javascripts/repo/repo_prev_directory.vue
+11
-7
app/assets/javascripts/repo/repo_sidebar.js
app/assets/javascripts/repo/repo_sidebar.js
+4
-4
app/assets/javascripts/repo/repo_store.js
app/assets/javascripts/repo/repo_store.js
+1
-1
app/assets/javascripts/repo/repo_tab.vue
app/assets/javascripts/repo/repo_tab.vue
+15
-10
app/assets/javascripts/repo/repo_tabs.js
app/assets/javascripts/repo/repo_tabs.js
+1
-1
No files found.
app/assets/javascripts/repo/repo_file.
js
→
app/assets/javascripts/repo/repo_file.
vue
View file @
f0e23800
<
script
>
const
RepoFile
=
{
const
RepoFile
=
{
template
:
`
<tr v-if='!loading.tree || hasFiles' :class='{"active": activeFile.url === file.url}'>
<td>
<i class='fa' :class='file.icon' :style='{"margin-left": file.level * 10 + "px"}'></i>
<a :href='file.url' @click.prevent='linkClicked(file)' class='repo-file-name' :title='file.url'>{{file.name}}</a>
</td>
<td v-if='!isMini' class='hidden-sm hidden-xs'>
<div class='commit-message'>{{file.lastCommitMessage}}</div>
</td>
<td v-if='!isMini' class='hidden-xs'>
<span>{{file.lastCommitUpdate}}</span>
</td>
</tr>
`
,
props
:
{
props
:
{
name
:
'
repo-file
'
,
name
:
'
repo-file
'
,
file
:
Object
,
file
:
Object
,
...
@@ -29,4 +16,23 @@ const RepoFile = {
...
@@ -29,4 +16,23 @@ const RepoFile = {
},
},
},
},
};
};
export
default
RepoFile
;
export
default
RepoFile
;
</
script
>
<
template
>
<tr
v-if=
"!loading.tree || hasFiles"
:class=
"
{'active': activeFile.url === file.url}">
<td>
<i
class=
"fa"
:class=
"file.icon"
:style=
"
{'margin-left': file.level * 10 + 'px'}">
</i>
<a
:href=
"file.url"
@
click.prevent=
"linkClicked(file)"
class=
"repo-file-name"
:title=
"file.url"
>
{{
file
.
name
}}
</a>
</td>
<td
v-if=
"!isMini"
class=
"hidden-sm hidden-xs"
>
<div
class=
"commit-message"
>
{{
file
.
lastCommitMessage
}}
</div>
</td>
<td
v-if=
"!isMini"
class=
"hidden-xs"
>
<span>
{{
file
.
lastCommitUpdate
}}
</span>
</td>
</tr>
</
template
>
app/assets/javascripts/repo/repo_file_options.js
deleted
100644 → 0
View file @
bf2210c1
const
RepoFileOptions
=
{
template
:
`
<tr v-if='isMini' class='repo-file-options'>
<td>
<span class='title'>{{projectName}}</span>
<ul>
<li>
<a href='#' title='New File'>
<i class='fa fa-file-o'></i>
</a>
</li>
<li>
<a href='#' title='New Folder'>
<i class='fa fa-folder-o'></i>
</a>
</li>
</ul>
</td>
</tr>
`
,
props
:
{
name
:
'
repo-file-options
'
,
isMini
:
Boolean
,
projectName
:
String
,
},
};
export
default
RepoFileOptions
;
app/assets/javascripts/repo/repo_file_options.vue
0 → 100644
View file @
f0e23800
<
script
>
const
RepoFileOptions
=
{
props
:
{
name
:
'
repo-file-options
'
,
isMini
:
Boolean
,
projectName
:
String
,
},
};
export
default
RepoFileOptions
;
</
script
>
<
template
>
<tr
v-if=
"isMini"
class=
"repo-file-options"
>
<td>
<span
class=
"title"
>
{{
projectName
}}
</span>
<ul>
<li>
<a
href=
"#"
title=
"New File"
>
<i
class=
"fa fa-file-o"
></i>
</a>
</li>
<li>
<a
href=
"#"
title=
"New Folder"
>
<i
class=
"fa fa-folder-o"
></i>
</a>
</li>
</ul>
</td>
</tr>
</
template
>
app/assets/javascripts/repo/repo_loading_file.js
deleted
100644 → 0
View file @
bf2210c1
const
RepoLoadingFile
=
{
template
:
`
<tr v-if='loading.tree && !hasFiles'>
<td>
<div class="animation-container animation-container-small">
<div v-for="n in 6" :class="lineOfCode(n)"></div>
</div>
</td>
<td v-if="!isMini" class='hidden-sm hidden-xs'>
<div class="animation-container">
<div v-for="n in 6" :class="lineOfCode(n)"></div>
</div>
</td>
<td v-if="!isMini" class='hidden-xs'>
<div class="animation-container animation-container-small">
<div v-for="n in 6" :class="lineOfCode(n)"></div>
</div>
</td>
</tr>
`
,
methods
:
{
lineOfCode
(
n
)
{
return
`line-of-code-
${
n
}
`
;
},
},
props
:
{
loading
:
Object
,
hasFiles
:
Boolean
,
isMini
:
Boolean
,
},
};
export
default
RepoLoadingFile
;
app/assets/javascripts/repo/repo_loading_file.vue
0 → 100644
View file @
f0e23800
<
script
>
const
RepoLoadingFile
=
{
methods
:
{
lineOfCode
(
n
)
{
return
`line-of-code-
${
n
}
`
;
},
},
props
:
{
loading
:
Object
,
hasFiles
:
Boolean
,
isMini
:
Boolean
,
},
};
export
default
RepoLoadingFile
;
</
script
>
<
template
>
<tr
v-if=
"loading.tree && !hasFiles"
>
<td>
<div
class=
"animation-container animation-container-small"
>
<div
v-for=
"n in 6"
:class=
"lineOfCode(n)"
></div>
</div>
</td>
<td
v-if=
"!isMini"
class=
"hidden-sm hidden-xs"
>
<div
class=
"animation-container"
>
<div
v-for=
"n in 6"
:class=
"lineOfCode(n)"
></div>
</div>
</td>
<td
v-if=
"!isMini"
class=
"hidden-xs"
>
<div
class=
"animation-container animation-container-small"
>
<div
v-for=
"n in 6"
:class=
"lineOfCode(n)"
></div>
</div>
</td>
</tr>
</
template
>
app/assets/javascripts/repo/repo_prev_directory.
js
→
app/assets/javascripts/repo/repo_prev_directory.
vue
View file @
f0e23800
<
script
>
const
RepoPreviousDirectory
=
{
const
RepoPreviousDirectory
=
{
template
:
`
<tr>
<td colspan='3'>
<a :href='prevUrl' @click.prevent='linkClicked(prevUrl)'>..</a>
</td>
</tr>
`
,
props
:
{
props
:
{
name
:
'
repo-previous-directory
'
,
name
:
'
repo-previous-directory
'
,
prevUrl
:
String
,
prevUrl
:
String
,
...
@@ -17,4 +11,14 @@ const RepoPreviousDirectory = {
...
@@ -17,4 +11,14 @@ const RepoPreviousDirectory = {
},
},
},
},
};
};
export
default
RepoPreviousDirectory
;
export
default
RepoPreviousDirectory
;
</
script
>
<
template
>
<tr>
<td
colspan=
"3"
>
<a
:href=
"prevUrl"
@
click.prevent=
"linkClicked(prevUrl)"
>
..
</a>
</td>
</tr>
</
template
>
app/assets/javascripts/repo/repo_sidebar.js
View file @
f0e23800
...
@@ -2,10 +2,10 @@ import Vue from 'vue';
...
@@ -2,10 +2,10 @@ import Vue from 'vue';
import
Service
from
'
./repo_service
'
;
import
Service
from
'
./repo_service
'
;
import
Helper
from
'
./repo_helper
'
;
import
Helper
from
'
./repo_helper
'
;
import
Store
from
'
./repo_store
'
;
import
Store
from
'
./repo_store
'
;
import
RepoPreviousDirectory
from
'
./repo_prev_directory
'
;
import
RepoPreviousDirectory
from
'
./repo_prev_directory
.vue
'
;
import
RepoFileOptions
from
'
./repo_file_options
'
;
import
RepoFileOptions
from
'
./repo_file_options
.vue
'
;
import
RepoFile
from
'
./repo_file
'
;
import
RepoFile
from
'
./repo_file
.vue
'
;
import
RepoLoadingFile
from
'
./repo_loading_file
'
;
import
RepoLoadingFile
from
'
./repo_loading_file
.vue
'
;
import
RepoMiniMixin
from
'
./repo_mini_mixin
'
;
import
RepoMiniMixin
from
'
./repo_mini_mixin
'
;
export
default
class
RepoSidebar
{
export
default
class
RepoSidebar
{
...
...
app/assets/javascripts/repo/repo_store.js
View file @
f0e23800
app/assets/javascripts/repo/repo_tab.
js
→
app/assets/javascripts/repo/repo_tab.
vue
View file @
f0e23800
import
RepoHelper
from
'
./repo_helper
'
;
<
script
>
import
RepoStore
from
'
./repo_store
'
;
import
RepoStore
from
'
./repo_store
'
;
const
RepoTab
=
{
const
RepoTab
=
{
template
:
`
<li>
<a href='#' @click.prevent='xClicked(tab)' v-if='!tab.loading'>
<i class='fa' :class="changedClass"></i>
</a>
<a href='#' v-if='!tab.loading' :title='tab.url' @click.prevent='tabClicked(tab)'>{{tab.name}}</a>
<i v-if='tab.loading' class='fa fa-spinner fa-spin'></i>
</li>
`
,
props
:
{
props
:
{
name
:
'
repo-tab
'
,
name
:
'
repo-tab
'
,
tab
:
Object
,
tab
:
Object
,
...
@@ -36,4 +27,18 @@ const RepoTab = {
...
@@ -36,4 +27,18 @@ const RepoTab = {
},
},
},
},
};
};
export
default
RepoTab
;
export
default
RepoTab
;
</
script
>
<
template
>
<li>
<a
href=
"#"
@
click.prevent=
"xClicked(tab)"
v-if=
"!tab.loading"
>
<i
class=
"fa"
:class=
"changedClass"
></i>
</a>
<a
href=
"#"
v-if=
"!tab.loading"
:title=
"tab.url"
@
click.prevent=
"tabClicked(tab)"
>
{{
tab
.
name
}}
</a>
<i
v-if=
"tab.loading"
class=
"fa fa-spinner fa-spin"
></i>
</li>
</
template
>
app/assets/javascripts/repo/repo_tabs.js
View file @
f0e23800
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
Store
from
'
./repo_store
'
;
import
Store
from
'
./repo_store
'
;
import
RepoTab
from
'
./repo_tab
'
;
import
RepoTab
from
'
./repo_tab
.vue
'
;
import
RepoMiniMixin
from
'
./repo_mini_mixin
'
;
import
RepoMiniMixin
from
'
./repo_mini_mixin
'
;
export
default
class
RepoTabs
{
export
default
class
RepoTabs
{
...
...
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