-
Notifications
You must be signed in to change notification settings - Fork 729
feat: collection color image management #3904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ALTER TABLE collections DROP COLUMN IF EXISTS "imageUrl"; | ||
| ALTER TABLE collections DROP COLUMN IF EXISTS "color"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ALTER TABLE collections ADD COLUMN IF NOT EXISTS "imageUrl" VARCHAR(1024); | ||
| ALTER TABLE collections ADD COLUMN IF NOT EXISTS "color" VARCHAR(30); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,9 @@ import { QueryOptions } from '../utils' | |
|
|
||
| export interface ICreateCollection { | ||
| categoryId: string | ||
| color?: string | null | ||
| description?: string | ||
| imageUrl?: string | null | ||
| name: string | ||
| slug?: string | ||
| starred: boolean | ||
|
|
@@ -80,9 +82,11 @@ export interface ICollectionInsightProject { | |
|
|
||
| export enum CollectionField { | ||
| CATEGORY_ID = 'categoryId', | ||
| COLOR = 'color', | ||
| CREATED_AT = 'createdAt', | ||
| DESCRIPTION = 'description', | ||
| ID = 'id', | ||
| IMAGE_URL = 'imageUrl', | ||
| IS_PRIVATE = 'isPrivate', | ||
| LOGO_URL = 'logoUrl', | ||
| NAME = 'name', | ||
|
|
@@ -136,8 +140,8 @@ export async function createCollection( | |
| ): Promise<ICollection> { | ||
| return qx.selectOne( | ||
| ` | ||
| INSERT INTO collections (name, description, slug, "categoryId", starred, "logoUrl") | ||
| VALUES ($(name), $(description), $(slug), $(categoryId), $(starred), $(logoUrl)) | ||
| INSERT INTO collections (name, description, slug, "categoryId", starred, "logoUrl", "imageUrl", color) | ||
| VALUES ($(name), $(description), $(slug), $(categoryId), $(starred), $(logoUrl), $(imageUrl), $(color)) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SQL references missing properties, breaking existing callersHigh Severity The Additional Locations (1) |
||
| RETURNING * | ||
| `, | ||
| collection, | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UI marks fields required but validation allows empty
Medium Severity
The
imageUrlfield'slf-fieldhas:required="true"(showing a required indicator to the user), but the validation rules at line 265 only include{ url }without arequiredvalidator. Vuelidate'surlvalidator passes for empty strings, so the form can be submitted with an emptyimageUrldespite the UI indicating it's mandatory.Additional Locations (1)
frontend/src/modules/admin/modules/collections/components/lf-collection-add.vue#L264-L265