Merge branch '18368-notification-banner' into main
authorDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Fri, 10 Feb 2023 17:00:18 +0000 (18:00 +0100)
committerDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Fri, 10 Feb 2023 17:02:07 +0000 (18:02 +0100)
closes #18368

Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla@contractors.roche.com>

1  2 
src/common/config.ts
src/store/store.ts
src/views/workbench/workbench.tsx

index 9319736784b81676c6c15fe931e5136b806d985a,ff44e2efc8ef8cf67b6662f835bcb4576e4a786d..a6eabdadf9b8ae409f3fa234be59a9d1ce719f82
@@@ -28,82 -26,83 +28,94 @@@ export interface ClusterConfigJSON 
              Scheme: string
          }
      };
 -    Mail?: {
 -        SupportEmailAddress: string;
 +  Mail?: {
 +    SupportEmailAddress: string;
 +  };
 +  Services: {
 +    Controller: {
 +      ExternalURL: string;
      };
 -    Services: {
 -        Controller: {
 -            ExternalURL: string
 -        }
 -        Workbench1: {
 -            ExternalURL: string
 -        }
 -        Workbench2: {
 -            ExternalURL: string
 -        }
 -        Websocket: {
 -            ExternalURL: string
 -        }
 -        WebDAV: {
 -            ExternalURL: string
 -        },
 -        WebDAVDownload: {
 -            ExternalURL: string
 -        },
 -        WebShell: {
 -            ExternalURL: string
 -        }
 +    Workbench1: {
 +      ExternalURL: string;
 +    };
 +    Workbench2: {
 +      ExternalURL: string;
      };
 -        BannerUUID: string;
+     Workbench: {
+         DisableSharingURLsUI: boolean;
+         ArvadosDocsite: string;
+         FileViewersConfigURL: string;
+         WelcomePageHTML: string;
+         InactivePageHTML: string;
+         SSHHelpPageHTML: string;
+         SSHHelpHostSuffix: string;
+         SiteName: string;
+         IdleTimeout: string;
 -    Login: {
 -        LoginCluster: string;
 -        Google: {
 -            Enable: boolean;
 -        }
 -        LDAP: {
 -            Enable: boolean;
 -        }
 -        OpenIDConnect: {
 -            Enable: boolean;
 -        }
 -        PAM: {
 -            Enable: boolean;
 -        }
 -        SSO: {
 -            Enable: boolean;
 -        }
 -        Test: {
 -            Enable: boolean;
 -        }
+     };
 +    Websocket: {
 +      ExternalURL: string;
      };
 -    Collections: {
 -        ForwardSlashNameSubstitution: string;
 -        ManagedProperties?: {
 -            [key: string]: {
 -                Function: string,
 -                Value: string,
 -                Protected?: boolean,
 -            }
 -        },
 -        TrustAllContent: boolean
 +    WebDAV: {
 +      ExternalURL: string;
      };
 -    Volumes: {
 -        [key: string]: {
 -            StorageClasses: {
 -                [key: string]: boolean;
 -            }
 -        }
 +    WebDAVDownload: {
 +      ExternalURL: string;
 +    };
 +    WebShell: {
 +      ExternalURL: string;
 +    };
 +  };
 +  Workbench: {
 +    DisableSharingURLsUI: boolean;
 +    ArvadosDocsite: string;
 +    FileViewersConfigURL: string;
 +    WelcomePageHTML: string;
 +    InactivePageHTML: string;
 +    SSHHelpPageHTML: string;
 +    SSHHelpHostSuffix: string;
 +    SiteName: string;
 +    IdleTimeout: string;
++    BannerUUID: string;
 +  };
 +  Login: {
 +    LoginCluster: string;
 +    Google: {
 +      Enable: boolean;
 +    };
 +    LDAP: {
 +      Enable: boolean;
 +    };
 +    OpenIDConnect: {
 +      Enable: boolean;
 +    };
 +    PAM: {
 +      Enable: boolean;
 +    };
 +    SSO: {
 +      Enable: boolean;
 +    };
 +    Test: {
 +      Enable: boolean;
      };
 +  };
 +  Collections: {
 +    ForwardSlashNameSubstitution: string;
 +    ManagedProperties?: {
 +      [key: string]: {
 +        Function: string;
 +        Value: string;
 +        Protected?: boolean;
 +      };
 +    };
 +    TrustAllContent: boolean;
 +  };
 +  Volumes: {
 +    [key: string]: {
 +      StorageClasses: {
 +        [key: string]: boolean;
 +      };
 +    };
 +  };
  }
  
  export class Config {
@@@ -240,73 -219,66 +252,85 @@@ remove the entire ${varName} entry fro
  };
  
  // Maps remote cluster hosts and removes the default RemoteCluster entry
 -export const mapRemoteHosts = (clusterConfigJSON: ClusterConfigJSON, config: Config) => {
 -    config.remoteHosts = {};
 -    Object.keys(clusterConfigJSON.RemoteClusters).forEach(k => { config.remoteHosts[k] = clusterConfigJSON.RemoteClusters[k].Host; });
 -    delete config.remoteHosts["*"];
 +export const mapRemoteHosts = (
 +  clusterConfigJSON: ClusterConfigJSON,
 +  config: Config
 +) => {
 +  config.remoteHosts = {};
 +  Object.keys(clusterConfigJSON.RemoteClusters).forEach((k) => {
 +    config.remoteHosts[k] = clusterConfigJSON.RemoteClusters[k].Host;
 +  });
 +  delete config.remoteHosts['*'];
  };
  
 -export const mockClusterConfigJSON = (config: Partial<ClusterConfigJSON>): ClusterConfigJSON => ({
 -    API: {
 -        UnfreezeProjectRequiresAdmin: false,
 -    },
 -    ClusterID: "",
 -    RemoteClusters: {},
 -    Services: {
 -        Controller: { ExternalURL: "" },
 -        Workbench1: { ExternalURL: "" },
 -        Workbench2: { ExternalURL: "" },
 -        Websocket: { ExternalURL: "" },
 -        WebDAV: { ExternalURL: "" },
 -        WebDAVDownload: { ExternalURL: "" },
 -        WebShell: { ExternalURL: "" },
 -    },
 +export const mockClusterConfigJSON = (
 +  config: Partial<ClusterConfigJSON>
 +): ClusterConfigJSON => ({
 +  API: {
 +    UnfreezeProjectRequiresAdmin: false,
 +    MaxItemsPerResponse: 1000,
 +  },
 +  ClusterID: '',
 +  RemoteClusters: {},
 +  Services: {
 +    Controller: { ExternalURL: '' },
 +    Workbench1: { ExternalURL: '' },
 +    Workbench2: { ExternalURL: '' },
 +    Websocket: { ExternalURL: '' },
 +    WebDAV: { ExternalURL: '' },
 +    WebDAVDownload: { ExternalURL: '' },
 +    WebShell: { ExternalURL: '' },
+     Workbench: {
+         DisableSharingURLsUI: false,
+         ArvadosDocsite: "",
+         FileViewersConfigURL: "",
+         WelcomePageHTML: "",
+         InactivePageHTML: "",
+         SSHHelpPageHTML: "",
+         SSHHelpHostSuffix: "",
+         SiteName: "",
 -        IdleTimeout: "0s",
 -        BannerUUID: "",
++        IdleTimeout: "0s"
++    }
 +  },
 +  Workbench: {
 +    DisableSharingURLsUI: false,
 +    ArvadosDocsite: '',
 +    FileViewersConfigURL: '',
 +    WelcomePageHTML: '',
 +    InactivePageHTML: '',
 +    SSHHelpPageHTML: '',
 +    SSHHelpHostSuffix: '',
 +    SiteName: '',
 +    IdleTimeout: '0s',
++    BannerUUID: ""
 +  },
 +  Login: {
 +    LoginCluster: '',
 +    Google: {
 +      Enable: false,
 +    },
 +    LDAP: {
 +      Enable: false,
      },
 -    Login: {
 -        LoginCluster: "",
 -        Google: {
 -            Enable: false,
 -        },
 -        LDAP: {
 -            Enable: false,
 -        },
 -        OpenIDConnect: {
 -            Enable: false,
 -        },
 -        PAM: {
 -            Enable: false,
 -        },
 -        SSO: {
 -            Enable: false,
 -        },
 -        Test: {
 -            Enable: false,
 -        },
 +    OpenIDConnect: {
 +      Enable: false,
      },
 -    Collections: {
 -        ForwardSlashNameSubstitution: "",
 -        TrustAllContent: false,
 +    PAM: {
 +      Enable: false,
      },
 -    Volumes: {},
 -    ...config
 +    SSO: {
 +      Enable: false,
 +    },
 +    Test: {
 +      Enable: false,
 +    },
 +  },
 +  Collections: {
 +    ForwardSlashNameSubstitution: '',
 +    TrustAllContent: false,
 +  },
 +  Volumes: {},
 +  ...config,
  });
  
  export const mockConfig = (config: Partial<Config>): Config => ({
index 2057939e6812e79c1dd27b021591e645f89ff91e,899eb1cbaadd6d3da44fb752210e78f8256e36d0..4ef5e3d0e5c45d4bb29bcc8f701f701dd65d7af7
@@@ -74,7 -73,7 +74,8 @@@ import { ALL_PROCESSES_PANEL_ID } from 
  import { Config } from 'common/config';
  import { pluginConfig } from 'plugins';
  import { MiddlewareListReducer } from 'common/plugintypes';
 +import { sidePanelReducer } from './side-panel/side-panel-reducer'
+ import { bannerReducer } from './banner/banner-reducer';
  
  declare global {
      interface Window {
index 87f004b335693b7df95a32102415f2b7232b75be,b6ce07aebaf961c0c84f90051afef3432adf44bf..7103efd132a1b8e1ac149229d1fbcda0e7620a7f
@@@ -99,7 -99,7 +99,8 @@@ import { RestoreCollectionVersionDialo
  import { WebDavS3InfoDialog } from 'views-components/webdav-s3-dialog/webdav-s3-dialog';
  import { pluginConfig } from 'plugins';
  import { ElementListReducer } from 'common/plugintypes';
 +import { COLLAPSE_ICON_SIZE } from 'views-components/side-panel-toggle/side-panel-toggle'
+ import { Banner } from 'views-components/baner/banner';
  
  type CssRules = 'root' | 'container' | 'splitter' | 'asidePanel' | 'contentWrapper' | 'content';
  
@@@ -293,6 -271,7 +294,7 @@@ export const WorkbenchPanel 
              <VirtualMachineAttributesDialog />
              <FedLogin />
              <WebDavS3InfoDialog />
+             <Banner />
              {React.createElement(React.Fragment, null, pluginConfig.dialogs)}
 -        </Grid>
 +        </Grid>}
      );