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
6022eca3
Commit
6022eca3
authored
Feb 05, 2021
by
Vitaly Slobodin
Committed by
Natalia Tepluhina
Feb 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update doc links in usage quotas
parent
97991630
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
35 deletions
+46
-35
ee/app/assets/javascripts/storage_counter/components/usage_statistics.vue
...vascripts/storage_counter/components/usage_statistics.vue
+15
-19
ee/app/assets/javascripts/storage_counter/components/usage_statistics_card.vue
...ipts/storage_counter/components/usage_statistics_card.vue
+1
-1
ee/changelogs/unreleased/vs-update-doc-links-in-usage-quotas.yml
...gelogs/unreleased/vs-update-doc-links-in-usage-quotas.yml
+5
-0
ee/spec/frontend/storage_counter/components/usage_statistics_spec.js
...ntend/storage_counter/components/usage_statistics_spec.js
+19
-15
locale/gitlab.pot
locale/gitlab.pot
+6
-0
No files found.
ee/app/assets/javascripts/storage_counter/components/usage_statistics.vue
View file @
6022eca3
<
script
>
import
{
GlButton
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
helpPagePath
}
from
'
~/helpers/help_page_helper
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
formatUsageSize
}
from
'
../utils
'
;
import
UsageStatisticsCard
from
'
./usage_statistics_card.vue
'
;
...
...
@@ -7,7 +8,6 @@ import UsageStatisticsCard from './usage_statistics_card.vue';
export
default
{
components
:
{
GlButton
,
GlSprintf
,
UsageStatisticsCard
,
},
props
:
{
...
...
@@ -32,6 +32,10 @@ export default {
footerNote
:
s__
(
'
UsageQuota|This is the total amount of storage used across your projects within this namespace.
'
,
),
link
:
{
text
:
s__
(
'
UsageQuota|Learn more about usage quotas
'
),
url
:
helpPagePath
(
'
user/usage_quotas
'
),
},
};
},
excessUsage
()
{
...
...
@@ -41,6 +45,10 @@ export default {
footerNote
:
s__
(
'
UsageQuota|This is the total amount of storage used by projects above the free %{actualRepositorySizeLimit} storage limit.
'
,
),
link
:
{
text
:
s__
(
'
UsageQuota|Learn more about excess storage usage
'
),
url
:
helpPagePath
(
'
user/usage_quotas
'
,
{
anchor
:
'
excess-storage-usage
'
}),
},
};
},
purchasedUsage
()
{
...
...
@@ -87,34 +95,22 @@ export default {
<
template
>
<div
class=
"gl-display-flex gl-sm-flex-direction-column"
>
<usage-statistics-card
data-testid=
"total
U
sage"
data-testid=
"total
-u
sage"
:usage=
"totalUsage.usage"
:link=
"totalUsage.link"
:description=
"totalUsage.description"
css-class=
"gl-mr-4"
>
<template
#footer
="
{}">
{{
totalUsage
.
footerNote
}}
</
template
>
</usage-statistics-card>
/>
<usage-statistics-card
data-testid=
"excess
U
sage"
data-testid=
"excess
-u
sage"
:usage=
"excessUsage.usage"
:link=
"excessUsage.link"
:description=
"excessUsage.description"
css-class=
"gl-mx-4"
>
<
template
#footer=
"{}"
>
<gl-sprintf
:message=
"excessUsage.footerNote"
>
<template
#actualRepositorySizeLimit
>
{{
formattedActualRepoSizeLimit
}}
</
template
>
</gl-sprintf>
</template>
</usage-statistics-card>
/>
<usage-statistics-card
v-if=
"purchasedUsage"
data-testid=
"purchased
U
sage"
data-testid=
"purchased
-u
sage"
:usage=
"purchasedUsage.usage"
:usage-total=
"purchasedUsage.usageTotal"
:link=
"purchasedUsage.link"
...
...
ee/app/assets/javascripts/storage_counter/components/usage_statistics_card.vue
View file @
6022eca3
...
...
@@ -62,7 +62,7 @@ export default {
</p>
<p
class=
"gl-mb-0 gl-text-gray-900 gl-font-sm gl-white-space-normal"
data-testid=
"statistics
CardF
ooter"
data-testid=
"statistics
-card-f
ooter"
>
<slot
v-bind=
"{ link }"
name=
"footer"
>
<gl-link
target=
"_blank"
:href=
"link.url"
>
...
...
ee/changelogs/unreleased/vs-update-doc-links-in-usage-quotas.yml
0 → 100644
View file @
6022eca3
---
title
:
Replace text with links on Usage Quota page
merge_request
:
53279
author
:
type
:
added
ee/spec/frontend/storage_counter/components/usage_statistics_spec.js
View file @
6022eca3
import
{
GlButton
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
Gl
Link
,
Gl
Sprintf
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
UsageStatistics
from
'
ee/storage_counter/components/usage_statistics.vue
'
;
import
UsageStatisticsCard
from
'
ee/storage_counter/components/usage_statistics_card.vue
'
;
...
...
@@ -21,12 +21,15 @@ describe('Usage Statistics component', () => {
stubs
:
{
UsageStatisticsCard
,
GlSprintf
,
GlLink
,
},
});
};
const
getStatisticsCards
=
()
=>
wrapper
.
findAll
(
UsageStatisticsCard
);
const
getStatisticsCard
=
(
testId
)
=>
wrapper
.
find
(
`[data-testid="
${
testId
}
"]`
);
const
findGlLinkInCard
=
(
cardName
)
=>
getStatisticsCard
(
cardName
).
find
(
'
[data-testid="statistics-card-footer"]
'
).
find
(
GlLink
);
describe
(
'
with purchaseStorageUrl passed
'
,
()
=>
{
beforeEach
(()
=>
{
...
...
@@ -43,24 +46,20 @@ describe('Usage Statistics component', () => {
expect
(
getStatisticsCards
()).
toHaveLength
(
3
);
});
it
(
'
renders text in total usage card footer
'
,
()
=>
{
expect
(
getStatisticsCard
(
'
totalUsage
'
).
find
(
'
[data-testid="statisticsCardFooter"]
'
).
text
(),
).
toMatchInterpolatedText
(
'
This is the total amount of storage used across your projects within this namespace.
'
,
);
it
(
'
renders URL in total usage card footer
'
,
()
=>
{
const
url
=
findGlLinkInCard
(
'
total-usage
'
);
expect
(
url
.
attributes
(
'
href
'
)).
toBe
(
'
/help/user/usage_quotas
'
);
});
it
(
'
renders text in excess usage card footer
'
,
()
=>
{
expect
(
getStatisticsCard
(
'
excessUsage
'
).
find
(
'
[data-testid="statisticsCardFooter"]
'
).
text
(),
).
toMatchInterpolatedText
(
'
This is the total amount of storage used by projects above the free 978.8KiB storage limit.
'
,
);
it
(
'
renders URL in excess usage card footer
'
,
()
=>
{
const
url
=
findGlLinkInCard
(
'
excess-usage
'
);
expect
(
url
.
attributes
(
'
href
'
)).
toBe
(
'
/help/user/usage_quotas#excess-storage-usage
'
);
});
it
(
'
renders button in purchased usage card footer
'
,
()
=>
{
expect
(
getStatisticsCard
(
'
purchased
U
sage
'
).
find
(
GlButton
).
exists
()).
toBe
(
true
);
expect
(
getStatisticsCard
(
'
purchased
-u
sage
'
).
find
(
GlButton
).
exists
()).
toBe
(
true
);
});
});
...
...
@@ -70,8 +69,13 @@ describe('Usage Statistics component', () => {
purchaseStorageUrl
:
null
,
});
});
afterEach
(()
=>
{
wrapper
.
destroy
();
});
it
(
'
does not render purchased usage card if purchaseStorageUrl is not provided
'
,
()
=>
{
expect
(
getStatisticsCard
(
'
purchased
U
sage
'
).
exists
()).
toBe
(
false
);
expect
(
getStatisticsCard
(
'
purchased
-u
sage
'
).
exists
()).
toBe
(
false
);
});
});
});
locale/gitlab.pot
View file @
6022eca3
...
...
@@ -31362,6 +31362,12 @@ msgstr ""
msgid "UsageQuota|LFS Storage"
msgstr ""
msgid "UsageQuota|Learn more about excess storage usage"
msgstr ""
msgid "UsageQuota|Learn more about usage quotas"
msgstr ""
msgid "UsageQuota|Packages"
msgstr ""
...
...
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