Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ angular.module('virtoCommerce.dynamicAssociationsModule')
blade.headIcon = 'fa fa-area-chart';
var formScope;
$scope.setForm = (form) => { formScope = form; };
$scope.storeDataSource = (criteria) => stores.search(criteria);

$scope.isValid = function() {
return formScope && formScope.$valid;
Expand All @@ -19,18 +20,17 @@ angular.module('virtoCommerce.dynamicAssociationsModule')
}
});

stores.query({}, response => {
$scope.stores = response;
if (parentRefresh) {
blade.parentBlade.refresh();
}
blade.isLoading = false;
});
if (parentRefresh) {
blade.parentBlade.refresh();
}
blade.isLoading = false;

blade.currentEntity = angular.copy(blade.originalEntity);
};

$scope.onStoreSelected = ($item) => blade.currentEntity.catalogId = $item.catalog;
$scope.onStoreSelected = (item) => {
blade.currentEntity.catalogId = item.catalog;
};

// datepicker
$scope.datepickers = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
<div class="form-group __info list">
<label class="form-label">{{ 'dynamicAssociations.blades.dynamicAssociation-parameters.labels.store' | translate }}</label>
<div class="form-input">
<ui-select ng-model="blade.currentEntity.storeId" required on-select="onStoreSelected($item)">
<ui-select-match placeholder="{{'dynamicAssociations.blades.dynamicAssociation-parameters.placeholders.store' | translate}}">{{$select.selected.name}}</ui-select-match>
<ui-select-choices repeat="x.id as x in stores">
<span ng-bind-html="x.name | highlight: $select.search"></span>
</ui-select-choices>
</ui-select>
<ui-scroll-drop-down data="storeDataSource(criteria)"
required
on-select="onStoreSelected(item)"
placeholder="'dynamicAssociations.blades.dynamicAssociation-parameters.placeholders.store'"
ng-model="blade.currentEntity.storeId">
</ui-scroll-drop-down>
</div>
<div class="list-descr">{{ 'dynamicAssociations.blades.dynamicAssociation-parameters.descriptions.store' | translate }}</div>
</div>
Expand Down
Loading