Skip to content
This repository has been archived by the owner on Dec 23, 2019. It is now read-only.

Commit

Permalink
feat(Line - Contact): Add bulk action to contact edit - review
Browse files Browse the repository at this point in the history
  • Loading branch information
feoche committed Dec 21, 2017
1 parent 87e7ed1 commit 7747070
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,18 @@ angular.module("managerApp").controller("TelecomTelephonyServiceContactCtrl", fu

function init () {
self.isLoading = true;
self.isBulkLoading = true;
self.isEditing = false;
self.wayNumberExtraEnum = [
"bis", "ter", "quater", "quinquies", "sexto", "septimo", "octimo", "nono",
"A", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "S", "U", "V",
"W", "X", "Y", "Z"
];
self.directoryCodes = null;
return fetchDirectory().then(function (directory) {
self.directory = directory;
return $q.all({
infos: OvhApiTelephony.Lexi().schema().$promise,
directory: fetchDirectory()
}).then(function (res) {
self.directory = res.directory;
self.directoryForm = angular.copy(self.directory);
self.cityList = [{ name: self.directory.city }];
self.onPostCodeChange();
Expand All @@ -43,14 +45,12 @@ angular.module("managerApp").controller("TelecomTelephonyServiceContactCtrl", fu
self.directoryCodes = result;
});
}

self.directoryProperties = _.get(res.infos, "models['telephony.DirectoryInfo'].properties");
return null;
}).catch(function (err) {
return new ToastError(err);
}).finally(function () {
OvhApiTelephony.Lexi().schema({}, {}).$promise.then(function (infos) {
self.directoryProperties = _.get(infos, "models['telephony.DirectoryInfo'].properties");
self.isBulkLoading = false;
});
self.isLoading = false;
});
}
Expand Down Expand Up @@ -124,7 +124,7 @@ angular.module("managerApp").controller("TelecomTelephonyServiceContactCtrl", fu
};

self.getBulkParams = function () {
return _.pick(self.directory, function (value, key) {
return _.pick(self.directoryForm, function (value, key) {
return _.get(self.directoryProperties, [key, "readOnly"]) === 0;
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,10 +720,9 @@
<telephony-bulk-action data-billing-account="{{ ServiceContactCtrl.bulkDatas.billingAccount }}"
data-service-name="{{ ServiceContactCtrl.bulkDatas.serviceName }}"
data-custom-class="link d-block pl-0 mb-3"
data-ng-disabled="ServiceContactCtrl.isBulkLoading"
data-ng-disabled="ServiceContactCtrl.isLoading"
data-bulk-infos="ServiceContactCtrl.bulkDatas.infos"
data-get-bulk-params="ServiceContactCtrl.getBulkParams"
data-on-open="ServiceContactCtrl.applyChanges()"
data-on-success="ServiceContactCtrl.onBulkSuccess"
data-on-error="ServiceContactCtrl.onBulkError">
</telephony-bulk-action>
Expand Down

0 comments on commit 7747070

Please sign in to comment.