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
5cd549d6
Commit
5cd549d6
authored
Jun 04, 2020
by
Daniel Tian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove eslint-disable for app row component
parent
02f310f6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
34 deletions
+47
-34
app/assets/javascripts/clusters/components/application_row.vue
...ssets/javascripts/clusters/components/application_row.vue
+25
-21
locale/gitlab.pot
locale/gitlab.pot
+1
-1
spec/frontend/clusters/components/application_row_spec.js
spec/frontend/clusters/components/application_row_spec.js
+21
-12
No files found.
app/assets/javascripts/clusters/components/application_row.vue
View file @
5cd549d6
<
script
>
<
script
>
/* eslint-disable vue/require-default-prop */
import
{
GlLink
,
GlModalDirective
,
GlSprintf
}
from
'
@gitlab/ui
'
;
/* eslint-disable @gitlab/vue-require-i18n-strings */
import
{
GlLink
,
GlModalDirective
}
from
'
@gitlab/ui
'
;
import
{
s__
,
__
,
sprintf
}
from
'
~/locale
'
;
import
{
s__
,
__
,
sprintf
}
from
'
~/locale
'
;
import
eventHub
from
'
../event_hub
'
;
import
eventHub
from
'
../event_hub
'
;
import
identicon
from
'
../../vue_shared/components/identicon.vue
'
;
import
identicon
from
'
../../vue_shared/components/identicon.vue
'
;
...
@@ -17,6 +15,7 @@ export default {
...
@@ -17,6 +15,7 @@ export default {
loadingButton
,
loadingButton
,
identicon
,
identicon
,
GlLink
,
GlLink
,
GlSprintf
,
UninstallApplicationButton
,
UninstallApplicationButton
,
UninstallApplicationConfirmationModal
,
UninstallApplicationConfirmationModal
,
UpdateApplicationConfirmationModal
,
UpdateApplicationConfirmationModal
,
...
@@ -36,15 +35,17 @@ export default {
...
@@ -36,15 +35,17 @@ export default {
titleLink
:
{
titleLink
:
{
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
default
:
''
,
},
},
manageLink
:
{
manageLink
:
{
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
default
:
''
,
},
},
logoUrl
:
{
logoUrl
:
{
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
default
:
null
,
default
:
''
,
},
},
disabled
:
{
disabled
:
{
type
:
Boolean
,
type
:
Boolean
,
...
@@ -59,14 +60,17 @@ export default {
...
@@ -59,14 +60,17 @@ export default {
status
:
{
status
:
{
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
default
:
''
,
},
},
statusReason
:
{
statusReason
:
{
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
default
:
''
,
},
},
requestReason
:
{
requestReason
:
{
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
default
:
''
,
},
},
installed
:
{
installed
:
{
type
:
Boolean
,
type
:
Boolean
,
...
@@ -81,14 +85,17 @@ export default {
...
@@ -81,14 +85,17 @@ export default {
installedVia
:
{
installedVia
:
{
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
default
:
''
,
},
},
version
:
{
version
:
{
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
default
:
''
,
},
},
chartRepo
:
{
chartRepo
:
{
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
default
:
''
,
},
},
updateAvailable
:
{
updateAvailable
:
{
type
:
Boolean
,
type
:
Boolean
,
...
@@ -206,15 +213,6 @@ export default {
...
@@ -206,15 +213,6 @@ export default {
return
sprintf
(
errorDescription
,
{
title
:
this
.
title
});
return
sprintf
(
errorDescription
,
{
title
:
this
.
title
});
},
},
versionLabel
()
{
if
(
this
.
updateFailed
)
{
return
__
(
'
Update failed
'
);
}
else
if
(
this
.
isUpdating
)
{
return
__
(
'
Updating
'
);
}
return
this
.
updateSuccessful
?
__
(
'
Updated to
'
)
:
__
(
'
Updated
'
);
},
updateFailureDescription
()
{
updateFailureDescription
()
{
return
s__
(
'
ClusterIntegration|Update failed. Please check the logs and try again.
'
);
return
s__
(
'
ClusterIntegration|Update failed. Please check the logs and try again.
'
);
},
},
...
@@ -365,14 +363,20 @@ export default {
...
@@ -365,14 +363,20 @@ export default {
v-if=
"shouldShowUpdateDetails"
v-if=
"shouldShowUpdateDetails"
class=
"form-text text-muted label p-0 js-cluster-application-update-details"
class=
"form-text text-muted label p-0 js-cluster-application-update-details"
>
>
{{
versionLabel
}}
<template
v-if=
"updateFailed"
>
{{
__
(
'
Update failed
'
)
}}
</
template
>
<
template
v-else-if=
"isUpdating"
>
{{
__
(
'
Updating
'
)
}}
</
template
>
<
template
v-else
>
<gl-sprintf
:message=
"__('Updated to %
{linkStart}chart v%{linkEnd}')">
<template
#link
="
{ content }">
<gl-link
<gl-link
v-if=
"updateSuccessful"
:href=
"chartRepo"
:href=
"chartRepo"
target=
"_blank"
target=
"_blank"
class=
"js-cluster-application-update-version"
class=
"js-cluster-application-update-version"
>
chart v
{{
version
}}
</gl-link
>
{{
content
}}
{{
version
}}
</gl-link
>
>
</
template
>
</gl-sprintf>
</template>
</div>
</div>
<div
<div
...
...
locale/gitlab.pot
View file @
5cd549d6
...
@@ -23999,7 +23999,7 @@ msgstr ""
...
@@ -23999,7 +23999,7 @@ msgstr ""
msgid "Updated at"
msgid "Updated at"
msgstr ""
msgstr ""
msgid "Updated to"
msgid "Updated to
%{linkStart}chart v%{linkEnd}
"
msgstr ""
msgstr ""
msgid "Updating"
msgid "Updating"
...
...
spec/frontend/clusters/components/application_row_spec.js
View file @
5cd549d6
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlSprintf
}
from
'
@gitlab/ui
'
;
import
eventHub
from
'
~/clusters/event_hub
'
;
import
eventHub
from
'
~/clusters/event_hub
'
;
import
{
APPLICATION_STATUS
,
ELASTIC_STACK
}
from
'
~/clusters/constants
'
;
import
{
APPLICATION_STATUS
,
ELASTIC_STACK
}
from
'
~/clusters/constants
'
;
import
ApplicationRow
from
'
~/clusters/components/application_row.vue
'
;
import
ApplicationRow
from
'
~/clusters/components/application_row.vue
'
;
...
@@ -16,6 +17,7 @@ describe('Application Row', () => {
...
@@ -16,6 +17,7 @@ describe('Application Row', () => {
const
mountComponent
=
data
=>
{
const
mountComponent
=
data
=>
{
wrapper
=
shallowMount
(
ApplicationRow
,
{
wrapper
=
shallowMount
(
ApplicationRow
,
{
stubs
:
{
GlSprintf
},
propsData
:
{
propsData
:
{
...
DEFAULT_APPLICATION_STATE
,
...
DEFAULT_APPLICATION_STATE
,
...
data
,
...
data
,
...
@@ -356,6 +358,9 @@ describe('Application Row', () => {
...
@@ -356,6 +358,9 @@ describe('Application Row', () => {
});
});
describe
(
'
Version
'
,
()
=>
{
describe
(
'
Version
'
,
()
=>
{
const
updateDetails
=
()
=>
wrapper
.
find
(
'
.js-cluster-application-update-details
'
);
const
versionEl
=
()
=>
wrapper
.
find
(
'
.js-cluster-application-update-version
'
);
it
(
'
displays a version number if application has been updated
'
,
()
=>
{
it
(
'
displays a version number if application has been updated
'
,
()
=>
{
const
version
=
'
0.1.45
'
;
const
version
=
'
0.1.45
'
;
mountComponent
({
mountComponent
({
...
@@ -363,12 +368,8 @@ describe('Application Row', () => {
...
@@ -363,12 +368,8 @@ describe('Application Row', () => {
updateSuccessful
:
true
,
updateSuccessful
:
true
,
version
,
version
,
});
});
const
updateDetails
=
wrapper
.
find
(
'
.js-cluster-application-update-details
'
);
const
versionEl
=
wrapper
.
find
(
'
.js-cluster-application-update-version
'
);
expect
(
updateDetails
.
text
()).
toContain
(
'
Updated
'
);
expect
(
updateDetails
().
text
()).
toBe
(
`Updated to chart v
${
version
}
`
);
expect
(
versionEl
.
exists
()).
toBe
(
true
);
expect
(
versionEl
.
text
()).
toContain
(
version
);
});
});
it
(
'
contains a link to the chart repo if application has been updated
'
,
()
=>
{
it
(
'
contains a link to the chart repo if application has been updated
'
,
()
=>
{
...
@@ -380,10 +381,9 @@ describe('Application Row', () => {
...
@@ -380,10 +381,9 @@ describe('Application Row', () => {
chartRepo
,
chartRepo
,
version
,
version
,
});
});
const
versionEl
=
wrapper
.
find
(
'
.js-cluster-application-update-version
'
);
expect
(
versionEl
.
attributes
(
'
href
'
)).
toEqual
(
chartRepo
);
expect
(
versionEl
()
.
attributes
(
'
href
'
)).
toEqual
(
chartRepo
);
expect
(
versionEl
.
props
(
'
target
'
)).
toEqual
(
'
_blank
'
);
expect
(
versionEl
()
.
props
(
'
target
'
)).
toEqual
(
'
_blank
'
);
});
});
it
(
'
does not display a version number if application update failed
'
,
()
=>
{
it
(
'
does not display a version number if application update failed
'
,
()
=>
{
...
@@ -393,11 +393,20 @@ describe('Application Row', () => {
...
@@ -393,11 +393,20 @@ describe('Application Row', () => {
updateFailed
:
true
,
updateFailed
:
true
,
version
,
version
,
});
});
const
updateDetails
=
wrapper
.
find
(
'
.js-cluster-application-update-details
'
);
const
versionEl
=
wrapper
.
find
(
'
.js-cluster-application-update-version
'
);
expect
(
updateDetails
.
text
()).
toContain
(
'
failed
'
);
expect
(
updateDetails
().
text
()).
toBe
(
'
Update failed
'
);
expect
(
versionEl
.
exists
()).
toBe
(
false
);
expect
(
versionEl
().
exists
()).
toBe
(
false
);
});
it
(
'
displays updating when the application update is currently updating
'
,
()
=>
{
mountComponent
({
status
:
APPLICATION_STATUS
.
UPDATING
,
updateSuccessful
:
true
,
version
:
'
1.2.3
'
,
});
expect
(
updateDetails
().
text
()).
toBe
(
'
Updating
'
);
expect
(
versionEl
().
exists
()).
toBe
(
false
);
});
});
});
});
...
...
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