diff --git a/app/assets/stylesheets/scaffolds.scss b/app/assets/stylesheets/scaffolds.scss index b307f6316..bfc3873bc 100644 --- a/app/assets/stylesheets/scaffolds.scss +++ b/app/assets/stylesheets/scaffolds.scss @@ -267,6 +267,7 @@ body.trusted-status-true .trusted-visible-block { color: white; display: inline-block; margin-bottom: 0px; + border-radius: 3px; } h2 { font-size: 22px; @@ -281,4 +282,34 @@ body.trusted-status-true .trusted-visible-block { opacity: 0.9; } } + form button { + background: $red; + color: white; + font-size: 1.5em; + border: 0px; + border-radius: 3px; + padding: 6px 12px; + } +} + +.app-shell-loader { + position: absolute; + top: 200px; + text-align: center; + left: 0; + right: 0; + opacity: 0; + animation: loading-fadein 1.5s; + animation-delay: 0.6s; + font-size: 1.2em; + z-index: -1; +} + +.base-background-color { + @include themeable(background, theme-background, $lightest-gray); +} + +@keyframes loading-fadein { + from { opacity: 0; } + to { opacity: 0.6; } } diff --git a/app/assets/stylesheets/settings.scss b/app/assets/stylesheets/settings.scss index 8c10b389f..587df88c7 100755 --- a/app/assets/stylesheets/settings.scss +++ b/app/assets/stylesheets/settings.scss @@ -670,6 +670,13 @@ .signout_confirm-wrapper { padding: calc(15% + 50px) 2% 30%; text-align: center; + form button { + font-size: 1.5em; + padding: 8px 15px; + border: 0px; + border-radius: 3px; + margin-top: 15px; + } } .org-widget-preview .primary-sticky-nav { diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5140e2af6..f0eccec5f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -36,7 +36,7 @@ class ApplicationController < ActionController::Base def after_sign_in_path_for(resource) return "/onboarding?referrer=#{request.env['omniauth.origin'] || 'none'}" unless current_user.saw_onboarding - request.env["omniauth.origin"] || stored_location_for(resource) || "/dashboard" + (request.env["omniauth.origin"] || stored_location_for(resource) || "/dashboard") + "?signin=true" # This signin=true param is used by frontend end def raise_banned diff --git a/app/controllers/async_info_controller.rb b/app/controllers/async_info_controller.rb index 72a38157e..7ee5403b9 100644 --- a/app/controllers/async_info_controller.rb +++ b/app/controllers/async_info_controller.rb @@ -1,6 +1,7 @@ class AsyncInfoController < ApplicationController include Devise::Controllers::Rememberable # No pundit policy. All actions are unrestricted. + before_action :set_cache_control_headers, only: %i[shell_version] def base_data flash.discard(:notice) @@ -29,6 +30,13 @@ class AsyncInfoController < ApplicationController end end + def shell_version + set_surrogate_key_header "shell-version-endpoint" + # shell_version will change on every deploy. *Technically* could be only on changes to assets and shell, but this is more fool-proof. + shell_version = ApplicationConfig["HEROKU_SLUG_COMMIT"] + render json: { version: Rails.env.production? ? shell_version : rand(1000) }.to_json + end + def user_data Rails.cache.fetch(user_cache_key, expires_in: 15.minutes) do { diff --git a/app/controllers/shell_controller.rb b/app/controllers/shell_controller.rb new file mode 100644 index 000000000..ef2bd2ce2 --- /dev/null +++ b/app/controllers/shell_controller.rb @@ -0,0 +1,13 @@ +class ShellController < ApplicationController + layout false + + def top + @shell = true + render partial: "top" + end + + def bottom + @shell = true + render partial: "bottom" + end +end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9dd1887d9..9def0832c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -15,38 +15,6 @@ module ApplicationHelper end end - def core_pages? - %w[ - articles - podcast_episodes - events - tags - registrations - users - pages - chat_channels - dashboards - moderations - videos - badges - stories - comments - notifications - reading_list_items - html_variants - classified_listings - credits - partnerships - pro_memberships - ].include?(controller_name) - end - - def render_js? - article_pages = controller_name == "articles" && %(index show).include?(controller.action_name) - pulses_pages = controller_name == "pulses" - !(article_pages || pulses_pages) - end - def title(page_title) derived_title = if page_title.include?(ApplicationConfig["COMMUNITY_NAME"]) page_title diff --git a/app/javascript/chat/chat.jsx b/app/javascript/chat/chat.jsx index ac0ea020b..9a0b1d7f2 100644 --- a/app/javascript/chat/chat.jsx +++ b/app/javascript/chat/chat.jsx @@ -88,6 +88,9 @@ export default class Chat extends Component { channel => `open-channel-${channel.chat_channel_id}`, ); setupObserver(this.observerCallback); + if (!window.currentUser) { + window.currentUser = JSON.parse(document.body.dataset.user) + } this.subscribePusher( `private-message-notifications-${window.currentUser.id}`, ); diff --git a/app/javascript/contentDisplayPolicy/hideBlockedContent.js b/app/javascript/contentDisplayPolicy/hideBlockedContent.js index 05558f6b7..45133e683 100644 --- a/app/javascript/contentDisplayPolicy/hideBlockedContent.js +++ b/app/javascript/contentDisplayPolicy/hideBlockedContent.js @@ -2,8 +2,8 @@ export default function hideBlockedContent() { const contentUserElements = Array.from( document.querySelectorAll('div[data-content-user-id]'), ); - /* eslint-disable-next-line no-undef */ - const blockedUserIds = userData().blocked_user_ids; + const user = userData(); //global var + const blockedUserIds = user ? user.blocked_user_ids : []; const divsToHide = contentUserElements.filter(div => { const { contentUserId } = div.dataset; diff --git a/app/views/articles/delete_confirm.html.erb b/app/views/articles/delete_confirm.html.erb index 26cd73dcf..a93d2ec10 100644 --- a/app/views/articles/delete_confirm.html.erb +++ b/app/views/articles/delete_confirm.html.erb @@ -1,5 +1,3 @@ -<%= javascript_include_tag "application" %> -