Skip to content

Commit e3e959d

Browse files
authored
Merge pull request #3271 from codecrafters-io/refactor-remove-deprecated-card
refactor(autofix-request): remove deprecated card component
2 parents 7fbdbf3 + 09c1ad7 commit e3e959d

File tree

4 files changed

+15
-64
lines changed

4 files changed

+15
-64
lines changed

app/components/course-admin/submissions-page/submission-details/autofix-container.hbs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
<div class="course-admin-submission-autofix-container" ...attributes>
22
{{#if this.latestAutofixRequest}}
3-
<CourseAdmin::SubmissionsPage::SubmissionDetails::AutofixRequestCard @autofixRequest={{this.latestAutofixRequest}} class="mb-4" />
3+
<div class="prose prose-sm prose-compact dark:prose-invert mb-4">
4+
<a class="flex items-center gap-1" href={{this.latestAutofixRequest.adminUrl}} target="_blank" rel="noopener noreferrer">
5+
<span>Admin Panel</span>
6+
{{svg-jar "external-link" class="w-4 h-4"}}
7+
</a>
8+
</div>
9+
10+
<div class="dark">
11+
<CoursePage::TestResultsBar::AutofixRequestCard @autofixRequest={{this.latestAutofixRequest}} class="mb-4" />
12+
</div>
413
{{else}}
514
<div class="bg-gray-800 p-4 text-white font-mono text-xs leading-relaxed rounded-sm mb-4">
615
This submission doesn't have any autofix requests.

app/components/course-admin/submissions-page/submission-details/autofix-request-card.hbs

Lines changed: 0 additions & 31 deletions
This file was deleted.

app/components/course-admin/submissions-page/submission-details/autofix-request-card.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

app/models/autofix-request.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Model, { attr, belongsTo } from '@ember-data/model';
22
import RepositoryModel from 'codecrafters-frontend/models/repository';
33
import SubmissionModel from 'codecrafters-frontend/models/submission';
4+
import config from 'codecrafters-frontend/config/environment';
45

56
export default class AutofixRequestModel extends Model {
67
@belongsTo('submission', { async: false, inverse: 'autofixRequests' }) declare submission: SubmissionModel;
@@ -16,6 +17,10 @@ export default class AutofixRequestModel extends Model {
1617
@attr('string') declare status: string; // 'in_progress' | 'success' | 'failure' | 'error'
1718
@attr('string') declare summary: string;
1819

20+
get adminUrl() {
21+
return `${config.x.backendUrl}/admin/autofix_requests/${this.id}`;
22+
}
23+
1924
get creatorTypeIsStaff() {
2025
return this.creatorType === 'staff';
2126
}

0 commit comments

Comments
 (0)