Skip to content

Commit 1d1c966

Browse files
Develop (#67)
* sprint backlog badge fix * Important bugix (#68) * Added endpoint to check if all stories for task are finished * Bugfixes --------- Co-authored-by: Martin Dagarin <[email protected]>
1 parent 626369b commit 1d1c966

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ ENV ARCH="${ARCH}" \
4545
CONTAINER_GROUP="node" \
4646
CONTAINER_USER="node" \
4747
DOCKER_CONTAINER=true \
48+
DATA_DIR="/data" \
4849
HOME="/root" \
4950
NODE_ENV="production" \
5051
PS1="\[\e]0;\u@\h: \w\a\]\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ " \
@@ -68,6 +69,8 @@ COPY root /
6869
COPY --from=build-backend /root/backend/dist /root/backend/package.json /root/backend/package-lock.json /app/
6970
RUN cd /app && \
7071
mkdir -p static && \
72+
mkdir -p /data && \
73+
chown -R ${CONTAINER_USER}:${CONTAINER_GROUP} /data && \
7174
npm install --only=prod
7275

7376
# Frontend files

backend/src/custom-config/multer-config.service.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Injectable, OnModuleInit } from '@nestjs/common';
1+
import { Injectable, OnModuleInit, Logger } from '@nestjs/common';
22
import { ConfigService } from '@nestjs/config';
33
import { MulterOptionsFactory } from '@nestjs/platform-express';
44
import { MulterOptions } from '@nestjs/platform-express/multer/interfaces/multer-options.interface';
@@ -7,15 +7,20 @@ import * as path from 'path';
77

88
@Injectable()
99
export class MulterConfigService implements MulterOptionsFactory, OnModuleInit {
10+
private readonly logger: Logger = new Logger(MulterConfigService.name);
1011

1112
constructor(
1213
private readonly configService: ConfigService,
1314
) {}
1415

1516
onModuleInit() {
1617
const p = path.join(this.configService.get<string>('DATA_DIR'), 'tmpupload');
17-
if (!fs.existsSync(p))
18-
fs.mkdirSync(p);
18+
try {
19+
if (!fs.existsSync(p))
20+
fs.mkdirSync(p);
21+
} catch (ex) {
22+
this.logger.warn(ex.message);
23+
}
1924
}
2025

2126
createMulterOptions(): MulterOptions | Promise<MulterOptions> {

backend/src/project/documentation/documentation.service.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Injectable } from '@nestjs/common';
1+
import { Injectable, Logger } from '@nestjs/common';
22
import { ConfigService } from '@nestjs/config';
33

44
import * as fs from 'fs';
@@ -8,6 +8,7 @@ import sanitize = require('sanitize-filename');
88

99
@Injectable()
1010
export class DocumentationService {
11+
private readonly logger: Logger = new Logger(DocumentationService.name);
1112

1213
private readonly rootDirectoryPath: string;
1314

@@ -17,8 +18,12 @@ export class DocumentationService {
1718
this.rootDirectoryPath = path.join(this.configService.get<string>('DATA_DIR'), 'project');
1819

1920
// Create directory if not exits
20-
if (!fs.existsSync(this.rootDirectoryPath))
21-
fs.mkdirSync(this.rootDirectoryPath);
21+
try {
22+
if (!fs.existsSync(this.rootDirectoryPath))
23+
fs.mkdirSync(this.rootDirectoryPath);
24+
} catch (ex) {
25+
this.logger.warn(ex.message);
26+
}
2227
}
2328

2429
getProjectDirPath(projectId: number): string {

frontend/src/pages/SprintBacklog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ function SprintBacklog() {
281281

282282
const isTaskFinished = (task: any) => {
283283
// return task.dateEnded != null;
284-
return task.category === 4;
284+
return task.category === 250;
285285
};
286286

287287
const renderStatus = (task: any) => {

0 commit comments

Comments
 (0)