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
42adac30
Commit
42adac30
authored
May 17, 2021
by
Angelo Gulina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update logic for better readability
Make tests more resilient
parent
0cf021ab
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
15 deletions
+34
-15
ee/app/assets/javascripts/pages/admin/cloud_licenses/components/subscription_breakdown.vue
...dmin/cloud_licenses/components/subscription_breakdown.vue
+6
-11
ee/spec/frontend/admin/cloud_licenses/components/subscription_breakdown_spec.js
.../cloud_licenses/components/subscription_breakdown_spec.js
+28
-4
No files found.
ee/app/assets/javascripts/pages/admin/cloud_licenses/components/subscription_breakdown.vue
View file @
42adac30
<
script
>
<
script
>
import
{
GlButton
,
GlModalDirective
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlModalDirective
}
from
'
@gitlab/ui
'
;
import
{
pick
,
some
}
from
'
lodash
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
{
import
{
enterActivationCode
,
enterActivationCode
,
...
@@ -70,7 +69,7 @@ export default {
...
@@ -70,7 +69,7 @@ export default {
},
},
computed
:
{
computed
:
{
canManageSubscription
()
{
canManageSubscription
()
{
return
this
.
customersPortalUrl
;
return
this
.
customersPortalUrl
&&
this
.
hasSubscription
;
},
},
canSyncSubscription
()
{
canSyncSubscription
()
{
return
this
.
subscriptionSyncPath
&&
this
.
isCloudType
;
return
this
.
subscriptionSyncPath
&&
this
.
isCloudType
;
...
@@ -94,15 +93,11 @@ export default {
...
@@ -94,15 +93,11 @@ export default {
return
this
.
subscription
.
type
===
subscriptionType
.
LEGACY
;
return
this
.
subscription
.
type
===
subscriptionType
.
LEGACY
;
},
},
shouldShowFooter
()
{
shouldShowFooter
()
{
return
some
(
return
(
pick
(
this
,
[
this
.
canRemoveLicense
||
'
hasSubscription
'
,
this
.
canManageSubscription
||
'
canDeleteSubscription
'
,
this
.
canSyncSubscription
||
'
canManageSubscription
'
,
this
.
canUploadLicense
'
canSyncSubscription
'
,
'
canUploadSubscription
'
,
]),
Boolean
,
);
);
},
},
subscriptionHistory
()
{
subscriptionHistory
()
{
...
...
ee/spec/frontend/admin/cloud_licenses/components/subscription_breakdown_spec.js
View file @
42adac30
...
@@ -159,7 +159,13 @@ describe('Subscription Breakdown', () => {
...
@@ -159,7 +159,13 @@ describe('Subscription Breakdown', () => {
`
(
`
(
'
with url is $url and type is $type the sync button is shown: $shouldShow
'
,
'
with url is $url and type is $type the sync button is shown: $shouldShow
'
,
({
url
,
type
,
shouldShow
})
=>
{
({
url
,
type
,
shouldShow
})
=>
{
const
provide
=
{
subscriptionSyncPath
:
url
};
const
provide
=
{
connectivityHelpURL
:
''
,
customersPortalUrl
:
''
,
licenseUploadPath
:
''
,
licenseRemovePath
:
''
,
subscriptionSyncPath
:
url
,
};
const
props
=
{
subscription
:
{
...
license
.
ULTIMATE
,
type
}
};
const
props
=
{
subscription
:
{
...
license
.
ULTIMATE
,
type
}
};
const
stubs
=
{
GlCard
,
SubscriptionDetailsCard
};
const
stubs
=
{
GlCard
,
SubscriptionDetailsCard
};
createComponent
({
props
,
provide
,
stubs
});
createComponent
({
props
,
provide
,
stubs
});
...
@@ -179,7 +185,13 @@ describe('Subscription Breakdown', () => {
...
@@ -179,7 +185,13 @@ describe('Subscription Breakdown', () => {
`
(
`
(
'
with url is $url and type is $type the upload button is shown: $shouldShow
'
,
'
with url is $url and type is $type the upload button is shown: $shouldShow
'
,
({
url
,
type
,
shouldShow
})
=>
{
({
url
,
type
,
shouldShow
})
=>
{
const
provide
=
{
licenseUploadPath
:
url
};
const
provide
=
{
connectivityHelpURL
:
''
,
customersPortalUrl
:
''
,
licenseRemovePath
:
''
,
subscriptionSyncPath
:
''
,
licenseUploadPath
:
url
,
};
const
props
=
{
subscription
:
{
...
license
.
ULTIMATE
,
type
}
};
const
props
=
{
subscription
:
{
...
license
.
ULTIMATE
,
type
}
};
const
stubs
=
{
GlCard
,
SubscriptionDetailsCard
};
const
stubs
=
{
GlCard
,
SubscriptionDetailsCard
};
createComponent
({
props
,
provide
,
stubs
});
createComponent
({
props
,
provide
,
stubs
});
...
@@ -194,7 +206,13 @@ describe('Subscription Breakdown', () => {
...
@@ -194,7 +206,13 @@ describe('Subscription Breakdown', () => {
${
''
}
|
${
false
}
${
''
}
|
${
false
}
${
undefined
}
|
${
false
}
${
undefined
}
|
${
false
}
`
(
'
with url is $url the manage button is shown: $shouldShow
'
,
({
url
,
shouldShow
})
=>
{
`
(
'
with url is $url the manage button is shown: $shouldShow
'
,
({
url
,
shouldShow
})
=>
{
const
provide
=
{
customersPortalUrl
:
url
};
const
provide
=
{
connectivityHelpURL
:
''
,
licenseUploadPath
:
''
,
licenseRemovePath
:
''
,
subscriptionSyncPath
:
''
,
customersPortalUrl
:
url
,
};
const
stubs
=
{
GlCard
,
SubscriptionDetailsCard
};
const
stubs
=
{
GlCard
,
SubscriptionDetailsCard
};
createComponent
({
provide
,
stubs
});
createComponent
({
provide
,
stubs
});
...
@@ -212,7 +230,13 @@ describe('Subscription Breakdown', () => {
...
@@ -212,7 +230,13 @@ describe('Subscription Breakdown', () => {
`
(
`
(
'
with url is $url and type is $type the remove button is shown: $shouldShow
'
,
'
with url is $url and type is $type the remove button is shown: $shouldShow
'
,
({
url
,
type
,
shouldShow
})
=>
{
({
url
,
type
,
shouldShow
})
=>
{
const
provide
=
{
licenseRemovePath
:
url
};
const
provide
=
{
connectivityHelpURL
:
''
,
customersPortalUrl
:
''
,
licenseUploadPath
:
''
,
subscriptionSyncPath
:
''
,
licenseRemovePath
:
url
,
};
const
props
=
{
subscription
:
{
...
license
.
ULTIMATE
,
type
}
};
const
props
=
{
subscription
:
{
...
license
.
ULTIMATE
,
type
}
};
const
stubs
=
{
GlCard
,
SubscriptionDetailsCard
};
const
stubs
=
{
GlCard
,
SubscriptionDetailsCard
};
createComponent
({
props
,
provide
,
stubs
});
createComponent
({
props
,
provide
,
stubs
});
...
...
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