diff --git a/apps/api/src/domains/channel/channel/dtos/requests/create-channel-request.dto.ts b/apps/api/src/domains/channel/channel/dtos/requests/create-channel-request.dto.ts index 73c9545b0..3d44a1bea 100644 --- a/apps/api/src/domains/channel/channel/dtos/requests/create-channel-request.dto.ts +++ b/apps/api/src/domains/channel/channel/dtos/requests/create-channel-request.dto.ts @@ -97,7 +97,8 @@ export class CreateChannelRequestDto { @IsString() description: string | null; - @ApiProperty({ nullable: true, type: ImageConfigRequestDto }) + @ApiProperty({ required: false, nullable: true, type: ImageConfigRequestDto }) + @IsOptional() @IsNullable() @IsObject() imageConfig: ImageConfigRequestDto | null; diff --git a/apps/api/src/domains/feedback/feedback.service.ts b/apps/api/src/domains/feedback/feedback.service.ts index 28ddfa57f..e6b7face4 100644 --- a/apps/api/src/domains/feedback/feedback.service.ts +++ b/apps/api/src/domains/feedback/feedback.service.ts @@ -235,7 +235,6 @@ export class FeedbackService { fieldsByKey, fieldsToExport, ); - worksheet.addRow(convertedFeedback).commit(); feedbackIds.push(feedback.id); } @@ -261,7 +260,9 @@ export class FeedbackService { fieldsToExport, }) { const stream = new PassThrough(); - const csvStream = fastcsv.format({ headers: true }); + const csvStream = fastcsv.format({ + headers: fieldsToExport.map((field) => field.name), + }); csvStream.pipe(stream); diff --git a/apps/api/src/domains/statistics/feedback-issue/feedback-issue-statistics.service.spec.ts b/apps/api/src/domains/statistics/feedback-issue/feedback-issue-statistics.service.spec.ts index 0295625f5..9435fe981 100644 --- a/apps/api/src/domains/statistics/feedback-issue/feedback-issue-statistics.service.spec.ts +++ b/apps/api/src/domains/statistics/feedback-issue/feedback-issue-statistics.service.spec.ts @@ -96,7 +96,7 @@ describe('FeedbackIssueStatisticsService suite', () => { describe('getCountByDateByissue', () => { it('getting counts by day by issue succeeds with valid inputs', async () => { const from = new Date('2023-01-01'); - const to = faker.date.future(); + const to = new Date('2023-12-31'); const interval = 'day'; const issueIds = [faker.number.int(), faker.number.int()]; const dto = new GetCountByDateByIssueDto(); @@ -141,7 +141,7 @@ describe('FeedbackIssueStatisticsService suite', () => { }); it('getting counts by week by issue succeeds with valid inputs', async () => { const from = new Date('2023-01-01'); - const to = faker.date.future(); + const to = new Date('2023-12-31'); const interval = 'week'; const issueIds = [faker.number.int(), faker.number.int()]; const dto = new GetCountByDateByIssueDto(); @@ -182,7 +182,7 @@ describe('FeedbackIssueStatisticsService suite', () => { }); it('getting counts by month by issue succeeds with valid inputs', async () => { const from = new Date('2023-01-01'); - const to = faker.date.future(); + const to = new Date('2023-12-31'); const interval = 'month'; const issueIds = [faker.number.int(), faker.number.int()]; const dto = new GetCountByDateByIssueDto(); @@ -206,11 +206,11 @@ describe('FeedbackIssueStatisticsService suite', () => { statistics: [ { feedbackCount: 6, - date: '2023-01-01', + date: '2022-12-31', }, { feedbackCount: 4, - date: '2023-02-01', + date: '2023-01-31', }, ], }, diff --git a/apps/api/src/domains/statistics/feedback-issue/feedback-issue-statistics.service.ts b/apps/api/src/domains/statistics/feedback-issue/feedback-issue-statistics.service.ts index d15f47ecb..9104e572c 100644 --- a/apps/api/src/domains/statistics/feedback-issue/feedback-issue-statistics.service.ts +++ b/apps/api/src/domains/statistics/feedback-issue/feedback-issue-statistics.service.ts @@ -73,12 +73,12 @@ export class FeedbackIssueStatisticsService { acc.push(issue); } - const intervalCount = Math.floor( - DateTime.fromJSDate(from) - .until(DateTime.fromJSDate(new Date(curr.date))) + const intervalCount = Math.ceil( + DateTime.fromJSDate(new Date(curr.date)) + .until(DateTime.fromJSDate(to)) .length(interval), ); - const endOfInterval = DateTime.fromJSDate(from).plus({ + const endOfInterval = DateTime.fromJSDate(to).minus({ [interval]: intervalCount, }); diff --git a/apps/api/src/domains/statistics/feedback/feedback-statistics.service.spec.ts b/apps/api/src/domains/statistics/feedback/feedback-statistics.service.spec.ts index 91cfcfad9..84f0bf85c 100644 --- a/apps/api/src/domains/statistics/feedback/feedback-statistics.service.spec.ts +++ b/apps/api/src/domains/statistics/feedback/feedback-statistics.service.spec.ts @@ -99,7 +99,7 @@ describe('FeedbackStatisticsService suite', () => { describe('getCountByDateByChannel', () => { it('getting counts by day by channel succeeds with valid inputs', async () => { const from = new Date('2023-01-01'); - const to = faker.date.future(); + const to = new Date('2023-12-31'); const interval = 'day'; const channelIds = [faker.number.int(), faker.number.int()]; const dto = new GetCountByDateByChannelDto(); @@ -144,7 +144,7 @@ describe('FeedbackStatisticsService suite', () => { }); it('getting counts by week by channel succeeds with valid inputs', async () => { const from = new Date('2023-01-01'); - const to = faker.date.future(); + const to = new Date('2023-12-31'); const interval = 'week'; const channelIds = [faker.number.int(), faker.number.int()]; const dto = new GetCountByDateByChannelDto(); @@ -185,7 +185,7 @@ describe('FeedbackStatisticsService suite', () => { }); it('getting counts by month by channel succeeds with valid inputs', async () => { const from = new Date('2023-01-01'); - const to = faker.date.future(); + const to = new Date('2023-12-31'); const interval = 'month'; const channelIds = [faker.number.int(), faker.number.int()]; const dto = new GetCountByDateByChannelDto(); @@ -209,11 +209,11 @@ describe('FeedbackStatisticsService suite', () => { statistics: [ { count: 6, - date: '2023-01-01', + date: '2022-12-31', }, { count: 4, - date: '2023-02-01', + date: '2023-01-31', }, ], }, diff --git a/apps/api/src/domains/statistics/feedback/feedback-statistics.service.ts b/apps/api/src/domains/statistics/feedback/feedback-statistics.service.ts index d017f8006..9d60ebf0b 100644 --- a/apps/api/src/domains/statistics/feedback/feedback-statistics.service.ts +++ b/apps/api/src/domains/statistics/feedback/feedback-statistics.service.ts @@ -80,12 +80,12 @@ export class FeedbackStatisticsService { acc.push(channel); } - const intervalCount = Math.floor( - DateTime.fromJSDate(from) - .until(DateTime.fromJSDate(new Date(curr.date))) + const intervalCount = Math.ceil( + DateTime.fromJSDate(new Date(curr.date)) + .until(DateTime.fromJSDate(to)) .length(interval), ); - const endOfInterval = DateTime.fromJSDate(from).plus({ + const endOfInterval = DateTime.fromJSDate(to).minus({ [interval]: intervalCount, }); diff --git a/apps/api/src/domains/statistics/issue/issue-statistics.service.spec.ts b/apps/api/src/domains/statistics/issue/issue-statistics.service.spec.ts index 31096a3f1..f3abef703 100644 --- a/apps/api/src/domains/statistics/issue/issue-statistics.service.spec.ts +++ b/apps/api/src/domains/statistics/issue/issue-statistics.service.spec.ts @@ -91,7 +91,7 @@ describe('IssueStatisticsService suite', () => { describe('getCountByDate', () => { it('getting counts by date succeeds with valid inputs', async () => { const from = new Date('2023-01-01'); - const to = faker.date.future(); + const to = new Date('2023-12-31'); const interval = 'day'; const projectId = faker.number.int(); const dto = new GetCountByDateDto(); @@ -127,7 +127,7 @@ describe('IssueStatisticsService suite', () => { }); it('getting counts by week by channel succeeds with valid inputs', async () => { const from = new Date('2023-01-01'); - const to = faker.date.future(); + const to = new Date('2023-12-31'); const interval = 'week'; const projectId = faker.number.int(); const dto = new GetCountByDateDto(); @@ -159,7 +159,7 @@ describe('IssueStatisticsService suite', () => { }); it('getting counts by month by channel succeeds with valid inputs', async () => { const from = new Date('2023-01-01'); - const to = faker.date.future(); + const to = new Date('2023-12-31'); const interval = 'month'; const projectId = faker.number.int(); const dto = new GetCountByDateDto(); @@ -176,11 +176,11 @@ describe('IssueStatisticsService suite', () => { statistics: [ { count: 6, - date: '2023-01-01', + date: '2022-12-31', }, { count: 4, - date: '2023-02-01', + date: '2023-01-31', }, ], }); @@ -190,7 +190,7 @@ describe('IssueStatisticsService suite', () => { describe('getCount', () => { it('getting count succeeds with valid inputs', async () => { const from = new Date('2023-01-01'); - const to = faker.date.future(); + const to = new Date('2023-12-31'); const projectId = faker.number.int(); const dto = new GetCountDto(); dto.from = from; diff --git a/apps/api/src/domains/statistics/issue/issue-statistics.service.ts b/apps/api/src/domains/statistics/issue/issue-statistics.service.ts index 4cacfed0f..5ad608645 100644 --- a/apps/api/src/domains/statistics/issue/issue-statistics.service.ts +++ b/apps/api/src/domains/statistics/issue/issue-statistics.service.ts @@ -70,12 +70,12 @@ export class IssueStatisticsService { return { statistics: issueStatistics.reduce( (acc, curr) => { - const intervalCount = Math.floor( - DateTime.fromJSDate(from) - .until(DateTime.fromJSDate(new Date(curr.date))) + const intervalCount = Math.ceil( + DateTime.fromJSDate(new Date(curr.date)) + .until(DateTime.fromJSDate(to)) .length(interval), ); - const endOfInterval = DateTime.fromJSDate(from).plus({ + const endOfInterval = DateTime.fromJSDate(to).minus({ [interval]: intervalCount, }); diff --git a/apps/web/public/locales/en/common.json b/apps/web/public/locales/en/common.json index 564f1734a..bf83e5621 100644 --- a/apps/web/public/locales/en/common.json +++ b/apps/web/public/locales/en/common.json @@ -41,8 +41,7 @@ "total-channel": "Total Channel", "total-feedback": "Total Feedback", "create-project": "Create Project", - "no-project": "There are no registered projects.", - "in-progress": "In Progress" + "no-project": "There are no registered projects." }, "profile": { "title": "Profile", @@ -314,7 +313,9 @@ "guide": "Guide", "more": "more", "shrink": "shrink", - "feedback-detail": "Feedback Detail" + "feedback-detail": "Feedback Detail", + "create-channel-in-progress": "There is a Channel being created.", + "create-project-in-progress": "There is a Project being created." }, "toast": { "sign-in": "Login Successful", diff --git a/apps/web/public/locales/ja/common.json b/apps/web/public/locales/ja/common.json index c47685914..7ef1f0bb6 100644 --- a/apps/web/public/locales/ja/common.json +++ b/apps/web/public/locales/ja/common.json @@ -41,8 +41,7 @@ "total-channel": "全チャンネル数", "total-feedback": "全体フィードバック数", "create-project": "Project生成", - "no-project": "登録されたプロジェクトがありません。", - "in-progress": "進行中" + "no-project": "登録されたプロジェクトがありません。" }, "profile": { "title": "プロフィール", @@ -314,7 +313,9 @@ "guide": "案内", "more": "もっと", "shrink": "縮む", - "feedback-detail": "フィードバック詳細" + "feedback-detail": "フィードバック詳細", + "create-channel-in-progress": "作成中のChannelがあります。", + "create-project-in-progress": "作成中のProjectがあります。" }, "toast": { "sign-in": "ログイン成功", diff --git a/apps/web/public/locales/ko/common.json b/apps/web/public/locales/ko/common.json index eb5e70a26..efeb611e1 100644 --- a/apps/web/public/locales/ko/common.json +++ b/apps/web/public/locales/ko/common.json @@ -41,8 +41,7 @@ "total-channel": "전체 Channel 수", "total-feedback": "전체 피드백 수", "create-project": "Project 생성", - "no-project": "등록된 프로젝트가 없습니다.", - "in-progress": "진행중" + "no-project": "등록된 프로젝트가 없습니다." }, "profile": { "title": "프로필", @@ -314,7 +313,9 @@ "guide": "안내", "more": "더보기", "shrink": "줄이기", - "feedback-detail": "피드백 상세" + "feedback-detail": "피드백 상세", + "create-channel-in-progress": "생성중인 Channel이 있습니다.", + "create-project-in-progress": "생성중인 Project가 있습니다." }, "toast": { "sign-in": "로그인 성공", diff --git a/apps/web/src/components/etc/CreateChannelButton/CreateChannelButton.tsx b/apps/web/src/components/etc/CreateChannelButton/CreateChannelButton.tsx index b5525c2f2..a66ac50c5 100644 --- a/apps/web/src/components/etc/CreateChannelButton/CreateChannelButton.tsx +++ b/apps/web/src/components/etc/CreateChannelButton/CreateChannelButton.tsx @@ -85,7 +85,7 @@ const CreateChannelButton: React.FC = (props) => { - {t('main.index.in-progress')}{' '} + {t('text.create-channel-in-progress')}{' '} ({step + 1}/{CHANNEL_STEPS.length}) diff --git a/apps/web/src/components/etc/CreateProjectButton/CreateProjectButton.tsx b/apps/web/src/components/etc/CreateProjectButton/CreateProjectButton.tsx index a13e0b2b3..812987f5a 100644 --- a/apps/web/src/components/etc/CreateProjectButton/CreateProjectButton.tsx +++ b/apps/web/src/components/etc/CreateProjectButton/CreateProjectButton.tsx @@ -70,7 +70,7 @@ const CreateProjectButton: React.FC = ({ hasProject }) => { {!hasProject && t('main.index.no-project')} {hasProject && step > 0 && ( <> - {t('main.index.in-progress')}{' '} + {t('text.create-project-in-progress')}{' '} ({step + 1}/{PROJECT_STEPS.length}) diff --git a/apps/web/src/components/etc/NoChannel/NoChannel.tsx b/apps/web/src/components/etc/NoChannel/NoChannel.tsx index 4786f1ae5..7c7ea8e29 100644 --- a/apps/web/src/components/etc/NoChannel/NoChannel.tsx +++ b/apps/web/src/components/etc/NoChannel/NoChannel.tsx @@ -77,7 +77,7 @@ const NoChannel: React.FC = ({ projectId }) => { - {t('main.index.in-progress')}{' '} + {t('text.create-channel-in-progress')}{' '} ({step + 1}/{CHANNEL_STEPS.length})