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
6e6e3676
Commit
6e6e3676
authored
Apr 24, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moves folder view components into .vue files
parent
95061b38
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
61 deletions
+75
-61
app/assets/javascripts/environments/folder/environments_folder_bundle.js
...scripts/environments/folder/environments_folder_bundle.js
+10
-10
app/assets/javascripts/environments/folder/environments_folder_view.vue
...ascripts/environments/folder/environments_folder_view.vue
+62
-50
spec/javascripts/environments/folder/environments_folder_view_spec.js
...ipts/environments/folder/environments_folder_view_spec.js
+3
-1
No files found.
app/assets/javascripts/environments/folder/environments_folder_bundle.js
View file @
6e6e3676
import
EnvironmentsFolderComponent
from
'
./environments_folder_view
'
;
import
Vue
from
'
vue
'
;
import
EnvironmentsFolderComponent
from
'
./environments_folder_view.vue
'
;
$
(()
=>
{
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
window
.
gl
=
window
.
gl
||
{};
// eslint-disable-next-line no-new
new
Vue
({
if
(
gl
.
EnvironmentsListFolderApp
)
{
el
:
'
#environments-folder-list-view
'
,
gl
.
EnvironmentsListFolderApp
.
$destroy
(
true
);
components
:
{
}
'
environments-folder-app
'
:
EnvironmentsFolderComponent
,
},
gl
.
EnvironmentsListFolderApp
=
new
EnvironmentsFolderComponent
({
render
:
createElement
=>
createElement
(
'
environments-folder-app
'
),
el
:
document
.
querySelector
(
'
#environments-folder-list-view
'
),
});
});
});
});
app/assets/javascripts/environments/folder/environments_folder_view.
js
→
app/assets/javascripts/environments/folder/environments_folder_view.
vue
View file @
6e6e3676
<
script
>
/* eslint-disable no-new */
/* eslint-disable no-new */
/* global Flash */
/* global Flash */
import
Vue
from
'
vue
'
;
import
EnvironmentsService
from
'
../services/environments_service
'
;
import
EnvironmentsService
from
'
../services/environments_service
'
;
import
EnvironmentTable
from
'
../components/environments_table.vue
'
;
import
EnvironmentTable
from
'
../components/environments_table.vue
'
;
import
EnvironmentsStore
from
'
../stores/environments_store
'
;
import
EnvironmentsStore
from
'
../stores/environments_store
'
;
...
@@ -8,7 +8,7 @@ import TablePaginationComponent from '../../vue_shared/components/table_paginati
...
@@ -8,7 +8,7 @@ import TablePaginationComponent from '../../vue_shared/components/table_paginati
import
'
../../lib/utils/common_utils
'
;
import
'
../../lib/utils/common_utils
'
;
import
'
../../vue_shared/vue_resource_interceptor
'
;
import
'
../../vue_shared/vue_resource_interceptor
'
;
export
default
Vue
.
component
(
'
environment-folder-view
'
,
{
export
default
{
components
:
{
components
:
{
'
environment-table
'
:
EnvironmentTable
,
'
environment-table
'
:
EnvironmentTable
,
'
table-pagination
'
:
TablePaginationComponent
,
'
table-pagination
'
:
TablePaginationComponent
,
...
@@ -128,56 +128,68 @@ export default Vue.component('environment-folder-view', {
...
@@ -128,56 +128,68 @@ export default Vue.component('environment-folder-view', {
return
param
;
return
param
;
},
},
},
},
};
</
script
>
<
template
>
<div
:class=
"cssContainerClass"
>
<div
class=
"top-area"
v-if=
"!isLoading"
>
<h4
class=
"js-folder-name environments-folder-name"
>
Environments /
<b>
{{
folderName
}}
</b>
</h4>
<ul
class=
"nav-links"
>
<li
:class=
"
{ 'active': scope === null || scope === 'available' }">
<a
:href=
"availablePath"
class=
"js-available-environments-folder-tab"
>
Available
<span
class=
"badge js-available-environments-count"
>
{{
state
.
availableCounter
}}
</span>
</a>
</li>
<li
:class=
"
{ 'active' : scope === 'stopped' }">
<a
:href=
"stoppedPath"
class=
"js-stopped-environments-folder-tab"
>
Stopped
<span
class=
"badge js-stopped-environments-count"
>
{{
state
.
stoppedCounter
}}
</span>
</a>
</li>
</ul>
</div>
template
:
`
<div
class=
"environments-container"
>
<div :class="cssContainerClass">
<div
<div class="top-area" v-if="!isLoading">
class=
"environments-list-loading text-center"
v-if=
"isLoading"
>
<h4 class="js-folder-name environments-folder-name">
<i
Environments / <b>{{folderName}}</b>
class=
"fa fa-spinner fa-spin"
</h4>
aria-hidden=
"true"
/>
<ul class="nav-links">
<li v-bind:class="{ 'active': scope === null || scope === 'available' }">
<a :href="availablePath" class="js-available-environments-folder-tab">
Available
<span class="badge js-available-environments-count">
{{state.availableCounter}}
</span>
</a>
</li>
<li v-bind:class="{ 'active' : scope === 'stopped' }">
<a :href="stoppedPath" class="js-stopped-environments-folder-tab">
Stopped
<span class="badge js-stopped-environments-count">
{{state.stoppedCounter}}
</span>
</a>
</li>
</ul>
</div>
</div>
<div class="environments-container">
<div
<div class="environments-list-loading text-center" v-if="isLoading">
class=
"table-holder"
<i class="fa fa-spinner fa-spin"></i>
v-if=
"!isLoading && state.environments.length > 0"
>
</div>
<environment-table
<div class="table-holder"
:environments=
"state.environments"
v-if="!isLoading && state.environments.length > 0">
:can-create-deployment=
"canCreateDeploymentParsed"
:can-read-environment=
"canReadEnvironmentParsed"
<environment-table
:toggleDeployBoard=
"toggleDeployBoard"
:environments="state.environments"
:store=
"store"
:can-create-deployment="canCreateDeploymentParsed"
:service=
"service"
/>
:can-read-environment="canReadEnvironmentParsed"
:toggleDeployBoard="toggleDeployBoard"
<table-pagination
:store="store"
v-if=
"state.paginationInformation && state.paginationInformation.totalPages > 1"
:service="service"/>
:change=
"changePage"
:pageInfo=
"state.paginationInformation"
/>
<table-pagination v-if="state.paginationInformation && state.paginationInformation.totalPages > 1"
:change="changePage"
:pageInfo="state.paginationInformation"/>
</div>
</div>
</div>
</div>
</div>
`
,
</div>
});
</
template
>
spec/javascripts/environments/folder/environments_folder_view_spec.js
View file @
6e6e3676
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
'
~/flash
'
;
import
'
~/flash
'
;
import
EnvironmentsFolderViewComponent
from
'
~/environments/folder/environments_folder_view
'
;
import
environmentsFolderViewComponent
from
'
~/environments/folder/environments_folder_view.vue
'
;
import
{
environmentsList
}
from
'
../mock_data
'
;
import
{
environmentsList
}
from
'
../mock_data
'
;
describe
(
'
Environments Folder View
'
,
()
=>
{
describe
(
'
Environments Folder View
'
,
()
=>
{
preloadFixtures
(
'
static/environments/environments_folder_view.html.raw
'
);
preloadFixtures
(
'
static/environments/environments_folder_view.html.raw
'
);
let
EnvironmentsFolderViewComponent
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
loadFixtures
(
'
static/environments/environments_folder_view.html.raw
'
);
loadFixtures
(
'
static/environments/environments_folder_view.html.raw
'
);
EnvironmentsFolderViewComponent
=
Vue
.
extend
(
environmentsFolderViewComponent
);
window
.
history
.
pushState
({},
null
,
'
environments/folders/build
'
);
window
.
history
.
pushState
({},
null
,
'
environments/folders/build
'
);
});
});
...
...
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