diff --git a/CHANGELOG.md b/CHANGELOG.md index e0766ae..72d77a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### v2.2.0 (TBA) +- Added option to set custom description for apps ([#201](https://github.com/pawelmalak/flame/issues/201)) + ### v2.1.1 (2021-12-02) - Added support for Docker secrets ([#189](https://github.com/pawelmalak/flame/issues/189)) - Changed some messages and buttons to make it easier to open bookmarks editor ([#239](https://github.com/pawelmalak/flame/issues/239)) diff --git a/client/src/components/Apps/AppCard/AppCard.tsx b/client/src/components/Apps/AppCard/AppCard.tsx index 2fe3b21..98ec7ec 100644 --- a/client/src/components/Apps/AppCard/AppCard.tsx +++ b/client/src/components/Apps/AppCard/AppCard.tsx @@ -8,16 +8,15 @@ import { State } from '../../../store/reducers'; interface Props { app: App; - pinHandler?: Function; } -export const AppCard = (props: Props): JSX.Element => { +export const AppCard = ({ app }: Props): JSX.Element => { const { config } = useSelector((state: State) => state.config); - const [displayUrl, redirectUrl] = urlParser(props.app.url); + const [displayUrl, redirectUrl] = urlParser(app.url); let iconEl: JSX.Element; - const { icon } = props.app; + const { icon } = app; if (isImage(icon)) { const source = isUrl(icon) ? icon : `/uploads/${icon}`; @@ -25,7 +24,7 @@ export const AppCard = (props: Props): JSX.Element => { iconEl = ( {`${props.app.name} ); @@ -54,8 +53,8 @@ export const AppCard = (props: Props): JSX.Element => { >
{iconEl}
-
{props.app.name}
- {displayUrl} +
{app.name}
+ {!app.description.length ? displayUrl : app.description}
); diff --git a/client/src/components/Apps/AppForm/AppForm.tsx b/client/src/components/Apps/AppForm/AppForm.tsx index 8679f82..c2dc07a 100644 --- a/client/src/components/Apps/AppForm/AppForm.tsx +++ b/client/src/components/Apps/AppForm/AppForm.tsx @@ -96,7 +96,7 @@ export const AppForm = ({ modalHandler }: Props): JSX.Element => { {/* NAME */} - + { /> + {/* DESCRIPTION */} + + + inputChangeHandler(e)} + /> + + Optional - If description is not set, app URL will be displayed + + + {/* ICON */} {!useCustomIcon ? ( // use mdi icon - + { + await query.addColumn('apps', 'description', { + type: STRING, + allowNull: false, + defaultValue: '', + }); +}; + +const down = async (query) => { + await query.removeColumn('apps', 'description'); +}; + +module.exports = { + up, + down, +}; diff --git a/models/App.js b/models/App.js index 8971d60..7eb022f 100644 --- a/models/App.js +++ b/models/App.js @@ -31,6 +31,11 @@ const App = sequelize.define( allowNull: true, defaultValue: 1, }, + description: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: '', + }, }, { tableName: 'apps',