Skip to content

Commit

Permalink
use eslint-config-prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreezag committed Sep 22, 2024
1 parent 5b7f6ef commit 2e842c6
Show file tree
Hide file tree
Showing 73 changed files with 1,278 additions and 319 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": [
"prettier",
"eslint-config-prettier",
"plugin:vue/vue3-essential",
"plugin:vue/vue3-strongly-recommended",
"plugin:vue/vue3-recommended",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"eslint --fix"
],
"*.{vue,html}": [
"eslint --fix",
"prettier --write"
"prettier --write",
"eslint --fix"
],
"*.json": [
"prettier --write"
Expand Down Expand Up @@ -65,7 +65,7 @@
"eslint": "^8.57.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-prettier": "^8.6.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-cypress": "^3.3.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-storybook": "^0.8.0",
Expand Down
30 changes: 24 additions & 6 deletions src/entities/http-dump/ui/http-dump-page/http-dump-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ const hasAttachments = computed(
<span class="http-dump-page__title-uri">/{{ uri }}</span>
</h2>

<section v-if="hasHeaders" class="http-dump-page__section">
<section
v-if="hasHeaders"
class="http-dump-page__section"
>
<h1>Headers</h1>
<TableBase>
<TableBaseRow
Expand All @@ -63,7 +66,10 @@ const hasAttachments = computed(
</TableBase>
</section>

<section v-if="hasCookies" class="http-dump-page__section">
<section
v-if="hasCookies"
class="http-dump-page__section"
>
<h1>Cookie</h1>
<TableBase>
<TableBaseRow
Expand All @@ -76,7 +82,10 @@ const hasAttachments = computed(
</TableBase>
</section>

<section v-if="hasQuery" class="http-dump-page__section">
<section
v-if="hasQuery"
class="http-dump-page__section"
>
<h1>Query Parameters</h1>
<TableBase>
<TableBaseRow
Expand All @@ -89,7 +98,10 @@ const hasAttachments = computed(
</TableBase>
</section>

<section v-if="hasPostData" class="http-dump-page__section">
<section
v-if="hasPostData"
class="http-dump-page__section"
>
<h1>POST Data</h1>
<TableBase>
<TableBaseRow
Expand All @@ -102,7 +114,10 @@ const hasAttachments = computed(
</TableBase>
</section>

<section v-if="hasAttachments" class="http-dump-page__section">
<section
v-if="hasAttachments"
class="http-dump-page__section"
>
<h1>Attachments ({{ event.payload.request.files?.length }})</h1>

<div class="http-dump-page__attachments">
Expand All @@ -116,7 +131,10 @@ const hasAttachments = computed(
§
</section>

<section v-if="hasBody" class="http-dump-page__section">
<section
v-if="hasBody"
class="http-dump-page__section"
>
<h1>Request Body</h1>
<code class="http-dump-page__section-body">
{{ event.payload.request.body }}
Expand Down
5 changes: 4 additions & 1 deletion src/entities/http-dump/ui/preview-card/preview-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ const uri = decodeURI(props.event.payload.request.uri)
</script>

<template>
<PreviewCard class="preview-card" :event="event">
<PreviewCard
class="preview-card"
:event="event"
>
<div class="preview-card__content">
<span class="preview-card__method"> {{ event.payload.request.method }} </span>:
<span class="preview-card__uri">/{{ uri }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,14 @@ const segmentRows = computed(() => {
<template>
<section class="inspector-page-timeline">
<div class="inspector-page-timeline__head">
<h3 class="inspector-page-timeline__head-title">Timeline</h3>

<div v-if="segmentTypes.length > 0" class="inspector-page-timeline__head-tips">
<h3 class="inspector-page-timeline__head-title">
Timeline
</h3>

<div
v-if="segmentTypes.length > 0"
class="inspector-page-timeline__head-tips"
>
<div
v-for="segmentType in segmentTypes"
:key="segmentType"
Expand All @@ -107,8 +112,15 @@ const segmentRows = computed(() => {
'background-size': `${(100 / (COLUMNS_NUMBER + 1)).toFixed(2)}% 20%`
}"
>
<div class="inspector-page-timeline__body-cells" :class="`grid-cols-${COLUMNS_NUMBER + 1}`">
<div v-for="cell in layoutCells" :key="cell" class="inspector-page-timeline__body-cell">
<div
class="inspector-page-timeline__body-cells"
:class="`grid-cols-${COLUMNS_NUMBER + 1}`"
>
<div
v-for="cell in layoutCells"
:key="cell"
class="inspector-page-timeline__body-cell"
>
{{ cell }} ms
</div>
</div>
Expand All @@ -119,7 +131,10 @@ const segmentRows = computed(() => {
:key="`${segmentRow.label}-${segmentRow.duration}`"
class="inspector-page-timeline__segment"
>
<div class="inspector-page-timeline__segment-label" :title="segmentRow.label">
<div
class="inspector-page-timeline__segment-label"
:title="segmentRow.label"
>
{{ segmentRow.label }}
</div>

Expand Down Expand Up @@ -154,8 +169,13 @@ const segmentRows = computed(() => {
</div>
</div>

<div v-if="segmentRows.length === 0" class="inspector-page-timeline__no-segments">
<h3 class="inspector-page-timeline__no-segments-placeholder">No data</h3>
<div
v-if="segmentRows.length === 0"
class="inspector-page-timeline__no-segments"
>
<h3 class="inspector-page-timeline__no-segments-placeholder">
No data
</h3>
</div>
</section>
</template>
Expand Down
31 changes: 25 additions & 6 deletions src/entities/inspector/ui/inspector-page/inspector-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ const http = computed(() =>
</script>

<template>
<div ref="main" class="inspector-page">
<div
ref="main"
class="inspector-page"
>
<main class="inspector-page__in">
<header class="inspector-page__header">
<h2 class="inspector-page__header-title">
Expand All @@ -38,26 +41,42 @@ const http = computed(() =>
<InspectorPageTimeline :payload="event.payload" />

<section class="inspector-page__body">
<h3 class="inspector-page__body-text">Url</h3>
<h3 class="inspector-page__body-text">
Url
</h3>
<TableBase class="inspector-page__body-table">
<TableBaseRow v-for="(value, name) in http?.url" :key="name" :title="String(name)">
<TableBaseRow
v-for="(value, name) in http?.url"
:key="name"
:title="String(name)"
>
{{ value }}
</TableBaseRow>
</TableBase>
</section>

<section>
<h3 class="inspector-page__body-text">Request</h3>
<h3 class="inspector-page__body-text">
Request
</h3>
<TableBase class="inspector-page__body-table">
<TableBaseRow v-for="(value, name) in http?.request" :key="name" :title="String(name)">
<TableBaseRow
v-for="(value, name) in http?.request"
:key="name"
:title="String(name)"
>
<template v-if="typeof value === 'string'">
{{ value }}
</template>
<template v-else-if="Array.isArray(value)">
{{ value.join(', ') }}
</template>
<template v-else-if="!Array.isArray(value)">
<TableBaseRow v-for="(v, n) in value" :key="n" :title="String(n)">
<TableBaseRow
v-for="(v, n) in value"
:key="n"
:title="String(n)"
>
{{ v }}
</TableBaseRow>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,25 @@ const processResult = computed(() => (props.transaction.result || 'success').toU
<template>
<section class="inspector-stat-board">
<div class="inspector-stat-board__item">
<h4 class="inspector-stat-board__item-name">Timestamp</h4>
<h4 class="inspector-stat-board__item-name">
Timestamp
</h4>
<strong class="inspector-stat-board__item-value">
{{ processDate }}
</strong>
</div>

<div class="inspector-stat-board__item">
<h4 class="inspector-stat-board__item-name">Duration</h4>
<h4 class="inspector-stat-board__item-name">
Duration
</h4>
<strong class="inspector-stat-board__item-value"> {{ transaction.duration }} ms </strong>
</div>

<div class="inspector-stat-board__item">
<h4 class="inspector-stat-board__item-name">Result</h4>
<h4 class="inspector-stat-board__item-name">
Result
</h4>
<span class="inspector-stat-board__item-value">{{ processResult }}</span>
</div>
</section>
Expand Down
10 changes: 8 additions & 2 deletions src/entities/inspector/ui/preview-card/preview-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ const eventLink = computed(() => `/inspector/${props.event.id}`)
</script>

<template>
<PreviewCard class="preview-card" :event="event">
<RouterLink :to="eventLink" class="preview-card__link">
<PreviewCard
class="preview-card"
:event="event"
>
<RouterLink
:to="eventLink"
class="preview-card__link"
>
<InspectorStatBoard :transaction="event.payload[0]" />
</RouterLink>
</PreviewCard>
Expand Down
42 changes: 33 additions & 9 deletions src/entities/monolog/ui/monolog-page/monolog-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,24 @@ const date = computed(() => moment(props.event.date).format('DD.MM.YYYY HH:mm:ss
</script>

<template>
<div ref="main" class="monolog">
<div
ref="main"
class="monolog"
>
<main class="monolog__in">
<header class="monolog__header">
<h2 class="monolog__header-title">Channel: {{ event.payload.channel }}</h2>
<h2 class="monolog__header-title">
Channel: {{ event.payload.channel }}
</h2>
<div class="monolog__header-meta">
<span class="monolog__header-date">{{ date }}</span>
</div>
</header>

<CodeSnippet class="monolog__body" :code="event.payload.message" />
<CodeSnippet
class="monolog__body"
:code="event.payload.message"
/>

<CodeSnippet
v-if="event.payload.context"
Expand All @@ -42,8 +50,13 @@ const date = computed(() => moment(props.event.date).format('DD.MM.YYYY HH:mm:ss
/>
</template>

<section v-if="event.payload.context.source" class="monolog__body">
<h3 class="monolog__body-text">Source</h3>
<section
v-if="event.payload.context.source"
class="monolog__body"
>
<h3 class="monolog__body-text">
Source
</h3>
<TableBase class="monolog__body-table">
<TableBaseRow
v-for="(value, name) in event.payload.context.source"
Expand All @@ -55,11 +68,22 @@ const date = computed(() => moment(props.event.date).format('DD.MM.YYYY HH:mm:ss
</TableBase>
</section>

<section v-if="event.payload.context.request" class="monolog__body">
<h3 class="monolog__body-text">Request</h3>
<section
v-if="event.payload.context.request"
class="monolog__body"
>
<h3 class="monolog__body-text">
Request
</h3>
<TableBase class="monolog__body-table">
<template v-for="(value, name) in event.payload.context.request" :key="name">
<TableBaseRow v-if="name && value" :title="String(name)">
<template
v-for="(value, name) in event.payload.context.request"
:key="name"
>
<TableBaseRow
v-if="name && value"
:title="String(name)"
>
{{ value }}
</TableBaseRow>
</template>
Expand Down
11 changes: 9 additions & 2 deletions src/entities/monolog/ui/preview-card/preview-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ const toggleView = () => {
</script>

<template>
<PreviewCard class="preview-card" :event="event">
<PreviewCard
class="preview-card"
:event="event"
>
<CodeSnippet
class="preview-card__snippet preview-card__snippet--interactive"
:code="isFullMessage ? message : shortMessage"
Expand All @@ -44,7 +47,11 @@ const toggleView = () => {
:code="event.payload.context"
/>

<CodeSnippet class="preview-card__snippet" language="json" :code="event.payload.extra" />
<CodeSnippet
class="preview-card__snippet"
language="json"
:code="event.payload.extra"
/>
</PreviewCard>
</template>

Expand Down
Loading

0 comments on commit 2e842c6

Please sign in to comment.