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
04f9732b
Commit
04f9732b
authored
Jun 14, 2021
by
Thomas Randolph
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use GL utility classes
parent
7a9043b6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
app/assets/javascripts/diffs/components/diff_stats.vue
app/assets/javascripts/diffs/components/diff_stats.vue
+4
-4
app/assets/javascripts/diffs/utils/diff_file.js
app/assets/javascripts/diffs/utils/diff_file.js
+2
-2
spec/frontend/diffs/components/diff_stats_spec.js
spec/frontend/diffs/components/diff_stats_spec.js
+1
-1
spec/frontend/diffs/utils/diff_file_spec.js
spec/frontend/diffs/utils/diff_file_spec.js
+2
-2
No files found.
app/assets/javascripts/diffs/components/diff_stats.vue
View file @
04f9732b
...
...
@@ -53,8 +53,8 @@ export default {
<div
class=
"diff-stats"
:class=
"
{
'is-compare-versions-header
d-none d-lg
-inline-flex': isCompareVersionsHeader,
'
d-none d-sm
-inline-flex': !isCompareVersionsHeader,
'is-compare-versions-header
gl-display-none gl-lg-display
-inline-flex': isCompareVersionsHeader,
'
gl-display-none gl-sm-display
-inline-flex': !isCompareVersionsHeader,
}"
>
<div
v-if=
"notDiffable"
:class=
"fileStats.classes"
>
...
...
@@ -66,14 +66,14 @@ export default {
<span
class=
"text-secondary bold"
>
{{
diffFilesCountText
}}
{{
filesText
}}
</span>
</div>
<div
class=
"diff-stats-group
cgreen d-flex
align-items-center"
class=
"diff-stats-group
gl-text-green-600 gl-display-flex gl-
align-items-center"
:class=
"
{ bold: isCompareVersionsHeader }"
>
<span>
+
</span>
<span
class=
"js-file-addition-line"
>
{{
addedLines
}}
</span>
</div>
<div
class=
"diff-stats-group
cred d-flex
align-items-center"
class=
"diff-stats-group
gl-text-red-500 gl-display-flex gl-
align-items-center"
:class=
"
{ bold: isCompareVersionsHeader }"
>
<span>
-
</span>
...
...
app/assets/javascripts/diffs/utils/diff_file.js
View file @
04f9732b
...
...
@@ -105,9 +105,9 @@ export function stats(file) {
valid
=
true
;
if
(
diff
>
0
)
{
classes
=
'
cgreen
'
;
classes
=
'
gl-text-green-600
'
;
}
else
if
(
diff
<
0
)
{
classes
=
'
cred
'
;
classes
=
'
gl-text-red-500
'
;
}
}
...
...
spec/frontend/diffs/components/diff_stats_spec.js
View file @
04f9732b
...
...
@@ -58,7 +58,7 @@ describe('diff_stats', () => {
it
(
"
renders the bytes changes instead of line changes when the file isn't diffable
"
,
()
=>
{
const
content
=
getBytesContainer
();
expect
(
content
.
classes
(
'
cgreen
'
)).
toBe
(
true
);
expect
(
content
.
classes
(
'
gl-text-green-600
'
)).
toBe
(
true
);
expect
(
content
.
text
()).
toBe
(
'
+1.00 KiB (+100%)
'
);
});
});
...
...
spec/frontend/diffs/utils/diff_file_spec.js
View file @
04f9732b
...
...
@@ -181,7 +181,7 @@ describe('diff_file utilities', () => {
{
changed
:
1024
,
percent
:
100
,
classes
:
'
cgreen
'
,
classes
:
'
gl-text-green-600
'
,
sign
:
'
+
'
,
text
:
'
+1.00 KiB (+100%)
'
,
valid
:
true
,
...
...
@@ -197,7 +197,7 @@ describe('diff_file utilities', () => {
{
changed
:
-
1024
,
percent
:
-
100
,
classes
:
'
cred
'
,
classes
:
'
gl-text-red-500
'
,
sign
:
''
,
text
:
'
-1.00 KiB (-100%)
'
,
valid
:
true
,
...
...
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