Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

Commit

Permalink
Merge pull request #16 from SmartStockTz/migrate_angular_14
Browse files Browse the repository at this point in the history
Migrate angular 14
  • Loading branch information
joshuamshana authored Jun 26, 2022
2 parents 9dcb7e1 + b1f03e0 commit 4b03bd3
Show file tree
Hide file tree
Showing 11 changed files with 3,004 additions and 2,258 deletions.
3 changes: 1 addition & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,5 @@
}},
"cli": {
"analytics": false
},
"defaultProject": "web"
}
}
40 changes: 19 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "smartstock-web",
"version": "1.0.0",
"version": "1.0.1",
"scripts": {
"ng": "ng",
"box": "yarn install && yarn start",
Expand All @@ -13,33 +13,31 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~13.0.1",
"@angular/cdk": "^13.0.1",
"@angular/common": "~13.0.1",
"@angular/compiler": "~13.0.1",
"@angular/core": "~13.0.1",
"@angular/forms": "~13.0.1",
"@angular/material": "^13.0.1",
"@angular/platform-browser": "~13.0.1",
"@angular/platform-browser-dynamic": "~13.0.1",
"@angular/router": "~13.0.1",
"@angular/animations": "^14.0.3",
"@angular/cdk": "^14.0.3",
"@angular/common": "^14.0.3",
"@angular/compiler": "^14.0.3",
"@angular/core": "^14.0.3",
"@angular/forms": "^14.0.3",
"@angular/material": "^14.0.3",
"@angular/platform-browser": "^14.0.3",
"@angular/platform-browser-dynamic": "^14.0.3",
"@angular/router": "^14.0.3",
"bfast": "6.0.1",
"comlink": "^4.3.1",
"masonry-layout": "4.2.2",
"moment": "2.29.3",
"ngx-infinite-scroll": "13.0.2",
"ngx-masonry": "13.0.0",
"rxjs": "~7.4.0",
"smartstock-accounts": "1.0.0",
"smartstock-core": "1.0.1",
"smartstock-shop": "1.0.0",
"smartstock-accounts": "1.0.1",
"smartstock-core": "1.0.2",
"smartstock-shop": "1.0.1",
"tslib": "^2.0.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~13.0.2",
"@angular/cli": "~13.0.2",
"@angular/compiler-cli": "~13.0.1",
"@angular-devkit/build-angular": "^14.0.3",
"@angular/cli": "^14.0.3",
"@angular/compiler-cli": "^14.0.3",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^14.17.32",
Expand All @@ -51,10 +49,10 @@
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"ng-packagr": "^13.0.3",
"ng-packagr": "^14.0.2",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~4.4.4"
"typescript": "~4.7.4"
}
}
2 changes: 1 addition & 1 deletion projects/web-mock/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const routes: Routes = [
{
path: "account",
loadChildren: () =>
import("smartstockt-accounts").then((mod) => mod.AccountModule)
import("smartstock-accounts").then((mod) => mod.AccountModule)
}
];

Expand Down
2 changes: 1 addition & 1 deletion projects/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "smartstock-web",
"version": "1.0.0",
"version": "1.0.1",
"repository": {
"url": "git://github.com/smartstocktz/smartstock-web.git"
},
Expand Down
16 changes: 1 addition & 15 deletions projects/web/src/componets/product.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,7 @@ import {MallProduct} from '../models/mall-product';

@Component({
selector: 'app-product',
template: `
<div ngxMasonryItem class="product-item"
routerLink="/shops/{{product.shop.projectId}}" [queryParams]="{product:product.product}">
<img *ngIf="!noImage" (error)="hideImage()" [src]="product.images[0]" alt="{{product.product}}"/>
<div [class]="!noImage?'product-item-detail':'product-item-detail-no-image'">
<p [style]="noImage?{color: '#f5f5f5'}:{}" class="product-item-detail-category">{{product.product}}</p>
<p [style]="noImage?{color: 'white'}:{}"
class="product-item-detail-price">{{product.retailPrice | currency: 'TZS '}}</p>
</div>
<a routerLink="/shops/{{product.shop.projectId}}" [queryParams]="{product:product.product}"
class="product-item-detail-link">
by {{product.shop.businessName}}
</a>
</div>
`,
templateUrl: './product.html',
styleUrls: ['../styles/product.scss']
})
export class Product {
Expand Down
25 changes: 1 addition & 24 deletions projects/web/src/componets/products.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,7 @@ import {MallState} from '../states/mall.state';

@Component({
selector: 'app-products',
template: `
<div infiniteScroll
[infiniteScrollDistance]="5"
[infiniteScrollThrottle]="50"
[scrollWindow]="false"
(scrolled)="onScroll()"
class="products-container">
<app-join-promotion></app-join-promotion>
<ngx-masonry (layoutComplete)="donePopulate()" [ordered]="true" [options]="options">
<app-product [product]="product" *ngFor="let product of mallState.products | async"></app-product>
</ngx-masonry>
<div *ngIf="showLoadMore" class="load-more">
<button (click)="onScroll()"
mat-button color="primary" *ngIf="(mallState.loadProducts |async) === false">
Load More
</button>
<mat-progress-spinner *ngIf="(mallState.loadProducts | async) === true"
[diameter]="20"
color="primary"
mode="indeterminate">
</mat-progress-spinner>
</div>
</div>
`,
templateUrl: './products.html',
styleUrls: ['../styles/product.scss']
})

Expand Down
15 changes: 12 additions & 3 deletions projects/web/src/styles/product.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
.products-container {
display: flex;
flex-wrap: wrap;
margin: auto;
align-items: flex-start;
justify-content: center;
}

.product-item {
width: 243px;
background: transparent;
Expand All @@ -9,7 +17,8 @@
height: auto;
border-radius: 8px;
}
:hover{

:hover {
cursor: pointer;
}
}
Expand Down Expand Up @@ -65,7 +74,7 @@
color: #000000;
}

.product-item-detail-link{
.product-item-detail-link {
font-family: Roboto, "Helvetica Neue", sans-serif;
font-style: normal;
font-weight: 200;
Expand Down Expand Up @@ -129,4 +138,4 @@
.product-item {
width: 130px;
}
}
}
4 changes: 1 addition & 3 deletions projects/web/src/web.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import { DesktopDownloadsComponent } from "./componets/desktop-downloads.compone
import { MobileDownloadsComponent } from "./componets/mobile-downloads.component";
import { ProductsPage } from "./pages/products.page";
import { Products } from "./componets/products";
import { NgxMasonryModule } from "ngx-masonry";
import { Product } from "./componets/product";

const routes: Routes = [
Expand Down Expand Up @@ -137,8 +136,7 @@ const routes: Routes = [
MatIconModule,
ScrollingModule,
InfiniteScrollModule,
MatProgressSpinnerModule,
NgxMasonryModule
MatProgressSpinnerModule
]
})
export class WebModule {}
2 changes: 1 addition & 1 deletion projects/web/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/lib",
"target": "es2015",
"target": "es2020",
"declaration": true,
"declarationMap": true,
"inlineSources": true,
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"target": "es2020",
"module": "es2020",
"lib": [
"es2018",
Expand Down
Loading

0 comments on commit 4b03bd3

Please sign in to comment.