Skip to content

Commit df84c85

Browse files
author
Renato Juaçaba Neto
committed
Adjust resolution bar metadata
1 parent d5103d0 commit df84c85

3 files changed

Lines changed: 16 additions & 73 deletions

File tree

stanzas/idorg-resolution-bar/components/Search.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import config from './config';
66

77
interface SearchProps {
88
onButtonClick: (query: string | undefined) => void
9-
buttonCaption: string
10-
placeholderCaption: string
9+
textButton: string
10+
textPlaceholder: string
1111
}
1212

1313
interface SearchState {
@@ -129,7 +129,7 @@ class Search extends React.Component<SearchProps, SearchState> {
129129

130130
render() {
131131
const {
132-
props: { buttonCaption, placeholderCaption },
132+
props: { textButton, textPlaceholder },
133133
state: { query, showSuggestions, isSearchValid }
134134
} = this;
135135

@@ -157,7 +157,7 @@ class Search extends React.Component<SearchProps, SearchState> {
157157
onChange={this.handleChange}
158158
onKeyDown={this.handleKeyDown}
159159
onFocus={this.handleFocusShowSuggestions}
160-
placeholder={placeholderCaption}
160+
placeholder={textPlaceholder}
161161
ref={this.search}
162162
value={query}
163163
/>
@@ -168,7 +168,7 @@ class Search extends React.Component<SearchProps, SearchState> {
168168
onClick={this.handleButtonClick}
169169
disabled={!isSearchValid}
170170
>
171-
{buttonCaption}
171+
{textButton}
172172
</button>
173173
</div>
174174
{ config.showSearchSuggestions && showSuggestions &&

stanzas/idorg-resolution-bar/index.tsx

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default class ResolutionBar extends Stanza {
1616
const reactRootElem = this.root.querySelector("main") as HTMLElement;
1717
this.reactDomRoot = ReactDOM.createRoot(reactRootElem);
1818
this.reactDomRoot.render(
19-
<Search onButtonClick={alert} buttonCaption='Click!' placeholderCaption='Placeholder' />
19+
<Search onButtonClick={alert} {...props} />
2020
);
2121

2222
clearCustomCss(this);
@@ -26,30 +26,10 @@ export default class ResolutionBar extends Stanza {
2626
handleAttributeChange() {
2727
const props = toCamelCase(this.params) as any;
2828
this.reactDomRoot?.render(
29-
<Search onButtonClick={alert} buttonCaption='Click!' placeholderCaption='Placeholder' />
29+
<Search onButtonClick={alert} {...props} />
3030
);
3131

3232
clearCustomCss(this);
3333
addCustomCss(this, "/idorg-resolution-bar/assets/EBI-Icon-fonts/fonts.css");
3434
}
35-
36-
// addFonts() {
37-
// const fonts = [
38-
// "EBI-Conceptual",
39-
// "EBI-Species",
40-
// "EBI-Common",
41-
// "EBI-FileFormats",
42-
// "EBI-Chemistry",
43-
// "EBI-Functional",
44-
// "EBI-Generic",
45-
// "EBI-SocialMedia",
46-
// ];
47-
// for (const font of fonts) {
48-
// const fontFace = new FontFace(font, `url(/idorg-resolution-bar/assets/EBI-Icon-fonts/${font}/fonts/${font}.woff)`, {
49-
// style: "normal",
50-
// weight: "normal"
51-
// });
52-
// fontFace.load().then(loadedFace => this.root.fonts.add(loadedFace));
53-
// }
54-
// }
5535
}

stanzas/idorg-resolution-bar/metadata.json

Lines changed: 9 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -12,59 +12,22 @@
1212
"stanza:updated": "2025-09-15",
1313
"stanza:parameter": [
1414
{
15-
"stanza:key": "classes-label",
15+
"stanza:key": "text-button",
1616
"stanza:type": "string",
17-
"stanza:example": "input-group-text",
18-
"stanza:description": "css classes for label",
19-
"stanza:required": false
17+
"stanza:example": "Resolve",
18+
"stanza:description": "Text inside button",
19+
"stanza:required": true
2020
},
2121
{
22-
"stanza:key": "classes-input",
22+
"stanza:key": "text-placeholder",
2323
"stanza:type": "string",
24-
"stanza:example": "form-control",
25-
"stanza:description": "css classes for input",
26-
"stanza:required": false
27-
},
28-
{
29-
"stanza:key": "classes-button",
30-
"stanza:type": "string",
31-
"stanza:example": "btn btn-primary",
32-
"stanza:description": "css classes for button",
33-
"stanza:required": false
34-
},
35-
{
36-
"stanza:key": "classes-wrapper",
37-
"stanza:type": "string",
38-
"stanza:example": "input-group",
39-
"stanza:description": "css classes for wrapper div",
40-
"stanza:required": false
41-
}, {
42-
"stanza:key": "css-additional_stylesheet_urls",
43-
"stanza:type": "string",
44-
"stanza:description": "Semicolon separated list of CSS stylesheets to add to widget. Useful with the button-classes parameter.",
45-
"stanza:required": false
24+
"stanza:example": "Input CURIE identifier here",
25+
"stanza:description": "Placeholder text on input box",
26+
"stanza:required": true
4627
}
4728
],
4829
"stanza:menu-placement": "top-right",
49-
"stanza:style": [
50-
{
51-
"stanza:key": "--greeting-color",
52-
"stanza:type": "color",
53-
"stanza:default": "#eb7900",
54-
"stanza:description": "text color of greeting"
55-
},
56-
{
57-
"stanza:key": "--greeting-align",
58-
"stanza:type": "single-choice",
59-
"stanza:choice": [
60-
"left",
61-
"center",
62-
"right"
63-
],
64-
"stanza:default": "center",
65-
"stanza:description": "text align of greeting"
66-
}
67-
],
30+
"stanza:style": [],
6831
"stanza:incomingEvent": [],
6932
"stanza:outgoingEvent": []
7033
}

0 commit comments

Comments
 (0)