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
Léo-Paul Géneau
gitlab-ce
Commits
324aa141
Commit
324aa141
authored
Apr 20, 2017
by
Filipa Lacerda
Committed by
Phil Hughes
Apr 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor into .vue files part 2
parent
08b2e7cd
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
71 additions
and
29 deletions
+71
-29
app/assets/javascripts/environments/components/environment_external_url.vue
...ipts/environments/components/environment_external_url.vue
+33
-0
app/assets/javascripts/environments/components/environment_item.js
...s/javascripts/environments/components/environment_item.js
+3
-3
app/assets/javascripts/environments/components/environment_stop.vue
.../javascripts/environments/components/environment_stop.vue
+20
-13
app/assets/javascripts/environments/components/environment_terminal_button.vue
...s/environments/components/environment_terminal_button.vue
+12
-10
spec/javascripts/environments/environment_external_url_spec.js
...javascripts/environments/environment_external_url_spec.js
+1
-1
spec/javascripts/environments/environment_stop_spec.js
spec/javascripts/environments/environment_stop_spec.js
+1
-1
spec/javascripts/environments/environment_terminal_button_spec.js
...ascripts/environments/environment_terminal_button_spec.js
+1
-1
No files found.
app/assets/javascripts/environments/components/environment_external_url.
js
→
app/assets/javascripts/environments/components/environment_external_url.
vue
View file @
324aa141
<
script
>
/**
/**
* Renders the external url link in environments table.
* Renders the external url link in environments table.
*/
*/
...
@@ -5,7 +6,7 @@ export default {
...
@@ -5,7 +6,7 @@ export default {
props
:
{
props
:
{
externalUrl
:
{
externalUrl
:
{
type
:
String
,
type
:
String
,
default
:
''
,
required
:
true
,
},
},
},
},
...
@@ -14,17 +15,19 @@ export default {
...
@@ -14,17 +15,19 @@ export default {
return
'
Open
'
;
return
'
Open
'
;
},
},
},
},
template
:
`
<a
class="btn external-url has-tooltip"
data-container="body"
:href="externalUrl"
target="_blank"
rel="noopener noreferrer nofollow"
:title="title"
:aria-label="title">
<i class="fa fa-external-link" aria-hidden="true"></i>
</a>
`
,
};
};
</
script
>
<
template
>
<a
class=
"btn external-url has-tooltip"
data-container=
"body"
target=
"_blank"
rel=
"noopener noreferrer nofollow"
:title=
"title"
:aria-label=
"title"
:href=
"externalUrl"
>
<i
class=
"fa fa-external-link"
aria-hidden=
"true"
/>
</a>
</
template
>
app/assets/javascripts/environments/components/environment_item.js
View file @
324aa141
import
Timeago
from
'
timeago.js
'
;
import
Timeago
from
'
timeago.js
'
;
import
'
../../lib/utils/text_utility
'
;
import
'
../../lib/utils/text_utility
'
;
import
ActionsComponent
from
'
./environment_actions
'
;
import
ActionsComponent
from
'
./environment_actions
'
;
import
ExternalUrlComponent
from
'
./environment_external_url
'
;
import
ExternalUrlComponent
from
'
./environment_external_url
.vue
'
;
import
StopComponent
from
'
./environment_stop
'
;
import
StopComponent
from
'
./environment_stop
.vue
'
;
import
RollbackComponent
from
'
./environment_rollback
'
;
import
RollbackComponent
from
'
./environment_rollback
'
;
import
TerminalButtonComponent
from
'
./environment_terminal_button
'
;
import
TerminalButtonComponent
from
'
./environment_terminal_button
.vue
'
;
import
MonitoringButtonComponent
from
'
./environment_monitoring
'
;
import
MonitoringButtonComponent
from
'
./environment_monitoring
'
;
import
CommitComponent
from
'
../../vue_shared/components/commit
'
;
import
CommitComponent
from
'
../../vue_shared/components/commit
'
;
import
eventHub
from
'
../event_hub
'
;
import
eventHub
from
'
../event_hub
'
;
...
...
app/assets/javascripts/environments/components/environment_stop.
js
→
app/assets/javascripts/environments/components/environment_stop.
vue
View file @
324aa141
<
script
>
/* global Flash */
/* global Flash */
/* eslint-disable no-new, no-alert */
/* eslint-disable no-new, no-alert */
/**
/**
...
@@ -50,17 +51,23 @@ export default {
...
@@ -50,17 +51,23 @@ export default {
}
}
},
},
},
},
template
:
`
<button type="button"
class="btn stop-env-link has-tooltip"
data-container="body"
@click="onClick"
:disabled="isLoading"
:title="title"
:aria-label="title">
<i class="fa fa-stop stop-env-icon" aria-hidden="true"></i>
<i v-if="isLoading" class="fa fa-spinner fa-spin" aria-hidden="true"></i>
</button>
`
,
};
};
</
script
>
<
template
>
<button
type=
"button"
class=
"btn stop-env-link has-tooltip"
data-container=
"body"
@
click=
"onClick"
:disabled=
"isLoading"
:title=
"title"
:aria-label=
"title"
>
<i
class=
"fa fa-stop stop-env-icon"
aria-hidden=
"true"
/>
<i
v-if=
"isLoading"
class=
"fa fa-spinner fa-spin"
aria-hidden=
"true"
/>
</button>
</
template
>
app/assets/javascripts/environments/components/environment_terminal_button.
js
→
app/assets/javascripts/environments/components/environment_terminal_button.
vue
View file @
324aa141
<
script
>
/**
/**
* Renders a terminal button to open a web terminal.
* Renders a terminal button to open a web terminal.
* Used in environments table.
* Used in environments table.
...
@@ -24,14 +25,15 @@ export default {
...
@@ -24,14 +25,15 @@ export default {
return
'
Terminal
'
;
return
'
Terminal
'
;
},
},
},
},
template
:
`
<a class="btn terminal-button has-tooltip"
data-container="body"
:title="title"
:aria-label="title"
:href="terminalPath">
${
terminalIconSvg
}
</a>
`
,
};
};
</
script
>
<
template
>
<a
class=
"btn terminal-button has-tooltip"
data-container=
"body"
:title=
"title"
:aria-label=
"title"
:href=
"terminalPath"
v-html=
"terminalIconSvg"
>
</a>
</
template
>
spec/javascripts/environments/environment_external_url_spec.js
View file @
324aa141
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
externalUrlComp
from
'
~/environments/components/environment_external_url
'
;
import
externalUrlComp
from
'
~/environments/components/environment_external_url
.vue
'
;
describe
(
'
External URL Component
'
,
()
=>
{
describe
(
'
External URL Component
'
,
()
=>
{
let
ExternalUrlComponent
;
let
ExternalUrlComponent
;
...
...
spec/javascripts/environments/environment_stop_spec.js
View file @
324aa141
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
stopComp
from
'
~/environments/components/environment_stop
'
;
import
stopComp
from
'
~/environments/components/environment_stop
.vue
'
;
describe
(
'
Stop Component
'
,
()
=>
{
describe
(
'
Stop Component
'
,
()
=>
{
let
StopComponent
;
let
StopComponent
;
...
...
spec/javascripts/environments/environment_terminal_button_spec.js
View file @
324aa141
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
terminalComp
from
'
~/environments/components/environment_terminal_button
'
;
import
terminalComp
from
'
~/environments/components/environment_terminal_button
.vue
'
;
describe
(
'
Stop Component
'
,
()
=>
{
describe
(
'
Stop Component
'
,
()
=>
{
let
TerminalComponent
;
let
TerminalComponent
;
...
...
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