This repository has been archived by the owner on Dec 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dotCMS/core#18830 Layout edit displaying incorrectly (#1375)
* #18714 Fixing error when try to add the same file container twice int… (#1368) * #18714 Fixing error when try to add the same file container twice into a sidebar * #18714 Removing f * dotCMS/core#18779 (#1371) * dotCMS/core#18830 Co-authored-by: Freddy Rodriguez <[email protected]>
- Loading branch information
1 parent
7349060
commit ea35128
Showing
15 changed files
with
192 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 20 additions & 31 deletions
51
src/app/portlets/dot-apps/dot-apps-list/dot-apps-list-resolver.service.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,51 @@ | ||
import { of as observableOf } from 'rxjs'; | ||
import { async } from '@angular/core/testing'; | ||
import { ActivatedRouteSnapshot } from '@angular/router'; | ||
import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; | ||
import { DOTTestBed } from '../../../test/dot-test-bed'; | ||
import { DotAppsService } from '@services/dot-apps/dot-apps.service'; | ||
import { DotAppsListResolver } from './dot-apps-list-resolver.service'; | ||
import { DotLicenseService } from '@services/dot-license/dot-license.service'; | ||
|
||
class AppsServicesMock { | ||
get() {} | ||
class DotLicenseServicesMock { | ||
canAccessEnterprisePortlet(_url: string) {} | ||
} | ||
|
||
const activatedRouteSnapshotMock: any = jasmine.createSpyObj<ActivatedRouteSnapshot>( | ||
'ActivatedRouteSnapshot', | ||
['toString'] | ||
); | ||
activatedRouteSnapshotMock.paramMap = {}; | ||
|
||
const routerStateSnapshotMock = jasmine.createSpyObj<RouterStateSnapshot>('RouterStateSnapshot', [ | ||
'toString' | ||
]); | ||
routerStateSnapshotMock.url = '/apps'; | ||
|
||
describe('DotAppsListResolver', () => { | ||
let dotAppsServices: DotAppsService; | ||
let dotLicenseServices: DotLicenseService; | ||
let dotAppsListResolver: DotAppsListResolver; | ||
|
||
beforeEach(async(() => { | ||
const testbed = DOTTestBed.configureTestingModule({ | ||
providers: [ | ||
DotAppsListResolver, | ||
{ provide: DotAppsService, useClass: AppsServicesMock }, | ||
{ provide: DotLicenseService, useClass: DotLicenseServicesMock }, | ||
{ | ||
provide: ActivatedRouteSnapshot, | ||
useValue: activatedRouteSnapshotMock | ||
} | ||
] | ||
}); | ||
dotAppsServices = testbed.get(DotAppsService); | ||
dotLicenseServices = testbed.get(DotLicenseService); | ||
dotAppsListResolver = testbed.get(DotAppsListResolver); | ||
})); | ||
|
||
it('should get and return an Apps list', () => { | ||
const response = [ | ||
{ | ||
configurationsCount: 0, | ||
key: 'google-calendar', | ||
name: 'Google Calendar', | ||
description: 'It\'s a tool to keep track of your life\'s events', | ||
iconUrl: '/dA/d948d85c-3bc8-4d85-b0aa-0e989b9ae235/photo/surfer-profile.jpg' | ||
}, | ||
{ | ||
configurationsCount: 1, | ||
key: 'asana', | ||
name: 'Asana', | ||
description: 'It\'s asana to keep track of your asana events', | ||
iconUrl: '/dA/792c7c9f-6b6f-427b-80ff-1643376c9999/photo/mountain-persona.jpg' | ||
} | ||
]; | ||
|
||
spyOn(dotAppsServices, 'get').and.returnValue(observableOf(response)); | ||
it('should get if portlet can be accessed', () => { | ||
spyOn(dotLicenseServices, 'canAccessEnterprisePortlet').and.returnValue(observableOf(true)); | ||
|
||
dotAppsListResolver.resolve().subscribe((fakeContentType: any) => { | ||
expect(fakeContentType).toEqual(response); | ||
}); | ||
expect(dotAppsServices.get).toHaveBeenCalled(); | ||
dotAppsListResolver | ||
.resolve(activatedRouteSnapshotMock, routerStateSnapshotMock) | ||
.subscribe((canAccess: any) => { | ||
expect(canAccess).toEqual(true); | ||
}); | ||
expect(dotLicenseServices.canAccessEnterprisePortlet).toHaveBeenCalledWith('/apps'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 19 additions & 16 deletions
35
src/app/portlets/dot-apps/dot-apps-list/dot-apps-list.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
<div class="dot-apps__container"> | ||
<div class="dot-apps__header"> | ||
<input | ||
pInputText | ||
#searchInput | ||
type="text" | ||
[placeholder]="('apps.search.placeholder' | dm) || ''" | ||
/> | ||
<dot-not-licensed-component *ngIf="!canAccessPortlet; else licensed"></dot-not-licensed-component> | ||
<ng-template #licensed | ||
><div class="dot-apps__container"> | ||
<div class="dot-apps__header"> | ||
<input | ||
pInputText | ||
#searchInput | ||
type="text" | ||
[placeholder]="('apps.search.placeholder' | dm) || ''" | ||
/> | ||
</div> | ||
<div class="dot-apps__body"> | ||
<dot-apps-card | ||
*ngFor="let app of appsCopy" | ||
[app]="app" | ||
(actionFired)="goToApp($event)" | ||
></dot-apps-card> | ||
</div> | ||
</div> | ||
<div class="dot-apps__body"> | ||
<dot-apps-card | ||
*ngFor="let app of appsCopy" | ||
[app]="app" | ||
(actionFired)="goToApp($event)" | ||
></dot-apps-card> | ||
</div> | ||
</div> | ||
</ng-template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.