Skip to content
Permalink
Browse files
Merge pull request #7 from kengneruphine/develop
Consume sign-off meeting endpoint [GSoC Period]
  • Loading branch information
awasum committed Aug 14, 2018
2 parents 6b10d04 + 398c3dd commit 58d2000679a9b178a9905b985da3647072095c51
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 41 deletions.
@@ -100,6 +100,7 @@ import {DisplayFimsFinancialNumber} from './number/fims-financial-number.pipe';
AccountSelectComponent,
LedgerSelectComponent,
ProductSelectComponent,
GroupSelectComponent,
EmployeeAutoCompleteComponent,
IdInputComponent,
PermissionDirective,
@@ -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
@@ -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>
@@ -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>
@@ -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,17 +49,26 @@ form:FormGroup
customers: Observable<Customer[]>;
customers1: Customer[];
name:Subscription;
groupSubscription: Subscription;
group: Group;
members: any[];


attendee : Attendee[] =[];
len :number;
i:any;


statusOptions = StatusOptionList;

@ViewChild('detailsStep') step: TdStepComponent;

@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() {

}
}
this.navigateAway();
}

navigateAway(): void {
this.router.navigate(['../'], { relativeTo: this.route });
}

}
@@ -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>
@@ -57,7 +57,7 @@ const groupTemplate: Group = {
createdOn:'21-10-2018',
createdBy:'test',
lastModifiedOn:'',
lastModifiefBy:''
lastModifiedBy:''

};
const country: Country = {
@@ -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() {
@@ -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)))
@@ -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 {
@@ -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;


}
@@ -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);
}


0 comments on commit 58d2000

Please sign in to comment.