Skip to content

Commit

Permalink
Merge pull request #1988 from DSD-DBS/prettier-plugin-classnames
Browse files Browse the repository at this point in the history
ci: Auto-format inline CSS classes with prettier
  • Loading branch information
MoritzWeber0 authored Nov 13, 2024
2 parents 83cc2f3 + 44afb55 commit 69221c4
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ repos:
- 'prettier-plugin-tailwindcss@^0.6.8'
- '@trivago/prettier-plugin-sort-imports@^4.3.0'
- 'tailwindcss@^3.4.12'
- 'prettier-plugin-classnames@^0.7.4'
- 'prettier-plugin-merge@^0.7.1'
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
Expand Down
2 changes: 2 additions & 0 deletions frontend/.prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ module.exports = {
plugins: [
require.resolve("prettier-plugin-tailwindcss"),
require.resolve("@trivago/prettier-plugin-sort-imports"),
require.resolve("prettier-plugin-classnames"),
require.resolve("prettier-plugin-merge"),
],
importOrder: ["^[./]"],
importOrderParserPlugins: ["typescript", "decorators-legacy"],
Expand Down
49 changes: 48 additions & 1 deletion frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"ngx-skeleton-loader": "^9.0.0",
"ngx-toastr": "^19.0.0",
"npm": "^10.9.0",
"prettier-plugin-classnames": "^0.7.4",
"prettier-plugin-merge": "^0.7.1",
"puppeteer": "^23.6.1",
"rxjs": "~7.8.1",
"semver": "^7.6.3",
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/app/general/footer/footer.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

<hr />
<div
class="flex h-full flex-wrap items-end justify-center px-3 py-2 text-gray-500 md:mx-5 md:justify-between"
class="flex h-full flex-wrap items-end justify-center px-3 py-2 text-gray-500 md:mx-5
md:justify-between"
>
<app-version class="px-2 pb-2 md:basis-1/3 md:p-0"></app-version>
<div class="px-2 text-center md:basis-1/3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ <h2 class="mb-5 text-xl font-medium">View diagrams</h2>
}
} @else {
<div
class="mb-2 flex h-[200px] flex-col items-center justify-center rounded border border-gray-400 py-[15px] text-center"
class="mb-2 flex h-[200px] flex-col items-center justify-center rounded border
border-gray-400 py-[15px] text-center"
>
<mat-icon class="scale-[2] text-red-900">error</mat-icon> <br />
Diagram export has failed. <br />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
} @else if (errorCode === "FILE_NOT_FOUND") {
<div
(click)="openModelComplexityBadgeDocs()"
class="flex size-full cursor-pointer items-center justify-between rounded border border-gray-400 p-2 text-center"
class="flex size-full cursor-pointer items-center justify-between rounded border
border-gray-400 p-2 text-center"
>
<mat-icon class="basis-[60px] scale-[2]">open_in_new</mat-icon>
<span class="basis-[calc(100%-60px)]">
Expand All @@ -40,7 +41,8 @@
</div>
} @else {
<div
class="flex size-full items-center justify-between rounded border border-gray-400 p-2 text-center"
class="flex size-full items-center justify-between rounded border border-gray-400 p-2
text-center"
>
<mat-icon class="basis-[60px] scale-[2]">error</mat-icon>
<span class="basis-[calc(100%-60px)]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ <h1 class="text-lg font-semibold">
[attr.data-testid]="'rating-' + rating"
mat-icon-button
type="button"
[class]="
[
'!flex',
getColorForRating(rating),
this.feedbackForm.get('rating')?.value === rating
? '!bg-gray-200'
: '',
].join(' ')
"
[ngClass]="[
'!flex',
getColorForRating(rating),
this.feedbackForm.get('rating')?.value === rating
? '!bg-gray-200'
: '',
]"
>
<mat-icon>
@switch (rating) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors
* SPDX-License-Identifier: Apache-2.0
*/
import { AsyncPipe } from '@angular/common';
import { AsyncPipe, NgClass } from '@angular/common';
import { Component, Inject } from '@angular/core';
import {
FormControl,
Expand Down Expand Up @@ -55,6 +55,7 @@ interface DialogData {
ReactiveFormsModule,
FormsModule,
AsyncPipe,
NgClass,
],
templateUrl: './feedback-dialog.component.html',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
(cdkDragEnded)="dragStop()"
>
<div
class="flex cursor-grab items-center justify-between gap-2 rounded-t p-1 active:cursor-grabbing"
class="flex cursor-grab items-center justify-between gap-2 rounded-t p-1
active:cursor-grabbing"
[ngClass]="session.focused ? 'bg-slate-100' : 'bg-slate-300'"
cdkDragHandle
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
}
@for (session of sortedResolvedHistory; track $index) {
<button
class="flex w-full flex-row items-center justify-between gap-5 rounded border bg-slate-100 p-2"
class="flex w-full flex-row items-center justify-between gap-5 rounded border
bg-slate-100 p-2"
(click)="requestSession(session)"
>
<div class="w-full flex-col items-center">
Expand Down

0 comments on commit 69221c4

Please sign in to comment.