Fixed slug-based navigation in collections UI

refs https://github.com/TryGhost/Team/issues/3169

- When navigating through collections slugs did not display correctly returning "undefined" in the navigation. It was easier to fix the bug than working around it.
This commit is contained in:
Naz 2023-06-19 17:07:36 +07:00
parent 2173fd9ef9
commit 7d4b278a83
No known key found for this signature in database
3 changed files with 13 additions and 3 deletions

View File

@ -14,6 +14,16 @@
</span>
</GhFormGroup>
<GhFormGroup @errors={{@collection.errors}} @hasValidated={{@collection.hasValidated}} @property="slug" class="mr2 flex-auto">
<label for="collection-slug">Slug</label>
<input type="text" class="gh-input" id="collection-slug" name="slug" value={{@collection.slug}} {{on "input" (pick "target.value"
(fn this.setCollectionProperty "slug" ))}} {{on "blur" (fn this.validateCollectionProperty "slug" )}}
data-test-input="collection-slug" />
<span class="error">
<GhErrorMessage @errors={{@collection.errors}} @property="slug" />
</span>
</GhFormGroup>
<GhFormGroup class="no-margin" @errors={{@collection.errors}} @hasValidated={{@collection.hasValidated}}
@property="description">
<label for="collection-description">Description</label>

View File

@ -51,8 +51,8 @@ Router.map(function () {
this.route('tag', {path: '/tags/:tag_slug'});
this.route('collections');
this.route('collection.new', {path: '/collection/new'});
this.route('collection', {path: '/collection/:collection_slug'});
this.route('collection.new', {path: '/collections/new'});
this.route('collection', {path: '/collections/:collection_slug'});
this.route('settings-x');
this.route('settings');

View File

@ -27,7 +27,7 @@ export default class CollectionRoute extends AuthenticatedRoute {
}
serialize(collection) {
return {collection_slug: collection.get('collection')};
return {collection_slug: collection.get('slug')};
}
@action