Skip to content

Commit

Permalink
chore(distribution): cleanup document header template
Browse files Browse the repository at this point in the history
  • Loading branch information
anehx committed Oct 21, 2022
1 parent 10619bf commit 8edee8c
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 35 deletions.
6 changes: 4 additions & 2 deletions packages/distribution/addon/components/cd-document-header.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p class="uk-text-large uk-margin-remove uk-flex uk-flex-middle">
<div class="uk-text-large uk-flex uk-flex-middle" data-test-document-header>
<div class="uk-width-expand">
{{@name}}
{{#if @group}}
Expand All @@ -9,4 +9,6 @@
{{/if}}
</div>
{{yield}}
</p>
</div>

<hr />
49 changes: 22 additions & 27 deletions packages/distribution/addon/components/cd-inquiry-answer-form.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,32 @@
@name={{content.document.rootForm.raw.name}}
@status={{if (eq this.inquiry.status "READY") this.answerStatus}}
>
<div class="uk-flex uk-flex-middle">
<CdInquiryDialog::InquiryDeadline @inquiry={{this.inquiry}} />
<CdInquiryDialog::InquiryDeadline @inquiry={{this.inquiry}} />

{{#if this.inquiryDetails.length}}
<a
href=""
class="uk-margin-small-left uk-link-reset"
{{uk-tooltip
(if
this.isExpanded
(t "caluma.distribution.answer.details.hide")
(t "caluma.distribution.answer.details.show")
)
{{#if this.inquiryDetails.length}}
<button
class="uk-icon-button uk-margin-left"
type="button"
{{uk-tooltip
(if
this.isExpanded
(t "caluma.distribution.answer.details.hide")
(t "caluma.distribution.answer.details.show")
)
}}
{{on "click" this.toggle}}
>
<UkIcon
@icon={{if
this.isExpanded
"chevron-double-right"
"chevron-double-left"
}}
{{on "click" this.toggle}}
>
<UkIcon
@icon={{if
this.isExpanded
"chevron-double-right"
"chevron-double-left"
}}
/>
</a>
{{/if}}
</div>

/>
</button>
{{/if}}
</CdDocumentHeader>

<hr />

<div class="uk-margin uk-text-italic inquiry-answer-form__request">
<CdInquiryDialog::InquiryPart
@inquiry={{this.inquiry}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
}}
/>

<hr />
{{#if
(and
(cannot "send inquiry" this.inquiry)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ module("Integration | Component | cd-document-header", function (hooks) {
/>
`);

assert.dom("p.uk-text-large").containsText("Test");
assert.dom("p.uk-text-large .uk-label").hasText("Test");
assert.dom("[data-test-document-header]").containsText("Test");
assert.dom("[data-test-document-header] .uk-label").hasText("Test");

this.set("status", null);

assert.dom("p.uk-text-large .uk-label").doesNotExist();
assert.dom("[data-test-document-header] .uk-label").doesNotExist();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module("Integration | Component | cd-inquiry-answer-form", function (hooks) {
await render(hbs`<CdInquiryAnswerForm @inquiry={{this.inquiry.id}} />`);

assert
.dom("p.uk-text-large")
.dom("[data-test-document-header]")
.containsText(
"Inquiry answer t:caluma.distribution.answer.buttons.compose.status:()"
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module("Integration | Component | cd-inquiry-edit-form", function (hooks) {
await render(hbs`<CdInquiryEditForm @inquiry={{this.inquiry.id}} />`);

assert
.dom("p.uk-text-large")
.dom("[data-test-document-header]")
.hasText("Inquiry (group2) t:caluma.distribution.status.draft:()");
assert.dom("form").exists();
assert
Expand Down

0 comments on commit 8edee8c

Please sign in to comment.