Skip to content

Commit

Permalink
Merge branch 'production' of https://github.com/Walkover-Web-Solution…
Browse files Browse the repository at this point in the history
…/Giddh-New-Angular4-App into 22dec-mac-electron
  • Loading branch information
the-prateek-mishra committed Feb 9, 2021
2 parents 4803263 + f38fca3 commit 99678bc
Show file tree
Hide file tree
Showing 174 changed files with 1,629 additions and 1,080 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ jobs:
- run: npx cypress install
- run: npx cypress cache list
# and run Cypress tests
- run: npm run cy:run
- run: npm run cy:run1
# Cypress binary will be cached after successful workflow finish
20 changes: 17 additions & 3 deletions apps/web-giddh/src/app/about/about.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { take } from 'rxjs/operators';
import { Component, OnInit } from '@angular/core';
import { take, takeUntil } from 'rxjs/operators';
import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { StateDetailsRequest } from '../models/api-models/Company';
import { AppState } from '../store/roots';
import { Store, select } from '@ngrx/store';
import { CompanyActions } from '../actions/company.actions';
import { ReplaySubject } from 'rxjs';

@Component({
selector: 'about',
Expand All @@ -24,9 +25,11 @@ import { CompanyActions } from '../actions/company.actions';
<pre>this.localState = {{ localState | json }}</pre>
`
})
export class AboutComponent implements OnInit {
export class AboutComponent implements OnInit, OnDestroy {

public localState: any;
/** Subject to release subscription memory */
private destroyed$: ReplaySubject<boolean> = new ReplaySubject(1);

constructor(
public route: ActivatedRoute, private store: Store<AppState>, private companyActions: CompanyActions
Expand All @@ -36,6 +39,7 @@ export class AboutComponent implements OnInit {
public ngOnInit() {
this.route
.data
.pipe(takeUntil(this.destroyed$))
.subscribe((data: any) => {
/**
* Your resolved data from route.
Expand Down Expand Up @@ -67,4 +71,14 @@ export class AboutComponent implements OnInit {

}

/**
* Releases memory
*
* @memberof AboutComponent
*/
public ngOnDestroy(): void {
this.destroyed$.next(true);
this.destroyed$.complete();
}

}
11 changes: 0 additions & 11 deletions apps/web-giddh/src/app/accounting/accounting.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,6 @@ export class AccountingComponent implements OnInit, OnDestroy {

this.store.dispatch(this.companyActions.SetStateDetails(stateDetailsRequest));

this.store.pipe(select(p => p.session.companyUniqueName), take(1)).subscribe(a => {
if (a && a !== '') {
this._accountService.getFlattenAccounts('', '', '').pipe(takeUntil(this.destroyed$)).subscribe(data => {
if (data.status === 'success') {
this.flattenAccounts = data.body.results;
this._tallyModuleService.setFlattenAccounts(data.body.results);
}
});
}
});

this.store.dispatch(this.sidebarAction.GetGroupsWithStocksHierarchyMin());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,6 @@ <h3 class="pd-1 bd-rb primary-color" *ngIf="selectedField === 'stock'">List of S
</div>

<div class="aside-overlay" (click)="closeCreateStock($event)" *ngIf="asideMenuStateForProductService === 'in'"></div>
<aside-inventory-stock-group [autoFocus]="autoFocusStockGroupField" (closeAsideEvent)="closeCreateStock()"
<aside-inventory-stock-group *ngIf="asideMenuStateForProductService === 'in'" [autoFocus]="autoFocusStockGroupField" (closeAsideEvent)="closeCreateStock()"
[class]="asideMenuStateForProductService" [@slideInOut]="asideMenuStateForProductService">
</aside-inventory-stock-group>
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,6 @@ <h3 class="pd-1 bd-rb primary-color" *ngIf="selectedField === 'stock'">List of S
</div>

<div class="aside-overlay" (click)="closeCreateStock($event)" *ngIf="asideMenuStateForProductService === 'in'"></div>
<aside-inventory-stock-group [autoFocus]="autoFocusStockGroupField" (closeAsideEvent)="closeCreateStock()"
<aside-inventory-stock-group *ngIf="asideMenuStateForProductService === 'in'" [autoFocus]="autoFocusStockGroupField" (closeAsideEvent)="closeCreateStock()"
[class]="asideMenuStateForProductService" [@slideInOut]="asideMenuStateForProductService">
</aside-inventory-stock-group>
Original file line number Diff line number Diff line change
Expand Up @@ -258,16 +258,6 @@ export class JournalVoucherComponent implements OnInit, OnDestroy {

this.store.dispatch(this.companyActions.SetStateDetails(stateDetailsRequest));

this.store.pipe(select(appState => appState.session.companyUniqueName), take(1)).subscribe(a => {
if (a && a !== '') {
this.accountService.getFlattenAccounts('', '', '').pipe(takeUntil(this.destroyed$)).subscribe(data => {
if (data && data.status === 'success') {
this.flattenAccounts = data.body.results;
this.tallyModuleService.setFlattenAccounts(data.body.results);
}
});
}
});

this.store.dispatch(this.sidebarAction.GetGroupsWithStocksHierarchyMin());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export class ReceiptEntryModalComponent implements OnInit, OnDestroy {
* @memberof ReceiptEntryModalComponent
*/
public getInvoiceListForReceiptVoucher(): void {
this.salesService.getInvoiceList(this.pendingInvoicesListParams, moment(this.voucherDate, GIDDH_DATE_FORMAT).format(GIDDH_DATE_FORMAT)).subscribe(response => {
this.salesService.getInvoiceList(this.pendingInvoicesListParams, moment(this.voucherDate, GIDDH_DATE_FORMAT).format(GIDDH_DATE_FORMAT)).pipe(takeUntil(this.destroyed$)).subscribe(response => {
if (response && response.status === "success" && response.body && response.body.results && response.body.results.length > 0) {
let pendingInvoiceList: IOption[] = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<input onReturn id="first_element_{{i}}" type="text"
class="form-control from-or-to-acc" #particular [required]="transaction.amount"
[(ngModel)]="transaction.selectedAccount.account"
(keyup)="searchAccount($event, $event?.target?.value);"
(keyup)="searchedAccountQuery.next($event);"
(focus)="onAccountFocus($event, transaction.type === 'by' ? amountField1 : amountField2, transaction.type, i);"
(blur)="onAccountBlur($event);"
[ngClass]="{'focus': isSelectedRow && selectedIdx === i}"
Expand Down Expand Up @@ -228,12 +228,13 @@ <h3 class="pd-1 bd-rb primary-color" *ngIf="selectedField === 'account'">List of
<h3 class="pd-1 bd-rb primary-color" *ngIf="selectedField === 'stock'">List of Stock Items</h3>
<accounting-virtual-list [keydownUpInput]="keyUpDownEvent" [filterText]="filterByText" [options]="inputForList"
[showList]="showLedgerAccountList" [isFilterEnabled]="true" (selected)="onItemSelected($event)"
[(ngModel)]="currentSelectedValue" [placeholder]="'Select Option'"
[(ngModel)]="currentSelectedValue" [placeholder]="'Select Option'" (scrollEnd)="handleScrollEnd()"
[notFoundLink]="selectedField === 'account'" (noResultsClicked)="addNewAccount()" [multiple]="false"
[ItemHeight]="33" (noOptionsFound)="onNoAccountFound($event)"></accounting-virtual-list>
[ItemHeight]="33" (noOptionsFound)="onNoAccountFound($event)" [isPaginationEnabled]="true"></accounting-virtual-list>
</div>
</div>

<div class="aside-overlay" *ngIf="accountAsideMenuState === 'in'"></div>
<generic-aside-menu-account [class]="accountAsideMenuState" [@slideInOut]="accountAsideMenuState"
(closeAsideEvent)="toggleAccountAsidePane($event)" [keyboardShortcut]="{'esc':accountAsideMenuState ==='in'}"
[selectedGrpUniqueName]="categoryOfAccounts" *ngIf="accountAsideMenuState === 'in'"
Expand Down Expand Up @@ -279,7 +280,7 @@ <h3 class="modal-title">Cheque details (if any)</h3>
</div>

<div class="aside-overlay" (click)="closeCreateStock($event)" *ngIf="asideMenuStateForProductService === 'in'"></div>
<aside-inventory-stock-group [autoFocus]="autoFocusStockGroupField" (closeAsideEvent)="closeCreateStock()"
<aside-inventory-stock-group *ngIf="asideMenuStateForProductService === 'in'" [autoFocus]="autoFocusStockGroupField" (closeAsideEvent)="closeCreateStock()"
[class]="asideMenuStateForProductService" [@slideInOut]="asideMenuStateForProductService">
</aside-inventory-stock-group>

Expand Down
Loading

0 comments on commit 99678bc

Please sign in to comment.