Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* dev: fix vertial videos thumbnail * dev: Show/hide thumbnails based on the dotmarketing SHOW_VIDEO_THUMBNAIL property * clean up * clean up v2 * clean up v2 * remove 'fit'
- Loading branch information
Showing
19 changed files
with
217 additions
and
37 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
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
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
18 changes: 15 additions & 3 deletions
18
...et-form/components/dot-asset-search/components/dot-asset-card/dot-asset-card.component.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
36 changes: 36 additions & 0 deletions
36
...-editor/src/lib/shared/services/dot-marketing-config/dot-marketing-config.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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { DotMarketingConfigService, INITIAL_STATE } from './dot-marketing-config.service'; | ||
|
||
describe('DotEditorMarketingService', () => { | ||
let service: DotMarketingConfigService; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ teardown: { destroyAfterEach: false } }); | ||
service = TestBed.inject(DotMarketingConfigService); | ||
}); | ||
|
||
test('should be created', () => { | ||
expect(service).toBeTruthy(); | ||
}); | ||
|
||
test('should has initial state', () => { | ||
expect(service.configObject).toEqual(INITIAL_STATE); | ||
}); | ||
|
||
test('should set a config property', () => { | ||
const key = 'SHOW_VIDEO_THUMBNAIL'; | ||
const value = false; | ||
|
||
jest.spyOn(service, 'setProperty'); | ||
|
||
service.setProperty(key, value); | ||
|
||
expect(service.setProperty).toHaveBeenCalledWith(key, value); | ||
expect(service.getProperty(key)).toBe(value); | ||
}); | ||
|
||
test('should return the config object', () => { | ||
expect(service.configObject).toBeDefined(); | ||
}); | ||
}); |
49 changes: 49 additions & 0 deletions
49
...block-editor/src/lib/shared/services/dot-marketing-config/dot-marketing-config.service.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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { Injectable } from '@angular/core'; | ||
|
||
import { EDITOR_DOTMARKETING_CONFIG } from '@dotcms/dotcms-models'; | ||
|
||
export const INITIAL_STATE = { | ||
SHOW_VIDEO_THUMBNAIL: true | ||
}; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class DotMarketingConfigService { | ||
private config: EDITOR_DOTMARKETING_CONFIG = INITIAL_STATE; | ||
|
||
/** | ||
* Get the config object | ||
* | ||
* @return {*} {EDITOR_DOTMARKETING_CONFIG} | ||
* @memberof DotMarketingConfigService | ||
*/ | ||
get configObject(): EDITOR_DOTMARKETING_CONFIG { | ||
return this.config; | ||
} | ||
|
||
/** | ||
* Set a property in the config object | ||
* | ||
* @param {keyof EDITOR_DOTMARKETING_CONFIG} key | ||
* @param {boolean} value | ||
* @memberof DotMarketingConfigService | ||
*/ | ||
setProperty(key: keyof EDITOR_DOTMARKETING_CONFIG, value: boolean): void { | ||
this.config = { | ||
...this.config, | ||
[key]: value | ||
}; | ||
} | ||
|
||
/** | ||
* Get a property from the config object base on a key | ||
* | ||
* @param {keyof EDITOR_DOTMARKETING_CONFIG} key | ||
* @return {*} {boolean} | ||
* @memberof DotMarketingConfigService | ||
*/ | ||
getProperty(key: keyof EDITOR_DOTMARKETING_CONFIG): boolean { | ||
return this.config[key] || false; | ||
} | ||
} |
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,3 +1,4 @@ | ||
export * from './dot-language/dot-language.service'; | ||
export * from './search/search.service'; | ||
export * from './suggestions/suggestions.service'; | ||
export * from './dot-marketing-config/dot-marketing-config.service'; |
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
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.