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

Feat/dq allow year selection going back to 2000 #58

Merged
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
6 changes: 4 additions & 2 deletions src/domain/usecases/CreateQualityAnalysisUseCase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { SequentialRepository } from "$/domain/repositories/SequentialRepository
import { SettingsRepository } from "$/domain/repositories/SettingsRepository";
import { UserRepository } from "$/domain/repositories/UserRepository";

const previousYear = (new Date().getFullYear() - 1).toString();

export class CreateQualityAnalysisUseCase {
constructor(
private qualityAnalysisRepository: QualityAnalysisRepository,
Expand All @@ -33,7 +35,7 @@ export class CreateQualityAnalysisUseCase {
);

return QualityAnalysis.build({
endDate: defaultSettings.endDate,
endDate: previousYear,
id: getUid(`quality-analysis_${new Date().getTime()}`),
module: options.qualityAnalysis.module,
name: qualityAnalysisName,
Expand All @@ -43,7 +45,7 @@ export class CreateQualityAnalysisUseCase {
status: QualityAnalysisSection.getInitialStatus(),
});
}),
startDate: defaultSettings.startDate,
startDate: previousYear,
status: "In Progress",
lastModification: "",
countriesAnalysis: defaultSettings.countryIds,
Expand Down
2 changes: 1 addition & 1 deletion src/webapp/components/analysis-filter/AnalysisFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Id } from "$/domain/entities/Ref";

const currentYear = new Date().getFullYear();

export const periods = Collection.range(currentYear - 5, currentYear + 1)
export const periods = Collection.range(2000, currentYear + 1)
.map(period => {
return { value: period.toString(), text: period.toString() };
})
Expand Down
Loading