Config recently_used_apps widget to NOT skip form?

I’d like to use the recently_used_apps widget but think I should only implement it if I can modify it so that the tiles link to the bespoke forms (instead of copying their last resource request).

A large contingent of our userbase are novice users who tend to have varying needs from job to job, and I’d like them to have to consider their resource requests before launching a given app. Is this functionality something that I can “hack in” by overriding the page using some judicious modding of the widget view? (Or maybe through an initializer?)

Thanks!
jason

Looks like one can, and I’ll post the receipts here because I’m surprised this doesn’t have an admin-friendly config to control it. There’s probably a much cleaner way to do it, but my Ruby skills are minimal.

The whole process:

  1. if you don’t already have it, create: /etc/ood/config/apps/dashboard/views/widgets/
  2. copy the code below into /etc/ood/config/apps/dashboard/views/widgets/_recently_used_apps.html.erb (Note: this will override the code in /var/www/ood/apps/sys/dashboard/app/views/widgets/_recently_used_apps.html.erb per the page-override docs)
  3. Consider customizing the HTML wrapped around the title
  4. Develop > Restart Web Server (on your instance – or reopen browser)
$ cat /etc/ood/config/apps/dashboard/views/widgets/_recently_used_apps.html.erb
<%- apps = recently_used_apps -%>
<%- unless apps.empty? -%>
  <div class="recently-used-apps-header">
    <!--
      <h4 class="apps-section-header-blue"><%= t('dashboard.recently_used_apps_title') %></h4>
      ## NOTE: the pinned_apps app uses this totally diff visual style:
      <h2>Pinned apps <small></small></h2>
    -->
    <h2><%= t('dashboard.recently_used_apps_title') %> NEW</h2>
    <div class="row">
    <%- apps.each do |app| -%>
      <%- link = app.link -%>
      <%- tile_data = link.tile -%>
      <div class="col-sm-3 col-md-3 app-launcher-container">
        <div class="app-launcher app-launcher-hover" data-bs-toggle="launcher-button">
          <%= button_to(
                new_batch_connect_session_context_path(token: app.token),
                method: :get,
                class: ['launcher-click', tile_data[:border_color]],
                title: (displayable_settings?(app)? 'Parameters' : nil),
                data: { bs_content: recent_settings(app), bs_toggle: 'popover', bs_placement: 'bottom', bs_html: 'true', bs_trigger: 'hover focus' }
              ) do %>
            <%= render partial: "/widgets/pinned_apps/app_content", locals: { link: link } %>

          <% end %>
        </div>
      </div>
    <%- end -%>
    </div>
  </div>
<%- end -%>

Regarding point#3 above – Devs, am I doing something wrong to make the visual language different between pinned_apps and recently_used_apps header-titles? It seems weird that they wouldn’t match. But then again, the motd widget uses still another variation (h2+hr) so maybe it’s just up to us to tweak until our finicky hearts are content.

Yea sorry there’s no real way to do this other than through Pinned apps which I see you already have.

I’ll have to take a look at the headers issue.

That said - I created Recently used apps without presets · Issue #5659 · OSC/ondemand · GitHub upstream for this feature.

Ah thank you for that!

BTW I think I better-understand the headers issue:

The default recently_used_apps header matches the headers for the GROUPS under pinned_apps.

Though, if a site uses groupings for pinned_apps, then they’ll be left with a “Pinned Apps” title that doesn’t match the default white-on-blue-bar style for “Recently Used Apps”.

I’m guessing that maybe most sites that use grouping must then disable the “pinned_apps_title” through localization, per the “Customize Text in OnDemand” customization section? For others’ convenience:

# /etc/ood/config/locales/en.yml
en:
  dashboard:
    pinned_apps_title: "Pinned Apps"
    pinned_apps_caption_html: ""
    #pinned_apps_caption_html: A featured subset of <a href="%{all_apps_url}">all available apps</a>
    recently_used_apps_title: "Recently Used Apps"