Skip to content

Commit c6fcb10

Browse files
committed
wip
1 parent 1b397b4 commit c6fcb10

6 files changed

Lines changed: 27 additions & 8 deletions

File tree

backend/src/controllers/dto.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {
3434
EmailTemplateSize,
3535
FrontendSettings,
3636
Settings,
37+
ProjectSettings,
3738
} from "../entities/settings";
3839
import { User } from "../entities/user";
3940
import { UserRole } from "../entities/user-role";
@@ -91,6 +92,22 @@ export class ApplicationSettingsDTO implements DTO<ApplicationSettings> {
9192
@IsNumber()
9293
@Expose()
9394
public hoursToConfirm!: number;
95+
@Type(() => Date)
96+
@IsDate()
97+
@Expose()
98+
public fillProfileFormFrom!: Date;
99+
@Type(() => Date)
100+
@IsDate()
101+
@Expose()
102+
public fillProfileFormUntil!: Date;
103+
@Type(() => Date)
104+
@IsDate()
105+
@Expose()
106+
public acceptanceDeadline!: Date;
107+
@Type(() => Date)
108+
@IsDate()
109+
@Expose()
110+
public confirmSpotUntil!: Date;
94111
}
95112

96113
export class ProjectSettingsDTO implements DTO<ProjectSettings> {

backend/src/entities/application-settings.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ export class ApplicationSettings {
3030
@Column()
3131
public hoursToConfirm!: number;
3232
@Column()
33-
public fillProfileFormFrom: Date;
33+
public fillProfileFormFrom!: Date;
3434
@Column()
35-
public fillProfileFormTo: Date;
35+
public fillProfileFormUntil!: Date;
3636
@Column()
37-
public acceptanceDeadline: Date;
37+
public acceptanceDeadline!: Date;
3838
@Column()
39-
public confirmSpotUntil: Date;
39+
public confirmSpotUntil!: Date;
4040
}

backend/src/entities/settings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class Settings {
7171
public email!: EmailSettings;
7272
@Type(() => ProjectSettings)
7373
@Column(() => ProjectSettings)
74-
public rating!: ProjectSettings;
74+
public project!: ProjectSettings;
7575
}
7676

7777
/**

backend/src/services/settings-service.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
EmailTemplate,
1010
FrontendSettings,
1111
Settings,
12+
ProjectSettings,
1213
} from "../entities/settings";
1314
import {
1415
ConfigurationServiceToken,
@@ -102,6 +103,7 @@ export class SettingsService implements ISettingsService {
102103
settings.application = this.getDefaultApplicationSettings();
103104
settings.frontend = this.getDefaultFrontendSettings();
104105
settings.email = this.getDefaultEmailSettings();
106+
settings.project = this.getDefaultProjectSettings();
105107
return settings;
106108
}
107109

frontend/src/components/pages/status.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const Status = () => {
3030

3131
const confirmationDays = Math.floor(settings.application.hoursToConfirm / 24);
3232
const fillProfileFormFrom = settings.application.fillProfileFormFrom;
33-
const fillProfileFormTo = settings.application.fillProfileFormTo;
33+
const fillProfileFormUntil = settings.application.fillProfileFormUntil;
3434
const acceptanceDeadline = settings.application.acceptanceDeadline;
3535
const confirmSpotUntil = settings.application.confirmSpotUntil;
3636
const isExpired = user == null ? false : isConfirmationExpired(user);
@@ -102,7 +102,7 @@ export const Status = () => {
102102
<InternalLink to={Routes.ProfileForm}>
103103
profile form
104104
</InternalLink>
105-
, any time between <b>{fillProfileFormFrom} - {fillProfileFormTo}</b>
105+
, any time between <b>{fillProfileFormFrom} - {fillProfileFormUntil}</b>
106106
</Text>
107107
</>
108108
)}

frontend/src/components/settings/project-rating/rating-criteria-settings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export const ProjectProjectSettings = () => {
9191

9292
useEffect(() => {
9393
// Only update if settings are loaded
94-
if (settings.rating) {
94+
if (settings.project) {
9595
api.updateSettings(settings as SettingsDTO);
9696
}
9797
}, [settings]);

0 commit comments

Comments
 (0)