firecmsco / firecms

Awesome Firebase/Firestore-based CMS. The missing admin panel for your Firebase project!
https://firecms.co
Other
1.13k stars 185 forks source link

Subcollections don't show in table view when set in propertiesOrder #568

Closed faizanabidnaqvi closed 10 months ago

faizanabidnaqvi commented 10 months ago

Hi there!

I have a collection with subcollection with a custom propertiesOrder set because I wish to show only certain properties in the table view. I also wish to show the subcollection link within the table view. Based on firecms documentation for propertiesOrder:

... If you have subcollections, you get a column for each subcollection, with the path (or alias) as the subcollection, prefixed with subcollection:. e.g. subcollection:orders. - If you are using a collection group, you will also have an additional collectionGroupParent column.

I tried settings the propertiesOrder this way:

const classesCollection = buildCollection<Class>({
    path: "classes",
    name: collections?.[identifier]?.menuTitle ?? "Classes",
    singularName: "Class",
    customId: classDocIdAndName,
    properties: classesSchema,
    group: collections?.[identifier]?.group ?? "Config",
    propertiesOrder: ["updatedOn",
        "title", "description", "featureReferences", "subcollection:platformConfig", "subcollection:onboarding"],
    initialSort: ["updatedOn", "desc"],
    inlineEditing: false,
    textSearchEnabled: true,
    subcollections: [classPlatformConfigCollection, onBoardingPageCollection],
    permissions: ({ authController }) => collections?.[identifier]?.permissions ?? getPermissionsFromAuth(authController, contentPermissions),
    //callbacks: setCreatedOnDateOnlySchemaCallback,
    callbacks: buildEntityCallbacks({
        onPreSave: processOnPreSave
    })
})

platformConfig and onboarding are subcollection paths for classPlatformConfigCollection and onBoardingPageCollection.

I don't see any subcollections in the table view this way. Let me know if this is a bug or if I am doing something wrong here.

faizanabidnaqvi commented 10 months ago

I also noted that if I don't use propertiesOrder field, subcollection links will still not show in table view like it did in v1.

faizanabidnaqvi commented 10 months ago

Seems to be fixed in 2.2.0-pre.