diff --git a/frontend_v2/src/app/components/challenge/challengephases/editphasemodal/editphasemodal.component.html b/frontend_v2/src/app/components/challenge/challengephases/editphasemodal/editphasemodal.component.html
index 924da573c7..de9de7325c 100644
--- a/frontend_v2/src/app/components/challenge/challengephases/editphasemodal/editphasemodal.component.html
+++ b/frontend_v2/src/app/components/challenge/challengephases/editphasemodal/editphasemodal.component.html
@@ -77,113 +77,99 @@
-
+
@@ -135,7 +140,7 @@
Challenge Settings
-
+
Edit Phase
@@ -151,29 +156,45 @@
Challenge Settings
#phaseselect
>
-
-
+
+
Phase Details
-
-
+
Is Public
-
-
+
Submission Visibility
+
+
+ Test Annotations
+
+
+
+
-
-
+
+
@@ -199,8 +220,8 @@
Challenge Settings
Leaderboard Visibility
-
-
+
@@ -216,14 +237,16 @@
Challenge Settings
{{ leaderboardPrecisionValue }}
@@ -232,11 +255,10 @@ Challenge Settings
-
-
+
@@ -251,8 +273,8 @@
Evaluation script
Evaluation Criteria
-
-
+
Evaluation Script
@@ -303,7 +325,6 @@ Submission worker logs
-
diff --git a/frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.scss b/frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.scss
index 1683fabdf0..d2fc82b7d3 100644
--- a/frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.scss
+++ b/frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.scss
@@ -17,6 +17,10 @@
}
}
+p {
+ margin: 6px 0px 25px 0px;
+}
+
.rangeslider {
width: 50%;
display: flex;
@@ -50,13 +54,13 @@ input {
border-bottom: none;
}
-:host ::ng-deep .mat-tab-label .mat-tab-label-content{
+:host ::ng-deep .mat-tab-label .mat-tab-label-content {
font-weight: $fw-light !important;
font-size: $fs-16 !important;
}
.phase-card {
- width:50vw;
+ width: 50vw;
}
.phase-button {
@@ -68,7 +72,7 @@ input {
}
.upload-container {
- text-align:center;
+ text-align: center;
}
@media (max-width: 992px) {
@@ -83,7 +87,7 @@ input {
}
}
-@media (max-width: 600px) {
+@media (max-width: 600px) {
.settings-section {
padding: 25px !important;
}
@@ -91,8 +95,8 @@ input {
justify-content: space-evenly;
}
.btn-floating {
- margin: 0%
- }
+ margin: 0%;
+ }
}
.example-chip-list {
diff --git a/frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts b/frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts
index fcb7813f23..72293fb12e 100644
--- a/frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts
+++ b/frontend_v2/src/app/components/challenge/challengesettings/challengesettings.component.ts
@@ -929,6 +929,68 @@ export class ChallengesettingsComponent implements OnInit, OnDestroy {
}
}
+ showCliInstructions() {
+ const SELF = this;
+ /**
+ * Parameters of the modal
+ */
+ const PARAMS = {
+ title: 'Instructions',
+ label: 'evaluation_details',
+ isCliInstructions: true,
+ };
+ SELF.globalService.showModal(PARAMS);
+ }
+
+ /**
+ * Edit test annotations of the phase
+ */
+ editTestAnnotations() {
+ const SELF = this;
+ SELF.apiCall = (params) => {
+ const FORM_DATA: FormData = new FormData();
+ FORM_DATA.append('test_annotation', params['test_annotation']);
+ SELF.apiService
+ .patchFileUrl(
+ SELF.endpointsService.updateChallengePhaseDetailsURL(
+ SELF.selectedPhase['challenge'],
+ SELF.selectedPhase['id']
+ ),
+ FORM_DATA
+ )
+ .subscribe(
+ (data) => {
+ SELF.globalService.showToast('success', 'The test annotations are successfully updated!');
+ },
+ (err) => {
+ SELF.globalService.showToast('error', err);
+ },
+ () => this.logger.info('EDIT-TEST-ANNOTATION-FINISHED')
+ );
+ };
+
+ /**
+ * Parameters of the modal
+ */
+ const PARAMS = {
+ title: 'Edit Test Annotations',
+ confirm: 'Submit',
+ deny: 'Cancel',
+ form: [
+ {
+ name: 'testAnnotation',
+ isRequired: true,
+ label: 'test_annotation',
+ placeholder: '',
+ type: 'file',
+ value: '',
+ },
+ ],
+ confirmCallback: SELF.apiCall,
+ };
+ SELF.globalService.showModal(PARAMS);
+ }
+
// Edit Leaderboard Details ->
/**
diff --git a/frontend_v2/src/app/components/utility/modal/modal.component.html b/frontend_v2/src/app/components/utility/modal/modal.component.html
index 1fbafcaff5..630291a705 100644
--- a/frontend_v2/src/app/components/utility/modal/modal.component.html
+++ b/frontend_v2/src/app/components/utility/modal/modal.component.html
@@ -3,8 +3,10 @@
{{ title }}
+
+
-
+
{{ content }}
@@ -46,7 +48,7 @@
>
-
diff --git a/frontend_v2/src/app/components/utility/modal/modal.component.scss b/frontend_v2/src/app/components/utility/modal/modal.component.scss
index 813a177be3..5dcf10ed9b 100644
--- a/frontend_v2/src/app/components/utility/modal/modal.component.scss
+++ b/frontend_v2/src/app/components/utility/modal/modal.component.scss
@@ -10,3 +10,15 @@
margin-right: 20px;
}
}
+
+code {
+ max-width: 650px;
+}
+
+.content-instructions {
+ width: 760px;
+}
+
+.cross-icon {
+ float: right;
+}
diff --git a/frontend_v2/src/app/components/utility/modal/modal.component.ts b/frontend_v2/src/app/components/utility/modal/modal.component.ts
index 89639303c0..b4fe5ba331 100644
--- a/frontend_v2/src/app/components/utility/modal/modal.component.ts
+++ b/frontend_v2/src/app/components/utility/modal/modal.component.ts
@@ -45,6 +45,11 @@ export class ModalComponent implements OnInit {
*/
isButtonDisabled: boolean;
+ /**
+ * Is Cli instructions modal
+ */
+ isCliInstructions = false;
+
/**
* If rich text editor required
*/
@@ -123,6 +128,16 @@ export class ModalComponent implements OnInit {
width: '720px',
};
+ /**
+ * Cli version
+ */
+ cliVersion = '';
+
+ /**
+ * Auth token
+ */
+ authToken = '';
+
/**
* Modal form items
*/
@@ -172,6 +187,9 @@ export class ModalComponent implements OnInit {
if (this.params['content']) {
this.content = this.params['content'];
}
+ if (this.params['isCliInstructions']) {
+ this.isCliInstructions = this.params['isCliInstructions'];
+ }
if (this.params['confirm']) {
this.confirm = this.params['confirm'];
}
@@ -196,7 +214,14 @@ export class ModalComponent implements OnInit {
if (this.isEditorRequired || this.isButtonDisabled) {
this.isDisabled = false;
}
- this.challengeService.currentChallenge.subscribe((challenge) => (this.challenge = challenge));
+
+ this.challengeService.currentChallenge.subscribe((challenge) => {
+ this.challenge = challenge;
+ if (this.challenge.cli_version !== null) {
+ this.cliVersion = this.challenge.cli_version;
+ }
+ });
+ this.authToken = this.globalService.getData('refreshJWT');
}
/**
@@ -237,6 +262,25 @@ export class ModalComponent implements OnInit {
self.confirmCallback(PARAMS);
}
+ /**
+ * Copy text to clipboard
+ */
+ copyTextToClipboard(ref: HTMLElement) {
+ const textBox = document.createElement('textarea');
+ textBox.style.position = 'fixed';
+ textBox.style.left = '0';
+ textBox.style.top = '0';
+ textBox.style.opacity = '0';
+ textBox.value = ref.innerText.split('$ ')[1];
+ document.body.appendChild(textBox);
+ textBox.focus();
+ textBox.select();
+ document.execCommand('copy');
+ document.body.removeChild(textBox);
+
+ this.globalService.showToast('success', 'Command copied to clipboard');
+ }
+
/**
* Modal Denied.
*/