extensions/xnat/src/components/XNATNavigationPanel.js
/**
   * componentDidMount - On mounting, fetch a list of available projects from XNAT.
   *
   * @returns {type}  description
   */
On mounting, fetch a list of available projects from XNAT.
@returns {type}  description
On mounting fetch a list of available projects from XNAT . @returns { type } description
componentDidMount() {
    fetchJSON('data/archive/projects/?format=json')
      .promise.then(result => {
        if (!result) {
          return;
        }
        const otherProjects = result.ResultSet.Result;
        const activeProjectId = sessionMap.getProject();
        const thisProjectIndex = otherProjects.findIndex(
          element => element.ID === activeProjectId
        );
        const activeProjects = otherProjects.splice(thisProjectIndex, 1);
        otherProjects.sort((a, b) => compareOnProperty(a, b, 'name'));
        this.setState({
          activeProjects,
          otherProjects,
        });
      })
      .catch(err => console.log(err));
  }
componentDidMount ( ) { fetchJSON ( 'data/archive/projects/?format=json' ) . promise . then ( result => { if ( ! result ) { return ; } const otherProjects = result . ResultSet . Result ; const activeProjectId = sessionMap . getProject ( ) ; const thisProjectIndex = otherProjects . findIndex ( element => element . ID === activeProjectId ) ; const activeProjects = otherProjects . splice ( thisProjectIndex , 1 ) ; otherProjects . sort ( ( a , b ) => compareOnProperty ( a , b , 'name' ) ) ; this . setState ( { activeProjects , otherProjects , } ) ; } ) . catch ( err => console . log ( err ) ) ; }
componentDidMount - On mounting, fetch a list of available projects from XNAT.
componentDidMount - On mounting fetch a list of available projects from XNAT .