client/public/elements/pages/grant/rp-page-grant.js
/**
   * @method _doMainQuery
   * @param {String} id - The grant id of this page.
   * @description Retrieves the grant from the id given and saves in this.grant array
   * Called on AppStateUpdate
   * 

   * @returns {Promise} AppStateModel
   */
@method _doMainQuery
@param {String} id - The grant id of this page.
@description Retrieves the grant from the id given and saves in this.grant array
Called on AppStateUpdate


@method _doMainQuery @param { String } id - The grant id of this page . @description Retrieves the grant from the id given and saves in this . grant array Called on AppStateUpdate
async _doMainQuery(id){
    let data = await this.GrantModel.getGrant(id);
    this.grantStatus = data.state;
    if( data.state === 'error' ) {
      return this.AppStateModel.show404Page(data);
    }
    if (data.state != 'loaded') {
      return false;
    }
    this.grant = data.payload;
    if (config.verbose) console.log("grant payload:", data);
    let admin = await this.GrantModel.getAdminRole(this.grant.relates);
    this.admin = admin ? admin.label : this.emptyValue;
    this.grantType = this._getGrantType();
    return false;
  }
async _doMainQuery ( id ) { let data = await this . GrantModel . getGrant ( id ) ; this . grantStatus = data . state ; if ( data . state === 'error' ) { return this . AppStateModel . show404Page ( data ) ; } if ( data . state != 'loaded' ) { return false ; } this . grant = data . payload ; if ( config . verbose ) console . log ( "grant payload:" , data ) ; let admin = await this . GrantModel . getAdminRole ( this . grant . relates ) ; this . admin = admin ? admin . label : this . emptyValue ; this . grantType = this . _getGrantType ( ) ; return false ; }
@method _doMainQuery
 @param {String} id - The grant id of this page.
@method _doMainQuery @param { String } id - The grant id of this page .
// Gets the relate Ids from gran and checks to make sure inheresIn has it with the // ["@id"] or the item itself has ["@id"] then filters if item has ucdrp // this.role = this.grant.relates[0]["@id"].split("/")[0].split(":")[1]; // let relateIds = this.grant.relates //   .map(item => item.inheresIn ? item.inheresIn["@id"] : item["@id"] ) //   .filter(item => item.match(/^ucdrp:/)); // // set is created from the related IDs array and  // relateIds = Array.from(new Set(relateIds)); // this.contributors = rdfUtils.asArray((await this.GrantModel.getContributors(this.grant["@id"], relateIds)).payload);