FINERACT-1432:ClientDocumentDropDown (#3447)

merging after code review. thanks @luckyman20
This commit is contained in:
Rahul Pawar 2022-01-08 16:10:13 +05:30 committed by GitHub
parent 2c610b3f71
commit 88d63ad43e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 6 deletions

View File

@ -1,6 +1,6 @@
(function (module) {
mifosX.controllers = _.extend(module, {
ClientDocumentController: function (scope, location, http, routeParams, API_VERSION, Upload, $rootScope) {
ClientDocumentController: function (scope, location, resourceFactory, http, routeParams, API_VERSION, Upload, $rootScope) {
scope.clientId = routeParams.clientId;
scope.onFileSelect = function (files) {
scope.formData.file = files[0];
@ -18,9 +18,13 @@
location.path('/viewclient/' + scope.clientId);
});
};
resourceFactory.codeValueResource.getAllCodeValues({codeId: 34}, function (data) {
scope.documenttypes = data;
});
}
});
mifosX.ng.application.controller('ClientDocumentController', ['$scope', '$location', '$http', '$routeParams', 'API_VERSION', 'Upload', '$rootScope', mifosX.controllers.ClientDocumentController]).run(function ($log) {
mifosX.ng.application.controller('ClientDocumentController', ['$scope', '$location', 'ResourceFactory', '$http', '$routeParams', 'API_VERSION', 'Upload', '$rootScope', mifosX.controllers.ClientDocumentController]).run(function ($log) {
$log.info("ClientDocumentController initialized");
});
}(mifosX.controllers || {}));
}(mifosX.controllers || {}));

View File

@ -86,7 +86,9 @@
clientIdenfierResource: defineResource(apiVer + "/clients/:clientId/identifiers/:id", {clientId: '@clientId', id: '@id'}, {
get: {method: 'GET', params: {}}
}),
clientDocumentTemplateResource: defineResource(apiVer + "/clients/:clientId/documentsuploaded", {clientId: '@clientId'}, {
get: {method: 'GET', params: {}}
}),
surveyResource: defineResource(apiVer + "/surveys/:surveyId", {surveyId: '@surveyId'}, {
getAll: {method: 'GET', params: {}, isArray: true},
get: {method: 'GET', params: {surveyId: '@surveyId'}, isArray: false},

View File

@ -14,8 +14,12 @@
class="required">*</span></label>
<div class="col-sm-3">
<input ng-autofocus="true" type="text" id="name" name="name" ng-model="formData.name" class="form-control" required
late-Validate/>
<select id="name" ng-model="formData.name"
ng-options="documenttype.name as documenttype.name for documenttype in documenttypes"
value="{{documenttype.name}}" required="required"
class="form-control">
<option style="display:none" value="">{{'label.menu.selectone' | translate}}
</select>
</div>
<div class="col-sm-3">
<form-validate valattributeform="clientdocumentform" valattribute="name"/>