Skip to content

Resolve "Sampleviewer with dates will not work"

Closes #519 (closed)

This MR fixes few issues and changes the way the renderers are defined. It allows to have intervals that makes it clearer how to define the different renderers. Example:

export const sampleViewers: SampleViewerDefinition[] = [
  {
    beamline: /^(ID23.*|ID30.*)$/,
    component: (props: any) => (
      <RemoteComponent component={MXSampleViewer} {...props} />
    ),
  },
  {
    startDate: '01/01/2024',
    endDate: '29/04/2024',
    beamline: /.*/,
    component: (props: any) => (
      <>Sample viewer with startDate 01/01/2024 and endDate '29/04/2024'</>
    ),
  },
  {
    startDate: '30/04/2024',
    beamline: /.*/,
    component: (props: any) => <>Sample viewer starting from 30/04/2024</>,
  },
  {
    beamline: /.*/,
    component: (props: any) => <GenericSampleViewer {...props} />,
  },
];
Edited by Alejandro De Maria Antolinos

Merge request reports

Loading