Skip to content

Commit

Permalink
fix(chore) check prettier and eslint configuration (#28801)
Browse files Browse the repository at this point in the history
…ore-web (#28713)

### Proposed Changes
* Verify configuration ESLint and Prettier
* Run both in all `core-web`

### Checklist
- [ ] Tests
- [ ] Translations
- [ ] Security Implications Contemplated (add notes if applicable)

### Additional Info
** any additional useful context or info **

### Screenshots
Original             |  Updated
:-------------------------:|:-------------------------:
** original screenshot **  |  ** updated screenshot **
  • Loading branch information
oidacra authored Jun 10, 2024
1 parent d36fe1f commit 94d759a
Show file tree
Hide file tree
Showing 505 changed files with 7,772 additions and 8,074 deletions.
2 changes: 1 addition & 1 deletion core-web/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.18.2
v18.20.3
7 changes: 5 additions & 2 deletions core-web/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
/dist
/coverage
/.nx/cache

/target
/tmp
/tools

package.json
package-lock.json
yarn-error.log.json
dist
dist-lib
dist-doc
Expand All @@ -18,4 +21,4 @@ docs
.angular
**/*.md
**/*.d.ts
decorate-angular-cli.js
decorate-angular-cli.js
7 changes: 7 additions & 0 deletions core-web/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,12 @@
"singleQuote": false
}
}
],
"plugins": ["prettier-plugin-organize-attributes"],
"attributeGroups": [
"$ANGULAR_STRUCTURAL_DIRECTIVE",
"$ANGULAR_OUTPUT",
"$ANGULAR_TWO_WAY_BINDING",
"$ANGULAR_INPUT"
]
}
59 changes: 25 additions & 34 deletions core-web/apps/dotcdn/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
<p-tabView>
<p-tabPanel header="Overview" *ngIf="vm$ | async as VM">
<p-tabPanel *ngIf="vm$ | async as VM" header="Overview">
<div class="dot-cdn__tab-content">
<div class="dot-cdn__tab-content-meta">
<p-dropdown
[options]="periodValues"
(onChange)="changePeriod($event)"
optionLabel="label"
optionValue="value"
[(ngModel)]="selectedPeriod.value"
></p-dropdown>
<div class="dot-cdn__tab-domain" *ngIf="VM.cdnDomain">
[options]="periodValues"
optionLabel="label"
optionValue="value"></p-dropdown>
<div *ngIf="VM.cdnDomain" class="dot-cdn__tab-domain">
<small>Root CDN Domain</small>
<p>{{ VM.cdnDomain }}</p>
</div>
</div>
<div class="dot-cdn__stats">
<div class="dot-cdn__col" *ngFor="let stats of VM.statsData">
<div *ngFor="let stats of VM.statsData" class="dot-cdn__col">
<span class="dot-cdn__stats-label">{{ stats.label }}</span>
<p-skeleton
*ngIf="VM.isChartLoading; else valuesBlock"
styleClass="skeleton"
width="10rem"
height="1.5rem"
*ngIf="VM.isChartLoading; else valuesBlock"
></p-skeleton>
height="1.5rem"></p-skeleton>
<ng-template #valuesBlock>
<h3 class="dot-cdn__stats-value">{{ stats.value }}</h3>
</ng-template>
Expand All @@ -32,45 +30,41 @@ <h3 class="dot-cdn__stats-value">{{ stats.value }}</h3>

<div class="dot-cdn__chart">
<dot-spinner
*ngIf="VM.isChartLoading; else chartBlock"
[size]="'4rem'"
[borderSize]="'3px'"
*ngIf="VM.isChartLoading; else chartBlock"
[ngStyle]="{ height: chartHeight }"
></dot-spinner>
[ngStyle]="{ height: chartHeight }"></dot-spinner>
<ng-template #chartBlock>
<h3 class="dot-cdn__tab-content-label">Bandwidth Served</h3>
<p-chart
#chart
type="line"
[data]="VM.chartBandwidthData"
width="100%"
[height]="chartHeight"
[options]="options['bandwidthUsedChart']"
></p-chart>
#chart
type="line"
width="100%"></p-chart>
</ng-template>
</div>
<div class="dot-cdn__chart">
<dot-spinner
*ngIf="VM.isChartLoading; else chartBlockRequests"
[size]="'4rem'"
[borderSize]="'3px'"
*ngIf="VM.isChartLoading; else chartBlockRequests"
[ngStyle]="{ height: chartHeight }"
></dot-spinner>
[ngStyle]="{ height: chartHeight }"></dot-spinner>
<ng-template #chartBlockRequests>
<h3 class="dot-cdn__tab-content-label">Requests Served</h3>
<p-chart
#chart
type="line"
[data]="VM.chartRequestsData"
width="100%"
[height]="chartHeight"
[options]="options['requestsServedChart']"
></p-chart>
#chart
type="line"
width="100%"></p-chart>
</ng-template>
</div>
</div>
</p-tabPanel>
<p-tabPanel header="Flush Cache" *ngIf="vmPurgeLoaders$ | async as VMPurgeLoaders">
<p-tabPanel *ngIf="vmPurgeLoaders$ | async as VMPurgeLoaders" header="Flush Cache">
<div class="dot-cdn__tab-content--contained">
<form [formGroup]="purgeZoneForm">
<div class="dot-cdn__tab-content__row">
Expand All @@ -84,14 +78,12 @@ <h3 class="dot-cdn__tab-content-label">Purge URL List</h3>
[rows]="5"
pInputTextarea
formControlName="purgeUrlsTextArea"
placeholder="https://cdn.dotcms.com&#10;https://cdn.dotcms.com/images/*"
></textarea>
placeholder="https://cdn.dotcms.com&#10;https://cdn.dotcms.com/images/*"></textarea>
<button
pButton
(click)="purgeUrls()"
[label]="VMPurgeLoaders.isPurgeUrlsLoading ? 'loading...' : 'Purge URL'"
[disabled]="purgeZoneForm.get('purgeUrlsTextArea').value.length === 0"
(click)="purgeUrls()"
></button>
pButton></button>
</div>
</form>
<div class="dot-cdn__tab-content__row">
Expand All @@ -103,11 +95,10 @@ <h3 class="dot-cdn__tab-content-label">Purge All</h3>
to your origin sites, so use with caution.
</p>
<button
pButton
[label]="VMPurgeLoaders.isPurgeZoneLoading ? 'loading...' : 'Purge All'"
class="p-button-danger p-button-outlined"
(click)="purgePullZone()"
></button>
[label]="VMPurgeLoaders.isPurgeZoneLoading ? 'loading...' : 'Purge All'"
pButton
class="p-button-danger p-button-outlined"></button>
</div>
</div>
</p-tabPanel>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe('dotcms-block-editor', () => {
beforeEach(() => cy.visit('/iframe.html?id=appcomponent--primary'));
beforeEach(() => cy.visit('/iframe.html?id=appcomponent--primary'));

it('should render the component', () => {
cy.get('dotcms-root').should('exist');
});
it('should render the component', () => {
cy.get('dotcms-root').should('exist');
});
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe('dotcms-block-editor', () => {
beforeEach(() => cy.visit('/iframe.html?id=dotblockeditorcomponent--primary'));
beforeEach(() => cy.visit('/iframe.html?id=dotblockeditorcomponent--primary'));

it('should render the component', () => {
cy.get('dot-block-editor').should('exist');
});
it('should render the component', () => {
cy.get('dot-block-editor').should('exist');
});
});
3 changes: 3 additions & 0 deletions core-web/apps/dotcms-ui-e2e/src/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const isIframeLoaded = ($iframe) => {
if (contentWindow.document.readyState === 'complete') {
const src = $iframe.attributes.src;
const href = contentWindow.location.href;

return href !== 'about:blank' || src === 'about:blank' || src === '';
}

Expand Down Expand Up @@ -98,8 +99,10 @@ Cypress.Commands.add('form_request', (method, url, formData, done) => {
xhr.onload = function () {
done(xhr);
};

xhr.onerror = function () {
done(xhr);
};

xhr.send(formData);
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Navigation {
resolve(url.toString());
});
});

return text;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<form class="p-fluid" #form="ngForm" [formGroup]="myFormGroup" novalidate>
<form [formGroup]="myFormGroup" class="p-fluid" #form="ngForm" novalidate>
<ng-template #warningIcon let-field="field">
<dot-icon
*ngIf="field.warnings && field.warnings.length"
name="warning"
pTooltip="{{ field.warnings.length ? field.warnings.join('. ') : '' }}"
size="18"
></dot-icon>
size="18"></dot-icon>
</ng-template>

<ng-template #labelField let-field="field">
Expand All @@ -15,45 +14,38 @@
</ng-template>
<div class="dot-apps-configuration-detail__form" #formContainer>
<div
class="field"
*ngFor="let field of formFields"
[attr.data-testid]="field.name"
[ngSwitch]="field.type"
>
class="field">
<ng-container *ngSwitchCase="'BUTTON'">
<ng-container
*ngTemplateOutlet="labelField; context: { field: field }"
></ng-container>
*ngTemplateOutlet="labelField; context: { field: field }"></ng-container>
<button
(click)="onIntegrate(field.value)"
[id]="field.name"
[label]="field.label"
[disabled]="!appConfigured"
(click)="onIntegrate(field.value)"
pButton
type="button"
></button>
type="button"></button>
<ng-container
*ngTemplateOutlet="warningIcon; context: { field: field }"
></ng-container>
*ngTemplateOutlet="warningIcon; context: { field: field }"></ng-container>
<span class="form__group-hint"
><markdown>{{ field.hint }}</markdown></span
>
</ng-container>
<ng-container *ngSwitchCase="'STRING'">
<ng-container
*ngTemplateOutlet="labelField; context: { field: field }"
></ng-container>
*ngTemplateOutlet="labelField; context: { field: field }"></ng-container>
<ng-container
*ngTemplateOutlet="warningIcon; context: { field: field }"
></ng-container>
*ngTemplateOutlet="warningIcon; context: { field: field }"></ng-container>
<textarea
#inputTextarea
(click)="field.hidden ? $event.target.select() : null"
[id]="field.name"
[formControlName]="field.name"
(click)="field.hidden ? $event.target.select() : null"
#inputTextarea
pInputTextarea
autoResize="autoResize"
></textarea>
autoResize="autoResize"></textarea>
<span class="p-field-hint"
><markdown>{{ field.hint }}</markdown></span
>
Expand All @@ -67,30 +59,25 @@
[label]="field.label"
[formControlName]="field.name"
[value]="field.value"
binary="true"
></p-checkbox>
binary="true"></p-checkbox>
<ng-container
*ngTemplateOutlet="warningIcon; context: { field: field }"
></ng-container>
*ngTemplateOutlet="warningIcon; context: { field: field }"></ng-container>
<span class="p-field-hint"
><markdown>{{ field.hint }}</markdown></span
>
</ng-container>
<ng-container *ngSwitchCase="'SELECT'">
<ng-container
*ngTemplateOutlet="labelField; context: { field: field }"
></ng-container>
*ngTemplateOutlet="labelField; context: { field: field }"></ng-container>
<ng-container
*ngTemplateOutlet="warningIcon; context: { field: field }"
></ng-container>
*ngTemplateOutlet="warningIcon; context: { field: field }"></ng-container>
<p-dropdown
[id]="field.name"
[formControlName]="field.name"
[ngClass]="{
required: field.required
}"
[options]="field.options"
></p-dropdown>
[options]="field.options"></p-dropdown>
<span class="p-field-hint"
><markdown>{{ field.hint }}</markdown></span
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
<span>{{ apps.sites[0].name }}</span>
<div class="dot-apps-configuration-detail-actions">
<button
class="p-button-outlined"
[label]="'Cancel' | dm"
(click)="goToApps(apps.key)"
[label]="'Cancel' | dm"
class="p-button-outlined"
pButton
data-testid="cancelBtn"
type="button"></button>
<button
(click)="onSubmit()"
[label]="'Save' | dm"
[disabled]="!formValid"
(click)="onSubmit()"
pButton
data-testid="saveBtn"
type="button"></button>
Expand All @@ -24,17 +24,17 @@
<div class="dot-apps-configuration-detail__body">
<div class="dot-apps-configuration-detail__form-content">
<dot-apps-configuration-detail-form
[appConfigured]="apps.sites[0].configured"
[formFields]="formFields"
(data)="formData = $event"
(valid)="formValid = $event"></dot-apps-configuration-detail-form>
(valid)="formValid = $event"
[appConfigured]="apps.sites[0].configured"
[formFields]="formFields"></dot-apps-configuration-detail-form>
<div *ngIf="apps.allowExtraParams">
<h5>{{ 'apps.custom.properties' | dm }}</h5>
<dot-key-value-ng
(updatedList)="updateVariables($event)"
[autoFocus]="false"
[showHiddenField]="true"
[variables]="dynamicVariables"
(updatedList)="updateVariables($event)" />
[variables]="dynamicVariables" />
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit 94d759a

Please sign in to comment.