@@ -4,7 +4,6 @@ import type { Meta, StoryObj } from "@storybook/react"
4
4
import { FairDOElasticSearch } from "@/components/FairDOElasticSearch"
5
5
import { GenericResultView } from "@/components/result/GenericResultView"
6
6
import { AtomIcon , AudioLines , CircleDot , GlobeIcon , GraduationCap , Microscope , ScaleIcon , UserIcon } from "lucide-react"
7
- import { tryURLPrettyPrint } from "@/lib/utils"
8
7
import { PidDisplay } from "@/components/result/PidDisplay"
9
8
import { OrcidDisplay } from "@/components/result/OrcidDisplay"
10
9
@@ -111,44 +110,44 @@ const demoConfig: FairDOConfig = {
111
110
]
112
111
}
113
112
114
- const demoConfigWithCompound : FairDOConfig = {
115
- debug : false ,
116
- alwaysSearchOnInitialLoad : true ,
117
- // host: "https://matwerk.datamanager.kit.edu/search-proxy/api/v1",
118
- host : "https://ddaa9283-f114-4496-b6ed-af12ee34b107.ka.bw-cloud-instance.org:9200" ,
119
- apiKey : "UGNoTW1KUUJ3WmluUHBTcEVpalo6cGloOUVKZ0tTdnlMYVlpTzV4SXBrUQ==" ,
120
- indices : [
121
- {
122
- name : "fdo-prod" ,
123
- facets : [
124
- {
125
- key : "Compound.Molar_mass" ,
126
- label : "Compound" ,
127
- type : "min-max-slider"
128
- }
129
- ] ,
130
- resultFields : [ ] , // Leave empty to get all fields
131
- searchFields : [ "name" , "pid" , "hasMetadata" , "isMetadataFor" , "NMR_Method" ]
132
- }
133
- ] ,
134
- initialState : {
135
- sortList : [
136
- {
137
- field : "_score" ,
138
- direction : "desc"
139
- } ,
140
- {
141
- field : "name.keyword" ,
142
- direction : "asc"
143
- } ,
144
- {
145
- field : "locationPreview/Sample.keyword" ,
146
- direction : "asc"
147
- }
148
- ]
149
- } ,
150
- disjunctiveFacets : [ "NMR_Method.keyword" ]
151
- }
113
+ // const demoConfigWithCompound: FairDOConfig = {
114
+ // debug: false,
115
+ // alwaysSearchOnInitialLoad: true,
116
+ // // host: "https://matwerk.datamanager.kit.edu/search-proxy/api/v1",
117
+ // host: "https://ddaa9283-f114-4496-b6ed-af12ee34b107.ka.bw-cloud-instance.org:9200",
118
+ // apiKey: "UGNoTW1KUUJ3WmluUHBTcEVpalo6cGloOUVKZ0tTdnlMYVlpTzV4SXBrUQ==",
119
+ // indices: [
120
+ // {
121
+ // name: "fdo-prod",
122
+ // facets: [
123
+ // {
124
+ // key: "Compound.Molar_mass",
125
+ // label: "Compound",
126
+ // type: "min-max-slider"
127
+ // }
128
+ // ],
129
+ // resultFields: [], // Leave empty to get all fields
130
+ // searchFields: ["name", "pid", "hasMetadata", "isMetadataFor", "NMR_Method"]
131
+ // }
132
+ // ],
133
+ // initialState: {
134
+ // sortList: [
135
+ // {
136
+ // field: "_score",
137
+ // direction: "desc"
138
+ // },
139
+ // {
140
+ // field: "name.keyword",
141
+ // direction: "asc"
142
+ // },
143
+ // {
144
+ // field: "locationPreview/Sample.keyword",
145
+ // direction: "asc"
146
+ // }
147
+ // ]
148
+ // },
149
+ // disjunctiveFacets: ["NMR_Method.keyword"]
150
+ // }
152
151
153
152
export const NoResultRenderer : Story = {
154
153
args : {
@@ -169,7 +168,8 @@ export const GenericResultRenderer: Story = {
169
168
icon : < UserIcon className = "rfs-shrink-0 rfs-size-4 rfs-mr-2" /> ,
170
169
label : "Contact" ,
171
170
field : "contact" ,
172
- singleValueMapper : ( v ) => < OrcidDisplay orcid = { v } />
171
+ singleValueMapper : ( v ) => < OrcidDisplay orcid = { v } /> ,
172
+ clickBehavior : "follow-url"
173
173
} ,
174
174
{
175
175
icon : < GraduationCap className = "rfs-shrink-0 rfs-size-4 rfs-mr-2" /> ,
@@ -228,49 +228,49 @@ export const GenericResultRenderer: Story = {
228
228
}
229
229
}
230
230
231
- export const CompoundSlider : Story = {
232
- args : {
233
- config : demoConfigWithCompound ,
234
- resultView : ( props ) => (
235
- < GenericResultView
236
- result = { props . result }
237
- invertImageInDarkMode
238
- tags = { [
239
- {
240
- icon : < GraduationCap className = "rfs-shrink-0 rfs-size-4 rfs-mr-2" /> ,
241
- label : "Resource Type" ,
242
- field : "resourceType"
243
- } ,
244
- {
245
- icon : < GlobeIcon className = "rfs-shrink-0 rfs-size-4 rfs-mr-2" /> ,
246
- field : "hadPrimarySource" ,
247
- valueMapper : ( v ) => tryURLPrettyPrint ( v + "" ) ,
248
- label : "Source"
249
- } ,
250
- {
251
- icon : < ScaleIcon className = "rfs-shrink-0 rfs-size-4 rfs-mr-2" /> ,
252
- field : "licenseURL" ,
253
- valueMapper : ( v ) => tryURLPrettyPrint ( v + "" ) ,
254
- label : "License URL"
255
- } ,
256
- {
257
- icon : < AtomIcon className = "rfs-shrink-0 rfs-size-4 rfs-mr-2" /> ,
258
- field : "Compound.Molar_mass" ,
259
- label : "Molar Mass" ,
260
- valueMapper : ( v ) => v + " g/mol"
261
- }
262
- ] }
263
- titleField = "name"
264
- creationDateField = "dateCreatedRfc3339"
265
- additionalIdentifierField = "identifier"
266
- digitalObjectLocationField = "digitalObjectLocation"
267
- imageField = "locationPreview/Sample"
268
- parentItemPidField = "hasMetadata"
269
- relatedItemPidsField = "isMetadataFor"
270
- pidField = "pid"
271
- relatedItemsPrefetch = { { searchFields : { pid : { } } } }
272
- showOpenInFairDoScope
273
- />
274
- )
275
- }
276
- }
231
+ // export const CompoundSlider: Story = {
232
+ // args: {
233
+ // config: demoConfigWithCompound,
234
+ // resultView: (props) => (
235
+ // <GenericResultView
236
+ // result={props.result}
237
+ // invertImageInDarkMode
238
+ // tags={[
239
+ // {
240
+ // icon: <GraduationCap className="rfs-shrink-0 rfs-size-4 rfs-mr-2" />,
241
+ // label: "Resource Type",
242
+ // field: "resourceType"
243
+ // },
244
+ // {
245
+ // icon: <GlobeIcon className="rfs-shrink-0 rfs-size-4 rfs-mr-2" />,
246
+ // field: "hadPrimarySource",
247
+ // valueMapper: (v) => tryURLPrettyPrint(v + ""),
248
+ // label: "Source"
249
+ // },
250
+ // {
251
+ // icon: <ScaleIcon className="rfs-shrink-0 rfs-size-4 rfs-mr-2" />,
252
+ // field: "licenseURL",
253
+ // valueMapper: (v) => tryURLPrettyPrint(v + ""),
254
+ // label: "License URL"
255
+ // },
256
+ // {
257
+ // icon: <AtomIcon className="rfs-shrink-0 rfs-size-4 rfs-mr-2" />,
258
+ // field: "Compound.Molar_mass",
259
+ // label: "Molar Mass",
260
+ // valueMapper: (v) => v + " g/mol"
261
+ // }
262
+ // ]}
263
+ // titleField="name"
264
+ // creationDateField="dateCreatedRfc3339"
265
+ // additionalIdentifierField="identifier"
266
+ // digitalObjectLocationField="digitalObjectLocation"
267
+ // imageField="locationPreview/Sample"
268
+ // parentItemPidField="hasMetadata"
269
+ // relatedItemPidsField="isMetadataFor"
270
+ // pidField="pid"
271
+ // relatedItemsPrefetch={{ searchFields: { pid: {} } }}
272
+ // showOpenInFairDoScope
273
+ // />
274
+ // )
275
+ // }
276
+ // }
0 commit comments