Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gpt
large_projects
gitlabhq1
Commits
7a21f39d
Commit
7a21f39d
authored
6 years ago
by
Mykhailo Formus
Browse files
Options
Download
Plain Diff
Merge branch 'master' into qa-264
parents
331f8d71
767ccaa1
Changes
703
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
798 additions
and
684 deletions
+798
-684
.gitattributes
.gitattributes
+1
-0
.gitlab-ci.yml
.gitlab-ci.yml
+18
-0
Dangerfile
Dangerfile
+6
-0
GITALY_SERVER_VERSION
GITALY_SERVER_VERSION
+1
-1
GITLAB_SHELL_VERSION
GITLAB_SHELL_VERSION
+1
-1
app/assets/javascripts/confirm_danger_modal.js
app/assets/javascripts/confirm_danger_modal.js
+4
-1
app/assets/javascripts/diffs/components/diff_file.vue
app/assets/javascripts/diffs/components/diff_file.vue
+0
-4
app/assets/javascripts/diffs/components/diff_file_header.vue
app/assets/javascripts/diffs/components/diff_file_header.vue
+14
-12
app/assets/javascripts/diffs/store/actions.js
app/assets/javascripts/diffs/store/actions.js
+28
-10
app/assets/javascripts/diffs/store/getters.js
app/assets/javascripts/diffs/store/getters.js
+49
-1
app/assets/javascripts/diffs/store/index.js
app/assets/javascripts/diffs/store/index.js
+0
-11
app/assets/javascripts/diffs/store/modules/index.js
app/assets/javascripts/diffs/store/modules/index.js
+1
-1
app/assets/javascripts/environments/components/environment_actions.vue
...vascripts/environments/components/environment_actions.vue
+40
-47
app/assets/javascripts/environments/components/environment_external_url.vue
...ipts/environments/components/environment_external_url.vue
+24
-27
app/assets/javascripts/environments/components/environment_item.vue
.../javascripts/environments/components/environment_item.vue
+447
-426
app/assets/javascripts/environments/components/environment_monitoring.vue
...cripts/environments/components/environment_monitoring.vue
+23
-26
app/assets/javascripts/environments/components/environment_rollback.vue
...ascripts/environments/components/environment_rollback.vue
+56
-38
app/assets/javascripts/environments/components/environment_stop.vue
.../javascripts/environments/components/environment_stop.vue
+56
-50
app/assets/javascripts/environments/components/environment_terminal_button.vue
...s/environments/components/environment_terminal_button.vue
+25
-28
app/assets/javascripts/environments/components/environments_app.vue
.../javascripts/environments/components/environments_app.vue
+4
-0
No files found.
.gitattributes
0 → 100644
View file @
7a21f39d
Dangerfile gitlab-language=ruby
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
View file @
7a21f39d
...
...
@@ -348,6 +348,24 @@ retrieve-tests-metadata:
-
wget -O $FLAKY_RSPEC_SUITE_REPORT_PATH http://${TESTS_METADATA_S3_BUCKET}.s3.amazonaws.com/$FLAKY_RSPEC_SUITE_REPORT_PATH || rm $FLAKY_RSPEC_SUITE_REPORT_PATH
-
'
[[
-f
$FLAKY_RSPEC_SUITE_REPORT_PATH
]]
||
echo
"{}"
>
${FLAKY_RSPEC_SUITE_REPORT_PATH}'
danger-review
:
image
:
registry.gitlab.com/gitlab-org/gitaly/dangercontainer:latest
stage
:
prepare
before_script
:
-
source scripts/utils.sh
-
retry gem install danger --no-ri --no-rdoc
cache
:
{}
only
:
refs
:
-
branches@gitlab-org/gitlab-ce
-
branches@gitlab-org/gitlab-ee
except
:
variables
:
-
$CI_COMMIT_REF_NAME =~ /^ce-to-ee-.*/
script
:
-
git version
-
danger --fail-on-errors=true
update-tests-metadata
:
<<
:
*tests-metadata-state
<<
:
*only-canonical-masters
...
...
This diff is collapsed.
Click to expand it.
Dangerfile
0 → 100644
View file @
7a21f39d
danger
.
import_dangerfile
(
path:
'danger/metadata'
)
danger
.
import_dangerfile
(
path:
'danger/changes_size'
)
danger
.
import_dangerfile
(
path:
'danger/changelog'
)
danger
.
import_dangerfile
(
path:
'danger/specs'
)
danger
.
import_dangerfile
(
path:
'danger/gemfile'
)
danger
.
import_dangerfile
(
path:
'danger/database'
)
This diff is collapsed.
Click to expand it.
GITALY_SERVER_VERSION
View file @
7a21f39d
0.11
1
.0
0.11
2
.0
This diff is collapsed.
Click to expand it.
GITLAB_SHELL_VERSION
View file @
7a21f39d
7.1.
4
7.1.
5
This diff is collapsed.
Click to expand it.
app/assets/javascripts/confirm_danger_modal.js
View file @
7a21f39d
...
...
@@ -2,13 +2,16 @@ import $ from 'jquery';
import
{
rstrip
}
from
'
./lib/utils/common_utils
'
;
function
openConfirmDangerModal
(
$form
,
text
)
{
const
$input
=
$
(
'
.js-confirm-danger-input
'
);
$input
.
val
(
''
);
$
(
'
.js-confirm-text
'
).
text
(
text
||
''
);
$
(
'
.js-confirm-danger-input
'
).
val
(
''
);
$
(
'
#modal-confirm-danger
'
).
modal
(
'
show
'
);
const
confirmTextMatch
=
$
(
'
.js-confirm-danger-match
'
).
text
();
const
$submit
=
$
(
'
.js-confirm-danger-submit
'
);
$submit
.
disable
();
$input
.
focus
();
$
(
'
.js-confirm-danger-input
'
).
off
(
'
input
'
).
on
(
'
input
'
,
function
handleInput
()
{
const
confirmText
=
rstrip
(
$
(
this
).
val
());
...
...
This diff is collapsed.
Click to expand it.
app/assets/javascripts/diffs/components/diff_file.vue
View file @
7a21f39d
...
...
@@ -31,9 +31,6 @@ export default {
};
},
computed
:
{
isDiscussionsExpanded
()
{
return
true
;
// TODO: @fatihacet - Fix this.
},
isCollapsed
()
{
return
this
.
file
.
collapsed
||
false
;
},
...
...
@@ -131,7 +128,6 @@ export default {
:diff-file=
"file"
:collapsible=
"true"
:expanded=
"!isCollapsed"
:discussions-expanded=
"isDiscussionsExpanded"
:add-merge-request-buttons=
"true"
class=
"js-file-title file-title"
@
toggleFile=
"handleToggle"
...
...
This diff is collapsed.
Click to expand it.
app/assets/javascripts/diffs/components/diff_file_header.vue
View file @
7a21f39d
<
script
>
import
_
from
'
underscore
'
;
import
{
mapActions
,
mapGetters
}
from
'
vuex
'
;
import
ClipboardButton
from
'
~/vue_shared/components/clipboard_button.vue
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
FileIcon
from
'
~/vue_shared/components/file_icon.vue
'
;
...
...
@@ -38,11 +39,6 @@ export default {
required
:
false
,
default
:
true
,
},
discussionsExpanded
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
,
},
currentUser
:
{
type
:
Object
,
required
:
true
,
...
...
@@ -54,6 +50,10 @@ export default {
};
},
computed
:
{
...
mapGetters
(
'
diffs
'
,
[
'
diffHasExpandedDiscussions
'
]),
hasExpandedDiscussions
()
{
return
this
.
diffHasExpandedDiscussions
(
this
.
diffFile
);
},
icon
()
{
if
(
this
.
diffFile
.
submodule
)
{
return
'
archive
'
;
...
...
@@ -88,9 +88,6 @@ export default {
collapseIcon
()
{
return
this
.
expanded
?
'
chevron-down
'
:
'
chevron-right
'
;
},
isDiscussionsExpanded
()
{
return
this
.
discussionsExpanded
&&
this
.
expanded
;
},
viewFileButtonText
()
{
const
truncatedContentSha
=
_
.
escape
(
truncateSha
(
this
.
diffFile
.
contentSha
));
return
sprintf
(
...
...
@@ -113,7 +110,8 @@ export default {
},
},
methods
:
{
handleToggle
(
e
,
checkTarget
)
{
...
mapActions
(
'
diffs
'
,
[
'
toggleFileDiscussions
'
]),
handleToggleFile
(
e
,
checkTarget
)
{
if
(
!
checkTarget
||
e
.
target
===
this
.
$refs
.
header
||
...
...
@@ -125,6 +123,9 @@ export default {
showForkMessage
()
{
this
.
$emit
(
'
showForkMessage
'
);
},
handleToggleDiscussions
()
{
this
.
toggleFileDiscussions
(
this
.
diffFile
);
},
},
};
</
script
>
...
...
@@ -133,7 +134,7 @@ export default {
<div
ref=
"header"
class=
"js-file-title file-title file-title-flex-parent"
@
click=
"handleToggle($event, true)"
@
click=
"handleToggle
File
($event, true)"
>
<div
class=
"file-header-content"
>
<icon
...
...
@@ -216,10 +217,11 @@ export default {
v-if=
"diffFile.blob && diffFile.blob.readableText"
>
<button
:class=
"
{ active:
is
Discussions
Expanded
}"
:class=
"
{ active:
hasExpanded
Discussions }"
:title="s__('MergeRequests|Toggle comments for this file')"
class="
btn js
-toggle-
diff-
comments"
class="
js-btn-vue
-toggle-comments
btn
"
type="button"
@click="handleToggleDiscussions"
>
<icon
name=
"comment"
/>
</button>
...
...
This diff is collapsed.
Click to expand it.
app/assets/javascripts/diffs/store/actions.js
View file @
7a21f39d
...
...
@@ -82,14 +82,32 @@ export const expandAllFiles = ({ commit }) => {
commit
(
types
.
EXPAND_ALL_FILES
);
};
export
default
{
setBaseConfig
,
fetchDiffFiles
,
setInlineDiffViewType
,
setParallelDiffViewType
,
showCommentForm
,
cancelCommentForm
,
loadMoreLines
,
loadCollapsedDiff
,
expandAllFiles
,
/**
* Toggles the file discussions after user clicked on the toggle discussions button.
*
* Gets the discussions for the provided diff.
*
* If all discussions are expanded, it will collapse all of them
* If all discussions are collapsed, it will expand all of them
* If some discussions are open and others closed, it will expand the closed ones.
*
* @param {Object} diff
*/
export
const
toggleFileDiscussions
=
({
getters
,
dispatch
},
diff
)
=>
{
const
discussions
=
getters
.
getDiffFileDiscussions
(
diff
);
const
shouldCloseAll
=
getters
.
diffHasAllExpandedDiscussions
(
diff
);
const
shouldExpandAll
=
getters
.
diffHasAllCollpasedDiscussions
(
diff
);
discussions
.
forEach
(
discussion
=>
{
const
data
=
{
discussionId
:
discussion
.
id
};
if
(
shouldCloseAll
)
{
dispatch
(
'
collapseDiscussion
'
,
data
,
{
root
:
true
});
}
else
if
(
shouldExpandAll
||
(
!
shouldCloseAll
&&
!
shouldExpandAll
&&
!
discussion
.
expanded
))
{
dispatch
(
'
expandDiscussion
'
,
data
,
{
root
:
true
});
}
});
};
// prevent babel-plugin-rewire from generating an invalid default during karma tests
export
default
()
=>
{};
This diff is collapsed.
Click to expand it.
app/assets/javascripts/diffs/store/getters.js
View file @
7a21f39d
import
_
from
'
underscore
'
;
import
{
PARALLEL_DIFF_VIEW_TYPE
,
INLINE_DIFF_VIEW_TYPE
}
from
'
../constants
'
;
export
const
isParallelView
=
state
=>
state
.
diffViewType
===
PARALLEL_DIFF_VIEW_TYPE
;
...
...
@@ -8,5 +9,52 @@ export const areAllFilesCollapsed = state => state.diffFiles.every(file => file.
export
const
commitId
=
state
=>
(
state
.
commit
&&
state
.
commit
.
id
?
state
.
commit
.
id
:
null
);
// prevent babel-plugin-rewire from generating an invalid default during karma tests
/**
* Checks if the diff has all discussions expanded
* @param {Object} diff
* @returns {Boolean}
*/
export
const
diffHasAllExpandedDiscussions
=
(
state
,
getters
)
=>
diff
=>
{
const
discussions
=
getters
.
getDiffFileDiscussions
(
diff
);
return
(
discussions
.
length
&&
discussions
.
every
(
discussion
=>
discussion
.
expanded
))
||
false
;
};
/**
* Checks if the diff has all discussions collpased
* @param {Object} diff
* @returns {Boolean}
*/
export
const
diffHasAllCollpasedDiscussions
=
(
state
,
getters
)
=>
diff
=>
{
const
discussions
=
getters
.
getDiffFileDiscussions
(
diff
);
return
(
discussions
.
length
&&
discussions
.
every
(
discussion
=>
!
discussion
.
expanded
))
||
false
;
};
/**
* Checks if the diff has any open discussions
* @param {Object} diff
* @returns {Boolean}
*/
export
const
diffHasExpandedDiscussions
=
(
state
,
getters
)
=>
diff
=>
{
const
discussions
=
getters
.
getDiffFileDiscussions
(
diff
);
return
(
(
discussions
.
length
&&
discussions
.
find
(
discussion
=>
discussion
.
expanded
)
!==
undefined
)
||
false
);
};
/**
* Returns an array with the discussions of the given diff
* @param {Object} diff
* @returns {Array}
*/
export
const
getDiffFileDiscussions
=
(
state
,
getters
,
rootState
,
rootGetters
)
=>
diff
=>
rootGetters
.
discussions
.
filter
(
discussion
=>
discussion
.
diff_discussion
&&
_
.
isEqual
(
discussion
.
diff_file
.
file_hash
,
diff
.
fileHash
),
)
||
[];
// prevent babel-plugin-rewire from generating an invalid default during karma∂ tests
export
default
()
=>
{};
This diff is collapsed.
Click to expand it.
app/assets/javascripts/diffs/store/index.js
deleted
100644 → 0
View file @
331f8d71
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
diffsModule
from
'
./modules
'
;
Vue
.
use
(
Vuex
);
export
default
new
Vuex
.
Store
({
modules
:
{
diffs
:
diffsModule
,
},
});
This diff is collapsed.
Click to expand it.
app/assets/javascripts/diffs/store/modules/index.js
View file @
7a21f39d
import
actions
from
'
../actions
'
;
import
*
as
actions
from
'
../actions
'
;
import
*
as
getters
from
'
../getters
'
;
import
mutations
from
'
../mutations
'
;
import
createState
from
'
./diff_state
'
;
...
...
This diff is collapsed.
Click to expand it.
app/assets/javascripts/environments/components/environment_actions.vue
View file @
7a21f39d
<
script
>
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
eventHub
from
'
../event_hub
'
;
import
loadingIcon
from
'
../../vue_shared/components/loading_icon.vue
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
eventHub
from
'
../event_hub
'
;
import
loadingIcon
from
'
../../vue_shared/components/loading_icon.vue
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
export
default
{
directives
:
{
tooltip
,
export
default
{
directives
:
{
tooltip
,
},
components
:
{
loadingIcon
,
Icon
,
},
props
:
{
actions
:
{
type
:
Array
,
required
:
false
,
default
:
()
=>
[],
},
components
:
{
loadingIcon
,
Icon
,
},
data
()
{
return
{
isLoading
:
false
,
};
},
computed
:
{
title
()
{
return
'
Deploy to...
'
;
},
props
:
{
actions
:
{
type
:
Array
,
required
:
false
,
default
:
()
=>
[],
},
},
data
()
{
return
{
isLoading
:
false
,
};
},
computed
:
{
title
()
{
return
'
Deploy to...
'
;
},
},
methods
:
{
onClickAction
(
endpoint
)
{
this
.
isLoading
=
true
;
},
methods
:
{
onClickAction
(
endpoint
)
{
this
.
isLoading
=
true
;
eventHub
.
$emit
(
'
postAction
'
,
endpoint
);
},
eventHub
.
$emit
(
'
postAction
'
,
{
endpoint
}
);
},
isActionDisabled
(
action
)
{
if
(
action
.
playable
===
undefined
)
{
return
false
;
}
isActionDisabled
(
action
)
{
if
(
action
.
playable
===
undefined
)
{
return
false
;
}
return
!
action
.
playable
;
},
return
!
action
.
playable
;
},
};
},
};
</
script
>
<
template
>
<div
...
...
@@ -61,10 +61,7 @@
data-toggle=
"dropdown"
>
<span>
<icon
:size=
"12"
name=
"play"
/>
<icon
name=
"play"
/>
<i
class=
"fa fa-caret-down"
aria-hidden=
"true"
...
...
@@ -85,10 +82,6 @@
class="js-manual-action-link no-btn btn"
@click="onClickAction(action.play_path)"
>
<icon
:size=
"12"
name=
"play"
/>
<span>
{{
action
.
name
}}
</span>
...
...
This diff is collapsed.
Click to expand it.
app/assets/javascripts/environments/components/environment_external_url.vue
View file @
7a21f39d
<
script
>
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
import
{
s__
}
from
'
../../locale
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
import
{
s__
}
from
'
../../locale
'
;
/**
* Renders the external url link in environments table.
*/
export
default
{
components
:
{
Icon
,
/**
* Renders the external url link in environments table.
*/
export
default
{
components
:
{
Icon
,
},
directives
:
{
tooltip
,
},
props
:
{
externalUrl
:
{
type
:
String
,
required
:
true
,
},
directives
:
{
tooltip
,
},
computed
:
{
title
()
{
return
s__
(
'
Environments|Open live environment
'
);
},
props
:
{
externalUrl
:
{
type
:
String
,
required
:
true
,
},
},
computed
:
{
title
()
{
return
s__
(
'
Environments|Open
'
);
},
},
};
},
};
</
script
>
<
template
>
<a
...
...
@@ -37,9 +37,6 @@
target=
"_blank"
rel=
"noopener noreferrer nofollow"
>
<icon
:size=
"12"
name=
"external-link"
/>
<icon
name=
"external-link"
/>
</a>
</
template
>
This diff is collapsed.
Click to expand it.
app/assets/javascripts/environments/components/environment_item.vue
View file @
7a21f39d
This diff is collapsed.
Click to expand it.
app/assets/javascripts/environments/components/environment_monitoring.vue
View file @
7a21f39d
<
script
>
/**
* Renders the Monitoring (Metrics) link in environments table.
*/
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
/**
* Renders the Monitoring (Metrics) link in environments table.
*/
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
export
default
{
components
:
{
Icon
,
export
default
{
components
:
{
Icon
,
},
directives
:
{
tooltip
,
},
props
:
{
monitoringUrl
:
{
type
:
String
,
required
:
true
,
},
directives
:
{
tooltip
,
},
computed
:
{
title
()
{
return
'
Monitoring
'
;
},
props
:
{
monitoringUrl
:
{
type
:
String
,
required
:
true
,
},
},
computed
:
{
title
()
{
return
'
Monitoring
'
;
},
},
};
},
};
</
script
>
<
template
>
<a
...
...
@@ -35,9 +35,6 @@
data-container=
"body"
rel=
"noopener noreferrer nofollow"
>
<icon
:size=
"12"
name=
"chart"
/>
<icon
name=
"chart"
/>
</a>
</
template
>
This diff is collapsed.
Click to expand it.
app/assets/javascripts/environments/components/environment_rollback.vue
View file @
7a21f39d
<
script
>
/**
* Renders Rollback or Re deploy button in environments table depending
* of the provided property `isLastDeployment`.
*
* Makes a post request when the button is clicked.
*/
import
eventHub
from
'
../event_hub
'
;
import
loadingIcon
from
'
../../vue_shared/components/loading_icon.vue
'
;
export
default
{
components
:
{
loadingIcon
,
/**
* Renders Rollback or Re deploy button in environments table depending
* of the provided property `isLastDeployment`.
*
* Makes a post request when the button is clicked.
*/
import
{
s__
}
from
'
~/locale
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
eventHub
from
'
../event_hub
'
;
import
LoadingIcon
from
'
../../vue_shared/components/loading_icon.vue
'
;
export
default
{
components
:
{
Icon
,
LoadingIcon
,
},
directives
:
{
tooltip
,
},
props
:
{
retryUrl
:
{
type
:
String
,
default
:
''
,
},
props
:
{
retryUrl
:
{
type
:
String
,
default
:
''
,
},
isLastDeployment
:
{
type
:
Boolean
,
default
:
true
,
},
isLastDeployment
:
{
type
:
Boolean
,
default
:
true
,
},
data
()
{
return
{
isLoading
:
false
,
};
},
data
()
{
return
{
isLoading
:
false
,
};
},
computed
:
{
title
()
{
return
this
.
isLastDeployment
?
s__
(
'
Environments|Re-deploy to environment
'
)
:
s__
(
'
Environments|Rollback environment
'
);
},
methods
:
{
onClick
()
{
this
.
isLoading
=
true
;
},
methods
:
{
onClick
()
{
this
.
isLoading
=
true
;
eventHub
.
$emit
(
'
postAction
'
,
this
.
retryUrl
);
},
eventHub
.
$emit
(
'
postAction
'
,
{
endpoint
:
this
.
retryUrl
});
},
};
},
};
</
script
>
<
template
>
<button
v-tooltip
:disabled=
"isLoading"
:title=
"title"
type=
"button"
class=
"btn d-none d-sm-none d-md-block"
@
click=
"onClick"
>
<
span
v-if=
"isLastDeployment"
>
{{
s__
(
"
Environments|Re-deploy
"
)
}}
</span
>
<
span
v-else
>
{{
s__
(
"
Environments|Rollback
"
)
}}
</span
>
<
icon
v-if=
"isLastDeployment"
name=
"repeat"
/
>
<
icon
v-else
name=
"redo"
/
>
<loading-icon
v-if=
"isLoading"
/>
</button>
...
...
This diff is collapsed.
Click to expand it.
app/assets/javascripts/environments/components/environment_stop.vue
View file @
7a21f39d
<
script
>
/**
* Renders the stop "button" that allows stop an environment.
* Used in environments table.
*/
/**
* Renders the stop "button" that allows stop an environment.
* Used in environments table.
*/
import
$
from
'
jquery
'
;
import
eventHub
from
'
../event_hub
'
;
import
loadingIcon
from
'
../../vue_shared/components/loading_icon.vue
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
import
$
from
'
jquery
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
{
s__
}
from
'
~/locale
'
;
import
eventHub
from
'
../event_hub
'
;
import
LoadingButton
from
'
../../vue_shared/components/loading_button.vue
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
export
default
{
components
:
{
loadingIcon
,
},
export
default
{
components
:
{
Icon
,
LoadingButton
,
},
directives
:
{
tooltip
,
},
directives
:
{
tooltip
,
},
props
:
{
stopUrl
:
{
type
:
String
,
default
:
''
,
},
props
:
{
environment
:
{
type
:
Object
,
required
:
true
,
},
},
data
()
{
return
{
isLoading
:
false
,
};
},
data
()
{
return
{
isLoading
:
false
,
};
},
computed
:
{
title
()
{
return
'
Stop
'
;
},
computed
:
{
title
()
{
return
s__
(
'
Environments|Stop environment
'
);
},
},
methods
:
{
onClick
()
{
// eslint-disable-next-line no-alert
if
(
window
.
confirm
(
'
Are you sure you want to stop this environment?
'
))
{
this
.
isLoading
=
true
;
mounted
()
{
eventHub
.
$on
(
'
stopEnvironment
'
,
this
.
onStopEnvironment
);
},
$
(
this
.
$el
).
tooltip
(
'
dispose
'
);
beforeDestroy
()
{
eventHub
.
$off
(
'
stopEnvironment
'
,
this
.
onStopEnvironment
);
},
eventHub
.
$emit
(
'
postAction
'
,
this
.
stopUrl
);
}
},
methods
:
{
onClick
()
{
$
(
this
.
$el
).
tooltip
(
'
dispose
'
);
eventHub
.
$emit
(
'
requestStopEnvironment
'
,
this
.
environment
);
},
onStopEnvironment
(
environment
)
{
if
(
this
.
environment
.
id
===
environment
.
id
)
{
this
.
isLoading
=
true
;
}
},
};
},
};
</
script
>
<
template
>
<button
<
loading-
button
v-tooltip
:
disabled
=
"isLoading"
:
loading
=
"isLoading"
:title=
"title"
:aria-label=
"title"
type=
"button"
class=
"btn stop-env-link d-none d-sm-none d-md-block"
container-class=
"btn btn-danger d-none d-sm-none d-md-block"
data-container=
"body"
data-toggle=
"modal"
data-target=
"#stop-environment-modal"
@
click=
"onClick"
>
<i
class=
"fa fa-stop stop-env-icon"
aria-hidden=
"true"
>
</i>
<loading-icon
v-if=
"isLoading"
/>
</button>
<icon
name=
"stop"
/>
</loading-button>
</
template
>
This diff is collapsed.
Click to expand it.
app/assets/javascripts/environments/components/environment_terminal_button.vue
View file @
7a21f39d
<
script
>
/**
* Renders a terminal button to open a web terminal.
* Used in environments table.
*/
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
/**
* Renders a terminal button to open a web terminal.
* Used in environments table.
*/
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
export
default
{
components
:
{
Icon
,
export
default
{
components
:
{
Icon
,
},
directives
:
{
tooltip
,
},
props
:
{
terminalPath
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
directives
:
{
tooltip
,
},
computed
:
{
title
()
{
return
'
Terminal
'
;
},
props
:
{
terminalPath
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
},
computed
:
{
title
()
{
return
'
Terminal
'
;
},
},
};
},
};
</
script
>
<
template
>
<a
...
...
@@ -36,9 +36,6 @@
class=
"btn terminal-button d-none d-sm-none d-md-block"
data-container=
"body"
>
<icon
:size=
"12"
name=
"terminal"
/>
<icon
name=
"terminal"
/>
</a>
</
template
>
This diff is collapsed.
Click to expand it.
app/assets/javascripts/environments/components/environments_app.vue
View file @
7a21f39d
...
...
@@ -5,10 +5,12 @@
import
eventHub
from
'
../event_hub
'
;
import
environmentsMixin
from
'
../mixins/environments_mixin
'
;
import
CIPaginationMixin
from
'
../../vue_shared/mixins/ci_pagination_api_mixin
'
;
import
StopEnvironmentModal
from
'
./stop_environment_modal.vue
'
;
export
default
{
components
:
{
emptyState
,
StopEnvironmentModal
,
},
mixins
:
[
...
...
@@ -90,6 +92,8 @@
</
script
>
<
template
>
<div
:class=
"cssContainerClass"
>
<stop-environment-modal
:environment=
"environmentInStopModal"
/>
<div
class=
"top-area"
>
<tabs
:tabs=
"tabs"
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
5
…
36
Next
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