projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
19690: description hover hacked in
[arvados-workbench2.git]
/
src
/
views-components
/
data-explorer
/
with-resources.tsx
diff --git
a/src/views-components/data-explorer/with-resources.tsx
b/src/views-components/data-explorer/with-resources.tsx
index f6670bd66426166a87b42366bd7002a90553cf25..deeabe95eec7682f57aa0de62c55feee126e653d 100644
(file)
--- a/
src/views-components/data-explorer/with-resources.tsx
+++ b/
src/views-components/data-explorer/with-resources.tsx
@@
-2,11
+2,11
@@
//
// SPDX-License-Identifier: AGPL-3.0
//
// SPDX-License-Identifier: AGPL-3.0
-import
* as
React from 'react';
+import React from 'react';
import { connect } from 'react-redux';
import { connect } from 'react-redux';
-import { RootState } from '
~/
store/store';
-import { getResource } from '
~/
store/resources/resources';
-import { Resource } from '
~/
models/resource';
+import { RootState } from 'store/store';
+import { getResource } from 'store/resources/resources';
+import { Resource } from 'models/resource';
interface WithResourceProps {
resource?: Resource;
interface WithResourceProps {
resource?: Resource;
@@
-22,3
+22,6
@@
export const withResource = (component: React.ComponentType<WithResourceProps &
export const getDataFromResource = (property: string, resource?: Resource) => {
return resource && resource[property] ? resource[property] : '(none)';
};
export const getDataFromResource = (property: string, resource?: Resource) => {
return resource && resource[property] ? resource[property] : '(none)';
};
+
+export const withResourceData = (property: string, render: (data: any) => React.ReactElement<any>) =>
+ withResource(({ resource }) => render(getDataFromResource(property, resource)));