Skip to content

Commit

Permalink
Version 4.16.9
Browse files Browse the repository at this point in the history
  • Loading branch information
acaurrinhos committed Feb 15, 2024
1 parent c22687b commit 372d28b
Show file tree
Hide file tree
Showing 25 changed files with 130 additions and 85 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -3,7 +3,7 @@
"displayName": "Cyclos 4 UI",
"description": "The new Cyclos 4 frontend",
"icon": "cyclos.png",
"version": "4.16.8",
"version": "4.16.9",
"license": "MIT",
"author": {
"name": "Cyclos development team",
Expand Down
2 changes: 2 additions & 0 deletions src/app/core/api-i18n.service.ts
Expand Up @@ -235,6 +235,8 @@ export class ApiI18nService {
switch (kind) {
case TransferKind.ACCOUNT_FEE:
return this.i18n.transaction.transferkind.accountFee;
case TransferKind.BALANCE_DISPOSAL:
return this.i18n.transaction.transferkind.balanceDisposal;
case TransferKind.CHARGEBACK:
return this.i18n.transaction.transferkind.chargeback;
case TransferKind.IMPORT:
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/custom-field-value.component.html
@@ -1,7 +1,7 @@
<ng-container
*ngIf="value != null && (value.length === undefined || value.length > 0)">
<label-value [label]="fieldValue?.field?.name"
[labelPosition]="['text','richText'].includes(fieldValue?.field?.type) ? 'above' : 'auto'">
[labelPosition]="labelPosition ? labelPosition : ['text','richText'].includes(fieldValue?.field?.type) ? 'above' : 'auto'">
<format-field-value #formatFieldValue [fieldValue]="fieldValue">
</format-field-value>
</label-value>
Expand Down
7 changes: 6 additions & 1 deletion src/app/shared/text-selection-field.component.html
Expand Up @@ -4,7 +4,7 @@
</label-value>

<ng-template #widget>
<div class="d-flex mw-100 w-100">
<div *ngIf="!maxItemsReached; else maxItemsReachedInfo" class="d-flex mw-100 w-100">
<div class="d-flex flex-grow-1 mw-100">
<input-field #inputField [formControl]="inputFieldControl">
</input-field>
Expand All @@ -16,6 +16,11 @@
</button>
</div>
</div>
<ng-template #maxItemsReachedInfo>
<div class="mt-2">
{{ i18n.general.maxItemsReached }}
</div>
</ng-template>
<div *ngIf="value.length > 0" class="d-flex mw-100 w-100 flex-wrap">
<chip [icon]="SvgIcon.Search" *ngFor="let str of value" class="mt-2 mr-2"
(close)="remove(str)">
Expand Down
16 changes: 11 additions & 5 deletions src/app/shared/text-selection-field.component.ts
@@ -1,4 +1,4 @@
import { ChangeDetectionStrategy, Component, Host, Injector, OnInit, Optional, SkipSelf, ViewChild } from '@angular/core';
import { ChangeDetectionStrategy, Component, Host, Injector, Input, OnInit, Optional, SkipSelf, ViewChild } from '@angular/core';
import { ControlContainer, FormControl, NG_VALUE_ACCESSOR } from '@angular/forms';
import { BaseFormFieldComponent } from 'app/shared/base-form-field.component';
import { InputFieldComponent } from 'app/shared/input-field.component';
Expand All @@ -17,6 +17,8 @@ import { InputFieldComponent } from 'app/shared/input-field.component';
export class TextSelectionFieldComponent
extends BaseFormFieldComponent<string[]> implements OnInit {

@Input('maxItems') maxItems: number;

@ViewChild('inputField') inputField: InputFieldComponent;

inputFieldControl = new FormControl(null);
Expand All @@ -31,6 +33,10 @@ export class TextSelectionFieldComponent
super.ngOnInit();
}

get maxItemsReached() {
return this.maxItems ? this.maxItems <= this.value.length : false;
}

protected getDisabledValue(): string {
return (this.value || []).join(', ');
}
Expand All @@ -40,15 +46,15 @@ export class TextSelectionFieldComponent
}

add() {
const nativeInput = this.inputField.input;
const str = nativeInput.value;
if (!str) {
const str = this.inputField.input.value;
if (!str || (this.value || []).includes(str)) {
this.inputFieldControl.setValue(null);
return;
}
const current = this.value || [];
current.push(str);
this.value = current;
nativeInput.value = null;
this.inputFieldControl.setValue(null);
}

remove(str: string) {
Expand Down
Expand Up @@ -228,6 +228,6 @@ export class SearchUserBalancesComponent
}

resolveMenu() {
return Menu.USER_BALANCES_OVERVIEW;
return Menu.ADMIN_USER_BALANCES_OVERVIEW;
}
}
Expand Up @@ -170,6 +170,6 @@ export class SearchBalanceLimitsOverviewComponent
}

resolveMenu() {
return new ActiveMenu(Menu.ACCOUNT_BALANCE_LIMITS_OVERVIEW);
return new ActiveMenu(Menu.ADMIN_ACCOUNT_BALANCE_LIMITS_OVERVIEW);
}
}
Expand Up @@ -208,6 +208,6 @@ export class SearchPaymentLimitsOverviewComponent
}

resolveMenu() {
return new ActiveMenu(Menu.ACCOUNT_PAYMENT_LIMITS_OVERVIEW);
return new ActiveMenu(Menu.ADMIN_ACCOUNT_PAYMENT_LIMITS_OVERVIEW);
}
}
Expand Up @@ -18,7 +18,7 @@
<!-- Force a line break on sm and up -->
<div class="w-100 d-none d-sm-block"></div>
<div class="col-12 col-md-6">
<single-selection-field formControlName="fromAccountType"
<single-selection-field formControlName="fromAccountTypes"
[emptyOption]="i18n.general.notApplied"
[label]="i18n.transaction.fromAccount">
<field-option *ngFor="let at of data.accountTypes"
Expand All @@ -28,7 +28,7 @@
</single-selection-field>
</div>
<div class="col-12 col-md-6">
<single-selection-field formControlName="toAccountType"
<single-selection-field formControlName="toAccountTypes"
[emptyOption]="i18n.general.notApplied"
[label]="i18n.transaction.toAccount">
<field-option *ngFor="let at of data.accountTypes"
Expand Down
21 changes: 7 additions & 14 deletions src/app/ui/banking/transactions/search-installments.component.ts
@@ -1,20 +1,15 @@
import { HttpResponse } from '@angular/common/http';
import { ChangeDetectionStrategy, Component, Injector, OnInit } from '@angular/core';
import {
Currency, CustomFieldDetailed, InstallmentOverviewDataForSearch, InstallmentOverviewResult, InstallmentStatusEnum, TransactionDataForSearch
Currency, CustomFieldDetailed, InstallmentOverviewDataForSearch, InstallmentOverviewQueryFilters, InstallmentOverviewResult, InstallmentStatusEnum, TransactionDataForSearch
} from 'app/api/models';
import { InstallmentQueryFilters } from 'app/api/models/installment-query-filters';
import { InstallmentsService } from 'app/api/services/installments.service';
import { empty } from 'app/shared/helper';
import { BankingHelperService } from 'app/ui/core/banking-helper.service';
import { BaseSearchPageComponent } from 'app/ui/shared/base-search-page.component';
import { Menu } from 'app/ui/shared/menu';
import { Observable } from 'rxjs';

export type InstallmentSearchParams = InstallmentQueryFilters & {
owner: string;
};

/**
* General search for installments
*/
Expand All @@ -24,7 +19,7 @@ export type InstallmentSearchParams = InstallmentQueryFilters & {
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SearchInstallmentsComponent
extends BaseSearchPageComponent<InstallmentOverviewDataForSearch, InstallmentSearchParams, InstallmentOverviewResult>
extends BaseSearchPageComponent<InstallmentOverviewDataForSearch, InstallmentOverviewQueryFilters, InstallmentOverviewResult>
implements OnInit {

currencies = new Map<string, Currency>();
Expand Down Expand Up @@ -75,7 +70,7 @@ export class SearchInstallmentsComponent
}

getFormControlNames() {
return ['status', 'fromAccountType', 'toAccountType', 'transferFilter', 'user', 'preselectedPeriod', 'periodBegin', 'periodEnd',
return ['status', 'fromAccountTypes', 'toAccountTypes', 'transferFilter', 'user', 'preselectedPeriod', 'periodBegin', 'periodEnd',
'direction', 'transactionNumber', 'customFields', 'orderBy'];
}

Expand All @@ -93,10 +88,8 @@ export class SearchInstallmentsComponent
}));
}

protected toSearchParams(value: any): InstallmentSearchParams {
const params: InstallmentSearchParams = value;
params.accountTypes = value.accountType ? [value.accountType] : null;
params.transferFilters = value.transferFilter ? [value.transferFilter] : null;
protected toSearchParams(value: any): InstallmentOverviewQueryFilters {
const params: InstallmentOverviewQueryFilters = value;
params.datePeriod = this.bankingHelper.resolveDatePeriod(value);
const status = value.status as InstallmentStatusEnum;
params.statuses = [status];
Expand All @@ -113,10 +106,10 @@ export class SearchInstallmentsComponent
}

resolveMenu() {
return Menu.SCHEDULED_PAYMENTS_OVERVIEW;
return Menu.ADMIN_SCHEDULED_PAYMENTS_OVERVIEW;
}

protected doSearch(filter: InstallmentSearchParams): Observable<HttpResponse<InstallmentOverviewResult[]>> {
protected doSearch(filter: InstallmentOverviewQueryFilters): Observable<HttpResponse<InstallmentOverviewResult[]>> {
return this.installmentsService.searchInstallmentsOverview$Response(filter);
}

Expand Down
Expand Up @@ -157,7 +157,7 @@ export class SearchOwnerTransactionsComponent
}
} else if (this.isExternalPayment()) {
// There's only a possible action for payment requests, either as self, system or user: pay an external user
if (bankingPermissions?.externalPayments?.perform || userPermissions?.externalPayments.performAsSelf) {
if (bankingPermissions?.externalPayments?.perform || userPermissions?.externalPayments?.performAsSelf) {
headingActions.push(new HeadingAction(SvgIcon.Wallet2ArrowUpRight, this.i18n.transaction.payExternalUser,
() => this.payExternalUser(), true));
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/ui/content/content-page.component.html
@@ -1,6 +1,6 @@
<ng-container *ngIf="data$ | async">
<ng-container *ngIf="page.layout === FrontendContentLayoutEnum.FULL">
<div class="d-flex flex-grow-1" [innerHTML]="page.content | trust"></div>
<div class="flex-grow-1" [innerHTML]="page.content | trust"></div>
</ng-container>
<page-layout *ngIf="page.layout !== FrontendContentLayoutEnum.FULL">
<page-content [heading]="page.title || page.name"
Expand Down
55 changes: 38 additions & 17 deletions src/app/ui/core/menu.service.ts
Expand Up @@ -1010,21 +1010,23 @@ export class MenuService {
add(Menu.PENDING_MY_AUTHORIZATION, `/banking/pending-my-authorization`,
SvgIcon.Wallet2Check, this.i18n.menu.bankingPendingMyAuth);
}
if (authorizations.view) {
if (isAdmin && banking.searchGeneralAuthorizedPayments) {
add(Menu.AUTHORIZED_PAYMENTS_OVERVIEW, `/banking/authorized-payments`,
SvgIcon.Wallet2Check, this.i18n.menu.bankingAuthorizations);
} else {
add(Menu.AUTHORIZED_PAYMENTS, `/banking/${owner}/authorized-payments`,
SvgIcon.Wallet2Check, this.i18n.menu.bankingAuthorizations);
}

if (!isAdmin && authorizations.view) {
add(Menu.AUTHORIZED_PAYMENTS, `/banking/${owner}/authorized-payments`,
SvgIcon.Wallet2Check, this.i18n.menu.bankingAuthorizations);
}

if (isAdmin && banking.searchGeneralAuthorizedPayments) {
add(Menu.AUTHORIZED_PAYMENTS_OVERVIEW, `/banking/authorized-payments`,
SvgIcon.Wallet2Check, this.i18n.menu.bankingAuthorizations);
}
if (banking.searchGeneralTransfers) {

if (isAdmin && banking.searchGeneralTransfers) {
add(Menu.ADMIN_TRANSFERS_OVERVIEW, `/banking/transfers-overview`, SvgIcon.ArrowLeftRight, this.i18n.menu.bankingTransfersOverview);
}

if (banking.scheduledPayments?.view && banking.searchGeneralScheduledPayments) {
add(Menu.SCHEDULED_PAYMENTS_OVERVIEW, `/banking/installments-overview`,
if (isAdmin && banking.searchGeneralScheduledPayments) {
add(Menu.ADMIN_SCHEDULED_PAYMENTS_OVERVIEW, `/banking/installments-overview`,
SvgIcon.CalendarEvent, this.i18n.menu.bankingScheduledPaymentsOverview);
}

Expand All @@ -1038,8 +1040,8 @@ export class MenuService {
SvgIcon.Wallet2ArrowUpRight, this.i18n.menu.bankingExternalPaymentsOverview);
}

if (banking.searchUsersWithBalances) {
add(Menu.USER_BALANCES_OVERVIEW, `/banking/user-balances-overview`,
if (isAdmin && banking.searchUsersWithBalances) {
add(Menu.ADMIN_USER_BALANCES_OVERVIEW, `/banking/user-balances-overview`,
SvgIcon.Wallet2Person, this.i18n.menu.bankingUserBalancesOverview);
}

Expand All @@ -1060,13 +1062,13 @@ export class MenuService {
SvgIcon.Ticket, this.i18n.menu.bankingVouchers);
}

if (banking.searchGeneralBalanceLimits) {
add(Menu.ACCOUNT_BALANCE_LIMITS_OVERVIEW, '/banking/account-balance-limits-overview',
if (isAdmin && banking.searchGeneralBalanceLimits) {
add(Menu.ADMIN_ACCOUNT_BALANCE_LIMITS_OVERVIEW, '/banking/account-balance-limits-overview',
SvgIcon.ArrowDownUp, this.i18n.menu.bankingAccountBalanceLimits);
}

if (banking.searchGeneralPaymentLimits) {
add(Menu.ACCOUNT_PAYMENT_LIMITS_OVERVIEW, '/banking/account-payment-limits-overview',
if (isAdmin && banking.searchGeneralPaymentLimits) {
add(Menu.ADMIN_ACCOUNT_PAYMENT_LIMITS_OVERVIEW, '/banking/account-payment-limits-overview',
SvgIcon.ArrowDownUp, this.i18n.menu.bankingAccountPaymentLimits);
}

Expand Down Expand Up @@ -1107,6 +1109,25 @@ export class MenuService {
add(Menu.BROKER_AUTHORIZED_PAYMENTS_OVERVIEW, `/banking/authorized-payments`,
SvgIcon.Wallet2Check, this.i18n.menu.bankingAuthorizations);
}
if (banking.searchGeneralScheduledPayments) {
add(Menu.BROKER_SCHEDULED_PAYMENTS_OVERVIEW, `/banking/installments-overview`,
SvgIcon.CalendarEvent, this.i18n.menu.bankingScheduledPaymentsOverview);
}
if (banking.searchUsersWithBalances) {
add(Menu.BROKER_USER_BALANCES_OVERVIEW, `/banking/user-balances-overview`,
SvgIcon.Wallet2Person, this.i18n.menu.bankingUserBalancesOverview);
}

if (banking.searchGeneralBalanceLimits) {
add(Menu.BROKER_ACCOUNT_BALANCE_LIMITS_OVERVIEW, '/banking/account-balance-limits-overview',
SvgIcon.ArrowDownUp, this.i18n.menu.bankingAccountBalanceLimits);
}

if (banking.searchGeneralPaymentLimits) {
add(Menu.BROKER_ACCOUNT_PAYMENT_LIMITS_OVERVIEW, '/banking/account-payment-limits-overview',
SvgIcon.ArrowDownUp, this.i18n.menu.bankingAccountPaymentLimits);
}

addRecords(RootMenu.BROKERING);
addOperations(RootMenu.BROKERING);
addWizards(RootMenu.BROKERING);
Expand Down
3 changes: 1 addition & 2 deletions src/app/ui/dashboard/dashboard.component.ts
Expand Up @@ -194,8 +194,7 @@ export class DashboardComponent extends BasePageComponent<DataForFrontendHome> i
addAction(new ActiveMenu(isAdmin ? Menu.ADMIN_TRANSFERS_OVERVIEW : Menu.BROKER_TRANSFERS_OVERVIEW));
break;
case QuickAccessTypeEnum.BALANCES_OVERVIEW:
// TODO Maybe we're missing a Menu.BROKER_BALANCES_OVERVIEW?
addAction(new ActiveMenu(Menu.USER_BALANCES_OVERVIEW));
addAction(new ActiveMenu(isAdmin ? Menu.ADMIN_USER_BALANCES_OVERVIEW:Menu.BROKER_USER_BALANCES_OVERVIEW));
break;
case QuickAccessTypeEnum.PAY_USER:
addAction(new ActiveMenu(Menu.PAYMENT_TO_USER));
Expand Down
2 changes: 1 addition & 1 deletion src/app/ui/marketplace/edit-ad.component.html
Expand Up @@ -69,7 +69,7 @@
[label]="i18n.ad.creationDate">
{{ creationDate | date }}
</label-value>
<input-field [label]="i18n.general.name" formControlName="name"
<input-field [label]="i18n.ad.name" formControlName="name"
required></input-field>
<single-selection-field *ngIf="data.maxCategoriesPerAd == 1"
formControlName="categories" [label]="i18n.general.category"
Expand Down
Expand Up @@ -10,7 +10,7 @@
<ng-container [formGroup]="form">
<input-field formControlName="name" [label]="i18n.general.name"
required></input-field>
<text-selection-field formControlName="keywords"
<text-selection-field formControlName="keywords" [maxItems]="5"
[label]="i18n.general.keywords">
</text-selection-field>
<single-selection-field formControlName="kind"
Expand All @@ -23,7 +23,7 @@
<user-field formControlName="user" [label]="i18n.general.by">
</user-field>
<single-selection-field formControlName="category"
[label]="i18n.general.category">
[label]="i18n.general.category" [emptyOption]="i18n.general.all">
<field-option *ngFor="let cat of categories"
[value]="ApiHelper.internalNameOrId(cat)" [id]="cat.id"
[internalName]="cat.internalName" [text]="cat.name"
Expand Down
Expand Up @@ -18,8 +18,8 @@ <h2>{{ i18n.ad.matchFields }}</h2>
<label-value *ngIf="data.category" [label]="i18n.general.category"
[value]="data.category.name">
</label-value>
<label-value *ngIf="data.user" [label]="i18n.general.by">
<user-link [user]="data.user"></user-link>
<label-value *ngIf="data.adUser" [label]="i18n.general.by">
<user-link [user]="data.adUser"></user-link>
</label-value>
<label-value *ngIf="data.minPrice || data.maxPrice"
[label]="i18n.ad.price"
Expand Down

0 comments on commit 372d28b

Please sign in to comment.