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
1838b748
Commit
1838b748
authored
Sep 15, 2020
by
Thomas Randolph
Committed by
Himanshu Kapoor
Sep 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move alert strings into constants (and $options)
parent
dd066c10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
6 deletions
+19
-6
app/assets/javascripts/diffs/components/app.vue
app/assets/javascripts/diffs/components/app.vue
+14
-6
app/assets/javascripts/diffs/constants.js
app/assets/javascripts/diffs/constants.js
+5
-0
No files found.
app/assets/javascripts/diffs/components/app.vue
View file @
1838b748
...
...
@@ -28,6 +28,9 @@ import {
TREE_HIDE_STATS_WIDTH
,
MR_TREE_SHOW_KEY
,
CENTERED_LIMITED_CONTAINER_CLASSES
,
ALERT_OVERFLOW_HIDDEN
,
ALERT_MERGE_CONFLICT
,
ALERT_COLLAPSED_FILES
,
}
from
'
../constants
'
;
export
default
{
...
...
@@ -47,6 +50,11 @@ export default {
GlSprintf
,
},
mixins
:
[
glFeatureFlagsMixin
()],
alerts
:
{
ALERT_OVERFLOW_HIDDEN
,
ALERT_MERGE_CONFLICT
,
ALERT_COLLAPSED_FILES
,
},
props
:
{
endpoint
:
{
type
:
String
,
...
...
@@ -195,15 +203,15 @@ export default {
let
visible
=
false
;
if
(
this
.
renderOverflowWarning
)
{
visible
=
'
overflow
'
;
visible
=
this
.
$options
.
alerts
.
ALERT_OVERFLOW_HIDDEN
;
}
else
if
(
this
.
isDiffHead
&&
this
.
hasConflicts
)
{
visible
=
'
merge-conflict
'
;
visible
=
this
.
$options
.
alerts
.
ALERT_MERGE_CONFLICT
;
}
else
if
(
this
.
hasCollapsedFile
&&
!
this
.
collapsedWarningDismissed
&&
!
this
.
viewDiffsFileByFile
)
{
visible
=
'
collapsed
'
;
visible
=
this
.
$options
.
alerts
.
ALERT_COLLAPSED_FILES
;
}
return
visible
;
...
...
@@ -441,20 +449,20 @@ export default {
/>
<hidden-files-warning
v-if=
"visibleWarning ==
'overflow'
"
v-if=
"visibleWarning ==
$options.alerts.ALERT_OVERFLOW_HIDDEN
"
:visible=
"numVisibleFiles"
:total=
"numTotalFiles"
:plain-diff-path=
"plainDiffPath"
:email-patch-path=
"emailPatchPath"
/>
<merge-conflict-warning
v-if=
"visibleWarning ==
'merge-conflict'
"
v-if=
"visibleWarning ==
$options.alerts.ALERT_MERGE_CONFLICT
"
:limited=
"isLimitedContainer"
:resolution-path=
"conflictResolutionPath"
:mergeable=
"canMerge"
/>
<collapsed-files-warning
v-if=
"visibleWarning ==
'collapsed'
"
v-if=
"visibleWarning ==
$options.alerts.ALERT_COLLAPSED_FILES
"
:limited=
"isLimitedContainer"
@
dismiss=
"dismissCollapsedWarning"
/>
...
...
app/assets/javascripts/diffs/constants.js
View file @
1838b748
...
...
@@ -68,6 +68,11 @@ export const DIFFS_PER_PAGE = 20;
export
const
DIFF_COMPARE_BASE_VERSION_INDEX
=
-
1
;
export
const
DIFF_COMPARE_HEAD_VERSION_INDEX
=
-
2
;
// Diff View Alerts
export
const
ALERT_OVERFLOW_HIDDEN
=
'
overflow
'
;
export
const
ALERT_MERGE_CONFLICT
=
'
merge-conflict
'
;
export
const
ALERT_COLLAPSED_FILES
=
'
collapsed
'
;
// State machine states
export
const
STATE_IDLING
=
'
idle
'
;
export
const
STATE_LOADING
=
'
loading
'
;
...
...
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