Unverified Commit d78a7330 authored by Aysam Guerler's avatar Aysam Guerler Committed by GitHub
Browse files

Merge pull request #11748 from dannon/new-history-default

Allow site-specific history default, leave fallback option to legacy
parents 726eb76b ec8bd0e9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ on:
    - cron: '0 0 * * 2'
env:
  GALAXY_CONFIG_GALAXY_URL_PREFIX: '/galaxypf'
  GALAXY_CONFIG_USE_LEGACY_HISTORY: false
  GALAXY_TEST_DBURI: 'postgresql://postgres:postgres@localhost:5432/galaxy?client_encoding=utf8'
  GALAXY_TEST_RAISE_EXCEPTION_ON_HISTORYLESS_HDA: '1'
  GALAXY_TEST_SELENIUM_RETRIES: 1
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ import { buildCollectionModal } from "./buildCollectionModal";
import { createDatasetCollection } from "components/History/model/queries";

// extend existing current history panel
export default class HistoryPanelProxy {
export class HistoryPanelProxy {
    constructor() {
        const Galaxy = getGalaxyInstance();
        Galaxy.currHistoryPanel = this;
+13 −5
Original line number Diff line number Diff line
export const isBetaHistoryOpen = () => {
    return sessionStorage.getItem("useBetaHistory");
const USE_LEGACY_HISTORY_STORAGE_KEY = "useLegacyHistory";

export const shouldUseLegacyHistory = (instanceDefaultUseLegacyHistory) => {
    // If there's a value set, respect it.  Otherwise get instance default from config.
    const userPrefLegacyHistory = sessionStorage.getItem(USE_LEGACY_HISTORY_STORAGE_KEY);
    if (userPrefLegacyHistory != null) {
        return userPrefLegacyHistory === "1";
    } else {
        return instanceDefaultUseLegacyHistory;
    }
};

export const switchToLegacyHistoryPanel = () => {
    sessionStorage.removeItem("useBetaHistory");
    sessionStorage.setItem(USE_LEGACY_HISTORY_STORAGE_KEY, 1);
    location.reload();
};

export const switchToBetaHistoryPanel = () => {
    sessionStorage.setItem("useBetaHistory", 1);
    location.reload(false);
    sessionStorage.setItem(USE_LEGACY_HISTORY_STORAGE_KEY, 0);
    location.reload();
};
+8 −3
Original line number Diff line number Diff line
@@ -5,12 +5,17 @@ import MvcHistoryPanel from "entry/panels/history-panel";
import Page from "layout/page";

// Vue adapter emulates current features of backbone history panel
import HistoryPanelProxy from "components/History/adapters/HistoryPanelProxy";
import { isBetaHistoryOpen } from "components/History/adapters/betaToggle";
import { HistoryPanelProxy } from "components/History/adapters/HistoryPanelProxy";
import { shouldUseLegacyHistory } from "components/History/adapters/betaToggle";

addInitialization((Galaxy, { options = {} }) => {
    console.log("Analysis custom page setup");
    const HistoryPanel = isBetaHistoryOpen() ? HistoryPanelProxy : MvcHistoryPanel;

    // Handle beta history panel
    // Need to mock Galaxy.currHistoryPanel
    // pass config through for defaults
    const HistoryPanel = shouldUseLegacyHistory(Galaxy.config.use_legacy_history) ? MvcHistoryPanel : HistoryPanelProxy;

    const pageOptions = Object.assign({}, options, {
        config: Object.assign({}, options.config, {
            hide_panels: Galaxy.params.hide_panels,
+22 −2
Original line number Diff line number Diff line
@@ -1879,6 +1879,18 @@
:Type: str


~~~~~~~~~~~~~~~~~~~~~~
``use_legacy_history``
~~~~~~~~~~~~~~~~~~~~~~

:Description:
    Server-wide default selection to use the legacy history during the
    transition period, after which this option will disappear.  Users
    will remain able to swap back and forth per their preference.
:Default: ``false``
:Type: bool


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``user_preferences_extra_conf_path``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -3720,8 +3732,13 @@
:Description:
    When the simplified workflow run form is rendered, should the
    invocation outputs be sent to the 'current' history or a 'new'
    history.
:Default: ``current``
    history. If the user should be presented and option between these
    - set this to 'prefer_current' or 'prefer_new' to display a
    runtime setting with the corresponding default. The default is to
    provide the user this option and default it to the current history
    (the traditional behavior of Galaxy for years) - this corresponds
    to the setting 'prefer_current'.
:Default: ``prefer_current``
:Type: str


@@ -4795,3 +4812,6 @@
    Display built-in converters in the tool panel.
:Default: ``true``
:Type: bool


Loading