A platform for community discussion. Free, open, simple.
UX: update invite 'not found' message
Arpit Jalan1f1b3e99d19f
diff --git a/app/controllers/invites_controller.rb b/app/controllers/invites_controller.rbindex d569359b54d..cef597971f9 100644--- a/app/controllers/invites_controller.rb+++ b/app/controllers/invites_controller.rb@@ -35,7 +35,7 @@ class InvitesController < ApplicationControllerrender layout: 'no_ember'endelse- flash.now[:error] = I18n.t('invite.not_found')+ flash.now[:error] = I18n.t('invite.not_found', base_url: Discourse.base_url)render layout: 'no_ember'endend@@ -70,7 +70,7 @@ class InvitesController < ApplicationController}endelse- render json: { success: false, message: I18n.t('invite.not_found') }+ render json: { success: false, message: I18n.t('invite.not_found_json') }endenddiff --git a/config/locales/server.en.yml b/config/locales/server.en.ymlindex 6fa93ed7b29..4999a5f8232 100644--- a/config/locales/server.en.yml+++ b/config/locales/server.en.yml@@ -207,7 +207,8 @@ en:<<: *errorsinvite:- not_found: "Your invite token is invalid. Please contact the site's administrator."+ not_found: "Your invite token is invalid. Please <a href='%{base_url}/about'>contact staff</a>."+ not_found_json: "Your invite token is invalid. Please contact staff."not_found_template: |<p>Your invite to <a href="%{base_url}">%{site_name}</a> has already been redeemed.</p>diff --git a/spec/requests/invites_controller_spec.rb b/spec/requests/invites_controller_spec.rbindex 8fe51106fa3..23c7f173b0f 100644--- a/spec/requests/invites_controller_spec.rb+++ b/spec/requests/invites_controller_spec.rb@@ -14,7 +14,7 @@ describe InvitesController dobody = response.bodyexpect(body).to_not have_tag(:script, with: { src: '/assets/application.js' })- expect(CGI.unescapeHTML(body)).to include(I18n.t('invite.not_found', site_name: SiteSetting.title, base_url: Discourse.base_url))+ expect(CGI.unescapeHTML(body)).to include(I18n.t('invite.not_found', base_url: Discourse.base_url))endit "renders the accept invite page if invite exists" do@@ -210,7 +210,7 @@ describe InvitesController doexpect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["success"]).to eq(false)- expect(json["message"]).to eq(I18n.t('invite.not_found'))+ expect(json["message"]).to eq(I18n.t('invite.not_found_json'))expect(session[:current_user_id]).to be_blankendend@@ -245,7 +245,7 @@ describe InvitesController doexpect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["success"]).to eq(false)- expect(json["message"]).to eq(I18n.t('invite.not_found'))+ expect(json["message"]).to eq(I18n.t('invite.not_found_json'))expect(session[:current_user_id]).to be_blankendend