Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ export default class SingleSelectPulldownInput extends Component {
onInput!: () => void;
onMetadataInput!: () => void;

anotherOption?: string;

didReceiveAttrs() {
assert(
'SchemaBlockRenderer::Editable::SingleSelectPulldownInput requires optionBlocks to render',
Expand All @@ -39,9 +37,6 @@ export default class SingleSelectPulldownInput extends Component {
get optionBlockValues() {
const options = this.optionBlocks
.map(item => this.getLocalizedItemText(item));
if (this.anotherOption) {
options.push(this.anotherOption);
}
return options;
}

Expand All @@ -53,15 +48,6 @@ export default class SingleSelectPulldownInput extends Component {
this.changeset.set(this.valuePath, result);
this.onMetadataInput();
this.onInput();
this.set('anotherOption', null);
}

@action
onInputSearch(text: string) {
if (!this.optionBlocks.find(item => item.displayText === text || this.getLocalizedItemText(item) === text)) {
this.set('anotherOption', text);
}
return true;
}

getLocalizedItemText(item: SchemaBlock) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
...attributes
>
<PowerSelect
data-test-e-rad-award-number-input
data-test-single-select-pulldown-input
@options={{this.optionBlockValues}}
@onchange={{action this.onChange}}
@oninput={{action this.onInputSearch}}
@searchEnabled={{true}}
@selected={{or (get @changeset this.valuePath) null}}
@uniqueID={{@uniqueID}}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default } from
'osf-components/components/registries/schema-block-renderer/editable/rdm/singleselect-pulldown-input/component';
'osf-components/components/registries/schema-block-renderer/editable/rdm/single-select-pulldown-input/component';

This file was deleted.