You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by GitBox <gi...@apache.org> on 2018/08/14 14:09:50 UTC

[GitHub] awasum closed pull request #7: Consume sign-off meeting endpoint [GSoC Period]

awasum closed pull request #7: Consume sign-off meeting endpoint [GSoC Period]
URL: https://github.com/apache/fineract-cn-fims-web-app/pull/7
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/app/common/common.module.ts b/src/app/common/common.module.ts
index e5e7b4c..544ad60 100644
--- a/src/app/common/common.module.ts
+++ b/src/app/common/common.module.ts
@@ -100,6 +100,7 @@ import {DisplayFimsFinancialNumber} from './number/fims-financial-number.pipe';
     AccountSelectComponent,
     LedgerSelectComponent,
     ProductSelectComponent,
+    GroupSelectComponent,
     EmployeeAutoCompleteComponent,
     IdInputComponent,
     PermissionDirective,
diff --git a/src/app/groups/definition/form/edit.form.component.ts b/src/app/groups/definition/form/edit.form.component.ts
index fb496f0..e2aee9a 100644
--- a/src/app/groups/definition/form/edit.form.component.ts
+++ b/src/app/groups/definition/form/edit.form.component.ts
@@ -35,7 +35,7 @@ export class EditGroupDefinitionFormComponent {
     this.groupDefinition$ = store.select(fromGroups.getSelectedGroupDefinition);
   }
 
-  onSave(groupDefinition: GroupDefinition):void {
+  onSave(groupDefinition: GroupDefinition){
     this.store.dispatch({ type: UPDATE, payload: {
       groupDefinition,
       activatedRoute: this.route
diff --git a/src/app/groups/detail/meeting/meeting.detail.component.html b/src/app/groups/detail/meeting/meeting.detail.component.html
index b5aec31..6c7eddf 100644
--- a/src/app/groups/detail/meeting/meeting.detail.component.html
+++ b/src/app/groups/detail/meeting/meeting.detail.component.html
@@ -18,7 +18,14 @@
 <fims-layout-card-over [title]="meeting.meetingSequence" *ngIf="meeting$ | async as meeting" [navigateBackTo]="['../../../']">
     <div class="mat-content inset" flex>
         <div layout="row">
-            <mat-list>
+
+                <mat-list>
+                        <mat-list-item>
+                            <h3 matLine translate>Duration for the meeting</h3>
+                            <p matLine>{{meeting.duration}}</p>
+                        </mat-list-item> 
+<br><br>
+            
                 <mat-list-item>
                     <h3 matLine translate>Attendance Sheet</h3>
                 </mat-list-item>
diff --git a/src/app/groups/detail/signOffMeeting/signOff-meeting.component.html b/src/app/groups/detail/signOffMeeting/signOff-meeting.component.html
index e88e1ff..ac72d86 100644
--- a/src/app/groups/detail/signOffMeeting/signOff-meeting.component.html
+++ b/src/app/groups/detail/signOffMeeting/signOff-meeting.component.html
@@ -15,14 +15,14 @@
   limitations under the License.
 -->
 
-<fims-layout-card-over title="{{'Sign off Meeting' | translate}}"  [navigateBackTo]="['../']">
-
+<fims-layout-card-over title="{{'Sign off Meeting' | translate}}" [navigateBackTo]="['../']">
+<div>
   <td-steps mode="'vertical'">
     <td-step #detailsStep  [state]="form.valid ? 'complete' : form.pristine ? 'none' : 'required'">
       <form [formGroup]="form" layout="column">
         <fims-number-input [form]="form" placeholder="Meeting Sequence" controlName="sequence"></fims-number-input>
         <fims-number-input [form]="form" placeholder="Current Cycle" controlName="cycle"></fims-number-input>
-        <fims-text-input [form]="form" controlName="duration" placeholder="{{' Duration' | translate}}"></fims-text-input>
+        <fims-number-input [form]="form" controlName="duration" placeholder="Duration"></fims-number-input>
         <h3> Attendance </h3>
         <div layout="row">
           <table td-data-table>
@@ -37,19 +37,22 @@ <h3> Attendance </h3>
               </tr>
             </thead>
             <tbody>
-              <tr *ngFor="let customer of customers1">
+              <tr *ngFor="let member of members">
                 <td>
-                 {{customer.identifier}}
+                <input matInput value="{{member}}" controlName="member">
                 </td>
                 <td>
                   <div>
-                  <mat-form-field layout-margin>
+                   <mat-form-field layout-margin>
                     <mat-select formControlName="status">
                       <mat-option *ngFor="let status of statusOptions" [value]="status.type">
                         {{ status.label }}
                       </mat-option>
                     </mat-select>
                   </mat-form-field>
+                  <!-- <mat-form-field>
+                   <input matInput type="text" value="{{member}}" controlName="member" > 
+                  </mat-form-field>  -->
                 </div>
                 </td>
               </tr>
@@ -66,5 +69,5 @@ <h3> Attendance </h3>
 
     </td-step>
   </td-steps>
-
+</div>
 </fims-layout-card-over>
\ No newline at end of file
diff --git a/src/app/groups/detail/signOffMeeting/signOff-meeting.component.ts b/src/app/groups/detail/signOffMeeting/signOff-meeting.component.ts
index dc9343c..10954f4 100644
--- a/src/app/groups/detail/signOffMeeting/signOff-meeting.component.ts
+++ b/src/app/groups/detail/signOffMeeting/signOff-meeting.component.ts
@@ -21,7 +21,7 @@ import {ActivatedRoute, Router} from '@angular/router';
 import {FormComponent} from '../../../common/forms/form.component';
 import {FormBuilder, Validators,FormGroup} from '@angular/forms';
 import {FimsValidators} from '../../../common/validator/validators';
-import { Attendee,Status} from '../../../services/group/domain/attendee.model';
+import { Attendee} from '../../../services/group/domain/attendee.model';
 import {Customer} from '../../../services/customer/domain/customer.model';
 import {Observable} from 'rxjs/Observable';
 import * as fromGroups from '../../store';
@@ -32,7 +32,11 @@ import * as fromRoot from '../../../store';
 import {StatusOptionList} from './domain/status-option-list.model';
 import {FetchRequest} from '../../../services/domain/paging/fetch-request.model';
 import {SEARCH} from '../../../store/customer/customer.actions';
-
+import {Meeting} from '../../../services/group/domain/meeting.model'
+import {SignOffMeeting} from '../../../services/group/domain/signoff-meeting.model'
+import {UPDATE} from '../../store/meeting/meeting.actions';
+import {Group} from '../../../services/group/domain/group.model';
+import {GroupsStore} from '../../store/index';
 
 
 @Component({
@@ -45,6 +49,15 @@ form:FormGroup
 customers: Observable<Customer[]>;
 customers1: Customer[];
 name:Subscription;
+groupSubscription: Subscription;
+group: Group;
+members: any[];
+
+
+attendee : Attendee[] =[];
+len :number;
+i:any;
+
 
 statusOptions = StatusOptionList;
 
@@ -52,10 +65,10 @@ statusOptions = StatusOptionList;
 
 @ViewChild('detailsStep') detailsStep: TdStepComponent;
 
-
 constructor(private router: Router,private route: ActivatedRoute,private formBuilder: FormBuilder, 
-  private store: Store<fromRoot.State>) {
+  private store: Store<fromRoot.State>, private store1: GroupsStore) {
    // this.customers = customerService.getCustomer("identifier").share();
+  
   }
    
 ngOnInit(){
@@ -64,33 +77,57 @@ ngOnInit(){
        cycle : ['', [Validators.required, FimsValidators.minValue(0)]],
        duration:['',[Validators.required, FimsValidators.minValue(0)]],
        status: ['', [Validators.required]],
+       member:['']
 
     })
 
-      this.detailsStep.open();
+    this.groupSubscription = this.store1.select(fromGroups.getSelectedGroup)
+   .subscribe(group => this.group = group);
+      
+    this.detailsStep.open();
+    console.log(this.group.members)
+    this.members= this.group.members;
+    this.len = this.members.length
 
-      this.customers = this.store.select(fromRoot.getCustomerSearchResults)
-      .map(customerPage => customerPage.customers)
-     
-      this.name= this.customers.subscribe(res => this.customers1=res)
-      console.log(this.customers1);
 
-      
-}
-search(searchTerm) {
-  const fetchRequest: FetchRequest = {
-    searchTerm
-  };
+  }
+
 
-  this.store.dispatch({ type: SEARCH, payload: fetchRequest });
-}
 
 
     save(){
-     
+    
+   for ( this.i in this.members){
+    let attend : Attendee = {
+      customerIdentifier:this.members[this.i],
+      status : this.form.get('status').value,
+    }
+   console.log(attend);
+   this.attendee.push(attend);
+}
+   console.log("attendde",this.attendee)
+    
+
+     const signoff : SignOffMeeting = {
+        sequence:this.form.get('sequence').value,
+        cycle: this.form.get('cycle').value,
+        duration:this.form.get('duration').value,
+        attendees:this.attendee
+      };
+
+      this.store1.dispatch({ type: UPDATE, payload: {
+        groupId: this.group.identifier,
+        signoff,
+      activatedRoute: this.route
+    } });
     }
 
     cancel() {
-        
-      }
-}
\ No newline at end of file
+      this.navigateAway();
+    }
+  
+    navigateAway(): void {
+      this.router.navigate(['../'], { relativeTo: this.route });
+    }
+    
+}
diff --git a/src/app/groups/form/customers/customers.component.html b/src/app/groups/form/customers/customers.component.html
index f5ec383..c60ba80 100644
--- a/src/app/groups/form/customers/customers.component.html
+++ b/src/app/groups/form/customers/customers.component.html
@@ -25,5 +25,5 @@
                     title="Select leaders"
                     noResultsMessage="No Member was found."
                     noSelectionMessage="No Member assigned to group , yet."
-                    multiple
+                    multiselect multiple="multiple" 
 ></fims-select-list>
diff --git a/src/app/groups/form/form.component.spec.ts b/src/app/groups/form/form.component.spec.ts
index aac0ac1..3a06e49 100644
--- a/src/app/groups/form/form.component.spec.ts
+++ b/src/app/groups/form/form.component.spec.ts
@@ -57,7 +57,7 @@ const groupTemplate: Group = {
   createdOn:'21-10-2018', 
   createdBy:'test',
   lastModifiedOn:'',
-  lastModifiefBy:''
+  lastModifiedBy:''
   
 };
 const country: Country = {
diff --git a/src/app/groups/form/form.component.ts b/src/app/groups/form/form.component.ts
index 7382896..b5a7343 100644
--- a/src/app/groups/form/form.component.ts
+++ b/src/app/groups/form/form.component.ts
@@ -138,8 +138,7 @@ export class GroupFormComponent implements OnInit {
     };
     
     this.onSave.emit(group);
-    // directing to attach meeting page
-    //this.router.navigate(['meetingDate'], { relativeTo: this.route });
+
   }
 
   cancel() {
diff --git a/src/app/groups/store/meeting/effects/service.effects.ts b/src/app/groups/store/meeting/effects/service.effects.ts
index 52f2c3f..33d23c0 100644
--- a/src/app/groups/store/meeting/effects/service.effects.ts
+++ b/src/app/groups/store/meeting/effects/service.effects.ts
@@ -50,9 +50,9 @@ export class MeetingApiEffects {
     .ofType(meetingActions.UPDATE)
     .map((action: meetingActions.UpdateMeetingAction) => action.payload)
     .mergeMap(payload =>
-      this.groupService.updateMeeting(payload.groupId,payload.meeting)
+      this.groupService.updateMeeting(payload.groupId,payload.signoff)
         .map(() => new meetingActions.UpdateMeetingSuccessAction({
-          resource: payload.meeting,
+          resource: payload.signoff,
           activatedRoute: payload.activatedRoute
         }))
         .catch((error) => of(new meetingActions.UpdateMeetingFailAction(error)))
diff --git a/src/app/groups/store/meeting/meeting.actions.ts b/src/app/groups/store/meeting/meeting.actions.ts
index 674143c..d785bc2 100644
--- a/src/app/groups/store/meeting/meeting.actions.ts
+++ b/src/app/groups/store/meeting/meeting.actions.ts
@@ -20,6 +20,7 @@ import {Action} from '@ngrx/store';
 import {type} from '../../../store/util';
 import {Error} from '../../../services/domain/error.model';
 import {Meeting} from '../../../services/group/domain/meeting.model';
+import {SignOffMeeting} from '../../../services/group/domain/signoff-meeting.model';
 import {RoutePayload} from '../../../common/store/route-payload';
 import {
   CreateResourceSuccessPayload,
@@ -42,7 +43,8 @@ export const RESET_FORM = type('[Meeting] Reset Form');
 
 export interface MeetingRoutePayload extends RoutePayload {
   meeting: Meeting;
-  groupId : string
+  groupId : string;
+  signoff : SignOffMeeting
 }
 
 export class LoadAllAction implements Action {
diff --git a/src/app/services/group/domain/group.model.ts b/src/app/services/group/domain/group.model.ts
index 422c1ab..606a66a 100644
--- a/src/app/services/group/domain/group.model.ts
+++ b/src/app/services/group/domain/group.model.ts
@@ -40,10 +40,11 @@ export interface Group{
     weekday : number;
     status : Status;
     address : Address;
+    applicationDate?: string;
     createdOn? : string;
     createdBy?: string;
     lastModifiedOn? : string;
-    lastModifiefBy?: string;
+    lastModifiedBy?: string;
 
 
 }
\ No newline at end of file
diff --git a/src/app/services/group/group.service.ts b/src/app/services/group/group.service.ts
index 30959ee..a9e1c7c 100644
--- a/src/app/services/group/group.service.ts
+++ b/src/app/services/group/group.service.ts
@@ -94,8 +94,8 @@ export class GroupService{
       return this.http.get(`${this.baseUrl}/groups/${identifier}/meetings`);
     }
 
-    updateMeeting(identifier: string,meeting: Meeting): Observable<Meeting> {
-      return this.http.put(`${this.baseUrl}/groups/${identifier}/meetings/`, meeting);
+    updateMeeting(identifier: string,signoff: SignOffMeeting): Observable<Meeting> {
+      return this.http.put(`${this.baseUrl}/groups/${identifier}/meetings`, signoff);
     }
   
   


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services