From c26d64459c1b5c1dce5ef8effc24a23b5e9a052a Mon Sep 17 00:00:00 2001 From: "Chris Baudouin, Jr" Date: Fri, 27 Nov 2020 00:48:12 -0500 Subject: [PATCH 1/6] feat: Redesigns OAuth2 portal --- app/assets/stylesheets/forms/_forms.sass | 5 +++ app/assets/stylesheets/general/_header.sass | 7 +++ .../doorkeeper/applications/_form.html.haml | 12 ++++++ .../doorkeeper/applications/edit.html.haml | 3 ++ .../doorkeeper/applications/index.html.haml | 25 +++++++++++ .../doorkeeper/applications/new.html.haml | 3 ++ .../doorkeeper/applications/show.html.haml | 43 +++++++++++++++++++ .../doorkeeper/authorizations/error.html.haml | 10 +++++ .../doorkeeper/authorizations/new.html.haml | 29 +++++++++++++ .../_delete_form.html.erb | 4 ++ .../authorized_applications/index.html.erb | 24 +++++++++++ app/views/layouts/_header.html.haml | 4 +- .../layouts/doorkeeper/_header.html.haml | 9 ++++ .../layouts/doorkeeper/application.html.haml | 27 ++++++++++++ .../layouts/manage/application.html.haml | 13 +++--- config/application.rb | 13 +++++- config/locales/doorkeeper.en.yml | 20 +++++---- config/locales/en.yml | 2 +- 18 files changed, 234 insertions(+), 19 deletions(-) create mode 100644 app/views/doorkeeper/applications/_form.html.haml create mode 100644 app/views/doorkeeper/applications/edit.html.haml create mode 100644 app/views/doorkeeper/applications/index.html.haml create mode 100644 app/views/doorkeeper/applications/new.html.haml create mode 100644 app/views/doorkeeper/applications/show.html.haml create mode 100644 app/views/doorkeeper/authorizations/error.html.haml create mode 100644 app/views/doorkeeper/authorizations/new.html.haml create mode 100644 app/views/doorkeeper/authorized_applications/_delete_form.html.erb create mode 100644 app/views/doorkeeper/authorized_applications/index.html.erb create mode 100644 app/views/layouts/doorkeeper/_header.html.haml create mode 100644 app/views/layouts/doorkeeper/application.html.haml diff --git a/app/assets/stylesheets/forms/_forms.sass b/app/assets/stylesheets/forms/_forms.sass index f3f635423..c2330724c 100644 --- a/app/assets/stylesheets/forms/_forms.sass +++ b/app/assets/stylesheets/forms/_forms.sass @@ -91,6 +91,11 @@ hr margin-left: -1 * $form-spacing-horizontal margin-right: -1 * $form-spacing-horizontal +.actions + display: flex + justify-content: flex-end + wid + .input flex: 1 1 600px display: flex diff --git a/app/assets/stylesheets/general/_header.sass b/app/assets/stylesheets/general/_header.sass index 99e1d8dae..431a3124e 100644 --- a/app/assets/stylesheets/general/_header.sass +++ b/app/assets/stylesheets/general/_header.sass @@ -23,11 +23,18 @@ $account-nav-padding-vert: 15px .header-nav display: flex align-items: center + width: 100% .button margin-right: 10px &:last-child margin-right: 0 +.header-nav.start + justify-content: flex-start + +.header-nav.end + justify-content: flex-end + .account-nav @include css4 border-bottom: 1px solid var(--account-nav--border-color) diff --git a/app/views/doorkeeper/applications/_form.html.haml b/app/views/doorkeeper/applications/_form.html.haml new file mode 100644 index 000000000..a3742e61f --- /dev/null +++ b/app/views/doorkeeper/applications/_form.html.haml @@ -0,0 +1,12 @@ +.form-container + = bs_horizontal_simple_form_for(@application, url: doorkeeper_submit_path(@application)) do |f| + = f.error_notification + + .form-inputs + = f.input :name, required: true + = f.input :redirect_uri, required: true + = f.input :confidential + = f.input :scopes + + .center + = f.button :submit, class: 'btn-primary' diff --git a/app/views/doorkeeper/applications/edit.html.haml b/app/views/doorkeeper/applications/edit.html.haml new file mode 100644 index 000000000..70433428c --- /dev/null +++ b/app/views/doorkeeper/applications/edit.html.haml @@ -0,0 +1,3 @@ += render "layouts/manage/page_title", title: @application.name, subtitle: t(:title, scope: 'doorkeeper.applications.edit') + += render 'form' \ No newline at end of file diff --git a/app/views/doorkeeper/applications/index.html.haml b/app/views/doorkeeper/applications/index.html.haml new file mode 100644 index 000000000..e0440f445 --- /dev/null +++ b/app/views/doorkeeper/applications/index.html.haml @@ -0,0 +1,25 @@ += render "layouts/manage/page_title", title: t(:title, scope: 'pages.manage.doorkeeper'), docs: 'https://coderit.org/hackathon-manager/docs/busses' do + = link_to t(:new, scope: 'doorkeeper.applications.index'), new_oauth_application_path, class: "btn btn-sm btn-outline-secondary" + +.mb-4 + %table.table.table-striped.table-hover + %thead + %tr + %th + =t(:name, scope: 'doorkeeper.applications.index') + %th + =t(:callback_url, scope: 'doorkeeper.applications.index') + %th + =t(:confidential, scope: 'doorkeeper.applications.index') + + + %tbody + - @applications.each do |application| + %tr + %td + %strong= link_to(application.name, oauth_application_path(application)) + %td + = simple_format(application.redirect_uri) + %td + = application.confidential? ? t('doorkeeper.applications.index.confidentiality.yes') : t('doorkeeper.applications.index.confidentiality.no') + diff --git a/app/views/doorkeeper/applications/new.html.haml b/app/views/doorkeeper/applications/new.html.haml new file mode 100644 index 000000000..7818f0bef --- /dev/null +++ b/app/views/doorkeeper/applications/new.html.haml @@ -0,0 +1,3 @@ += render "layouts/manage/page_title", title: t(:title, scope: 'doorkeeper.applications.new') + += render 'form' diff --git a/app/views/doorkeeper/applications/show.html.haml b/app/views/doorkeeper/applications/show.html.haml new file mode 100644 index 000000000..eeedacb0f --- /dev/null +++ b/app/views/doorkeeper/applications/show.html.haml @@ -0,0 +1,43 @@ += render "layouts/manage/page_title", title: @application.name, subtitle: t(:title, scope: 'doorkeeper.applications.show') do + .btn-group + = link_to t('doorkeeper.applications.buttons.edit'), edit_oauth_application_path(@application), class: 'btn btn-sm btn-outline-secondary' + = link_to t('doorkeeper.applications.buttons.destroy'), oauth_application_path(@application), method: :delete, data: { confirm: t('doorkeeper.applications.confirmations.destroy', name: @application.name) }, class: 'btn btn-sm btn-outline-secondary' + +.row + .col-lg-6 + %h4.border-bottom.pb-2.mb-3 Details + %dl.row + %dt.col-md-4 + = t('.application_id') + %dd.col-md-8 + %code#application_id.bg-light + = @application.uid + %dt.col-md-4 + = t('.secret') + %dd.col-md-8 + %code#application_id.bg-light + = flash[:application_secret].presence || @application.plaintext_secret + %dt.col-md-4 + = t('.scopes') + %dd.col-md-8 + - if @application.scopes.present? + = @application.scopes + - else + %bg-light.font-italic.text-muted + = t('.not_defined') + %dt.col-md-4 + = t('.confidential') + %dd.col-md-8 + = @application.confidential? ? "Yes" : "No" + + .col-lg-6 + .h4.border-bottom.pb-2.mb-3 + = t('.callback_urls') + %table.table.table-striped.table-hover + %tbody + - @application.redirect_uri.split.each do |uri| + %tr + %td + = uri + %td + = link_to t('doorkeeper.applications.buttons.authorize'), oauth_authorization_path(client_id: @application.uid, redirect_uri: uri, response_type: 'code', scope: @application.scopes), class: 'btn btn-sm btn-outline-primary', target: '_blank' \ No newline at end of file diff --git a/app/views/doorkeeper/authorizations/error.html.haml b/app/views/doorkeeper/authorizations/error.html.haml new file mode 100644 index 000000000..e96f0e7a5 --- /dev/null +++ b/app/views/doorkeeper/authorizations/error.html.haml @@ -0,0 +1,10 @@ +.form-container + #disclaimer + %h1.section-title + Authorization + %span.emphasized Error + %p + = @pre_auth.error_response.body[:error_description] + %p + = raw t('doorkeeper.errors.messages.get_help', hackathon_name: content_tag(:strong, class: 'text-info') { HackathonConfig['name'] }) + diff --git a/app/views/doorkeeper/authorizations/new.html.haml b/app/views/doorkeeper/authorizations/new.html.haml new file mode 100644 index 000000000..fba28696e --- /dev/null +++ b/app/views/doorkeeper/authorizations/new.html.haml @@ -0,0 +1,29 @@ +.form-container + #disclaimer + %h1.section-title + Authorization + %span.emphasized Required + %p + = raw t('.prompt', client_name: content_tag(:strong, class: 'text-info') { @pre_auth.client.name }) + %p + = t('.able_to') + .actions + = form_tag oauth_authorization_path, method: :delete, style: "padding-right: 10px;" do + = hidden_field_tag :client_id, @pre_auth.client.uid + = hidden_field_tag :redirect_uri, @pre_auth.redirect_uri + = hidden_field_tag :state, @pre_auth.state + = hidden_field_tag :response_type, @pre_auth.response_type + = hidden_field_tag :scope, @pre_auth.scope + = hidden_field_tag :code_challenge, @pre_auth.code_challenge + = hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method + = submit_tag t('doorkeeper.authorizations.buttons.deny') + = form_tag oauth_authorization_path, method: :post do + = hidden_field_tag :client_id, @pre_auth.client.uid + = hidden_field_tag :redirect_uri, @pre_auth.redirect_uri + = hidden_field_tag :state, @pre_auth.state + = hidden_field_tag :response_type, @pre_auth.response_type + = hidden_field_tag :scope, @pre_auth.scope + = hidden_field_tag :code_challenge, @pre_auth.code_challenge + = hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method + = submit_tag t('doorkeeper.authorizations.buttons.authorize') + \ No newline at end of file diff --git a/app/views/doorkeeper/authorized_applications/_delete_form.html.erb b/app/views/doorkeeper/authorized_applications/_delete_form.html.erb new file mode 100644 index 000000000..512e8ece3 --- /dev/null +++ b/app/views/doorkeeper/authorized_applications/_delete_form.html.erb @@ -0,0 +1,4 @@ +<%- submit_btn_css ||= 'btn btn-link' %> +<%= form_tag oauth_authorized_application_path(application), method: :delete do %> + <%= submit_tag t('doorkeeper.authorized_applications.buttons.revoke'), onclick: "return confirm('#{ t('doorkeeper.authorized_applications.confirmations.revoke') }')", class: submit_btn_css %> +<% end %> diff --git a/app/views/doorkeeper/authorized_applications/index.html.erb b/app/views/doorkeeper/authorized_applications/index.html.erb new file mode 100644 index 000000000..a3f5aaac3 --- /dev/null +++ b/app/views/doorkeeper/authorized_applications/index.html.erb @@ -0,0 +1,24 @@ + + +
+ + + + + + + + + + <% @applications.each do |application| %> + + + + + + <% end %> + +
<%= t('doorkeeper.authorized_applications.index.application') %><%= t('doorkeeper.authorized_applications.index.created_at') %>
<%= application.name %><%= application.created_at.strftime(t('doorkeeper.authorized_applications.index.date_format')) %><%= render 'delete_form', application: application %>
+
diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 91427e44d..3d591f229 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -6,9 +6,9 @@ = link_to homepage_url do = image_tag HackathonConfig['logo_asset'], id: 'logo', alt: "#{HackathonConfig['name']} logo", title: HackathonConfig['name'], class: 'header-logo__image' - else - .header-nav + .header-nav.start = btn_link_to "Home", homepage_url - .header-nav + .header-nav.end - if user_signed_in? - if current_user.organizing_staff? = btn_link_to "Manage", manage_root_path diff --git a/app/views/layouts/doorkeeper/_header.html.haml b/app/views/layouts/doorkeeper/_header.html.haml new file mode 100644 index 000000000..f8e581953 --- /dev/null +++ b/app/views/layouts/doorkeeper/_header.html.haml @@ -0,0 +1,9 @@ +- homepage_url = HackathonConfig['homepage_url'].presence || root_path +.header + .header__wrapper.account-nav__wrapper + - if HackathonConfig['logo_asset'].present? + .header-logo + = image_tag HackathonConfig['logo_asset'], id: 'logo', alt: "#{HackathonConfig['name']} logo", title: HackathonConfig['name'], class: 'header-logo__image' + .header-nav.end + - if user_signed_in? + = btn_link_to "Sign Out", destroy_user_session_path, method: :delete diff --git a/app/views/layouts/doorkeeper/application.html.haml b/app/views/layouts/doorkeeper/application.html.haml new file mode 100644 index 000000000..46e8b7222 --- /dev/null +++ b/app/views/layouts/doorkeeper/application.html.haml @@ -0,0 +1,27 @@ +!!! 5 +%html + %head + %title= yield(:title) || HackathonConfig['default_page_title'] + %meta{ charset: "utf-8" } + %meta{ name:"viewport", content: "width=device-width, initial-scale=1" } + + - if HackathonConfig['favicon_asset'].present? + %link{ href: image_url(HackathonConfig['favicon_asset']), rel: "shortcut icon" } + + = csrf_meta_tags + = csp_meta_tag + + = stylesheet_link_tag "application", media: "all", 'data-turbolinks-track': 'reload' + = javascript_include_tag "application", 'data-turbolinks-track': 'reload' + %link{ href:'//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700', rel: 'stylesheet', type: 'text/css' } + - if HackathonConfig['custom_css'].present? + %style + = HackathonConfig['custom_css'] + + %body + = render "layouts/doorkeeper/header" + = render "layouts/flashes" + #main + %section.section + .container + = yield diff --git a/app/views/layouts/manage/application.html.haml b/app/views/layouts/manage/application.html.haml index 78db41d23..5f0a1e156 100644 --- a/app/views/layouts/manage/application.html.haml +++ b/app/views/layouts/manage/application.html.haml @@ -104,6 +104,12 @@ %span = t(:advanced, scope: 'layouts.manage.navigation') %ul.nav.flex-column.mb-2 + %li.nav-item + = active_link_to oauth_applications_path, class: "nav-link" do + .fa.fa-unlock.fa-fw.icon-space-r-half + = t(:title, scope: 'pages.manage.doorkeeper') + .nav-item-description + = t(:doorkeeper, scope: 'layouts.manage.navigation.descriptors') %li.nav-item = active_link_to sidekiq_web_path, target: '_blank', class: "nav-link" do .fa.fa-tasks.fa-fw.icon-space-r-half @@ -118,13 +124,6 @@ %span.fa.fa-external-link.icon-space-l-half .nav-item-description = t(:blazer, scope: 'layouts.manage.navigation.descriptors') - %li.nav-item - = active_link_to oauth_applications_path, target: '_blank', class: "nav-link" do - .fa.fa-unlock.fa-fw.icon-space-r-half - = t(:title, scope: 'pages.manage.doorkeeper') - %span.fa.fa-external-link.icon-space-l-half - .nav-item-description - = t(:doorkeeper, scope: 'layouts.manage.navigation.descriptors') %li.nav-item = active_link_to manage_data_exports_path, class: "nav-link" do .fa.fa-download.fa-fw.icon-space-r-half diff --git a/config/application.rb b/config/application.rb index 9e2bf1f19..f5228643c 100644 --- a/config/application.rb +++ b/config/application.rb @@ -7,7 +7,7 @@ # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) - +4 module HackathonManager class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. @@ -23,5 +23,16 @@ class Application < Rails::Application config.time_zone = ENV["TIME_ZONE"].presence || "UTC" config.active_job.queue_adapter = :sidekiq + + config.to_prepare do + # Only Applications list + Doorkeeper::ApplicationsController.layout "manage/application" + + # Only Authorization endpoint + #Doorkeeper::AuthorizationsController.layout "application" + + # Only Authorized Applications + Doorkeeper::AuthorizedApplicationsController.layout "application" + end end end diff --git a/config/locales/doorkeeper.en.yml b/config/locales/doorkeeper.en.yml index 0e5bbf2f4..9ef9af01d 100644 --- a/config/locales/doorkeeper.en.yml +++ b/config/locales/doorkeeper.en.yml @@ -20,10 +20,10 @@ en: doorkeeper: applications: confirmations: - destroy: 'Are you sure?' + destroy: Are you sure? The application %{name} will be permanently erased. This action is irreversible. buttons: edit: 'Edit' - destroy: 'Destroy' + destroy: 'Delete' submit: 'Submit' cancel: 'Cancel' authorize: 'Authorize' @@ -49,24 +49,24 @@ en: new: title: 'New Application' show: - title: 'Application: %{name}' + title: 'Application' application_id: 'Application UID' secret: 'Secret' scopes: 'Scopes' confidential: 'Confidential' - callback_urls: 'Callback urls' + callback_urls: 'Callback URLs' actions: 'Actions' authorizations: buttons: - authorize: 'Authorize' + authorize: 'Allow' deny: 'Deny' error: title: 'An error has occurred' new: title: 'Authorization required' - prompt: 'Authorize %{client_name} to use your account?' - able_to: 'This application will be able to' + prompt: 'The application %{client_name} is requesting access to your information.' + able_to: 'This application will be able to access your personally identifiable information and questionnaire data.' show: title: 'Authorization code' @@ -87,7 +87,8 @@ en: errors: messages: # Common error messages - invalid_request: 'The request is missing a required parameter, includes an unsupported parameter value, or is otherwise malformed.' + invalid_request: + missing_param: 'The request is missing a required parameter, includes an unsupported parameter value, or is otherwise malformed.' invalid_redirect_uri: "The requested redirect uri is malformed or doesn't match client redirect URI." unauthorized_client: 'The client is not authorized to perform this request using this method.' access_denied: 'The resource owner or authorization server denied the request.' @@ -96,6 +97,9 @@ en: server_error: 'The authorization server encountered an unexpected condition which prevented it from fulfilling the request.' temporarily_unavailable: 'The authorization server is currently unable to handle the request due to a temporary overloading or maintenance of the server.' + # Help from hackathon message + get_help: 'Please inform a %{hackathon_name} staff member of this issue for assistance.' + # Configuration error messages credential_flow_not_configured: 'Resource Owner Password Credentials flow failed due to Doorkeeper.configure.resource_owner_from_credentials being unconfigured.' resource_owner_authenticator_not_configured: 'Resource Owner find failed due to Doorkeeper.configure.resource_owner_authenticator being unconfigured.' diff --git a/config/locales/en.yml b/config/locales/en.yml index d3bd02c54..4e641763c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -194,7 +194,7 @@ en: blazer: title: Blazer doorkeeper: - title: Doorkeeper + title: App Authentication data-exports: title: Data Exports layouts: From d51355431480d3ac73abf23edfc1a2369a528e45 Mon Sep 17 00:00:00 2001 From: "Chris Baudouin, Jr" Date: Fri, 27 Nov 2020 01:06:35 -0500 Subject: [PATCH 2/6] fix: Some Hound issues --- app/views/doorkeeper/applications/show.html.haml | 12 ++++++------ app/views/doorkeeper/authorizations/new.html.haml | 1 - config/application.rb | 8 ++++---- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/app/views/doorkeeper/applications/show.html.haml b/app/views/doorkeeper/applications/show.html.haml index eeedacb0f..103fd1dcf 100644 --- a/app/views/doorkeeper/applications/show.html.haml +++ b/app/views/doorkeeper/applications/show.html.haml @@ -7,17 +7,17 @@ .col-lg-6 %h4.border-bottom.pb-2.mb-3 Details %dl.row - %dt.col-md-4 + %dt.col-md-4 = t('.application_id') %dd.col-md-8 %code#application_id.bg-light = @application.uid - %dt.col-md-4 + %dt.col-md-4 = t('.secret') %dd.col-md-8 %code#application_id.bg-light = flash[:application_secret].presence || @application.plaintext_secret - %dt.col-md-4 + %dt.col-md-4 = t('.scopes') %dd.col-md-8 - if @application.scopes.present? @@ -25,13 +25,13 @@ - else %bg-light.font-italic.text-muted = t('.not_defined') - %dt.col-md-4 + %dt.col-md-4 = t('.confidential') %dd.col-md-8 = @application.confidential? ? "Yes" : "No" .col-lg-6 - .h4.border-bottom.pb-2.mb-3 + .h4.border-bottom.pb-2.mb-3 = t('.callback_urls') %table.table.table-striped.table-hover %tbody @@ -40,4 +40,4 @@ %td = uri %td - = link_to t('doorkeeper.applications.buttons.authorize'), oauth_authorization_path(client_id: @application.uid, redirect_uri: uri, response_type: 'code', scope: @application.scopes), class: 'btn btn-sm btn-outline-primary', target: '_blank' \ No newline at end of file + = link_to t('doorkeeper.applications.buttons.authorize'), oauth_authorization_path(client_id: @application.uid, redirect_uri: uri, response_type: 'code', scope: @application.scopes), class: 'btn btn-sm btn-outline-primary', target: '_blank' diff --git a/app/views/doorkeeper/authorizations/new.html.haml b/app/views/doorkeeper/authorizations/new.html.haml index fba28696e..d1d73e20e 100644 --- a/app/views/doorkeeper/authorizations/new.html.haml +++ b/app/views/doorkeeper/authorizations/new.html.haml @@ -26,4 +26,3 @@ = hidden_field_tag :code_challenge, @pre_auth.code_challenge = hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method = submit_tag t('doorkeeper.authorizations.buttons.authorize') - \ No newline at end of file diff --git a/config/application.rb b/config/application.rb index f5228643c..e84a78d7d 100644 --- a/config/application.rb +++ b/config/application.rb @@ -7,7 +7,7 @@ # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) -4 + module HackathonManager class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. @@ -27,10 +27,10 @@ class Application < Rails::Application config.to_prepare do # Only Applications list Doorkeeper::ApplicationsController.layout "manage/application" - + # Only Authorization endpoint - #Doorkeeper::AuthorizationsController.layout "application" - + # Doorkeeper::AuthorizationsController.layout "application" + # Only Authorized Applications Doorkeeper::AuthorizedApplicationsController.layout "application" end From fa98ac292af3a5c5bfa9802d13a11052b704082d Mon Sep 17 00:00:00 2001 From: "Chris Baudouin, Jr" Date: Fri, 27 Nov 2020 16:53:16 -0500 Subject: [PATCH 3/6] Changes application verbiage --- app/views/doorkeeper/applications/edit.html.haml | 2 +- app/views/doorkeeper/applications/index.html.haml | 9 +++++---- config/locales/doorkeeper.en.yml | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/views/doorkeeper/applications/edit.html.haml b/app/views/doorkeeper/applications/edit.html.haml index 70433428c..e573e6e57 100644 --- a/app/views/doorkeeper/applications/edit.html.haml +++ b/app/views/doorkeeper/applications/edit.html.haml @@ -1,3 +1,3 @@ = render "layouts/manage/page_title", title: @application.name, subtitle: t(:title, scope: 'doorkeeper.applications.edit') -= render 'form' \ No newline at end of file += render 'form' diff --git a/app/views/doorkeeper/applications/index.html.haml b/app/views/doorkeeper/applications/index.html.haml index e0440f445..c7369f766 100644 --- a/app/views/doorkeeper/applications/index.html.haml +++ b/app/views/doorkeeper/applications/index.html.haml @@ -6,18 +6,19 @@ %thead %tr %th - =t(:name, scope: 'doorkeeper.applications.index') + = t(:name, scope: 'doorkeeper.applications.index') %th - =t(:callback_url, scope: 'doorkeeper.applications.index') + = t(:callback_url, scope: 'doorkeeper.applications.index') %th - =t(:confidential, scope: 'doorkeeper.applications.index') + = t(:confidential, scope: 'doorkeeper.applications.index') %tbody - @applications.each do |application| %tr %td - %strong= link_to(application.name, oauth_application_path(application)) + %strong + = link_to(application.name, oauth_application_path(application)) %td = simple_format(application.redirect_uri) %td diff --git a/config/locales/doorkeeper.en.yml b/config/locales/doorkeeper.en.yml index 9ef9af01d..df0440609 100644 --- a/config/locales/doorkeeper.en.yml +++ b/config/locales/doorkeeper.en.yml @@ -66,7 +66,7 @@ en: new: title: 'Authorization required' prompt: 'The application %{client_name} is requesting access to your information.' - able_to: 'This application will be able to access your personally identifiable information and questionnaire data.' + able_to: 'This application will be able to access your personally identifiable information and application data.' show: title: 'Authorization code' From 828dd544ec93b6c0f6cdcb3854c949c7e2f92b55 Mon Sep 17 00:00:00 2001 From: "Chris Baudouin, Jr" Date: Fri, 27 Nov 2020 17:04:32 -0500 Subject: [PATCH 4/6] Fixes ID issue --- app/views/doorkeeper/applications/show.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/doorkeeper/applications/show.html.haml b/app/views/doorkeeper/applications/show.html.haml index 103fd1dcf..dfe2b1f0b 100644 --- a/app/views/doorkeeper/applications/show.html.haml +++ b/app/views/doorkeeper/applications/show.html.haml @@ -10,12 +10,12 @@ %dt.col-md-4 = t('.application_id') %dd.col-md-8 - %code#application_id.bg-light + %code.bg-light = @application.uid %dt.col-md-4 = t('.secret') %dd.col-md-8 - %code#application_id.bg-light + %code.bg-light = flash[:application_secret].presence || @application.plaintext_secret %dt.col-md-4 = t('.scopes') From bdbfe0e4a0927035dbec0be3d95e9071f8e0ef7f Mon Sep 17 00:00:00 2001 From: "Chris Baudouin, Jr" Date: Sun, 29 Nov 2020 00:46:50 -0500 Subject: [PATCH 5/6] Fixes table link and sign out button --- app/assets/stylesheets/general/_header.sass | 1 + app/views/doorkeeper/applications/index.html.haml | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/general/_header.sass b/app/assets/stylesheets/general/_header.sass index 431a3124e..1c09b3269 100644 --- a/app/assets/stylesheets/general/_header.sass +++ b/app/assets/stylesheets/general/_header.sass @@ -31,6 +31,7 @@ $account-nav-padding-vert: 15px .header-nav.start justify-content: flex-start + flex-shrink: 2 .header-nav.end justify-content: flex-end diff --git a/app/views/doorkeeper/applications/index.html.haml b/app/views/doorkeeper/applications/index.html.haml index c7369f766..d856aa59e 100644 --- a/app/views/doorkeeper/applications/index.html.haml +++ b/app/views/doorkeeper/applications/index.html.haml @@ -5,6 +5,7 @@ %table.table.table-striped.table-hover %thead %tr + %th %th = t(:name, scope: 'doorkeeper.applications.index') %th @@ -16,9 +17,11 @@ %tbody - @applications.each do |application| %tr + %td + = link_to(''.html_safe, oauth_application_path(application)) %td %strong - = link_to(application.name, oauth_application_path(application)) + = application.name %td = simple_format(application.redirect_uri) %td From 308b47c2db9d70f5faf79dee49a5e5b2ff786d67 Mon Sep 17 00:00:00 2001 From: "Chris Baudouin, Jr" Date: Sun, 29 Nov 2020 00:49:40 -0500 Subject: [PATCH 6/6] Peter's wishes --- app/assets/stylesheets/forms/_forms.sass | 1 - .../_delete_form.html.erb | 4 ---- .../authorized_applications/index.html.erb | 24 ------------------- config/application.rb | 3 --- 4 files changed, 32 deletions(-) delete mode 100644 app/views/doorkeeper/authorized_applications/_delete_form.html.erb delete mode 100644 app/views/doorkeeper/authorized_applications/index.html.erb diff --git a/app/assets/stylesheets/forms/_forms.sass b/app/assets/stylesheets/forms/_forms.sass index c2330724c..ad14b353a 100644 --- a/app/assets/stylesheets/forms/_forms.sass +++ b/app/assets/stylesheets/forms/_forms.sass @@ -94,7 +94,6 @@ hr .actions display: flex justify-content: flex-end - wid .input flex: 1 1 600px diff --git a/app/views/doorkeeper/authorized_applications/_delete_form.html.erb b/app/views/doorkeeper/authorized_applications/_delete_form.html.erb deleted file mode 100644 index 512e8ece3..000000000 --- a/app/views/doorkeeper/authorized_applications/_delete_form.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<%- submit_btn_css ||= 'btn btn-link' %> -<%= form_tag oauth_authorized_application_path(application), method: :delete do %> - <%= submit_tag t('doorkeeper.authorized_applications.buttons.revoke'), onclick: "return confirm('#{ t('doorkeeper.authorized_applications.confirmations.revoke') }')", class: submit_btn_css %> -<% end %> diff --git a/app/views/doorkeeper/authorized_applications/index.html.erb b/app/views/doorkeeper/authorized_applications/index.html.erb deleted file mode 100644 index a3f5aaac3..000000000 --- a/app/views/doorkeeper/authorized_applications/index.html.erb +++ /dev/null @@ -1,24 +0,0 @@ - - -
- - - - - - - - - - <% @applications.each do |application| %> - - - - - - <% end %> - -
<%= t('doorkeeper.authorized_applications.index.application') %><%= t('doorkeeper.authorized_applications.index.created_at') %>
<%= application.name %><%= application.created_at.strftime(t('doorkeeper.authorized_applications.index.date_format')) %><%= render 'delete_form', application: application %>
-
diff --git a/config/application.rb b/config/application.rb index e84a78d7d..227114d96 100644 --- a/config/application.rb +++ b/config/application.rb @@ -28,9 +28,6 @@ class Application < Rails::Application # Only Applications list Doorkeeper::ApplicationsController.layout "manage/application" - # Only Authorization endpoint - # Doorkeeper::AuthorizationsController.layout "application" - # Only Authorized Applications Doorkeeper::AuthorizedApplicationsController.layout "application" end