Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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());
beforeModel: function(transition) {
let classId = transition.queryParams.classId;
if (!isNone(classId)) {
let queryPredicate = new SimplePredicate('class', '==', classId);
this.set('_queryPredicate', queryPredicate);
}
},
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);
},
});