diff --git a/CHANGELOG.md b/CHANGELOG.md index d2f3f3a8d..2f23f70fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ NOTE: As semantic versioning states all 0.y.z releases can contain breaking chan - [#102](https://github.com/kobsio/kobs/pull/102): Fix GitHub Action for creating a new Helm release. - [#109](https://github.com/kobsio/kobs/pull/109): Fix tooltip position in Prometheus charts. - [#110](https://github.com/kobsio/kobs/pull/110): Fix Dashboard tabs showing wrong variables. +- [#111](https://github.com/kobsio/kobs/pull/111): Fix usage of `memo` in Dashboards and fix resources table for CRDs when a value is undefined. ### Changed diff --git a/plugins/core/src/utils/resources.tsx b/plugins/core/src/utils/resources.tsx index 909ef6898..20cde6964 100644 --- a/plugins/core/src/utils/resources.tsx +++ b/plugins/core/src/utils/resources.tsx @@ -1415,6 +1415,7 @@ export const customResourceDefinition = (crds: ICRD[]): IResources => { crd.columns && crd.columns.length > 0 ? crd.columns.map((column) => { const value = JSONPath({ json: cr, path: `$.${column.jsonPath}` })[0]; + if (!value) return ''; if (column.type === 'date') return timeDifference(new Date().getTime(), new Date(value).getTime()); return value; }) diff --git a/plugins/dashboards/src/components/dashboards/Dashboard.tsx b/plugins/dashboards/src/components/dashboards/Dashboard.tsx index a63c3e635..f53d9b174 100644 --- a/plugins/dashboards/src/components/dashboards/Dashboard.tsx +++ b/plugins/dashboards/src/components/dashboards/Dashboard.tsx @@ -239,8 +239,10 @@ const Dashboard: React.FunctionComponent = ({ export default memo(Dashboard, (prevProps, nextProps) => { if ( + prevProps.activeKey === nextProps.activeKey && + JSON.stringify(prevProps.defaults) === JSON.stringify(nextProps.defaults) && JSON.stringify(prevProps.dashboard) === JSON.stringify(nextProps.dashboard) && - prevProps.activeKey === nextProps.activeKey + prevProps.forceDefaultSpan === nextProps.forceDefaultSpan ) { return true; }