renovatebot / app-support

Discussion/support issues for the hosted Renovate App
0 stars 0 forks source link

[Dashboard] Collapsable organisations #78

Closed viceice closed 3 years ago

viceice commented 4 years ago

It would be nicht to collapse the orgs on the left as they can grow. So the list is getting pretty big 🙃

Sample Tampermonkey helper. https://github.com/viceice/UserScripts/blob/ba0b24bc9679dfbd6b93c0a334a38f4042c2455d/Renovate.Dashboard.js#L1

viceice commented 4 years ago

image

rarkins commented 4 years ago

Is that a mockup? Maybe with > ^ types? Default to collapsed for all, or only if > a certain number of repos?

viceice commented 4 years ago

it's just a small piece of javascript hooked into dashboard

(function () {
  "use strict";

  function toggle($tgt, mode) {
    $tgt.next().nextUntil(":not(.repo-item)").toggle(mode);
  }

  try {
    $(document).on("click", "#sidebarList > .nav-item", (e) => {
      const $tgt = $(e.target).parent();
      if ($tgt.is(".repo-item")) {
        return;
      }
      toggle($tgt, "slow");
    });

    const bkp_generateSidebarLists = generateSidebarLists;

    generateSidebarLists = (...args) => {
      bkp_generateSidebarLists(...args);
      let orgs = $("#sidebarList > .nav-item").not(".repo-item");
      if (hashState && hashState.owner) {
        orgs = orgs.filter(
          (_i, e) => $(e).find("a").data("owner") !== hashState.owner
        );
      }
      toggle(orgs, "fast");
    };
  } catch (e) {
    console.error(`unexpected error`, e);
  }
})();
viceice commented 4 years ago

on load it closes all orgs (if not active)

rarkins commented 3 years ago

I'm going to archive this repository so that we have conversations in one place. Therefore please create an "App Support" discussion here if this problem or suggestion is still relevant: https://github.com/renovatebot/renovate/discussions