function onSubmit()

in src/main/resources/static/find-owners.js [665:697]


  function onSubmit(change, revision) {
    // onShowChangePolyGerrit is always called after all plugins are loaded.
    // However, onSubmit can be called earlier (thought it is unlikely) and
    // lastChangeInfo can be null.
    if(lastChangeInfo && lastChangeInfo.ownerPlugin === 'code-owners') {
      return true;
    }
    const OWNER_REVIEW_LABEL = 'Owner-Review-Vote';
    if (change.labels.hasOwnProperty(OWNER_REVIEW_LABEL)) {
      if(lastChangeInfo && lastChangeInfo.ownerPlugin === 'find-owners') {
        popupFindOwnersPage(null, change, revision, true);
      } else {
        // Usually, the api returns required config very fast, so this is
        // a very rare when user will see this message.
        document.dispatchEvent(
            new CustomEvent('show-error', {
              detail: {
                message:
                  'Some requests to code-owners are still in progress, ' +
                  'please try to submit again in a few seconds.\n' +
                  'The host has both find-owners and code-owners plugin enabled.' +
                  'The Submit is not possible until requests are completed. ',
                composed: true,
                bubbles: true,
              }
            }
          )
        );
      }
      return false;
    }
    return true;  // Okay to submit.
  }