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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
41bedd9c
Commit
41bedd9c
authored
May 15, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Creates mixin to hold data common to both environments apps
parent
8fd95496
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
24 deletions
+30
-24
app/assets/javascripts/environments/components/environment.vue
...ssets/javascripts/environments/components/environment.vue
+7
-12
app/assets/javascripts/environments/folder/environments_folder_view.vue
...ascripts/environments/folder/environments_folder_view.vue
+6
-12
app/assets/javascripts/environments/mixins/environments_mixin.js
...ets/javascripts/environments/mixins/environments_mixin.js
+17
-0
No files found.
app/assets/javascripts/environments/components/environment.vue
View file @
41bedd9c
...
...
@@ -9,6 +9,7 @@ import tablePagination from '../../vue_shared/components/table_pagination.vue';
import
'
../../lib/utils/common_utils
'
;
import
eventHub
from
'
../event_hub
'
;
import
Poll
from
'
../../lib/utils/poll
'
;
import
environmentsMixin
from
'
../mixins/environments_mixin
'
;
export
default
{
...
...
@@ -18,6 +19,10 @@ export default {
loadingIcon
,
},
mixins
:
[
environmentsMixin
,
],
data
()
{
const
environmentsData
=
document
.
querySelector
(
'
#environments-list-view
'
).
dataset
;
const
store
=
new
EnvironmentsStore
();
...
...
@@ -169,19 +174,9 @@ export default {
},
successCallback
(
resp
)
{
const
response
=
{
headers
:
resp
.
headers
,
body
:
resp
.
json
(),
};
this
.
isLoading
=
false
;
this
.
store
.
storeAvailableCount
(
response
.
body
.
available_count
);
this
.
store
.
storeStoppedCount
(
response
.
body
.
stopped_count
);
this
.
store
.
storeEnvironments
(
response
.
body
.
environments
);
this
.
store
.
setPagination
(
response
.
headers
);
this
.
saveData
(
resp
);
// If
it were any open folders while polling we need to set them open
again
// If
folders are open while polling we need to open them
again
if
(
this
.
openFolders
.
length
)
{
this
.
openFolders
.
map
((
folder
)
=>
{
// TODO - Move this to the backend
...
...
app/assets/javascripts/environments/folder/environments_folder_view.vue
View file @
41bedd9c
...
...
@@ -8,8 +8,8 @@ import loadingIcon from '../../vue_shared/components/loading_icon.vue';
import
tablePagination
from
'
../../vue_shared/components/table_pagination.vue
'
;
import
Poll
from
'
../../lib/utils/poll
'
;
import
eventHub
from
'
../event_hub
'
;
import
environmentsMixin
from
'
../mixins/environments_mixin
'
;
import
'
../../lib/utils/common_utils
'
;
import
'
../../vue_shared/vue_resource_interceptor
'
;
export
default
{
components
:
{
...
...
@@ -18,6 +18,10 @@ export default {
loadingIcon
,
},
mixins
:
[
environmentsMixin
,
],
data
()
{
const
environmentsData
=
document
.
querySelector
(
'
#environments-folder-list-view
'
).
dataset
;
const
store
=
new
EnvironmentsStore
();
...
...
@@ -139,17 +143,7 @@ export default {
},
successCallback
(
resp
)
{
const
response
=
{
headers
:
resp
.
headers
,
body
:
resp
.
json
(),
};
this
.
isLoading
=
false
;
this
.
store
.
storeAvailableCount
(
response
.
body
.
available_count
);
this
.
store
.
storeStoppedCount
(
response
.
body
.
stopped_count
);
this
.
store
.
storeEnvironments
(
response
.
body
.
environments
);
this
.
store
.
setPagination
(
response
.
headers
);
this
.
saveData
(
resp
);
},
errorCallback
()
{
...
...
app/assets/javascripts/environments/mixins/environments_mixin.js
0 → 100644
View file @
41bedd9c
export
default
{
methods
:
{
saveData
(
resp
)
{
const
response
=
{
headers
:
resp
.
headers
,
body
:
resp
.
json
(),
};
this
.
isLoading
=
false
;
this
.
store
.
storeAvailableCount
(
response
.
body
.
available_count
);
this
.
store
.
storeStoppedCount
(
response
.
body
.
stopped_count
);
this
.
store
.
storeEnvironments
(
response
.
body
.
environments
);
this
.
store
.
setPagination
(
response
.
headers
);
},
},
};
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