How to use the babel/actions/AppActions.displayMainError function in babel

To help you get started, we’ve selected a few babel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Esri / storymap-crowdsource / src / app / controllers / user / User.babel.js View on Github external
if (lang.getObject('appState.user.contributor',false,this) !== userPermissions.contributor || lang.getObject('appState.user.editor',false,this) !== userPermissions.editor || lang.getObject('appState.user.publisher',false,this) !== userPermissions.publisher) {
      UserActions.authenticateUser(userPermissions);
    } else if (settings.forceAuthenticate) {
      UserActions.authenticateUser(userPermissions);
    }

    if (!this.authorizedOwnersChecked && !$.isArray(authorizedOwners) || authorizedOwners.length === 0) {
      this.authorizedOwnersChecked = true;
      AppActions.displayMainError(viewerText.errors.loading.unspecifiedConfigOwner);
    } else if (!this.authorizedOwnersChecked && lang.getObject('appState.mode.isBuilder',false,this) && portalUser && authorizedOwners.indexOf(portalUser) === -1 && authorizedOwners.indexOf('*')) {
      this.authorizedOwnersChecked = true;
      AppActions.displayMainError(viewerText.errors.loading.invalidConfigOwner);
    } else if (!this.authorizedOwnersChecked && appOwner && authorizedOwners.indexOf(appOwner) === -1 && authorizedOwners.indexOf('*')) {
      this.authorizedOwnersChecked = true;
      AppActions.displayMainError(viewerText.errors.loading.invalidConfigOwner);
    }
  }
github Esri / storymap-crowdsource / src / app / components / map / WebmapController.babel.js View on Github external
$.each(errors, function() {
        if (this.toString().search('You do not have access') > -1) {
          AppActions.displayMainError(viewerText.errors.loading.notAuthorizedLayers);
        }
        _onError(this);
      });
    }
github Esri / storymap-crowdsource / src / app / controllers / user / User.babel.js View on Github external
if (settings.guestContributor) {
      userPermissions.contributor = true;
    }

    if (lang.getObject('appState.user.contributor',false,this) !== userPermissions.contributor || lang.getObject('appState.user.editor',false,this) !== userPermissions.editor || lang.getObject('appState.user.publisher',false,this) !== userPermissions.publisher) {
      UserActions.authenticateUser(userPermissions);
    } else if (settings.forceAuthenticate) {
      UserActions.authenticateUser(userPermissions);
    }

    if (!this.authorizedOwnersChecked && !$.isArray(authorizedOwners) || authorizedOwners.length === 0) {
      this.authorizedOwnersChecked = true;
      AppActions.displayMainError(viewerText.errors.loading.unspecifiedConfigOwner);
    } else if (!this.authorizedOwnersChecked && lang.getObject('appState.mode.isBuilder',false,this) && portalUser && authorizedOwners.indexOf(portalUser) === -1 && authorizedOwners.indexOf('*')) {
      this.authorizedOwnersChecked = true;
      AppActions.displayMainError(viewerText.errors.loading.invalidConfigOwner);
    } else if (!this.authorizedOwnersChecked && appOwner && authorizedOwners.indexOf(appOwner) === -1 && authorizedOwners.indexOf('*')) {
      this.authorizedOwnersChecked = true;
      AppActions.displayMainError(viewerText.errors.loading.invalidConfigOwner);
    }
  }
github Esri / storymap-crowdsource / src / app / utils / arcgis / items / Item.babel.js View on Github external
});
        } else if (!res.values.settings && !builderText) {
          const newUrl = new URI(window.location.href);

          newUrl.addSearch('edit');
          window.history.replaceState({},null,newUrl.href());
          window.location.reload();
        }
        response.data = res;
        checkUserLogin().then(getItem);
      } else if (settings.item === 'webmap' && res.version) {
        response.data = res;
        checkUserLogin().then(getItem);
      } else {
        if (settings.item === 'app') {
          AppActions.displayMainError(viewerText.errors.loading.appLoadingFail);
        }
        _onError(res);
        deferred.reject(res);
      }
    },(err) => {
      onError(err);
github Esri / storymap-crowdsource / src / app / controllers / fromScratch / StoryCreator.babel.js View on Github external
},(err) => {
      AppActions.displayMainError(builderText.errors.scratchCreation.unknown);
      _onError(err);
    });
  }
github Esri / storymap-crowdsource / src / app / controllers / user / User.babel.js View on Github external
userPermissions.contributor = true;
    }

    if (settings.guestContributor) {
      userPermissions.contributor = true;
    }

    if (lang.getObject('appState.user.contributor',false,this) !== userPermissions.contributor || lang.getObject('appState.user.editor',false,this) !== userPermissions.editor || lang.getObject('appState.user.publisher',false,this) !== userPermissions.publisher) {
      UserActions.authenticateUser(userPermissions);
    } else if (settings.forceAuthenticate) {
      UserActions.authenticateUser(userPermissions);
    }

    if (!this.authorizedOwnersChecked && !$.isArray(authorizedOwners) || authorizedOwners.length === 0) {
      this.authorizedOwnersChecked = true;
      AppActions.displayMainError(viewerText.errors.loading.unspecifiedConfigOwner);
    } else if (!this.authorizedOwnersChecked && lang.getObject('appState.mode.isBuilder',false,this) && portalUser && authorizedOwners.indexOf(portalUser) === -1 && authorizedOwners.indexOf('*')) {
      this.authorizedOwnersChecked = true;
      AppActions.displayMainError(viewerText.errors.loading.invalidConfigOwner);
    } else if (!this.authorizedOwnersChecked && appOwner && authorizedOwners.indexOf(appOwner) === -1 && authorizedOwners.indexOf('*')) {
      this.authorizedOwnersChecked = true;
      AppActions.displayMainError(viewerText.errors.loading.invalidConfigOwner);
    }
  }
github Esri / storymap-crowdsource / src / app / utils / arcgis / items / Item.babel.js View on Github external
const onError = function(err) {
    if (settings.item === 'app') {
      if (err.toString().search('You do not have access') > -1) {
        AppActions.displayMainError(viewerText.errors.loading.notAuthorizedApp);
      } else if (err.toString().search('Item does not exist or is inaccessible') > -1) {
        AppActions.displayMainError(viewerText.errors.loading.inaccessibleApp);
      } else {
        AppActions.displayMainError(viewerText.errors.loading.appLoadingFail);
      }
    }
    _onError(err);
  };
github Esri / storymap-crowdsource / src / app / components / map / CrowdsourceWebmapController.babel.js View on Github external
};

        map.setClusterLayerQueryWhere = function (where) {
          clusterLayer._where = where || '1=1';
          MapActions.updateFeaturesInExtent([]);
          map.refreshCrowdsourceLayer();
        };

      } else if (layer)  {
        _onError('Layer ' + this._settings.crowdsourceLayer.id + ' does not exist in map.');
      }
    } else if (window.app.mode.fromScratch) {
      this.onLoad();
    } else {
      _onError('Crowdsource layer not found. Check layer ID and make sure you have permission to access the feature layer.');
      AppActions.displayMainError(viewerText.errors.loading.crowdsourceLayerNotFound);
    }
  }
github Esri / storymap-crowdsource / src / app / components / map / WebmapController.babel.js View on Github external
},(error) => {
        this._errorWebmapId = this._settings.webmap;
        if (error.toString().search('You do not have access') > -1) {
          AppActions.displayMainError(viewerText.errors.loading.notAuthorizedMap);
        }
        _onError(error);
      });
    }