Skip to content

Commit

Permalink
Removed collections feature
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellockyer committed Nov 28, 2024
1 parent f6d774e commit 067bdd2
Show file tree
Hide file tree
Showing 88 changed files with 109 additions and 8,049 deletions.
90 changes: 0 additions & 90 deletions ghost/admin/app/components/collections/collection-form.hbs

This file was deleted.

65 changes: 0 additions & 65 deletions ghost/admin/app/components/collections/collection-form.js

This file was deleted.

19 changes: 0 additions & 19 deletions ghost/admin/app/components/collections/delete-collection-modal.hbs

This file was deleted.

29 changes: 0 additions & 29 deletions ghost/admin/app/components/collections/delete-collection-modal.js

This file was deleted.

32 changes: 0 additions & 32 deletions ghost/admin/app/components/collections/list-item.hbs

This file was deleted.

20 changes: 0 additions & 20 deletions ghost/admin/app/components/koenig-lexical-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,24 +276,6 @@ export default class KoenigLexicalEditor extends Component {
return response;
};

const fetchCollectionPosts = async (collectionSlug) => {
if (!this.contentKey) {
const integrations = await this.store.findAll('integration');
const contentIntegration = integrations.findBy('slug', 'ghost-core-content');
this.contentKey = contentIntegration?.contentKey.secret;
}

const postsUrl = new URL(this.ghostPaths.url.admin('/api/content/posts/'), window.location.origin);
postsUrl.searchParams.append('key', this.contentKey);
postsUrl.searchParams.append('collection', collectionSlug);
postsUrl.searchParams.append('limit', 12);

const response = await fetch(postsUrl.toString());
const {posts} = await response.json();

return posts;
};

const fetchAutocompleteLinks = async () => {
const defaults = [
{label: 'Homepage', value: window.location.origin + '/'},
Expand Down Expand Up @@ -455,13 +437,11 @@ export default class KoenigLexicalEditor extends Component {
unsplash: this.settings.unsplash ? unsplashConfig.defaultHeaders : null,
tenor: this.config.tenor?.googleApiKey ? this.config.tenor : null,
fetchAutocompleteLinks,
fetchCollectionPosts,
fetchEmbed,
fetchLabels,
renderLabels: !this.session.user.isContributor,
feature: {
collectionsCard: this.feature.collectionsCard,
collections: this.feature.collections,
contentVisibility: this.feature.contentVisibility
},
deprecated: { // todo fix typo
Expand Down
43 changes: 0 additions & 43 deletions ghost/admin/app/controllers/collection.js

This file was deleted.

38 changes: 0 additions & 38 deletions ghost/admin/app/controllers/collections.js

This file was deleted.

13 changes: 2 additions & 11 deletions ghost/admin/app/controllers/lexical-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,6 @@ export default class LexicalEditorController extends Controller {
});
}

@computed
get collections() {
return this.store.peekAll('collection');
}

@computed('session.user.{isAdmin,isEditor}')
get canManageSnippets() {
let {user} = this.session;
Expand Down Expand Up @@ -981,15 +976,11 @@ export default class LexicalEditorController extends Controller {
}
}

// load supplemental data such as snippets and collections in the background
// load supplemental data such as snippets in the background
@restartableTask
*backgroundLoaderTask() {
yield this.store.query('snippet', {limit: 'all'});

if (this.post?.displayName === 'page' && this.feature.get('collections') && this.feature.get('collectionsCard')) {
yield this.store.query('collection', {limit: 'all'});
}

this.search.refreshContentTask.perform();
this.syncMobiledocSnippets();
}
Expand Down Expand Up @@ -1235,7 +1226,7 @@ export default class LexicalEditorController extends Controller {
const isDraft = this.post.get('status') === 'draft';
const slugContainsUntitled = slug.includes('untitled');
const isTitleSet = title && title.trim() !== '' && title !== DEFAULT_TITLE;

if (isDraft && slugContainsUntitled && isTitleSet) {
Sentry.captureException(new Error('Draft post has title set with untitled slug'), {
extra: {
Expand Down
Loading

0 comments on commit 067bdd2

Please sign in to comment.