Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Added assets for a Journey #221

Merged
merged 6 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion apps/golden-sample-app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@
"tsConfig": "apps/golden-sample-app/tsconfig.app.json",
"assets": [
"apps/golden-sample-app/src/favicon.ico",
"apps/golden-sample-app/src/assets"
"apps/golden-sample-app/src/assets",
manisha-backbase marked this conversation as resolved.
Show resolved Hide resolved
{
"glob": "**/*",
"input": "libs/transactions-journey/assets",
"output": "assets/transactions-journey"
}
],
"styles": ["apps/golden-sample-app/src/styles.scss"],
"scripts": []
Expand Down
Binary file added libs/transactions-journey/assets/default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added libs/transactions-journey/assets/food.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added libs/transactions-journey/assets/travel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../../dist/libs/transactions-journey/feature-transaction-details-view",
"lib": {
"entryFile": "src/index.ts"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@backbase-gsa/internal-transactions-feature-transaction-details-view",
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^16.1.3",
"@angular/core": "^16.1.3"
},
"dependencies": {
"tslib": "^2.3.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@
"tags": ["scope:transaction-details-view-journey", "type:feature"],
"projectType": "library",
"targets": {
"build": {
"executor": "@nx/angular:package",
"outputs": ["{workspaceRoot}/dist/libs/transactions-journey/feature-transaction-details-view"],
"options": {
"project": "libs/transactions-journey/feature-transaction-details-view/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "libs/transactions-journey/feature-transaction-details-view/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "libs/transactions-journey/data-access/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false,
"target": "ES2022",
"useDefineForClassFields": false
},
"angularCompilerOptions": {
"compilationMode": "partial"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../../dist/libs/transactions-journey/feature-transaction-view",
"lib": {
"entryFile": "src/index.ts"
}
}
11 changes: 11 additions & 0 deletions libs/transactions-journey/feature-transaction-view/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@backbase-gsa/internal-transactions-feature-transaction-view",
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^16.1.3",
"@angular/core": "^16.1.3"
},
"dependencies": {
"tslib": "^2.3.1"
}
}
17 changes: 17 additions & 0 deletions libs/transactions-journey/feature-transaction-view/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@
"sourceRoot": "libs/transactions-journey/feature-transaction-view/src",
"prefix": "backbase",
"targets": {

"build": {
"executor": "@nx/angular:package",
"outputs": ["{workspaceRoot}/dist/libs/transactions-journey/feature-transaction-view"],
"options": {
"project": "libs/transactions-journey/feature-transaction-view/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "libs/transactions-journey/feature-transaction-view/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "libs/transactions-journey/feature-transaction-view/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/transactions-journey/feature-transaction-view"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@
transaction.bookingDate | date : 'MMM. d'
}}</span>
<span class="transactions-item__description">
<span class="transactions-item__counterParty">{{
transaction.counterPartyName || transaction.merchant?.name
}}</span>
<span class="transactions-item__counterParty"
>{{ transaction.counterPartyName || transaction.merchant?.name }}
<img
src="./assets/transactions-journey/{{ iconName }}"
width="20"
height="20"
[alt]="iconName"
/>
</span>

<span class="transactions-item__transactionType">
{{ transaction.type }}
<ng-container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from '../../extensions';
import { AmountModule } from '@backbase/ui-ang/amount';
import { CommonModule } from '@angular/common';

import { IconMap } from '@backbase-gsa/internal-transactions-shared-data';
@Directive({
selector: '[bbTransactionsItemAdditions]',
standalone: true,
Expand All @@ -40,7 +40,10 @@ export class TransactionItemAdditionalDetailsDirective extends ViewExtensionDire
export class TransactionItemComponent implements OnChanges {
@Input()
public transaction!: TransactionItem;
@Input()
public categoryName: string | undefined;

public iconName = 'default';
public amount = 0;
public isAmountPositive = true;
public additionsDetails?: Type<TransactionAdditionalDetailsComponent>;
Expand Down Expand Up @@ -70,5 +73,7 @@ export class TransactionItemComponent implements OnChanges {
counterPartyAccountNumber: this.transaction.counterPartyAccountNumber,
};
}
this.iconName =
IconMap[this.categoryName?.toLowerCase().replace(/\s/g, '') ?? 'default'];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@
data-role="transactions-view__item-container"
>
<a class="list-link" [routerLink]="['./', item.id]">
<bb-transaction-item [transaction]="item"></bb-transaction-item>
<bb-transaction-item
[transaction]="item"
[categoryName]="item.category"
></bb-transaction-item>
</a>
</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false,
"target": "ES2022",
"useDefineForClassFields": false
},
"angularCompilerOptions": {
"compilationMode": "partial"
}
}
1 change: 1 addition & 0 deletions libs/transactions-journey/shared-data/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './lib/config/constants/dynamic-translations';
export * from './lib/config/constants/icon-map';
export * from './lib/config/model/tracker-events';
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const IconMap: Record<string, string> = {
travel: 'travel.png',
'alcohol&bars': 'food.png',
default: 'default.png',
};
9 changes: 9 additions & 0 deletions libs/transactions-journey/shell/ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../../dist/libs/transactions-journey/shell",
"assets": ["./assets"],
"lib": {
"entryFile": "src/index.ts"
}
}

11 changes: 11 additions & 0 deletions libs/transactions-journey/shell/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@backbase-gsa/transactions-journey",
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^16.1.3",
"@angular/core": "^16.1.3"
},
"dependencies": {
"tslib": "^2.3.1"
}
}
17 changes: 17 additions & 0 deletions libs/transactions-journey/shell/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@
"sourceRoot": "libs/transactions-journey/shell/src",
"prefix": "bb",
"targets": {

"build": {
"executor": "@nx/angular:package",
"outputs": ["{workspaceRoot}/dist/libs/transactions-journey/shell"],
"options": {
"project": "libs/transactions-journey/shell/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "libs/transactions-journey/shell/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "libs/transactions-journey/shell/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/transactions-journey/shell"],
Expand Down
11 changes: 11 additions & 0 deletions libs/transactions-journey/shell/tsconfig.lib.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false,
"target": "ES2022",
"useDefineForClassFields": false
},
"angularCompilerOptions": {
"compilationMode": "partial"
}
}
Loading