mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Added first pass of upload cards
refs https://github.com/TryGhost/Team/issues/1229 refs https://github.com/TryGhost/Team/issues/1230 refs https://github.com/TryGhost/Team/issues/1231
This commit is contained in:
parent
c35cdae491
commit
3b49732cbb
15 changed files with 179 additions and 2 deletions
|
@ -65,6 +65,9 @@ export default Service.extend({
|
||||||
nftCard: feature('nftCard', {developer: true}),
|
nftCard: feature('nftCard', {developer: true}),
|
||||||
accordionCard: feature('accordionCard', {developer: true}),
|
accordionCard: feature('accordionCard', {developer: true}),
|
||||||
gifsCard: feature('gifsCard', {developer: true}),
|
gifsCard: feature('gifsCard', {developer: true}),
|
||||||
|
fileCard: feature('fileCard', {developer: true}),
|
||||||
|
audioCard: feature('audioCard', {developer: true}),
|
||||||
|
videoCard: feature('videoCard', {developer: true}),
|
||||||
|
|
||||||
_user: null,
|
_user: null,
|
||||||
|
|
||||||
|
|
|
@ -404,6 +404,45 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="gh-expandable-block">
|
||||||
|
<div class="gh-expandable-header">
|
||||||
|
<div>
|
||||||
|
<h4 class="gh-expandable-title">Cardmageddon - File</h4>
|
||||||
|
<p class="gh-expandable-description">
|
||||||
|
Add a generic file
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="for-switch">
|
||||||
|
<GhFeatureFlag @flag="fileCard" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="gh-expandable-block">
|
||||||
|
<div class="gh-expandable-header">
|
||||||
|
<div>
|
||||||
|
<h4 class="gh-expandable-title">Cardmageddon - Video</h4>
|
||||||
|
<p class="gh-expandable-description">
|
||||||
|
Add a video file
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="for-switch">
|
||||||
|
<GhFeatureFlag @flag="videoCard" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="gh-expandable-block">
|
||||||
|
<div class="gh-expandable-header">
|
||||||
|
<div>
|
||||||
|
<h4 class="gh-expandable-title">Cardmageddon - Audio</h4>
|
||||||
|
<p class="gh-expandable-description">
|
||||||
|
Add an audio file
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="for-switch">
|
||||||
|
<GhFeatureFlag @flag="audioCard" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
{{yield}}
|
|
@ -0,0 +1,4 @@
|
||||||
|
import Component from '@glimmer/component';
|
||||||
|
|
||||||
|
export default class KoenigCardAudioComponent extends Component {
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{{yield}}
|
|
@ -0,0 +1,4 @@
|
||||||
|
import Component from '@glimmer/component';
|
||||||
|
|
||||||
|
export default class KoenigCardFileComponent extends Component {
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{{yield}}
|
|
@ -0,0 +1,4 @@
|
||||||
|
import Component from '@glimmer/component';
|
||||||
|
|
||||||
|
export default class KoenigCardVideoComponent extends Component {
|
||||||
|
}
|
|
@ -17,7 +17,10 @@ export const CARD_COMPONENT_MAP = {
|
||||||
nft: 'koenig-card-nft',
|
nft: 'koenig-card-nft',
|
||||||
toggle: 'koenig-card-accordion',
|
toggle: 'koenig-card-accordion',
|
||||||
'email-cta': 'koenig-card-email-cta',
|
'email-cta': 'koenig-card-email-cta',
|
||||||
paywall: 'koenig-card-paywall'
|
paywall: 'koenig-card-paywall',
|
||||||
|
file: 'koenig-card-file',
|
||||||
|
audio: 'koenig-card-audio',
|
||||||
|
video: 'koenig-card-video'
|
||||||
};
|
};
|
||||||
|
|
||||||
// map card names to generic icons (used for ghost elements when dragging)
|
// map card names to generic icons (used for ghost elements when dragging)
|
||||||
|
@ -37,7 +40,10 @@ export const CARD_ICON_MAP = {
|
||||||
nft: 'koenig/kg-card-type-gen-embed',
|
nft: 'koenig/kg-card-type-gen-embed',
|
||||||
toggle: 'koenig/kg-card-type-accordion',
|
toggle: 'koenig/kg-card-type-accordion',
|
||||||
'email-cta': 'koenig/kg-card-type-gen-embed',
|
'email-cta': 'koenig/kg-card-type-gen-embed',
|
||||||
paywall: 'koenig/kg-card-type-divider'
|
paywall: 'koenig/kg-card-type-divider',
|
||||||
|
file: 'koenig/kg-card-type-divider',
|
||||||
|
audio: 'koenig/kg-card-type-divider',
|
||||||
|
video: 'koenig/kg-card-type-video'
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: move koenigOptions directly into cards now that card components register
|
// TODO: move koenigOptions directly into cards now that card components register
|
||||||
|
@ -58,6 +64,9 @@ export default [
|
||||||
createComponentCard('callout'),
|
createComponentCard('callout'),
|
||||||
createComponentCard('nft', {hasEditMode: false}),
|
createComponentCard('nft', {hasEditMode: false}),
|
||||||
createComponentCard('toggle'),
|
createComponentCard('toggle'),
|
||||||
|
createComponentCard('file'),
|
||||||
|
createComponentCard('audio'),
|
||||||
|
createComponentCard('video'),
|
||||||
createComponentCard('paywall', {hasEditMode: false, selectAfterInsert: false})
|
createComponentCard('paywall', {hasEditMode: false, selectAfterInsert: false})
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -189,6 +198,33 @@ export const CARD_MENU = [
|
||||||
type: 'card',
|
type: 'card',
|
||||||
replaceArg: 'toggle',
|
replaceArg: 'toggle',
|
||||||
isAvailable: 'feature.accordionCard'
|
isAvailable: 'feature.accordionCard'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'File',
|
||||||
|
icon: 'koenig/kg-card-type-accordion',
|
||||||
|
desc: 'Add a file',
|
||||||
|
matches: ['file'],
|
||||||
|
type: 'card',
|
||||||
|
replaceArg: 'file',
|
||||||
|
isAvailable: 'feature.fileCard'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Audio',
|
||||||
|
icon: 'koenig/kg-card-type-accordion',
|
||||||
|
desc: 'Add an audio file',
|
||||||
|
matches: ['audio'],
|
||||||
|
type: 'card',
|
||||||
|
replaceArg: 'audio',
|
||||||
|
isAvailable: 'feature.audioCard'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Video',
|
||||||
|
icon: 'koenig/kg-card-type-accordion',
|
||||||
|
desc: 'Add a video file',
|
||||||
|
matches: ['video'],
|
||||||
|
type: 'card',
|
||||||
|
replaceArg: 'video',
|
||||||
|
isAvailable: 'feature.videoCard'
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
export { default } from 'koenig-editor/components/koenig-card-audio';
|
|
@ -0,0 +1 @@
|
||||||
|
export {default} from 'koenig-editor/components/koenig-card-file';
|
|
@ -0,0 +1 @@
|
||||||
|
export { default } from 'koenig-editor/components/koenig-card-video';
|
|
@ -0,0 +1,27 @@
|
||||||
|
import { expect } from 'chai';
|
||||||
|
import { describe, it } from 'mocha';
|
||||||
|
import { setupRenderingTest } from 'ember-mocha';
|
||||||
|
import { render } from '@ember/test-helpers';
|
||||||
|
import { hbs } from 'ember-cli-htmlbars';
|
||||||
|
|
||||||
|
describe('Integration | Component | koenig-card-audio', function() {
|
||||||
|
setupRenderingTest();
|
||||||
|
|
||||||
|
it('renders', async function() {
|
||||||
|
// Set any properties with this.set('myProperty', 'value');
|
||||||
|
// Handle any actions with this.set('myAction', function(val) { ... });
|
||||||
|
|
||||||
|
await render(hbs`<KoenigCardAudio />`);
|
||||||
|
|
||||||
|
expect(this.element.textContent.trim()).to.equal('');
|
||||||
|
|
||||||
|
// Template block usage:
|
||||||
|
await render(hbs`
|
||||||
|
<KoenigCardAudio>
|
||||||
|
template block text
|
||||||
|
</KoenigCardAudio>
|
||||||
|
`);
|
||||||
|
|
||||||
|
expect(this.element.textContent.trim()).to.equal('template block text');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,27 @@
|
||||||
|
import { expect } from 'chai';
|
||||||
|
import { describe, it } from 'mocha';
|
||||||
|
import { setupRenderingTest } from 'ember-mocha';
|
||||||
|
import { render } from '@ember/test-helpers';
|
||||||
|
import { hbs } from 'ember-cli-htmlbars';
|
||||||
|
|
||||||
|
describe('Integration | Component | koenig-card-file', function() {
|
||||||
|
setupRenderingTest();
|
||||||
|
|
||||||
|
it('renders', async function() {
|
||||||
|
// Set any properties with this.set('myProperty', 'value');
|
||||||
|
// Handle any actions with this.set('myAction', function(val) { ... });
|
||||||
|
|
||||||
|
await render(hbs`<KoenigCardFile />`);
|
||||||
|
|
||||||
|
expect(this.element.textContent.trim()).to.equal('');
|
||||||
|
|
||||||
|
// Template block usage:
|
||||||
|
await render(hbs`
|
||||||
|
<KoenigCardFile>
|
||||||
|
template block text
|
||||||
|
</KoenigCardFile>
|
||||||
|
`);
|
||||||
|
|
||||||
|
expect(this.element.textContent.trim()).to.equal('template block text');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,27 @@
|
||||||
|
import { expect } from 'chai';
|
||||||
|
import { describe, it } from 'mocha';
|
||||||
|
import { setupRenderingTest } from 'ember-mocha';
|
||||||
|
import { render } from '@ember/test-helpers';
|
||||||
|
import { hbs } from 'ember-cli-htmlbars';
|
||||||
|
|
||||||
|
describe('Integration | Component | koenig-card-video', function() {
|
||||||
|
setupRenderingTest();
|
||||||
|
|
||||||
|
it('renders', async function() {
|
||||||
|
// Set any properties with this.set('myProperty', 'value');
|
||||||
|
// Handle any actions with this.set('myAction', function(val) { ... });
|
||||||
|
|
||||||
|
await render(hbs`<KoenigCardVideo />`);
|
||||||
|
|
||||||
|
expect(this.element.textContent.trim()).to.equal('');
|
||||||
|
|
||||||
|
// Template block usage:
|
||||||
|
await render(hbs`
|
||||||
|
<KoenigCardVideo>
|
||||||
|
template block text
|
||||||
|
</KoenigCardVideo>
|
||||||
|
`);
|
||||||
|
|
||||||
|
expect(this.element.textContent.trim()).to.equal('template block text');
|
||||||
|
});
|
||||||
|
});
|
Loading…
Add table
Reference in a new issue