Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
habdelra committed Nov 27, 2024
1 parent 4cc452a commit ea3c951
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
23 changes: 17 additions & 6 deletions packages/host/app/components/operator-mode/card-error-detail.gts
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { fn } from '@ember/helper';
import { on } from '@ember/modifier';
import { service } from '@ember/service';
import { Accordion, Button } from '@cardstack/boxel-ui/components';

import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';

import TriangleAlert from '@cardstack/boxel-icons/triangle-alert';

import { dropTask } from 'ember-concurrency';
import perform from 'ember-concurrency/helpers/perform';

import { Accordion, Button } from '@cardstack/boxel-ui/components';

import SwitchSubmodeCommand from '../../commands/switch-submode';
import { type CardError } from '../../resources/card-resource';

import type CommandService from '../../services/command-service';

interface Signature {
Expand Down Expand Up @@ -41,30 +45,37 @@ export default class CardErrorDetail extends Component<Signature> {
<template>
<Accordion as |A|>
<A.Item
data-test-error-detail-toggle
@onClick={{fn this.toggleDetail 'schema'}}
@isOpen={{this.showErrorDetail}}
>
<:title>
<TriangleAlert />
An error was encountered on this card:
<span class='error-detail'>{{this.args.title}}</span>
<span class='error-detail' data-test-error-title>{{@title}}</span>
</:title>
<:content>
<div class='actions'>
<Button
data-test-view-in-code-mode-button
@kind='primary'
{{on 'click' (perform this.viewInCodeMode)}}
>View in Code Mode</Button>
</div>
<div class='detail'>
<div class='detail-item'>
<div class='detail-title'>Details:</div>
<div class='detail-contents'>{{@error.message}}</div>
<div
class='detail-contents'
data-test-error-detail
>{{@error.message}}</div>
</div>
{{#if @error.meta.stack}}
<div class='detail-item'>
<div class='detail-title'>Stack trace:</div>
<pre>
<pre
data-test-error-stack
>
{{@error.meta.stack}}
</pre>
</div>
Expand Down
1 change: 1 addition & 0 deletions packages/host/app/components/operator-mode/card-error.gts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { TemplateOnlyComponent } from '@ember/component/template-only';

import FileAlert from '@cardstack/boxel-icons/file-alert';

const CardErrorComponent: TemplateOnlyComponent = <template>
Expand Down
2 changes: 1 addition & 1 deletion packages/host/app/components/operator-mode/stack-item.gts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ import { htmlComponent } from '../../lib/html-component';
import ElementTracker from '../../resources/element-tracker';
import Preview from '../preview';

import CardErrorDetail from './card-error-detail';
import CardError from './card-error';
import CardErrorDetail from './card-error-detail';

import OperatorModeOverlays from './overlays';

Expand Down

0 comments on commit ea3c951

Please sign in to comment.