Skip to content

Commit

Permalink
Merge pull request #425 from lblod/prettier
Browse files Browse the repository at this point in the history
Apply Prettier to the codebase
  • Loading branch information
dkozickis authored May 9, 2024
2 parents 194dbe8 + 69da054 commit 825c94d
Show file tree
Hide file tree
Showing 89 changed files with 1,169 additions and 807 deletions.
5 changes: 5 additions & 0 deletions .changeset/strong-weeks-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lblod/ember-rdfa-editor-lblod-plugins": patch
---

Apply Prettier to the codebase
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,12 @@
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try

# CI/CD
.changeset/
.github/
.woodpecker/
pnpm-lock.yaml

# Docs
*.md
2 changes: 1 addition & 1 deletion .release-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
"ignoreVersion": true,
"allowSameVersion": true
}
}
}
6 changes: 6 additions & 0 deletions .woodpecker/.verify-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ steps:
commands:
- corepack enable
- pnpm lint:hbs
lint-prettier:
image: node:20-slim
group: lint
commands:
- corepack enable
- pnpm lint:prettier
test:
image: danlynn/ember-cli:4.12.1
commands:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{{! @glint-nocheck: not typesafe yet }}
<div>
{{#each this.structureTypes as |structureType|}}
<li class="au-c-list__item">
<AuButton @icon={{this.AddIcon}} @iconAlignment="left" @skin="link" @disabled={{not (this.canInsertStructure structureType)}}
{{on 'click' (fn this.insertStructure structureType)}}>
{{t structureType.translations.insert}}
</AuButton>
</li>
<li class='au-c-list__item'>
<AuButton
@icon={{this.AddIcon}}
@iconAlignment='left'
@skin='link'
@disabled={{not (this.canInsertStructure structureType)}}
{{on 'click' (fn this.insertStructure structureType)}}
>
{{t structureType.translations.insert}}
</AuButton>
</li>
{{/each}}
</div>
89 changes: 50 additions & 39 deletions addon/components/article-structure-plugin/structure-card.hbs
Original file line number Diff line number Diff line change
@@ -1,28 +1,43 @@
{{! @glint-nocheck: not typesafe yet }}
{{#unless this.isOutsideStructure}}
<AuCard @flex={{true}} @divided={{true}} @expandable={{false}} @shadow={{true}} @size="flush" as |c|>
<c.header class="au-u-hidden-visually">
<AuHeading @level="3" @skin="6">{{t "article-structure-plugin.title.structure-card"}}</AuHeading>
<AuCard
@flex={{true}}
@divided={{true}}
@expandable={{false}}
@shadow={{true}}
@size='flush'
as |c|
>
<c.header class='au-u-hidden-visually'>
<AuHeading @level='3' @skin='6'>{{t
'article-structure-plugin.title.structure-card'
}}</AuHeading>
</c.header>
<c.content class="au-c-content--small">
<AuList @divider={{true}} class="au-u-padding-top-tiny au-u-padding-bottom-tiny" as |Item|>
<c.content class='au-c-content--small'>
<AuList
@divider={{true}}
class='au-u-padding-top-tiny au-u-padding-bottom-tiny'
as |Item|
>
<Item>
<AuButton
@icon={{this.ChevronUpIcon}}
@iconAlignment="left"
@skin="link"
@iconAlignment='left'
@skin='link'
@disabled={{not this.canMoveUp}}
{{on 'click' (fn this.moveStructure 'up')}}>
{{on 'click' (fn this.moveStructure 'up')}}
>
{{t this.currentStructureType.translations.move.up}}
</AuButton>
</Item>
<Item>
<AuButton
@icon={{this.ChevronDownIcon}}
@iconAlignment="left"
@skin="link"
@iconAlignment='left'
@skin='link'
@disabled={{not this.canMoveDown}}
{{on 'click' (fn this.moveStructure 'down')}}>
{{on 'click' (fn this.moveStructure 'down')}}
>
{{t this.currentStructureType.translations.move.down}}
</AuButton>
</Item>
Expand All @@ -32,23 +47,20 @@
<:hover as |hover|>
<AuButton
@icon={{this.BinIcon}}
@iconAlignment="left"
@skin="link"
@iconAlignment='left'
@skin='link'
@alert={{true}}
@disabled={{not this.canRemoveStructure}}
aria-describedby="remove-tooltip"
aria-describedby='remove-tooltip'
{{hover.velcroHook}}
{{hover.handleHover}}
{{on 'click' (fn this.removeStructure false)}}>
{{on 'click' (fn this.removeStructure false)}}
>
{{this.remove}}
</AuButton>
</:hover>
<:tooltip as |tooltip|>
<AuPill
id="remove-tooltip"
role="tooltip"
{{tooltip}}
>
<AuPill id='remove-tooltip' role='tooltip' {{tooltip}}>
{{t 'article-structure-plugin.remove.help-text'}}
</AuPill>
</:tooltip>
Expand All @@ -57,22 +69,19 @@
<:hover as |hover|>
<AuButton
@icon={{this.BinIcon}}
@iconAlignment="left"
@skin="link"
aria-describedby="remove-content-tooltip"
@iconAlignment='left'
@skin='link'
aria-describedby='remove-content-tooltip'
@alert={{true}}
{{hover.velcroHook}}
{{hover.handleHover}}
{{on 'click' (fn this.removeStructure true)}}>
{{on 'click' (fn this.removeStructure true)}}
>
{{this.removeWithContent}}
</AuButton>
</:hover>
<:tooltip as |tooltip|>
<AuPill
id="remove-content-tooltip"
role="tooltip"
{{tooltip}}
>
<AuPill id='remove-content-tooltip' role='tooltip' {{tooltip}}>
{{t 'article-structure-plugin.remove-with-content.help-text'}}
</AuPill>
</:tooltip>
Expand All @@ -81,7 +90,7 @@
</AuButtonGroup>
</Item>
{{#if this.currentStructureType.getStartNumber}}
<Item class="au-u-padding-left-small">
<Item class='au-u-padding-left-small'>
<AuFormRow>
{{#let (unique-id) as |id|}}
<AuLabel for={{id}}>
Expand All @@ -90,25 +99,27 @@
<AuInput
id={{id}}
value={{this.startNumberInputValue}}
{{on "change" this.onStartNumberChange}}
placeholder={{t 'article-structure-plugin.start-number.start-number'}}
type="number"
min="1"
{{on 'change' this.onStartNumberChange}}
placeholder={{t
'article-structure-plugin.start-number.start-number'
}}
type='number'
min='1'
/>
{{/let}}
</AuFormRow>
<AuButton
@iconAlignment="left"
class="au-u-margin-top-tiny"
@iconAlignment='left'
class='au-u-margin-top-tiny'
{{on 'click' this.setStructureStartNumber}}
>
{{t 'article-structure-plugin.start-number.set'}}
</AuButton>
<AuButton
@iconAlignment="left"
@skin="secondary"
@iconAlignment='left'
@skin='secondary'
@disabled={{not this.structureStartNumber}}
class="au-u-margin-top-tiny"
class='au-u-margin-top-tiny'
{{on 'click' this.resetStructureStartNumber}}
>
{{t 'article-structure-plugin.start-number.reset'}}
Expand Down
19 changes: 11 additions & 8 deletions addon/components/besluit-type-plugin/besluit-type-select.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
<PowerSelect
@renderInPlace={{true}}
@searchEnabled={{true}}
@searchMessage={{t "besluit-type-plugin.search-message"}}
@noMatchesMessage={{t "besluit-type-plugin.no-matches-message"}}
@searchMessage={{t 'besluit-type-plugin.search-message'}}
@noMatchesMessage={{t 'besluit-type-plugin.no-matches-message'}}
@search={{this.search}}
@options={{this.besluitTypes}}
@selected={{@selected}}
@onChange={{@onchange}} as |besluitType|>
@onChange={{@onchange}}
as |besluitType|
>
{{besluitType.label}}
</PowerSelect>
<p class='au-u-muted au-u-margin-tiny au-u-margin-bottom-small'>
Expand All @@ -18,11 +20,12 @@
{{#unless @selected}}
<AuAlert
@icon={{this.AlertTriangleIcon}}
@title={{t "besluit-type-plugin.alert-title"}}
@skin="warning"
@size="small"
class="au-u-margin-bottom-none au-u-margin-top-small">
<p>{{t "besluit-type-plugin.alert-body"}}</p>
@title={{t 'besluit-type-plugin.alert-title'}}
@skin='warning'
@size='small'
class='au-u-margin-bottom-none au-u-margin-top-small'
>
<p>{{t 'besluit-type-plugin.alert-body'}}</p>
</AuAlert>
{{/unless}}
{{/if}}
Expand Down
5 changes: 1 addition & 4 deletions addon/components/citation-plugin/citation-card.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
this.documentText
this.documentLegislationType
}}
{{did-update
this.update
this.activeDecoration
}}
{{did-update this.update this.activeDecoration}}
as |c|
>
<c.header>
Expand Down
2 changes: 1 addition & 1 deletion addon/components/citation-plugin/citation-insert.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{! @glint-nocheck: not typesafe yet }}
<li class="au-c-list__item">
<li class='au-c-list__item'>
<AuButton
@icon={{this.AddIcon}}
@iconAlignment='left'
Expand Down
10 changes: 7 additions & 3 deletions addon/components/citation-plugin/citations/article-list.hbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{{#if @articles.length}}
<AuList @direction="vertical" @divider={{true}} as |Item|>
<AuList @direction='vertical' @divider={{true}} as |Item|>
{{#each @articles as |article|}}
<Item>
<CitationPlugin::Citations::ArticlePreview
@insertArticleCitation={{fn @insertArticleCitation article}}
@article={{article}} />
@article={{article}}
/>
</Item>
{{/each}}
</AuList>
{{else}}
<Common::Search::AlertNoItems @fullSize={{@fullSize}} class={{if @fullSize "au-u-margin"}}/>
<Common::Search::AlertNoItems
@fullSize={{@fullSize}}
class={{if @fullSize 'au-u-margin'}}
/>
{{/if}}
20 changes: 12 additions & 8 deletions addon/components/citation-plugin/citations/article-preview.hbs
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
{{! @glint-nocheck: not typesafe yet }}
<div class="au-u-margin" ...attributes>
<AuHeading @level="3" @skin="5" class="au-u-margin-bottom-small">
{{@article.number}} ({{@article.dateInForce}} - {{if @article.dateNoLongerInForce @article.dateNoLongerInForce ""}})
<div class='au-u-margin' ...attributes>
<AuHeading @level='3' @skin='5' class='au-u-margin-bottom-small'>
{{@article.number}}
({{@article.dateInForce}}
-
{{if @article.dateNoLongerInForce @article.dateNoLongerInForce ''}})
</AuHeading>
<p>
{{this.content}}
</p>
<AuButton
@skin="primary"
@skin='primary'
@icon={{this.PlusTextIcon}}
@iconAlignment="left"
class="au-u-margin-top-small"
{{on "click" @insertArticleCitation}}>
{{t "citaten-plugin.references.refer-article"}}
@iconAlignment='left'
class='au-u-margin-top-small'
{{on 'click' @insertArticleCitation}}
>
{{t 'citaten-plugin.references.refer-article'}}
</AuButton>
</div>
Loading

0 comments on commit 825c94d

Please sign in to comment.