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
0412fd0d
Commit
0412fd0d
authored
Aug 26, 2021
by
Sunjung Park
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace node in ruby files
parent
ac251095
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
ee/app/helpers/ee/application_helper.rb
ee/app/helpers/ee/application_helper.rb
+3
-3
ee/spec/helpers/application_helper_spec.rb
ee/spec/helpers/application_helper_spec.rb
+4
-4
No files found.
ee/app/helpers/ee/application_helper.rb
View file @
0412fd0d
...
...
@@ -36,7 +36,7 @@ module EE
html
=
tag
.
div
do
tag
.
p
(
class:
'gl-mb-3'
)
do
concat
(
sprite_icon
(
'information-o'
,
css_class:
'gl-icon gl-mr-3'
))
concat
(
s_
(
'Geo|You are on a secondary, %{b_open}read-only%{b_close} Geo
nod
e.'
).
html_safe
%
{
b_open:
'<b>'
.
html_safe
,
b_close:
'</b>'
.
html_safe
})
concat
(
s_
(
'Geo|You are on a secondary, %{b_open}read-only%{b_close} Geo
sit
e.'
).
html_safe
%
{
b_open:
'<b>'
.
html_safe
,
b_close:
'</b>'
.
html_safe
})
concat
(
"
#{
message
}
"
)
end
end
...
...
@@ -48,13 +48,13 @@ module EE
def
lag_message
if
db_lag
>
DB_LAG_SHOW_THRESHOLD
return
(
s_
(
'Geo|The database is currently %{db_lag} behind the primary
nod
e.'
)
%
return
(
s_
(
'Geo|The database is currently %{db_lag} behind the primary
sit
e.'
)
%
{
db_lag:
time_ago_in_words
(
db_lag
.
seconds
.
ago
)
}).
html_safe
end
if
unprocessed_too_old?
minutes_behind
=
time_ago_in_words
(
next_unprocessed_event
.
created_at
)
(
s_
(
'Geo|The
node is currently %{minutes_behind} behind the primary nod
e.'
)
%
(
s_
(
'Geo|The
site is currently %{minutes_behind} behind the primary sit
e.'
)
%
{
minutes_behind:
minutes_behind
}).
html_safe
end
end
...
...
ee/spec/helpers/application_helper_spec.rb
View file @
0412fd0d
...
...
@@ -96,7 +96,7 @@ RSpec.describe ApplicationHelper do
allow_any_instance_of
(
::
Gitlab
::
Geo
::
HealthCheck
).
to
receive
(
:db_replication_lag_seconds
).
and_return
(
120
)
expect
(
helper
.
read_only_message
).
to
match
(
/If you want to make changes, you must visit the primary site./
)
expect
(
helper
.
read_only_message
).
to
match
(
/The database is currently 2 minutes behind the primary
nod
e/
)
expect
(
helper
.
read_only_message
).
to
match
(
/The database is currently 2 minutes behind the primary
sit
e/
)
expect
(
helper
.
read_only_message
).
to
include
(
geo_primary
.
url
)
end
...
...
@@ -107,7 +107,7 @@ RSpec.describe ApplicationHelper do
create
(
:geo_event_log_state
,
event_id:
event_log
.
id
)
expect
(
helper
.
read_only_message
).
to
match
(
/If you want to make changes, you must visit the primary site./
)
expect
(
helper
.
read_only_message
).
to
match
(
/The
nod
e is currently 3 minutes behind the primary/
)
expect
(
helper
.
read_only_message
).
to
match
(
/The
sit
e is currently 3 minutes behind the primary/
)
expect
(
helper
.
read_only_message
).
to
include
(
geo_primary
.
url
)
end
...
...
@@ -117,7 +117,7 @@ RSpec.describe ApplicationHelper do
create
(
:geo_event_log_state
,
event_id:
event_log
.
id
)
expect
(
helper
.
read_only_message
).
to
match
(
/If you want to make changes, you must visit the primary site./
)
expect
(
helper
.
read_only_message
).
not_to
match
(
/The
nod
e is currently 3 minutes behind the primary/
)
expect
(
helper
.
read_only_message
).
not_to
match
(
/The
sit
e is currently 3 minutes behind the primary/
)
expect
(
helper
.
read_only_message
).
to
include
(
geo_primary
.
url
)
end
...
...
@@ -126,7 +126,7 @@ RSpec.describe ApplicationHelper do
create
(
:geo_event_log_state
,
event_id:
event_log
.
id
)
expect
(
helper
.
read_only_message
).
to
match
(
/If you want to make changes, you must visit the primary site./
)
expect
(
helper
.
read_only_message
).
not_to
match
(
/The
nod
e is currently 3 minutes behind the primary/
)
expect
(
helper
.
read_only_message
).
not_to
match
(
/The
sit
e is currently 3 minutes behind the primary/
)
expect
(
helper
.
read_only_message
).
to
include
(
geo_primary
.
url
)
end
...
...
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