Skip to content

Commit

Permalink
Merge branch 'master' into rashik1144-patch-7
Browse files Browse the repository at this point in the history
  • Loading branch information
mbiuki authored Aug 23, 2024
2 parents 1a64b0c + 78dafd3 commit c37b8a7
Show file tree
Hide file tree
Showing 80 changed files with 15,720 additions and 706 deletions.
2 changes: 1 addition & 1 deletion .mvn/maven-build-cache-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ https://maven.apache.org/extensions/maven-build-cache-extension/maven-build-cach
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/BUILD-CACHE-CONFIG/1.0.0 https://maven.apache.org/xsd/build-cache-config-1.0.0.xsd">
<configuration>
<enabled>true</enabled>
<enabled>false</enabled>
<hashAlgorithm>SHA-256</hashAlgorithm>
<validateXml>true</validateXml>
<local>
Expand Down
7 changes: 7 additions & 0 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,13 @@

<!-- Apache Tomcat -->

<dependency>
<groupId>com.dotcms</groupId>
<artifactId>tomcat-redis-session-manager</artifactId>
<version>1.3</version>
<scope>provided</scope>
</dependency>

<dependency>
<!-- Jasper is the Tomcat JSP Engine -->
<groupId>org.apache.tomcat</groupId>
Expand Down
30 changes: 21 additions & 9 deletions bom/logging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<properties>
<maven.deploy.skip>false</maven.deploy.skip>
<flatten.mode>bom</flatten.mode>
<log4j.version>2.20.0</log4j.version>
<slf4j.version>2.0.7</slf4j.version>
<log4j.version>2.23.1</log4j.version>
<slf4j.version>2.0.9</slf4j.version>
</properties>

<dependencyManagement>
Expand All @@ -27,30 +27,42 @@
Do not include incompatible artifacts e.g. -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<!-- Support log4j1.2.x API in Log4j2 -->
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<artifactId>log4j-iostreams</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<!-- Support Java Commons Logging API in Log4j2 -->
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>${log4j.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<!-- Support Java Commons Logging API in Log4j2 -->
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jcl</artifactId>
<version>${log4j.version}</version>
<scope>compile</scope>
<scope>runtime</scope>
</dependency>
<dependency>
<!-- Support SLF4j2 API in Log4j2 -->
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
<version>${log4j.version}</version>
<scope>compile</scope>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand All @@ -61,16 +73,16 @@
<dependency>
<!-- Servlet container initialization of Log4j2 -->
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-web</artifactId>
<artifactId>log4j-appserver</artifactId>
<version>${log4j.version}</version>
<scope>compile</scope>
<scope>runtime</scope>
</dependency>
<dependency>
<!-- Async support for Log4J 2.x -->
<groupId>com.lmax</groupId>
<artifactId>disruptor</artifactId>
<version>3.3.4</version>
<scope>compile</scope>
<scope>runtime</scope>
</dependency>

</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
<ng-container *ngIf="vm$ | async as vm">
<div
*ngIf="showMask()"
(click)="toogleMenu($event)"
class="dot-mask"
data-testId="dot-mask"></div>
@if (vm$ | async; as vm) {
@if ($showMask()) {
<div (click)="toggleMenu($event)" class="dot-mask" data-testId="dot-mask"></div>
}
<p-avatar
(click)="toogleMenu($event)"
(click)="toggleMenu($event)"
[email]="vm.userData.email"
data-testId="avatar"
dotGravatar></p-avatar>
<p-menu
[model]="vm.items"
[popup]="true"
#menu
(onHide)="hideMask()"
appendTo="body"
styleClass="toolbar-user__menu"></p-menu>

<dot-my-account
*ngIf="vm.showMyAccount"
(shutdown)="store.showMyAccount(false)"
[visible]="vm.showMyAccount"></dot-my-account>
@if (vm.showMyAccount) {
<dot-my-account
(shutdown)="store.showMyAccount(false)"
[visible]="vm.showMyAccount"></dot-my-account>
}

<dot-login-as
*ngIf="vm.showLoginAs"
(cancel)="store.showLoginAs(false)"
[visible]="vm.showLoginAs"></dot-login-as>
</ng-container>
@if (vm.showLoginAs) {
<dot-login-as (cancel)="store.showLoginAs(false)" [visible]="vm.showLoginAs"></dot-login-as>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,17 @@ describe('DotToolbarUserComponent', () => {
fixture.detectChanges();
expect(de.query(By.css('[data-testid="dot-mask"]'))).toBeFalsy();
});

it('should hide mask when menu hide', () => {
fixture.detectChanges();
const avatarComponent = de.query(By.css('[data-testid="avatar"]')).nativeElement;
avatarComponent.click();

const menu = de.query(By.css('p-menu'));
menu.triggerEventHandler('onHide', {});

fixture.detectChanges();

expect(de.query(By.css('[data-testId="dot-mask"]'))).toBeNull();
});
});
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { AsyncPipe, NgIf } from '@angular/common';
import { AsyncPipe } from '@angular/common';
import {
ChangeDetectionStrategy,
Component,
OnInit,
ViewChild,
inject,
signal
signal,
viewChild
} from '@angular/core';

import { AvatarModule } from 'primeng/avatar';
Expand Down Expand Up @@ -33,23 +33,26 @@ import { DotMyAccountModule } from '../dot-my-account/dot-my-account.module';
DotMyAccountModule,
DotSafeHtmlPipe,
MenuModule,
AsyncPipe,
NgIf
AsyncPipe
]
})
export class DotToolbarUserComponent implements OnInit {
readonly #store = inject(DotToolbarUserStore);
readonly store = inject(DotToolbarUserStore);

vm$ = this.#store.vm$;
@ViewChild('menu') menu: Menu;
showMask = signal<boolean>(false);
vm$ = this.store.vm$;
$menu = viewChild<Menu>('menu');
$showMask = signal<boolean>(false);

ngOnInit(): void {
this.#store.init();
this.store.init();
}

toogleMenu(event: CustomEvent): void {
this.menu.toggle(event);
this.showMask.update((value) => !value);
toggleMenu(event: Event): void {
this.$menu().toggle(event);
this.$showMask.update((value) => !value);
}

hideMask(): void {
this.$showMask.update(() => false);
}
}
2 changes: 1 addition & 1 deletion core-web/apps/dotcms-ui/src/assets/seo/page-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"title": "Mozilla Observatory",
"description": "The Mozilla Observatory has helped hundreds of thousands of websites by teaching developers, system administrators, and security professionals how to configure their sites safely and securely. ",
"tags": ["Security", "Best Practices"],
"runnableLink": "https://developer.mozilla.org/en-US/observatory/analyze?host={requestHostName}"
"runnableLink": "https://developer.mozilla.org/en-US/observatory/analyze?host={domainName}"
},
{
"icon": "assets/seo/security-headers.png",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
color: $color-palette-gray-500;
margin-top: 1rem;
gap: 0.65rem;
font-size: $dot-editor-size;
font-size: $font-size-md;

.error-message {
color: $error;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
.url-container {
cursor: pointer;
white-space: nowrap;
font-size: $dot-editor-size;
font-size: $font-size-md;
width: 100%;
word-wrap: normal;
display: flex;
Expand All @@ -52,7 +52,7 @@
display: flex;
gap: 0.2 * $dot-editor-size;
min-width: 100%;
font-size: $dot-editor-size;
font-size: $font-size-md;

.checkbox-container {
cursor: pointer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

h3 {
text-transform: uppercase;
font-size: $dot-editor-size;
font-size: $font-size-md;
margin: (0.5 * $dot-editor-size) $dot-editor-size;
color: #999999;
}
Expand Down
1 change: 1 addition & 0 deletions core-web/libs/dotcms-scss/jsp/scss/dotcms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ legend,
input,
button,
textarea,
select,
p,
blockquote,
th,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,40 +245,82 @@ describe('DotEmaDialogStoreService', () => {
});
});

it('should update the state to show dialog for a translation', () => {
spectator.service.translatePage({
page: {
inode: '123',
liveInode: '1234',
stInode: '12345',
live: true,
title: 'test'
} as DotPage,
newLanguage: 2
});
describe('Dialog for translation', () => {
it('should update the state to show dialog for a translation', () => {
spectator.service.translatePage({
page: {
inode: '123',
liveInode: '1234',
stInode: '12345',
live: true,
title: 'test'
} as DotPage,
newLanguage: 2
});

const queryParams = new URLSearchParams({
p_p_id: 'content',
p_p_action: '1',
p_p_state: 'maximized',
angularCurrentPortlet: 'edit-page',
_content_sibbling: '1234',
_content_cmd: 'edit',
p_p_mode: 'view',
_content_sibblingStructure: '1234',
_content_struts_action: '/ext/contentlet/edit_contentlet',
inode: '',
lang: '2',
populateaccept: 'true',
reuseLastLang: 'true'
const queryParams = new URLSearchParams({
p_p_id: 'content',
p_p_action: '1',
p_p_state: 'maximized',
angularCurrentPortlet: 'edit-page',
_content_sibbling: '123',
_content_cmd: 'edit',
p_p_mode: 'view',
_content_sibblingStructure: '123',
_content_struts_action: '/ext/contentlet/edit_contentlet',
inode: '',
lang: '2',
populateaccept: 'true',
reuseLastLang: 'true'
});

spectator.service.dialogState$.subscribe((state) => {
expect(state).toEqual({
url: LAYOUT_URL + '?' + queryParams.toString(),
status: DialogStatus.LOADING,
header: 'test',
type: 'content'
});
});
});

spectator.service.dialogState$.subscribe((state) => {
expect(state).toEqual({
url: LAYOUT_URL + '?' + queryParams.toString(),
status: DialogStatus.LOADING,
header: 'test',
type: 'content'
it('should update the state to show dialog for a translation with working inode', () => {
spectator.service.translatePage({
page: {
inode: '123',
liveInode: '1234',
stInode: '12345',
live: true,
title: 'test',
working: true,
workingInode: '56789'
} as DotPage,
newLanguage: 2
});

const queryParams = new URLSearchParams({
p_p_id: 'content',
p_p_action: '1',
p_p_state: 'maximized',
angularCurrentPortlet: 'edit-page',
_content_sibbling: '56789',
_content_cmd: 'edit',
p_p_mode: 'view',
_content_sibblingStructure: '56789',
_content_struts_action: '/ext/contentlet/edit_contentlet',
inode: '',
lang: '2',
populateaccept: 'true',
reuseLastLang: 'true'
});

spectator.service.dialogState$.subscribe((state) => {
expect(state).toEqual({
url: LAYOUT_URL + '?' + queryParams.toString(),
status: DialogStatus.LOADING,
header: 'test',
type: 'content'
});
});
});
});
Expand Down
Loading

0 comments on commit c37b8a7

Please sign in to comment.