Skip to content

Commit

Permalink
remove possiblity to link instance to wikidata softwares
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeBu committed Jul 26, 2024
1 parent 0be6528 commit 9fe6eb5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 50 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
node_modules
.turbo
.env
deploy_sill.js
deploy_sill.js
docker-data
56 changes: 7 additions & 49 deletions web/src/ui/pages/instanceForm/Step1.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { useState } from "react";
import { useForm, Controller } from "react-hook-form";
import { fr } from "@codegouvfr/react-dsfr";
import type { useCore } from "core";
import type { WikidataEntry } from "core/usecases/instanceForm";
import type { NonPostableEvt } from "evt";
import { useEvt } from "evt/hooks";
import { declareComponentKeys } from "i18nifty";
import { useState } from "react";
import { Controller, useForm } from "react-hook-form";
import { assert } from "tsafe/assert";
import type { WikidataEntry } from "core/usecases/instanceForm";
import { useResolveLocalizedString, useTranslation } from "ui/i18n";
import { AutocompleteInput } from "ui/shared/AutocompleteInput";
import { SearchMultiInput } from "ui/shared/SearchMultiInput";
import type { useCore } from "core";
import { fr } from "@codegouvfr/react-dsfr";
import { declareComponentKeys } from "i18nifty";
import { useTranslation, useResolveLocalizedString } from "ui/i18n";

export type Step1Props = {
className?: string;
Expand Down Expand Up @@ -144,47 +143,6 @@ export function InstanceFormStep1(props: Step1Props) {
)}
/>

<Controller
name="otherWikidataSoftwares"
control={control}
render={({ field }) => (
<SearchMultiInput
debounceDelay={400}
getOptions={getLibreSoftwareWikidataOptions}
value={field.value}
onValueChange={value => field.onChange(value)}
getOptionLabel={wikidataEntry =>
resolveLocalizedString(wikidataEntry.label)
}
renderOption={(liProps, wikidataEntity) => (
<li {...liProps}>
<div>
<span>
{resolveLocalizedString(wikidataEntity.label)}
</span>
<br />
<span className={fr.cx("fr-text--xs")}>
{resolveLocalizedString(
wikidataEntity.description
)}
</span>
</div>
</li>
)}
noOptionText={tCommon("no result")}
loadingText={tCommon("loading")}
dsfrInputProps={{
"label": t("other software"),
"nativeInputProps": {
"ref": field.ref,
"onBlur": field.onBlur,
"name": field.name
}
}}
/>
)}
/>

<button
style={{ "display": "none" }}
ref={setSubmitButtonElement}
Expand Down

0 comments on commit 9fe6eb5

Please sign in to comment.