Skip to content

Commit

Permalink
#22993 merge master done again
Browse files Browse the repository at this point in the history
  • Loading branch information
jdotcms committed Nov 23, 2022
2 parents 86d76d4 + ff89225 commit 88eaae0
Show file tree
Hide file tree
Showing 70 changed files with 7,893 additions and 1,883 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/gradleSonarQube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ name: Sonar Qube Scan Gradle
on:
push:
branches:
- master # or the name of your main branch

- master
- testing-sonarqube
paths: ['dotCMS/**']
pull_request:
# Sequence of patterns matched against refs/heads
branches:
- master
- release-*
paths: ['dotCMS/**']

jobs:
build:
Expand Down Expand Up @@ -36,6 +38,7 @@ jobs:
restore-keys: ${{ runner.os }}-gradle
- name: Build and analyze
env:
SONAR_SCANNER_OPTS: "-Xmx3g"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
Expand Down
19 changes: 11 additions & 8 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
************************************************************************
All code and components under the "enterprise/" directory of this
repository are licensed under the "dotCMS Enterprise License" as defined
in "enterprise/LICENSE". All third party components incorporated into
the Software are licensed under the original license provided by the
owner of the applicable component. Unless otherwise granted by dotCMS,
code and components in this repository, outside of the above mentioned
directories or restrictions, are available under the "GPL3" license as
defined below.
Excluded Components: All code and components under the /enterprise
directory of this dotCMS core repository are licensed under the "dotCMS
Enterprise License" available at https://www.dotcms.com/terms.

Third-Party Components: All third-party components incorporated in
this repository are licensed under the original license provided by the
owner of the applicable component.

Except as otherwise set forth above, the code and components of this
dotCMS core repository are licensed under the GNU General Public License
Version 3/GPL 3 license, the text of which is provided below.
************************************************************************


Expand Down
1 change: 1 addition & 0 deletions core-web/apps/dotcms-ui/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { MonacoEditorModule } from '@materia-ui/ngx-monaco-editor';
import { MarkdownModule } from 'ngx-markdown';

// `AppModule` is the main entry point into Angular2's bootstraping process

@NgModule({
bootstrap: [AppComponent],
declarations: [AppComponent, ...COMPONENTS],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
[columns]="vm.tableColumns"
[actions]="[]"
[checkbox]="true"
[mapItems]="getContainersWithDisabledEntities"
(selectedItems)="updateSelectedContainers($event)"
(rowWasClicked)="handleRowClick($event)"
url="v1/containers?system=true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { By } from '@angular/platform-browser';
import { CONTAINER_SOURCE, DotContainer } from '@models/container/dot-container.model';
import { DotContainersService } from '@services/dot-containers/dot-containers.service';
import { DotActionMenuButtonComponent } from '@components/_common/dot-action-menu-button/dot-action-menu-button.component';

const containersMock: DotContainer[] = [
{
archived: false,
categoryId: '6e07301c-e6d2-4c1f-9e8e-fcc4a31947d3',
deleted: false,
friendlyName: '',
identifier: 'f17f87c0e571060732923ec92d071b73',
identifier: '123Published',
live: true,
name: 'movie',
parentPermissionable: {
Expand All @@ -64,8 +65,25 @@ const containersMock: DotContainer[] = [
categoryId: 'a443d26e-0e92-4a9e-a2ab-90a44fd1eb8d',
deleted: false,
friendlyName: '',
identifier: '282685c94eb370a7820766d6aa1d0136',
live: true,
identifier: '123Unpublish',
live: false,
name: 'test',
parentPermissionable: {
hostname: 'default'
},
path: null,
source: CONTAINER_SOURCE.DB,
title: 'test',
type: 'containers',
working: true
},
{
archived: true,
categoryId: 'a443d26e-0e92-4a9e-a2ab-90a44fd1eb8d',
deleted: true,
friendlyName: '',
identifier: '123Archived',
live: false,
name: 'test',
parentPermissionable: {
hostname: 'default'
Expand Down Expand Up @@ -153,6 +171,10 @@ describe('ContainerListComponent', () => {
let coreWebService: CoreWebService;
let dotRouterService: DotRouterService;

let unPublishContainer: DotActionMenuButtonComponent;
let publishContainer: DotActionMenuButtonComponent;
let archivedContainer: DotActionMenuButtonComponent;

const messageServiceMock = new MockDotMessageService(messages);

beforeEach(async () => {
Expand Down Expand Up @@ -244,5 +266,48 @@ describe('ContainerListComponent', () => {
containersMock[0].identifier
);
});

it('should set actions to publish template', () => {
publishContainer = fixture.debugElement.query(
By.css('[data-testid="123Published"]')
).componentInstance;
const actions = setBasicOptions();
actions.push({ menuItem: { label: 'Unpublish', command: jasmine.any(Function) } });
actions.push({ menuItem: { label: 'Duplicate', command: jasmine.any(Function) } });

expect(publishContainer.actions).toEqual(actions);
});

it('should set actions to unPublish template', () => {
unPublishContainer = fixture.debugElement.query(
By.css('[data-testid="123Unpublish"]')
).componentInstance;
const actions = setBasicOptions();
actions.push({ menuItem: { label: 'Archive', command: jasmine.any(Function) } });
actions.push({ menuItem: { label: 'Duplicate', command: jasmine.any(Function) } });

expect(unPublishContainer.actions).toEqual(actions);
});

it('should set actions to archived template', () => {
archivedContainer = fixture.debugElement.query(
By.css('[data-testid="123Archived"]')
).componentInstance;

const actions = [
{ menuItem: { label: 'Unarchive', command: jasmine.any(Function) } },
{ menuItem: { label: 'Delete', command: jasmine.any(Function) } }
];
expect(archivedContainer.actions).toEqual(actions);
});
});

function setBasicOptions() {
return [
{ menuItem: { label: 'Edit', command: jasmine.any(Function) } },
{ menuItem: { label: 'Publish', command: jasmine.any(Function) } },
{ menuItem: { label: 'Push Publish', command: jasmine.any(Function) } },
{ menuItem: { label: 'Add To Bundle', command: jasmine.any(Function) } }
];
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,13 @@ export class DotContainerListStore extends ComponentStore<DotContainerListState>
options = this.setArchiveContainerActions(container);
} else {
options = this.setBaseContainerOptions(container);
options = [...options, ...this.setCopyContainerOptions(container)];
options = [
...options,
...this.getLicenseAndRemotePublishContainerOptions(container),
...this.getUnPublishAndArchiveContainerOptions(container)
];

if (!container.live) {
options = [
...options,
...this.getLicenseAndRemotePublishContainerOptions(container),
...this.getUnPublishAndArchiveContainerOptions(container)
];
}
options = [...options, ...this.setCopyContainerOptions(container)];
}

return options;
Expand Down Expand Up @@ -362,50 +360,45 @@ export class DotContainerListStore extends ComponentStore<DotContainerListState>
}

private setCopyContainerOptions(container: DotContainer): DotActionMenuItem[] {
return !container.locked
? [
{
menuItem: {
label: this.dotMessageService.get('Duplicate'),
command: () => {
this.copyContainer(container.identifier);
}
}
}
]
: [];
return [
{
menuItem: {
label: this.dotMessageService.get('Duplicate'),
command: () => {
this.copyContainer(container.identifier);
}
}
}
];
}

private setBaseContainerOptions(container: DotContainer): DotActionMenuItem[] {
const options: DotActionMenuItem[] = [];

if (!container.locked) {
options.push({
menuItem: {
label: this.dotMessageService.get('edit'),
command: () => {
this.editContainer(container);
}
options.push({
menuItem: {
label: this.dotMessageService.get('edit'),
command: () => {
this.editContainer(container);
}
});
}
}
});

if (!container.live) {
options.push({
menuItem: {
label: this.dotMessageService.get('publish'),
command: () => {
this.publishContainer([container.identifier]);
}
options.push({
menuItem: {
label: this.dotMessageService.get('publish'),
command: () => {
this.publishContainer([container.identifier]);
}
});
}
}
});

return options;
}

private setArchiveContainerActions(container: DotContainer): DotActionMenuItem[] {
const options: DotActionMenuItem[] = [];

if (!container.live) {
options.push({
menuItem: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const messages = {
'message.containers.create.post_loop': 'Post-loop'
};

fdescribe('DotLoopEditorComponent', () => {
describe('DotLoopEditorComponent', () => {
let component: DotTestHostComponent;
let fixture: ComponentFixture<DotTestHostComponent>;
let de: DebugElement;
Expand All @@ -88,16 +88,16 @@ fdescribe('DotLoopEditorComponent', () => {
fixture.detectChanges();
});

fit('should create', () => {
it('should create', () => {
expect(component).toBeTruthy();
});

fit('should show pre_loop', () => {
it('should show pre_loop', () => {
const label = de.query(By.css('[data-testId="label"]')).nativeElement;
expect(label.innerText).toBe('Pre-loop');
});

fit('should show pre_loop', fakeAsync(() => {
it('should show pre_loop', fakeAsync(() => {
component.label = 'post_loop';
fixture.detectChanges();
tick();
Expand Down
4 changes: 3 additions & 1 deletion core-web/libs/block-editor/src/lib/block-editor.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { BubbleFormComponent } from './extensions/bubble-form/bubble-form.compon
//Editor
import { DotBlockEditorComponent } from './components/dot-block-editor/dot-block-editor.component';
import { DotEditorCountBarComponent } from './components/dot-editor-count-bar/dot-editor-count-bar.component';
import { FloatingButtonComponent } from './extensions/floating-button/floating-button.component';

@NgModule({
imports: [
Expand Down Expand Up @@ -69,7 +70,8 @@ import { DotEditorCountBarComponent } from './components/dot-editor-count-bar/do
BubbleFormComponent,
SuggestionPageComponent,
DotBlockEditorComponent,
DotEditorCountBarComponent
DotEditorCountBarComponent,
FloatingButtonComponent
],
providers: [DotImageService, LoggerService, StringUtils],
exports: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ListboxModule } from 'primeng/listbox';
import { OrderListModule } from 'primeng/orderlist';
import { MenuModule } from 'primeng/menu';

import { debounceTime, delay } from 'rxjs/operators';
import { debounceTime, delay, tap } from 'rxjs/operators';
import { BubbleLinkFormComponent } from '@dotcms/block-editor';

import {
Expand All @@ -20,7 +20,8 @@ import {
LoaderComponent,
DotImageService,
DotLanguageService,
DotBlockEditorComponent
DotBlockEditorComponent,
FileStatus
} from '@dotcms/block-editor';

export default {
Expand Down Expand Up @@ -219,16 +220,48 @@ export const primary = () => ({
{
provide: DotImageService,
useValue: {
publishContent() {
publishContent({
data: _data,
statusCallback = (_status) => {
/* */
}
}) {
statusCallback(FileStatus.IMPORT);

return of([
{
cd769844de530f7b5d3434b1b5cfdd62: {
asset: 'https://media.istockphoto.com/vectors/costa-rica-vector-id652225694?s=170667a',
mimeType: 'image/png',
name: 'costarica.png'
name: 'costarica.png',
icon: 'inventory_2',
url: '/inventory/product-in-the-store',
path: '/inventory/product-in-the-store',
variable: 'inventory',
title: 'Cras ornare tristique elit.',
inode: '1213',
image: 'https://images.unsplash.com/photo-1433883669848-fa8a7ce070b2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2988&q=80',
languageId: 2,
modDate: '2021-10-20 14:56:53.052',
baseType: 'CONTENT',
archived: false,
working: true,
locked: false,
live: true,
identifier: 'f1d378c9-b784-45d0-a43c-9790af678f13',
titleImage: 'image',
hasLiveVersion: true,
folder: 'SYSTEM_FOLDER',
hasTitleImage: true,
__icon__: 'contentIcon',
contentTypeIcon: 'file_copy',
contentType: 'Blog'
}
}
]).pipe(delay(800));
]).pipe(
delay(800),
tap(() => statusCallback(FileStatus.IMPORT))
);
}
}
},
Expand Down
Loading

0 comments on commit 88eaae0

Please sign in to comment.