How to use the ember-flexberry-data/query/predicate.SimplePredicate function in ember-flexberry-data

To help you get started, we’ve selected a few ember-flexberry-data 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 Flexberry / ember-flexberry-designer / addon / utils / fd-preload-stage-metadata.js View on Github external
all(promises).then(() => {
      let readonlyModeService = getOwner(store).lookup('service:fd-readonly-mode-service');
      if (readonlyModeService.getReadonlyModeProject()) {
        return resolve();
      }

      let userService = getOwner(store).lookup('service:user');
      let userName = userService.getCurrentUserName();
      let lockModelName = 'new-platform-flexberry-services-lock';

      let lockPredicate = new SimplePredicate('userName', FilterOperator.Eq, userName);
      let q = new Builder(store, lockModelName)
        .selectByProjection('LockL')
        .where(lockPredicate)
        .build();

      // delete locks for objects in current stage for current user.
      store.query(lockModelName, q).then((lockObjects) => {
        let deleteLocksPromises = [];
        lockObjects.forEach((item) => {
          let needToDeleteLock = tryPeekRecord(store, 'fd-dev-class', item.get('id'), stagePk) ||
            tryPeekRecord(store, 'fd-dev-association', item.get('id'), stagePk) ||
            tryPeekRecord(store, 'fd-dev-aggregation', item.get('id'), stagePk) ||
            tryPeekRecord(store, 'fd-dev-inheritance', item.get('id'), stagePk);

          if (needToDeleteLock) {
            deleteLocksPromises.push(item.destroyRecord());
github Flexberry / ember-flexberry-designer / addon / routes / fd-view-list-form.js View on Github external
beforeModel: function(transition) {
    let classId = transition.queryParams.classId;
    if (!isNone(classId)) {
      let queryPredicate = new SimplePredicate('class', '==', classId);
      this.set('_queryPredicate', queryPredicate);
    }
  },
github Flexberry / ember-flexberry-designer / addon / routes / fd-diagram-list-form.js View on Github external
objectListViewLimitPredicate() {
    let stage = this.get('currentContext').getCurrentStage();
    let spStage = new SimplePredicate('subsystem.stage', 'eq', stage);

    let iopDiagrams = Ember.A();
    iopDiagrams.pushObject(new IsOfPredicate('fd-dev-uml-ad'));
    iopDiagrams.pushObject(new IsOfPredicate('fd-dev-uml-cad'));
    iopDiagrams.pushObject(new IsOfPredicate('fd-dev-uml-cod'));
    iopDiagrams.pushObject(new IsOfPredicate('fd-dev-uml-dpd'));
    iopDiagrams.pushObject(new IsOfPredicate('fd-dev-uml-sd'));
    iopDiagrams.pushObject(new IsOfPredicate('fd-dev-uml-std'));
    iopDiagrams.pushObject(new IsOfPredicate('fd-dev-uml-ucd'));
    let cpDiagrams = new ComplexPredicate(Condition.Or, ...iopDiagrams);

    return new ComplexPredicate(Condition.And, spStage, cpDiagrams);
  },
});