client module refactors

This commit is contained in:
Carlos Jimenez Ruiz 2020-12-13 14:57:42 +01:00
parent c0289f87e9
commit 3ad6534160
11 changed files with 102 additions and 24 deletions

View File

@ -71,7 +71,14 @@
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit label="Save"></vn-submit>
<vn-button label="Undo changes" ng-if="watcher.dataChanged()" ng-click="watcher.loadOriginalData()"></vn-button>
<vn-submit
ng-if="watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
label="Undo changes"
ng-if="watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar>
</form>

View File

@ -95,8 +95,15 @@
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit label="Save" vn-acl="salesAssistant"></vn-submit>
<vn-button label="Undo changes" ng-if="watcher.dataChanged()" ng-click="watcher.loadOriginalData()"></vn-button>
<vn-submit
ng-if="watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
label="Undo changes"
ng-if="watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar>
</form>

View File

@ -46,6 +46,9 @@
</vn-one>
</vn-card>
<vn-button-bar>
<vn-submit label="Save"></vn-submit>
<vn-submit
ng-if="watcher.dataChanged()"
label="Save">
</vn-submit>
</vn-button-bar>
</form>

View File

@ -1,3 +1,9 @@
<vn-watcher
vn-id="watcher"
data="$ctrl.creditClassification"
form="form"
save="patch">
</vn-watcher>
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
@ -25,7 +31,13 @@
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit label="Save"></vn-submit>
<vn-button ui-sref="client.card.creditInsurance.index" label="Cancel"></vn-button>
<vn-submit
ng-if="watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
ui-sref="client.card.creditInsurance.index"
label="Cancel">
</vn-button>
</vn-button-bar>
</form>

View File

@ -19,8 +19,14 @@
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit label="Save"></vn-submit>
<vn-button ng-click="$ctrl.cancel()" label="Cancel"></vn-button>
<vn-submit
ng-if="watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
ng-click="$ctrl.cancel()"
label="Cancel">
</vn-button>
</vn-button-bar>
</form>
<vn-confirm

View File

@ -202,8 +202,15 @@
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit label="Save"></vn-submit>
<vn-button label="Undo changes" ng-if="$ctrl.$.form.$dirty" ng-click="watcher.loadOriginalData()"></vn-button>
<vn-submit
ng-if="watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
label="Undo changes"
ng-if="watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar>
</form>
<vn-confirm

View File

@ -40,7 +40,13 @@
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit label="Save"></vn-submit>
<vn-button ng-click="$ctrl.goToIndex()" label="Cancel"></vn-button>
<vn-submit
ng-if="watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
ng-click="$ctrl.goToIndex()"
label="Cancel">
</vn-button>
</vn-button-bar>
</form>

View File

@ -17,8 +17,14 @@
</vn-textarea>
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit label="Save"></vn-submit>
<vn-button ng-click="$ctrl.cancel()" label="Cancel"></vn-button>
<vn-button-bar>
<vn-submit
ng-if="watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
ng-click="$ctrl.cancel()"
label="Cancel">
</vn-button>
</vn-button-bar>
</form>

View File

@ -32,7 +32,13 @@
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit label="Save"></vn-submit>
<vn-button ng-click="$ctrl.cancel()" label="Cancel"></vn-button>
<vn-submit
ng-if="watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
ng-click="$ctrl.cancel()"
label="Cancel">
</vn-button>
</vn-button-bar>
</form>

View File

@ -53,12 +53,19 @@
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit label="Send"></vn-submit>
<vn-button ng-if="sampleType.selection.hasPreview"
<vn-submit
ng-if="sampleType.selection"
label="Send">
</vn-submit>
<vn-button
ng-if="sampleType.selection.hasPreview"
label="Preview"
ng-click="$ctrl.showPreview()">
</vn-button>
<vn-button ui-sref="client.card.sample.index" label="Cancel"></vn-button>
<vn-button
ui-sref="client.card.sample.index"
label="Cancel">
</vn-button>
</vn-button-bar>
</form>
<vn-dialog

View File

@ -26,9 +26,20 @@
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit label="Save"></vn-submit>
<vn-button ng-if="$ctrl.canChangePassword" label="Change password" vn-dialog="change-pass"></vn-button>
<vn-button label="Undo changes" ng-if="$ctrl.$.form.$dirty" ng-click="watcher.loadOriginalData()"></vn-button>
<vn-submit
ng-if="watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
label="Undo changes"
ng-if="$ctrl.$.form.$dirty"
ng-click="watcher.loadOriginalData()">
</vn-button>
<vn-button
ng-if="$ctrl.canChangePassword"
label="Change password"
vn-dialog="change-pass">
</vn-button>
</vn-button-bar>
</form>
<vn-dialog