Skip to content

Commit

Permalink
Merge pull request #3709 from Tangerine-Community/enable-js-code-in-f…
Browse files Browse the repository at this point in the history
…eedback-page

feat(editor): Allow users to Add custom code Javascript in Feedback page
  • Loading branch information
esurface committed Jun 18, 2024
2 parents c68dd41 + a2f1b7f commit 0fd1e83
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ <h3>Tasks/Subtasks with Feedback</h3>
<mat-form-field>
<textarea matInput placeholder="Feedback message" [(ngModel)]="message">{{message}}</textarea>
</mat-form-field>
<mat-form-field>
<textarea matInput placeholder="Custom JS Code" [(ngModel)]="customJSCode">{{customJSCode}}</textarea>
</mat-form-field>
<div style="display: flex; justify-content: flex-end">
<div mat-dialog-actions>
<button mat-button (click)="onNoClick()">Cancel</button> <button mat-raised-button color="primary" (click)="save()">Save feedback</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export class FeedbackEditorComponent implements OnInit {
skill:string = ""
assignment:string = ""
message:string = ""
customJSCode:string = ""
formItems:any
formItem:string
formItemName:string
Expand Down Expand Up @@ -122,6 +123,7 @@ export class FeedbackEditorComponent implements OnInit {
this.skill = ""
this.assignment = ""
this.message = ""
this.customJSCode = ""
this.formItem = ""

this.showFeedbackForm = true
Expand All @@ -140,6 +142,7 @@ export class FeedbackEditorComponent implements OnInit {
this.feedback.skill = this.skill
this.feedback.assignment = this.assignment
this.feedback.message = this.message
this.feedback.customJSCode = this.customJSCode
this.feedback.formItem = this.formItem
this.feedbackService.update(this.groupName, this.formId, this.feedback)
.then(async (data) => {
Expand Down Expand Up @@ -168,6 +171,7 @@ export class FeedbackEditorComponent implements OnInit {
this.skill = this.feedback.skill
this.assignment = this.feedback.assignment
this.message = this.feedback.message
this.customJSCode = this.feedback.customJSCode
this.formItem = this.feedback.formItem

this.percentileOptions = this.createPercentileOptions(null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ export class Feedback {
skill:string;
assignment:string;
message:string;
customJSCode: string;
messageTruncated: string; // for listing
}

0 comments on commit 0fd1e83

Please sign in to comment.