Skip to content

Commit

Permalink
feat(edit-content) fix comments #28764
Browse files Browse the repository at this point in the history
  • Loading branch information
oidacra committed Jun 11, 2024
1 parent 3f30e53 commit 5a60bde
Show file tree
Hide file tree
Showing 8 changed files with 3,277 additions and 3,352 deletions.
8 changes: 4 additions & 4 deletions core-web/.husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ perform_fixes() {
local add_to_index=$2 # Should be 'true' or 'false'
local file # Declare file variable for use in loop

if ! npx nx format:write; then
error_occurred=true
fi
# if ! npx nx format:write; then
# error_occurred=true
# fi

if ! npx nx affected -t lint --exclude='tag:skip:lint' --fix=true; then
error_occurred=true
Expand Down Expand Up @@ -128,4 +128,4 @@ if [ "$error_occurred" = true ]; then
exit 1 # Change the exit code to reflect that an error occurred
else
exit 0 # No errors, exit normally
fi
fi
7 changes: 0 additions & 7 deletions core-web/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,5 @@
"singleQuote": false
}
}
],
"plugins": ["prettier-plugin-organize-attributes"],
"attributeGroups": [
"$ANGULAR_STRUCTURAL_DIRECTIVE",
"$ANGULAR_OUTPUT",
"$ANGULAR_TWO_WAY_BINDING",
"$ANGULAR_INPUT"
]
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
@use "variables" as *;

.category-field__header {
height: 60px;
align-items: center;
flex-wrap: wrap;
gap: $spacing-0;
padding: 0 $spacing-4;
padding: $spacing-2 $spacing-4;
}

.category-field__header-title {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { expect, it } from '@jest/globals';
import { byTestId, createComponentFactory, Spectator } from '@ngneat/spectator';
import { mockProvider } from '@ngneat/spectator/jest';
import { byTestId, createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest';

import { fakeAsync } from '@angular/core/testing';

import { DotMessageService } from '@dotcms/data-access';

import { DotEditContentCategoryFieldSidebarComponent } from './components/dot-edit-content-category-field-sidebar/dot-edit-content-category-field-sidebar.component';
import { DotEditContentCategoryFieldComponent } from './dot-edit-content-category-field.component';
import { CLOSE_SIDEBAR_CSS_DELAY_MS } from './dot-edit-content-category-field.const';

describe('DotEditContentCategoryFieldComponent', () => {
let spectator: Spectator<DotEditContentCategoryFieldComponent>;
Expand Down Expand Up @@ -71,7 +72,7 @@ describe('DotEditContentCategoryFieldComponent', () => {
expect(spectator.query(DotEditContentCategoryFieldSidebarComponent)).not.toBeNull();
});

it('should remove DotEditContentCategoryFieldSidebarComponent when `closedSidebar` emit', async () => {
it('should remove DotEditContentCategoryFieldSidebarComponent when `closedSidebar` emit', fakeAsync(() => {
const selectBtn = spectator.query(byTestId('show-sidebar-btn')) as HTMLButtonElement;
expect(selectBtn).not.toBeNull();
spectator.click(selectBtn);
Expand All @@ -86,12 +87,11 @@ describe('DotEditContentCategoryFieldComponent', () => {
spectator.detectComponentChanges();

// Due to a delay in the pipe of the subscription
await new Promise((resolve) => setTimeout(resolve, 400));
spectator.tick(CLOSE_SIDEBAR_CSS_DELAY_MS + 100);

expect(spectator.query(DotEditContentCategoryFieldSidebarComponent)).toBeNull();

spectator.detectComponentChanges();
expect(selectBtn.disabled).toBe(false);
});
}));
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ import { DotCMSContentTypeField } from '@dotcms/dotcms-models';
import { DotDynamicDirective, DotMessagePipe } from '@dotcms/ui';

import { DotEditContentCategoryFieldSidebarComponent } from './components/dot-edit-content-category-field-sidebar/dot-edit-content-category-field-sidebar.component';

const CLOSE_SIDEBAR_CSS_DELAY_MS = 300;
import { CLOSE_SIDEBAR_CSS_DELAY_MS } from './dot-edit-content-category-field.const';

/**
* Component for editing content category field.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const CLOSE_SIDEBAR_CSS_DELAY_MS = 300;
1 change: 0 additions & 1 deletion core-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@
"postcss-preset-env": "7.5.0",
"postcss-url": "10.1.3",
"prettier": "^3.3.1",
"prettier-plugin-organize-attributes": "^1.0.0",
"protractor": "~7.0.0",
"puppeteer": "~5.3.1",
"react-test-renderer": "^18.2.0",
Expand Down
6,592 changes: 3,263 additions & 3,329 deletions core-web/yarn.lock

Large diffs are not rendered by default.

0 comments on commit 5a60bde

Please sign in to comment.