feat: Collection Icons (#1281)
* wip: Working for creation, and display * feat: IconPicker * fix * feat: Invert collection icon color when dark in dark mode * Improve readability of dropdown menus in dark mode Suggest icon based on collection name * Add additional icons Tweaks and final polish * fix: Write default icon as empty icon column * feat: Improve icon selection logic add more keywords Improve icon coloring when selected and in dark mode * lint * lint
This commit is contained in:
@ -19,6 +19,7 @@ const Collection = sequelize.define(
|
||||
urlId: { type: DataTypes.STRING, unique: true },
|
||||
name: DataTypes.STRING,
|
||||
description: DataTypes.STRING,
|
||||
icon: DataTypes.STRING,
|
||||
color: DataTypes.STRING,
|
||||
private: DataTypes.BOOLEAN,
|
||||
maintainerApprovalRequired: DataTypes.BOOLEAN,
|
||||
@ -46,6 +47,12 @@ const Collection = sequelize.define(
|
||||
}
|
||||
);
|
||||
|
||||
Collection.addHook('beforeSave', async model => {
|
||||
if (model.icon === 'collection') {
|
||||
model.icon = null;
|
||||
}
|
||||
});
|
||||
|
||||
// Class methods
|
||||
|
||||
Collection.associate = models => {
|
||||
|
Reference in New Issue
Block a user