upsertHandler(e) {
    // prevent default used to stop form submission to iframe
    e.preventDefault();

    const { entityDetails, document } = this.state;
    const isValid = validateSlo(document);

    if (!isValid) {
      // eslint-disable-next-line no-alert
      alert(
        'Problem with SLO definition! Please validate you have an SLO Name, Group, and Target defined. Also ensure your Error Budget includes at least one transaction and one defect, or your Alert driven SLO includes an Alert.'
      );
      return;
    }

    // Merge in entityDetails
    const newDocument = {
      ...document,
      entityGuid: entityDetails.entityGuid,
      accountId: entityDetails.accountId,
      accountName: entityDetails.accountName,
      language: entityDetails.language,
      appName: entityDetails.appName
    };

    // write the document
    this.writeNewSloDocument(newDocument);
  }
/*
   * Handle user submission of a new SLO document
   */
Handle user submission of a new SLO document
Handle user submission of a new SLO document
upsertHandler(e) {
    e.preventDefault();
    const { entityDetails, document } = this.state;
    const isValid = validateSlo(document);
    if (!isValid) {
      alert(
        'Problem with SLO definition! Please validate you have an SLO Name, Group, and Target defined. Also ensure your Error Budget includes at least one transaction and one defect, or your Alert driven SLO includes an Alert.'
      );
      return;
    }
    const newDocument = {
      ...document,
      entityGuid: entityDetails.entityGuid,
      accountId: entityDetails.accountId,
      accountName: entityDetails.accountName,
      language: entityDetails.language,
      appName: entityDetails.appName
    };
    this.writeNewSloDocument(newDocument);
  }
upsertHandler ( e ) { e . preventDefault ( ) ; const { entityDetails , document } = this . state ; const isValid = validateSlo ( document ) ; if ( ! isValid ) { alert ( 'Problem with SLO definition! Please validate you have an SLO Name, Group, and Target defined. Also ensure your Error Budget includes at least one transaction and one defect, or your Alert driven SLO includes an Alert.' ) ; return ; } const newDocument = { ... document , entityGuid : entityDetails . entityGuid , accountId : entityDetails . accountId , accountName : entityDetails . accountName , language : entityDetails . language , appName : entityDetails . appName } ; this . writeNewSloDocument ( newDocument ) ; }
Handle user submission of a new SLO document
Handle user submission of a new SLO document
// prevent default used to stop form submission to iframe // eslint-disable-next-line no-alert // Merge in entityDetails // write the document