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
6bbd190d
Commit
6bbd190d
authored
Aug 01, 2021
by
Fernando
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change byte formatting for corpus management
* Change MiB to MB
parent
a20f106e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
ee/app/assets/javascripts/security_configuration/corpus_management/components/columns/name.vue
...nfiguration/corpus_management/components/columns/name.vue
+2
-2
ee/app/assets/javascripts/security_configuration/corpus_management/components/corpus_upload.vue
...figuration/corpus_management/components/corpus_upload.vue
+2
-2
ee/spec/frontend/security_configuration/corpus_management/components/columns/__snapshots__/name_spec.js.snap
...gement/components/columns/__snapshots__/name_spec.js.snap
+3
-3
ee/spec/frontend/security_configuration/corpus_management/components/columns/name_spec.js
...uration/corpus_management/components/columns/name_spec.js
+3
-3
No files found.
ee/app/assets/javascripts/security_configuration/corpus_management/components/columns/name.vue
View file @
6bbd190d
<
script
>
<
script
>
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
{
numberToHumanSize
}
from
'
~/lib/utils/number_utils
'
;
import
{
decimalBytes
}
from
'
~/lib/utils/unit_format
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
s__
}
from
'
~/locale
'
;
export
default
{
export
default
{
...
@@ -18,7 +18,7 @@ export default {
...
@@ -18,7 +18,7 @@ export default {
},
},
computed
:
{
computed
:
{
fileSize
()
{
fileSize
()
{
return
numberToHumanSize
(
this
.
corpus
.
size
);
return
decimalBytes
(
this
.
corpus
.
size
);
},
},
jobUrl
()
{
jobUrl
()
{
/*
/*
...
...
ee/app/assets/javascripts/security_configuration/corpus_management/components/corpus_upload.vue
View file @
6bbd190d
<
script
>
<
script
>
import
{
GlButton
,
GlModal
,
GlModalDirective
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlModal
,
GlModalDirective
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
numberToHumanSize
}
from
'
~/lib/utils/number_utils
'
;
import
{
decimalBytes
}
from
'
~/lib/utils/unit_format
'
;
import
{
s__
,
__
}
from
'
~/locale
'
;
import
{
s__
,
__
}
from
'
~/locale
'
;
import
addCorpusMutation
from
'
../graphql/mutations/add_corpus.mutation.graphql
'
;
import
addCorpusMutation
from
'
../graphql/mutations/add_corpus.mutation.graphql
'
;
import
resetCorpus
from
'
../graphql/mutations/reset_corpus.mutation.graphql
'
;
import
resetCorpus
from
'
../graphql/mutations/reset_corpus.mutation.graphql
'
;
...
@@ -51,7 +51,7 @@ export default {
...
@@ -51,7 +51,7 @@ export default {
},
},
computed
:
{
computed
:
{
formattedFileSize
()
{
formattedFileSize
()
{
return
numberToHumanSize
(
this
.
totalSize
);
return
decimalBytes
(
this
.
totalSize
);
},
},
isUploaded
()
{
isUploaded
()
{
return
this
.
states
?.
uploadState
.
progress
===
100
;
return
this
.
states
?.
uploadState
.
progress
===
100
;
...
...
ee/spec/frontend/security_configuration/corpus_management/components/columns/__snapshots__/name_spec.js.snap
View file @
6bbd190d
...
@@ -10,7 +10,7 @@ exports[`Name component renders name with correct file size 1`] = `
...
@@ -10,7 +10,7 @@ exports[`Name component renders name with correct file size 1`] = `
<span
<span
data-testid="file-size"
data-testid="file-size"
>
>
381.47 Mi
B
400M
B
</span>
</span>
)
)
...
@@ -27,7 +27,7 @@ exports[`Name component renders the latest job 1`] = `
...
@@ -27,7 +27,7 @@ exports[`Name component renders the latest job 1`] = `
<span
<span
data-testid="file-size"
data-testid="file-size"
>
>
381.47 Mi
B
400M
B
</span>
</span>
)
)
...
@@ -44,7 +44,7 @@ exports[`Name component without job path renders a - string instead of a link 1`
...
@@ -44,7 +44,7 @@ exports[`Name component without job path renders a - string instead of a link 1`
<span
<span
data-testid="file-size"
data-testid="file-size"
>
>
3
06.13 Mi
B
3
21M
B
</span>
</span>
)
)
...
...
ee/spec/frontend/security_configuration/corpus_management/components/columns/name_spec.js
View file @
6bbd190d
...
@@ -28,14 +28,14 @@ describe('Name', () => {
...
@@ -28,14 +28,14 @@ describe('Name', () => {
describe
(
'
component
'
,
()
=>
{
describe
(
'
component
'
,
()
=>
{
it
(
'
renders name with correct file size
'
,
()
=>
{
it
(
'
renders name with correct file size
'
,
()
=>
{
createComponent
();
createComponent
();
expect
(
findFileSize
().
text
()).
toBe
(
'
381.47 Mi
B
'
);
expect
(
findFileSize
().
text
()).
toBe
(
'
400M
B
'
);
expect
(
findName
().
element
).
toMatchSnapshot
();
expect
(
findName
().
element
).
toMatchSnapshot
();
});
});
it
(
'
renders the latest job
'
,
()
=>
{
it
(
'
renders the latest job
'
,
()
=>
{
createComponent
();
createComponent
();
expect
(
wrapper
.
findComponent
(
GlLink
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
findComponent
(
GlLink
).
exists
()).
toBe
(
true
);
expect
(
findFileSize
().
text
()).
toBe
(
'
381.47 Mi
B
'
);
expect
(
findFileSize
().
text
()).
toBe
(
'
400M
B
'
);
expect
(
findName
().
element
).
toMatchSnapshot
();
expect
(
findName
().
element
).
toMatchSnapshot
();
});
});
...
@@ -43,7 +43,7 @@ describe('Name', () => {
...
@@ -43,7 +43,7 @@ describe('Name', () => {
it
(
'
renders a - string instead of a link
'
,
()
=>
{
it
(
'
renders a - string instead of a link
'
,
()
=>
{
createComponent
({
propsData
:
{
corpus
:
corpuses
[
2
]
}
});
createComponent
({
propsData
:
{
corpus
:
corpuses
[
2
]
}
});
expect
(
wrapper
.
findComponent
(
GlLink
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
findComponent
(
GlLink
).
exists
()).
toBe
(
false
);
expect
(
findFileSize
().
text
()).
toBe
(
'
3
06.13 Mi
B
'
);
expect
(
findFileSize
().
text
()).
toBe
(
'
3
21M
B
'
);
expect
(
findName
().
element
).
toMatchSnapshot
();
expect
(
findName
().
element
).
toMatchSnapshot
();
});
});
});
});
...
...
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