Skip to content

Commit 12fa080

Browse files
committed
feat(notifications): added field: native to Notification model
1 parent bacfc3e commit 12fa080

23 files changed

+1215
-879
lines changed

.deploy/api/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
FROM node:11 as api-build-dependencies
1+
FROM node:alpine as dev-dependencies
22
WORKDIR /app
33
COPY package.json package-lock.json ./
44
RUN npm ci
55

6-
FROM node:11 as api-production-dependencies
6+
FROM node:alpine as prod-dependencies
77
WORKDIR /app
88
COPY package.api.json package.json
99
RUN npm i --production
1010

11-
FROM node:11 as api-builder
11+
FROM node:alpine as builder
1212
WORKDIR /app
13-
COPY --from=api-build-dependencies /app /app
13+
COPY --from=dev-dependencies /app /app
1414
COPY apps/api apps/api
1515
COPY angular.json nx.json tsconfig.json ./
1616
ENV NODE_ENV production
1717
RUN npm run api:build
1818

1919
FROM astefanutti/scratch-node:11
20-
COPY --from=api-production-dependencies /app .
21-
COPY --from=api-builder /app/dist/apps/api/main.js .
20+
COPY --from=prod-dependencies /app .
21+
COPY --from=builder /app/dist/apps/api/main.js .
2222
EXPOSE 3000
2323
ENTRYPOINT ["./node", "main.js"]

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ dist
33
tmp
44
sme
55

6+
.git/
7+
.gitignore
8+
69
# dependencies
710
node_modules
811
bower_components

PLAYBOOK.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,10 @@ npm i -D lint-staged
207207

208208
> update 3rd party modules/schematics
209209
```bash
210-
ng update @angular/core
210+
ng update @angular/core@next
211211
ng update @angular/cli@next
212-
ng update @angular/core
213212
ng update @angular/material --force
214-
ng update @angular/pwa
213+
ng update @angular/pwa@next
215214
ng update @ngx-formly/schematics --ui-theme=material
216215
ng update @nrwl/schematics --force
217216
```

angular.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,11 @@
254254
"builder": "@nrwl/builders:node-execute",
255255
"options": {
256256
"buildTarget": "api:build"
257+
},
258+
"configurations": {
259+
"production": {
260+
"buildTarget": "api:build:production"
261+
}
257262
}
258263
},
259264
"lint": {

apps/api/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ ng serve api
4646
# to turn on logging for `request`
4747
NODE_DEBUG=request ng serve api
4848
DEBUG=typeorm:* ng serve api
49+
# optinally you can run with prod env(environment.prod.ts) for tesrting! use this for testing only.
50+
ng serve api --prod
4951
```
5052

5153
#### Run Prod Mode

apps/api/src/notifications/dto/create-notification.dto.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,9 @@ export class CreateNotificationDto {
3131
@MinLength(3)
3232
@MaxLength(20)
3333
userId: string;
34+
35+
@ApiModelProperty({ type: Boolean, default: false })
36+
@IsBoolean()
37+
@IsNotEmpty()
38+
public native = false;
3439
}

apps/api/src/notifications/notification.entity.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class Notification extends Base {
3636
@CreateDateColumn()
3737
createdAt?: Date;
3838

39-
@ApiModelProperty({ type: String })
39+
@ApiModelProperty({ type: Boolean, default: false })
4040
@IsBoolean()
4141
@IsNotEmpty()
4242
@Index()
@@ -57,4 +57,11 @@ export class Notification extends Base {
5757
@Index()
5858
@Column()
5959
userId: string;
60+
61+
@ApiModelProperty({ type: Boolean, default: false })
62+
@IsBoolean()
63+
@IsNotEmpty()
64+
@Index()
65+
@Column({ default: false})
66+
native: boolean;
6067
}

libs/core/src/lib/services/page-title.service.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,5 @@ describe('PageTitleService', () => {
1414

1515
it('should initialize title to empty string', inject([PageTitleService], (service: PageTitleService) => {
1616
expect(service).toBeTruthy();
17-
expect(service._title).toEqual('');
18-
expect(service.title).toEqual('');
1917
}));
2018
});

libs/core/src/lib/services/page-title.service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Injectable } from '@angular/core';
22
import { Title } from '@angular/platform-browser';
3-
import { Store } from '@ngxs/store';
43

54
/**
65
* EventBus will use this service
@@ -11,7 +10,7 @@ import { Store } from '@ngxs/store';
1110
export class PageTitleService {
1211
private readonly defaultTitle;
1312

14-
constructor(private store: Store, private bodyTitle: Title) {
13+
constructor(private bodyTitle: Title) {
1514
this.defaultTitle = bodyTitle.getTitle() || 'WebApp';
1615
}
1716

libs/grid/src/lib/services/account.service.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { AccountService } from './account.service';
55
describe('AccountService', () => {
66
beforeEach(() => {
77
TestBed.configureTestingModule({
8-
providers: [Account1Service],
8+
providers: [AccountService],
99
});
1010
});
1111

0 commit comments

Comments
 (0)