Skip to content
Permalink
Browse files
Merge pull request #19 from aasaru/kengneruphine_develop_fixed
Pull request #12 with a fix that makes tests pass
  • Loading branch information
awasum committed Sep 4, 2019
2 parents e1e89be + dc4c6d3 commit e9be30b2c68c64ab700e39dc969b1e39dbdb0f3f
Show file tree
Hide file tree
Showing 58 changed files with 996 additions and 963 deletions.
@@ -0,0 +1,4 @@
{
"repoId": "de78cc85-4b16-49bd-8491-48f41fca68a2",
"lastSync": 0
}
@@ -26,10 +26,6 @@ language: node_js
node_js:
- '6.9.4'

branches:
only:
- develop

before_script:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
@@ -7,7 +7,7 @@

## Development
* Follow instructions at https://github.com/apache/fineract-cn-demo-server and start demo-server
* Run local dev environment `npm run dev`
* Run local development environment `npm run dev`
* Go to http://localhost:4200

## Production build
@@ -9,12 +9,12 @@
"e2e-test": "protractor ./protractor.conf.js",
"tslint": "tslint -c ./tslint.json \"./src/**/*.ts\" -e \"./src/**/typings.d.ts\" -e \"./src/environments/**\"",
"postinstall": "webdriver-manager update",
"test": "ng test --single-run",
"test": "ng test --single-run --sm=false",
"karma": "karma start ./karma.conf.js --single-run",
"devTest": "ng test",
"dev": "ng serve --watch --verbose --proxy-config proxy.conf.json",
"runProd": "ng serve --proxy-config proxy.conf.json --prod",
"build": "ng build --prod",
"runProd": "ng serve --proxy-config proxy.conf.json --environment=prod",
"build": "ng build --environment=prod",
"checkLicenses": "license-to-fail ./license.config.js",
"bundle-report": "webpack-bundle-analyzer dist/stats.json"
},
@@ -65,6 +65,7 @@ import {DateInputComponent} from './date-input/date-input.component';
import {TextInputComponent} from './text-input/text-input.component';
import {DisplayFimsNumber} from './number/fims-number.pipe';
import {DisplayFimsFinancialNumber} from './number/fims-financial-number.pipe';
import {NumberGroupInputComponent} from './number-group-input/number-group-input.component'

@NgModule({
imports: [
@@ -120,7 +121,8 @@ import {DisplayFimsFinancialNumber} from './number/fims-financial-number.pipe';
FimsFabButtonComponent,
DisplayFimsDate,
DisplayFimsNumber,
DisplayFimsFinancialNumber
DisplayFimsFinancialNumber,
NumberGroupInputComponent
],
exports: [
LayoutCardOverComponent,
@@ -151,7 +153,8 @@ import {DisplayFimsFinancialNumber} from './number/fims-financial-number.pipe';
FimsFabButtonComponent,
DisplayFimsDate,
DisplayFimsNumber,
DisplayFimsFinancialNumber
DisplayFimsFinancialNumber,
NumberGroupInputComponent
],
entryComponents: [
ImageComponent
@@ -16,8 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
import {Component, Input,forwardRef} from '@angular/core';
import {FormGroup} from '@angular/forms';
import { Component, Input, forwardRef } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';

@Component({
@@ -40,9 +40,9 @@ export class DateInputComponent implements ControlValueAccessor {
@Input() form: FormGroup;

@Input() title = '';
//@Input('value') _value = false;
onChange: any = () => { };
onTouched: any = () => { };
// @Input('value') _value = false;
onChange: any = () => { };
onTouched: any = () => { };

get hasRequiredError(): boolean {
return this.hasError('required');
@@ -64,7 +64,7 @@ export class DateInputComponent implements ControlValueAccessor {
}

set value(val) {
this.controlName= val;
this.controlName = val;
this.onChange(val);
this.onTouched();
}
@@ -75,7 +75,7 @@ export class DateInputComponent implements ControlValueAccessor {
this.onChange = fn;
}

registerOnTouched(fn) {
registerOnTouched(fn) {
this.onTouched = fn;
}

@@ -16,13 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
import {Component, forwardRef, Input, OnInit} from '@angular/core';
import {FetchRequest} from '../../services/domain/paging/fetch-request.model';
import {Observable} from 'rxjs/Observable';
import {ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR} from '@angular/forms';
import {Group} from '../../services/group/domain/group.model';
import {GroupService} from '../../services/group/group.service';
import {GroupPage} from '../../services/group/domain/group-page.model';
import { Component, forwardRef, Input, OnInit } from '@angular/core';
import { FetchRequest } from '../../services/domain/paging/fetch-request.model';
import { Observable } from 'rxjs/Observable';
import { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR } from '@angular/forms';
import { Group } from '../../services/group/domain/group.model';
import { GroupService } from '../../services/group/group.service';
import { GroupPage } from '../../services/group/domain/group-page.model';

const noop: () => void = () => {
// empty method
@@ -49,7 +49,7 @@ export class GroupSelectComponent implements ControlValueAccessor, OnInit {

private _onChangeCallback: (_: any) => void = noop;

constructor(private groupService: GroupService) {}
constructor(private groupService: GroupService) { }

ngOnInit(): void {
this.formControl = new FormControl('');
@@ -91,4 +91,4 @@ export class GroupSelectComponent implements ControlValueAccessor, OnInit {
.map((groupPage: GroupPage) => groupPage.groups);
}

}
}
@@ -0,0 +1,39 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<mat-form-field layout-margin flex [formGroup]="form">
<input matInput type="text" [textMask]="{mask: mask}" [placeholder]="placeholder" [formControlName]="controlName"/>
<mat-error *ngIf="hasRequiredError" translate>
Required
</mat-error>
<mat-error *ngIf="hasMinValueError" translate>
{{ 'Value must be greater than or equal to' | translate:{value: form.get(controlName).errors.minValue.value} }}
</mat-error>
<mat-error *ngIf="hasMaxValueError" translate>
{{ 'Value must be smaller than or equal to' | translate:{value: form.get(controlName).errors.maxValue.value} }}
</mat-error>
<mat-error *ngIf="hasGreaterThanValueError" translate>
{{ 'Value must be greater than' | translate:{value: form.get(controlName).errors.greaterThanValue.value} }}
</mat-error>
<mat-error *ngIf="hasScaleError">
{{ 'Must have decimal places' | translate:{value: form.get(controlName).errors.scale.value} }}
</mat-error>
<mat-hint align="end" *ngIf="form.get(controlName).enabled">
{{hint}}
</mat-hint>
</mat-form-field>

@@ -0,0 +1,78 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import {Component, Input} from '@angular/core';
import {FormGroup} from '@angular/forms';
import {createNumberMask} from 'text-mask-addons/dist/textMaskAddons';

@Component({
selector: 'fims-number-group-input',
templateUrl: './number-group-input.component.html'
})
export class NumberGroupInputComponent {

@Input() placeholder;

@Input() controlName: string;

@Input() form: FormGroup;

@Input() requireDecimal = false;

@Input() decimalLimit = 2;

@Input() hint: string;

mask: any;

constructor() {
this.mask = createNumberMask({
prefix: '',
suffix: '',
includeThousandsSeparator: false,
requireDecimal: this.requireDecimal,
allowNegative: false,
allowLeadingZeroes: true,
decimalLimit: this.decimalLimit
});
}

get hasRequiredError(): boolean {
return this.hasError('required');
}

get hasMinValueError(): boolean {
return this.hasError('minValue');
}

get hasGreaterThanValueError(): boolean {
return this.hasError('greaterThanValue');
}

get hasMaxValueError(): boolean {
return this.hasError('maxValue');
}

get hasScaleError(): boolean {
return this.hasError('maxScale');
}

hasError(key: string): boolean {
return this.form.get(this.controlName).hasError(key);
}
}
@@ -16,26 +16,26 @@
* specific language governing permissions and limitations
* under the License.
*/
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {CustomerDetailFormComponent} from './detail/detail.component';
import {CustomerFormComponent} from './form.component';
import {CustomerContactFormComponent} from './contact/contact.component';
import {CustomerCustomFieldsComponent} from './customFields/custom-fields.component';
import {ReactiveFormsModule} from '@angular/forms';
import {CovalentChipsModule, CovalentStepsModule} from '@covalent/core';
import {Component, EventEmitter, ViewChild} from '@angular/core';
import {Customer} from '../../services/customer/domain/customer.model';
import {TranslateModule} from '@ngx-translate/core';
import {CustomerEmployeesComponent} from './employees/employees.component';
import {CustomerOfficesComponent} from './offices/offices.component';
import {Observable} from 'rxjs/Observable';
import {Store} from '@ngrx/store';
import {CustomersStore} from '../store/index';
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
import {CountryService} from '../../services/country/country.service';
import {Country} from '../../services/country/model/country.model';
import {FimsSharedModule} from '../../common/common.module';
import {MatAutocompleteModule, MatCheckboxModule, MatIconModule, MatInputModule, MatRadioModule} from '@angular/material';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { CustomerDetailFormComponent } from './detail/detail.component';
import { CustomerFormComponent } from './form.component';
import { CustomerContactFormComponent } from './contact/contact.component';
import { CustomerCustomFieldsComponent } from './customFields/custom-fields.component';
import { ReactiveFormsModule } from '@angular/forms';
import { CovalentChipsModule, CovalentStepsModule } from '@covalent/core';
import { Component, EventEmitter, ViewChild } from '@angular/core';
import { Customer } from '../../services/customer/domain/customer.model';
import { TranslateModule } from '@ngx-translate/core';
import { CustomerEmployeesComponent } from './employees/employees.component';
import { CustomerOfficesComponent } from './offices/offices.component';
import { Observable } from 'rxjs/Observable';
import { Store } from '@ngrx/store';
import { CustomersStore } from '../store/index';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { CountryService } from '../../services/country/country.service';
import { Country } from '../../services/country/model/country.model';
import { FimsSharedModule } from '../../common/common.module';
import { MatAutocompleteModule, MatCheckboxModule, MatIconModule, MatInputModule, MatRadioModule } from '@angular/material';

const customerTemplate: Customer = {
identifier: 'test',
@@ -198,5 +198,5 @@ class TestComponent {
this.saveEmitter.emit(customer);
}

onCancel(): void {}
}
onCancel(): void { }
}
@@ -16,17 +16,17 @@
* specific language governing permissions and limitations
* under the License.
*/
import {Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core';
import {TdStepComponent} from '@covalent/core';
import {Customer} from '../../services/customer/domain/customer.model';
import {CustomerDetailFormComponent, CustomerDetailFormData} from './detail/detail.component';
import {AddressFormComponent} from '../../common/address/address.component';
import {Address} from '../../services/domain/address/address.model';
import {CustomerContactFormComponent} from './contact/contact.component';
import {ContactDetail} from '../../services/domain/contact/contact-detail.model';
import {Value} from '../../services/catalog/domain/value.model';
import {CustomerCustomFieldsComponent} from './customFields/custom-fields.component';
import {Catalog} from '../../services/catalog/domain/catalog.model';
import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
import { TdStepComponent } from '@covalent/core';
import { Customer } from '../../services/customer/domain/customer.model';
import { CustomerDetailFormComponent, CustomerDetailFormData } from './detail/detail.component';
import { AddressFormComponent } from '../../common/address/address.component';
import { Address } from '../../services/domain/address/address.model';
import { CustomerContactFormComponent } from './contact/contact.component';
import { ContactDetail } from '../../services/domain/contact/contact-detail.model';
import { Value } from '../../services/catalog/domain/value.model';
import { CustomerCustomFieldsComponent } from './customFields/custom-fields.component';
import { Catalog } from '../../services/catalog/domain/catalog.model';

@Component({
selector: 'fims-customer-form-component',
@@ -141,4 +141,4 @@ export class CustomerFormComponent implements OnInit {
this.onCancel.emit();
}

}
}

0 comments on commit e9be30b

Please sign in to comment.