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

Arrow buttons shown on top right of entity form when no subcollections or additional views #569

Closed faizanabidnaqvi closed 10 months ago

faizanabidnaqvi commented 10 months ago

Hi there

This is a minor display issue that I noted. When collection has no additional views or subcollections, left and right arrow icons appear on the top bar of the entity form (right of the close button). They don't seem to do anything; they just occupy space and seem to a user that they can use it to go to the next entity in the table which it doesn't.

Here is a screenshot:

Screenshot 2023-10-11 at 9 40 34 PM

I don't see this happening in the demo (I am not sure which version is demo on); I am on the latest release of firecms.

Here is my collection:

const productsCollection = buildCollection<Product>({
    name: "Products",
    singularName: "Product",
    path: "testDocs",
    group: "E-commerce",
    inlineEditing: false,
    callbacks: questionsNewSchemaCallback,
    permissions: ({ authController, user }) => ({
        read: true,
        edit: true,
        create: true,
        delete: true
    }),
    additionalFields: [
        fullNameAdditionalField
    ],
    properties: {
        name: {
            name: "Name",
            validation: { required: true },
            dataType: "string"
        },
        price: {
            name: "Price",
            validation: {
                required: true,
                requiredMessage: "You must set a price between 0 and 1000",
                min: 0,
                max: 1000
            },
            description: "Price with range validation",
            dataType: "number"
        },
        status: {
            name: "Status",
            validation: { required: true },
            dataType: "string",
            description: "Should this product be visible in the website",
            enumValues: {
                private: "Private",
                public: "Public"
            }
        },
        published: ({ values }) => buildProperty({
            name: "Published",
            dataType: "boolean",
            columnWidth: 100,
            disabled: values.status === "public"
                ? false
                : {
                    clearOnDisabled: true,
                    disabledMessage: "Status must be public in order to enable this the published flag"
                }

        }),
        related_products: {
            dataType: "array",
            name: "Related products",
            description: "Reference to self",
            of: {
                dataType: "reference",
                path: "products"
            }
        },
        main_image: buildProperty({ // The `buildProperty` method is a utility function used for type checking
            name: "Image",
            dataType: "string",
            storage: {
                storagePath: "images",
                acceptedFiles: ["image/*"],
                storeUrl: true,
            },
            url: "image"
        }),
        image: generateImageWithMetaDataPropery("Image", false, "img"),
        video: generateVideoWithMetaDataPropery("Video", "Upload video", false, "videos", false),
        tags: {
            name: "Tags",
            description: "Example of generic array",
            validation: { required: true },
            dataType: "array",
            of: {
                dataType: "string"
            }
        },
        description: {
            name: "Description",
            description: "This is the description of the product",
            multiline: true,
            dataType: "string",
            columnWidth: 300
        },
        htmlDescription: {
            name: "HTML Description",
            dataType: "string",
            Field: RichTextEditorField,
            Preview: HtmlPreview
        },
        categories: {
            name: "Categories",
            validation: { required: true },
            dataType: "array",
            of: {
                dataType: "string",
                enumValues: {
                    electronics: "Electronics",
                    books: "Books",
                    furniture: "Furniture",
                    clothing: "Clothing",
                    food: "Food",
                    footwear: "Footwear",
                }
            }
        },
        publisher: {
            name: "Publisher",
            description: "This is an example of a map property",
            dataType: "map",
            pickOnlySomeKeys: true,
            properties: {
                name: {
                    name: "Name",
                    dataType: "string",
                },
                external_id: {
                    name: "External id",
                    dataType: "string"
                }
            }
        },
        metadata: {
            name: "Metadata",
            dataType: "map",
            keyValue: true
        },
        expires_on: {
            name: "Expires on",
            dataType: "date"
        },
        createdOn: {
            dataType: "date",
            name: "Creation Date",
            disabled: true,
            autoValue: "on_create"
        },
        updatedOn: {
            dataType: "date",
            name: "Update Date",
            disabled: true,
            autoValue: "on_update"
        }
    }
});
fgatti675 commented 10 months ago

Weird, I am not getting this. I am closing this since the UI has completely been revamped for version 3 and this won't be an issue in the future