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
70cb2792
Commit
70cb2792
authored
Dec 08, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace play icon svg logic
parent
1413c94a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
29 deletions
+28
-29
app/assets/javascripts/environments/components/environment.js.es6
...ts/javascripts/environments/components/environment.js.es6
+8
-2
app/assets/javascripts/environments/components/environment_actions.js.es6
...cripts/environments/components/environment_actions.js.es6
+6
-26
app/assets/javascripts/environments/components/environment_item.js.es6
...vascripts/environments/components/environment_item.js.es6
+11
-0
app/views/projects/environments/index.html.haml
app/views/projects/environments/index.html.haml
+3
-1
No files found.
app/assets/javascripts/environments/components/environment.js.es6
View file @
70cb2792
...
...
@@ -74,6 +74,8 @@
projectStoppedEnvironmentsPath: environmentsData.projectStoppedEnvironmentsPath,
newEnvironmentPath: environmentsData.newEnvironmentPath,
helpPagePath: environmentsData.helpPagePath,
commitIconSvg: environmentsData.commitIconSvg,
playIconSvg: environmentsData.playIconSvg,
};
},
...
...
@@ -227,7 +229,9 @@
:model="model"
:toggleRow="toggleRow.bind(model)"
:can-create-deployment="canCreateDeploymentParsed"
:can-read-environment="canReadEnvironmentParsed"></tr>
:can-read-environment="canReadEnvironmentParsed"
:play-icon-svg="playIconSvg"
:commit-icon-svg="commitIconSvg"></tr>
<tr v-if="model.isOpen && model.children && model.children.length > 0"
is="environment-item"
...
...
@@ -235,7 +239,9 @@
:model="children"
:toggleRow="toggleRow.bind(children)"
:can-create-deployment="canCreateDeploymentParsed"
:can-read-environment="canReadEnvironmentParsed">
:can-read-environment="canReadEnvironmentParsed"
:play-icon-svg="playIconSvg"
:commit-icon-svg="commitIconSvg">
</tr>
</template>
...
...
app/assets/javascripts/environments/components/environment_actions.js.es6
View file @
70cb2792
...
...
@@ -12,38 +12,18 @@
required: false,
default: () => [],
},
},
/**
* Appends the svg icon that were render in the index page.
* In order to reuse the svg instead of copy and paste in this template
* we need to render it outside this component using =custom_icon partial.
*
* TODO: Remove this when webpack is merged.
*
*/
mounted() {
const playIcon = document.querySelector('.play-icon-svg.hidden svg');
const dropdownContainer = this.$el.querySelector('.dropdown-play-icon-container');
const actionContainers = this.$el.querySelectorAll('.action-play-icon-container');
// Phantomjs does not have support to iterate a nodelist.
const actionsArray = [].slice.call(actionContainers);
if (playIcon && actionsArray && dropdownContainer) {
dropdownContainer.appendChild(playIcon.cloneNode(true));
actionsArray.forEach((element) => {
element.appendChild(playIcon.cloneNode(true));
});
}
playIconSvg: {
type: String,
required: false,
},
},
template: `
<div class="inline">
<div class="dropdown">
<a class="dropdown-new btn btn-default" data-toggle="dropdown">
<span
class="dropdown-play-icon-container"
></span>
<span
v-html='playIconSvg'
></span>
<i class="fa fa-caret-down"></i>
</a>
...
...
@@ -53,7 +33,7 @@
data-method="post"
rel="nofollow"
class="js-manual-action-link">
<span
class="action-play-icon-container"
></span>
<span
v-html='playIconSvg'
></span>
<span>
{{action.name}}
</span>
...
...
app/assets/javascripts/environments/components/environment_item.js.es6
View file @
70cb2792
...
...
@@ -58,6 +58,16 @@
required: false,
default: false,
},
commitIconSvg: {
type: String,
required: false,
},
playIconSvg: {
type: String,
required: false,
},
},
data() {
...
...
@@ -476,6 +486,7 @@
<div v-if="hasManualActions && canCreateDeployment"
class="inline js-manual-actions-container">
<actions-component
:play-icon-svg="playIconSvg"
:actions="manualActions">
</actions-component>
</div>
...
...
app/views/projects/environments/index.html.haml
View file @
70cb2792
...
...
@@ -17,4 +17,6 @@
"project-stopped-environments-path"
=>
project_environments_path
(
@project
,
scope: :stopped
),
"new-environment-path"
=>
new_namespace_project_environment_path
(
@project
.
namespace
,
@project
),
"help-page-path"
=>
help_page_path
(
"ci/environments"
),
"css-class"
=>
container_class
}}
"css-class"
=>
container_class
,
"commit-icon-svg"
=>
custom_icon
(
"icon_commit"
),
"play-icon-svg"
=>
custom_icon
(
"icon_play"
)}}
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