Skip to content

Commit 1361dea

Browse files
committed
Update guide
1 parent b94f6cf commit 1361dea

File tree

3 files changed

+123
-42
lines changed

3 files changed

+123
-42
lines changed
Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
## Workflow name
2-
#name: Build and Publish Storybook to GitHub Pages
3-
#
4-
#on:
5-
# # Event for the workflow to run on
6-
# push:
7-
# branches:
8-
# - 'main' # Replace with the branch you want to deploy from
9-
#
10-
#permissions:
11-
# contents: read
12-
# pages: write
13-
# id-token: write
14-
#
15-
## List of jobs
16-
#jobs:
17-
# deploy:
18-
# runs-on: ubuntu-latest
19-
# # Job steps
20-
# steps:
21-
# # Manual Checkout
22-
# - uses: actions/checkout@v4
23-
# with:
24-
# fetch-depth: 0
25-
# # Set up Node
26-
# - uses: actions/setup-node@v4
27-
# with:
28-
# node-version: '20'
29-
# #👇 Add Storybook build and deploy to GitHub Pages as a step in the workflow
30-
# - uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3
31-
# with:
32-
# install_command: npm ci # default: npm ci
33-
# build_command: npm run storybook:build # default: npm run build-storybook
34-
# path: storybook-static # default: dist/storybook
35-
# checkout: false # default: true
1+
# Workflow name
2+
name: Build and Publish Storybook to GitHub Pages
3+
4+
on:
5+
# Event for the workflow to run on
6+
push:
7+
branches:
8+
- 'main' # Replace with the branch you want to deploy from
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
# List of jobs
16+
jobs:
17+
deploy:
18+
runs-on: ubuntu-latest
19+
# Job steps
20+
steps:
21+
# Manual Checkout
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
# Set up Node
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: '20'
29+
#👇 Add Storybook build and deploy to GitHub Pages as a step in the workflow
30+
- uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3
31+
with:
32+
install_command: npm ci # default: npm ci
33+
build_command: npm run storybook:build # default: npm run build-storybook
34+
path: storybook-static # default: dist/storybook
35+
checkout: false # default: true

src/stories/0 Getting Started.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ export default function Home() {
4242
host: <elastic host>,
4343
indices: [
4444
{
45-
name: "index1",
45+
name: "index-name-here",
4646
facets: [
4747
{
4848
key: "hadPrimarySource.keyword",
4949
label: "Source",
50-
prettyPrintURLs: true
50+
prettyPrintURLs: true // Will remove https://www.
5151
},
5252
{
5353
key: "licenseURL.keyword",
@@ -89,22 +89,22 @@ export default function Home() {
8989
invertImageInDarkMode // Not recommended for colorful images
9090
tags={[
9191
{
92-
icon: <GraduationCap className="rfs-shrink-0 rfs-size-4 rfs-mr-2" />,
92+
icon: <GraduationCap />,
9393
label: "Resource Type",
9494
field: "resourceType"
9595
},
9696
{
97-
icon: <GlobeIcon className="rfs-shrink-0 rfs-size-4 rfs-mr-2" />,
97+
icon: <GlobeIcon />,
9898
field: "hadPrimarySource",
9999
valueMapper: tryURLPrettyPrint
100100
},
101101
{
102-
icon: <ScaleIcon className="rfs-shrink-0 rfs-size-4 rfs-mr-2" />,
102+
icon: <ScaleIcon />,
103103
field: "licenseURL",
104104
valueMapper: tryURLPrettyPrint
105105
},
106106
{
107-
icon: <AtomIcon className="rfs-shrink-0 rfs-size-4 rfs-mr-2" />,
107+
icon: <AtomIcon />,
108108
field: "Compound"
109109
}
110110
]}

src/stories/FairDOElasticSearch.stories.tsx

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const demoConfig: FairDOConfig = {
2020
alwaysSearchOnInitialLoad: true,
2121
// host: "https://matwerk.datamanager.kit.edu/search-proxy/api/v1",
2222
host: "https://ddaa9283-f114-4496-b6ed-af12ee34b107.ka.bw-cloud-instance.org:9200",
23-
apiKey: "VG9NNFNwUUJyWWdtamJ6UGExcjY6aXhKUkk1M0xTT1dTS2xzN3daQjA3UQ==",
23+
apiKey: "UGNoTW1KUUJ3WmluUHBTcEVpalo6cGloOUVKZ0tTdnlMYVlpTzV4SXBrUQ==",
2424
indices: [
2525
{
2626
name: "fdo-test-3",
@@ -68,6 +68,44 @@ const demoConfig: FairDOConfig = {
6868
disjunctiveFacets: ["NMR_Method.keyword"]
6969
}
7070

71+
const demoConfigWithCompound: FairDOConfig = {
72+
debug: false,
73+
alwaysSearchOnInitialLoad: true,
74+
// host: "https://matwerk.datamanager.kit.edu/search-proxy/api/v1",
75+
host: "https://ddaa9283-f114-4496-b6ed-af12ee34b107.ka.bw-cloud-instance.org:9200",
76+
apiKey: "UGNoTW1KUUJ3WmluUHBTcEVpalo6cGloOUVKZ0tTdnlMYVlpTzV4SXBrUQ==",
77+
indices: [
78+
{
79+
name: "fdo-test-4",
80+
facets: [
81+
{
82+
key: "Compound.keyword",
83+
label: "Compound"
84+
}
85+
],
86+
resultFields: [], // Leave empty to get all fields
87+
searchFields: ["name", "pid", "hasMetadata", "isMetadataFor", "NMR_Method"]
88+
}
89+
],
90+
initialState: {
91+
sortList: [
92+
{
93+
field: "_score",
94+
direction: "desc"
95+
},
96+
{
97+
field: "name.keyword",
98+
direction: "asc"
99+
},
100+
{
101+
field: "locationPreview/Sample.keyword",
102+
direction: "asc"
103+
}
104+
]
105+
},
106+
disjunctiveFacets: ["NMR_Method.keyword"]
107+
}
108+
71109
export const NoResultRenderer: Story = {
72110
args: {
73111
config: demoConfig,
@@ -117,3 +155,46 @@ export const GenericResultRenderer: Story = {
117155
)
118156
}
119157
}
158+
159+
export const CompoundSlider: Story = {
160+
args: {
161+
config: demoConfigWithCompound,
162+
resultView: (props) => (
163+
<GenericResultView
164+
result={props.result}
165+
invertImageInDarkMode
166+
tags={[
167+
{
168+
icon: <GraduationCap className="rfs-shrink-0 rfs-size-4 rfs-mr-2" />,
169+
label: "Resource Type",
170+
field: "resourceType"
171+
},
172+
{
173+
icon: <GlobeIcon className="rfs-shrink-0 rfs-size-4 rfs-mr-2" />,
174+
field: "hadPrimarySource",
175+
valueMapper: tryURLPrettyPrint
176+
},
177+
{
178+
icon: <ScaleIcon className="rfs-shrink-0 rfs-size-4 rfs-mr-2" />,
179+
field: "licenseURL",
180+
valueMapper: tryURLPrettyPrint
181+
},
182+
{
183+
icon: <AtomIcon className="rfs-shrink-0 rfs-size-4 rfs-mr-2" />,
184+
field: "Compound"
185+
}
186+
]}
187+
titleField="name"
188+
creationDateField="dateCreatedRfc3339"
189+
additionalIdentifierField="identifier"
190+
digitalObjectLocationField="digitalObjectLocation"
191+
imageField="locationPreview/Sample"
192+
parentItemPidField="hasMetadata"
193+
relatedItemPidsField="isMetadataFor"
194+
pidField="pid"
195+
relatedItemsPrefetch={{ prefetchAmount: 20, searchFields: { pid: {}, isMetadataFor: {}, hasMetadata: {} } }}
196+
showOpenInFairDoScope
197+
/>
198+
)
199+
}
200+
}

0 commit comments

Comments
 (0)