Commit 84199f19 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'rename-rendered_title' into 'master'

Rename all references to rendered_title to realtime_changes

See merge request !11359
parents afcc81da 3efb6064
...@@ -11,10 +11,10 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -11,10 +11,10 @@ class Projects::IssuesController < Projects::ApplicationController
before_action :redirect_to_external_issue_tracker, only: [:index, :new] before_action :redirect_to_external_issue_tracker, only: [:index, :new]
before_action :module_enabled before_action :module_enabled
before_action :issue, only: [:edit, :update, :show, :referenced_merge_requests, before_action :issue, only: [:edit, :update, :show, :referenced_merge_requests,
:related_branches, :can_create_branch, :rendered_title, :create_merge_request] :related_branches, :can_create_branch, :realtime_changes, :create_merge_request]
# Allow read any issue # Allow read any issue
before_action :authorize_read_issue!, only: [:show, :rendered_title] before_action :authorize_read_issue!, only: [:show, :realtime_changes]
# Allow write(create) issue # Allow write(create) issue
before_action :authorize_create_issue!, only: [:new, :create] before_action :authorize_create_issue!, only: [:new, :create]
...@@ -199,7 +199,7 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -199,7 +199,7 @@ class Projects::IssuesController < Projects::ApplicationController
end end
end end
def rendered_title def realtime_changes
Gitlab::PollingInterval.set_header(response, interval: 3_000) Gitlab::PollingInterval.set_header(response, interval: 3_000)
render json: { render json: {
......
...@@ -292,7 +292,7 @@ class Issue < ActiveRecord::Base ...@@ -292,7 +292,7 @@ class Issue < ActiveRecord::Base
end end
def expire_etag_cache def expire_etag_cache
key = Gitlab::Routing.url_helpers.rendered_title_namespace_project_issue_path( key = Gitlab::Routing.url_helpers.realtime_changes_namespace_project_issue_path(
project.namespace, project.namespace,
project, project,
self self
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
.issue-details.issuable-details .issue-details.issuable-details
.detail-page-description.content-block .detail-page-description.content-block
#js-issuable-app{ "data" => { "endpoint" => rendered_title_namespace_project_issue_path(@project.namespace, @project, @issue), #js-issuable-app{ "data" => { "endpoint" => realtime_changes_namespace_project_issue_path(@project.namespace, @project, @issue),
"can-update" => can?(current_user, :update_issue, @issue).to_s, "can-update" => can?(current_user, :update_issue, @issue).to_s,
"issuable-ref" => @issue.to_reference, "issuable-ref" => @issue.to_reference,
} } } }
......
...@@ -244,7 +244,7 @@ constraints(ProjectUrlConstrainer.new) do ...@@ -244,7 +244,7 @@ constraints(ProjectUrlConstrainer.new) do
get :referenced_merge_requests get :referenced_merge_requests
get :related_branches get :related_branches
get :can_create_branch get :can_create_branch
get :rendered_title get :realtime_changes
post :create_merge_request post :create_merge_request
end end
collection do collection do
......
...@@ -7,8 +7,8 @@ module Gitlab ...@@ -7,8 +7,8 @@ module Gitlab
# - Don't contain a reserved word (expect for the words used in the # - Don't contain a reserved word (expect for the words used in the
# regex itself) # regex itself)
# - Ending in `noteable/issue/<id>/notes` for the `issue_notes` route # - Ending in `noteable/issue/<id>/notes` for the `issue_notes` route
# - Ending in `issues/id`/rendered_title` for the `issue_title` route # - Ending in `issues/id`/realtime_changes` for the `issue_title` route
USED_IN_ROUTES = %w[noteable issue notes issues rendered_title USED_IN_ROUTES = %w[noteable issue notes issues realtime_changes
commit pipelines merge_requests new].freeze commit pipelines merge_requests new].freeze
RESERVED_WORDS = DynamicPathValidator::WILDCARD_ROUTES - USED_IN_ROUTES RESERVED_WORDS = DynamicPathValidator::WILDCARD_ROUTES - USED_IN_ROUTES
RESERVED_WORDS_REGEX = Regexp.union(*RESERVED_WORDS) RESERVED_WORDS_REGEX = Regexp.union(*RESERVED_WORDS)
...@@ -18,7 +18,7 @@ module Gitlab ...@@ -18,7 +18,7 @@ module Gitlab
'issue_notes' 'issue_notes'
), ),
Gitlab::EtagCaching::Router::Route.new( Gitlab::EtagCaching::Router::Route.new(
%r(^(?!.*(#{RESERVED_WORDS_REGEX})).*/issues/\d+/rendered_title\z), %r(^(?!.*(#{RESERVED_WORDS_REGEX})).*/issues/\d+/realtime_changes\z),
'issue_title' 'issue_title'
), ),
Gitlab::EtagCaching::Router::Route.new( Gitlab::EtagCaching::Router::Route.new(
......
...@@ -25,7 +25,7 @@ describe('Issuable output', () => { ...@@ -25,7 +25,7 @@ describe('Issuable output', () => {
vm = new IssuableDescriptionComponent({ vm = new IssuableDescriptionComponent({
propsData: { propsData: {
canUpdate: true, canUpdate: true,
endpoint: '/gitlab-org/gitlab-shell/issues/9/rendered_title', endpoint: '/gitlab-org/gitlab-shell/issues/9/realtime_changes',
issuableRef: '#1', issuableRef: '#1',
initialTitle: '', initialTitle: '',
initialDescriptionHtml: '', initialDescriptionHtml: '',
......
...@@ -14,7 +14,7 @@ describe Gitlab::EtagCaching::Router do ...@@ -14,7 +14,7 @@ describe Gitlab::EtagCaching::Router do
it 'matches issue title endpoint' do it 'matches issue title endpoint' do
env = build_env( env = build_env(
'/my-group/my-project/issues/123/rendered_title' '/my-group/my-project/issues/123/realtime_changes'
) )
result = described_class.match(env) result = described_class.match(env)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment