Skip to content

Commit 9cb9758

Browse files
Add canChangeProblemStatus to user
1 parent 00bf33f commit 9cb9758

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

frontend/src/app/shared/displayTextMappings.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Dataset, EntailmentLabel } from "@/types";
1+
import { Dataset, EntailmentLabel, ProblemStatus } from "@/types";
22

33
export const entailmentLabels: Record<EntailmentLabel, string> = {
44
[EntailmentLabel.ENTAILMENT]: $localize`Entailment`,
@@ -13,3 +13,9 @@ export const datasetLabels: Record<Dataset, string> = {
1313
[Dataset.SNLI]: "SNLI",
1414
[Dataset.USER]: "User",
1515
};
16+
17+
export const statusLabels: Record<ProblemStatus, string> = {
18+
[ProblemStatus.GOLD]: $localize`Gold`,
19+
[ProblemStatus.SILVER]: $localize`Silver`,
20+
[ProblemStatus.BRONZE]: $localize`Bronze`,
21+
};

frontend/src/app/user/models/user.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface UserResponse {
1212
canAddLabelAnnotations: boolean;
1313
canCopyProblem: boolean;
1414
canChangeProblemVisibility: boolean;
15+
canChangeProblemStatus: boolean;
1516
}
1617

1718
// Corresponds to frontend user type.
@@ -37,6 +38,7 @@ export class User {
3738
public canAddLabelAnnotations: boolean,
3839
public canCopyProblem: boolean,
3940
public canChangeProblemVisibility: boolean,
41+
public canChangeProblemStatus: boolean,
4042
) { }
4143
}
4244

frontend/src/app/user/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export const parseUserData = (result: UserResponse | null): User | null => {
3636
result.canAddLabelAnnotations,
3737
result.canCopyProblem,
3838
result.canChangeProblemVisibility,
39+
result.canChangeProblemStatus,
3940
);
4041
};
4142

0 commit comments

Comments
 (0)