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
2 changes: 2 additions & 0 deletions specifyweb/frontend/js_src/lib/components/DataModel/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5212,6 +5212,8 @@ export type SpLocaleContainerItem = {
readonly type: string | null;
readonly version: number | null;
readonly webLinkName: string | null;
readonly dwcConcept: string | null;
readonly dwcDescription: string | null;
};
readonly toOneDependent: RR<never, never>;
readonly toOneIndependent: {
Expand Down
51 changes: 50 additions & 1 deletion specifyweb/frontend/js_src/lib/components/SchemaConfig/Field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,16 @@ export function SchemaConfigField({
readonly field: LiteralField | Relationship;
readonly item: SerializedResource<SpLocaleContainerItem> & WithFetchedStrings;
readonly onChange: (
field: 'desc' | 'isHidden' | 'isRequired' | 'name',
field:
| 'desc'
/*
* To uncomment if we want to allow redefinition
* | 'dwcConcept'
* | 'dwcDescription'
*/
| 'isHidden'
| 'isRequired'
| 'name',
value: boolean | string
) => void;
readonly onFormatted: (format: ItemType, value: string | null) => void;
Expand Down Expand Up @@ -65,6 +74,46 @@ export function SchemaConfigField({
onValueChange={(value): void => handleChange('desc', value)}
/>
</Label.Block>
{/* Add back after testing*/}
{/* {item.dwcConcept !== null && ( */}
<Label.Block>
{schemaText.dwcConcept()}
<Input.Text
isReadOnly
/*
* MaxLength={maxSchemaValueLength}
* required
* To chnage once we have item.dwcConcept !== null &&
*/
value={item.dwcConcept === null ? 'DWC Concept' : item.dwcConcept}
/*
* To uncomment if we want to allow redefinition
* onValueChange={(value): void => handleChange('dwcConcept', value)}
*/
/>
</Label.Block>
{/* )} */}
{/* Add back after testing*/}
{/* {item.dwcDescription !== null && ( */}
<Label.Block>
{schemaText.dwcDescription()}
<AutoGrowTextArea
className="resize-y"
isReadOnly
/*
* MaxLength={maxSchemaValueLength}
* To chnage once we add the condition rendering
*/
value={
item.dwcDescription === null ? 'DwC desc' : item.dwcDescription
}
/*
* To uncomment if we want to allow redefinition
* onValueChange={(value): void => handleChange('dwcDescription', value)}
*/
/>
</Label.Block>
{/* )} */}
<Label.Block>
{schemaText.fieldLength()}
<Input.Integer isReadOnly value={field.length ?? ''} />
Expand Down
Loading
Loading