Skip to content

Commit

Permalink
Add an ability to add a valueHint to referenceTypes.
Browse files Browse the repository at this point in the history
Part of #682.
  • Loading branch information
jkomoros committed Dec 9, 2023
1 parent e72c63c commit 8a86047
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/card-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ class CardEditor extends connect(store)(LitElement) {
if (map) {
val = map[refType] || '';
}
const newVal = prompt('What do you want the value to be?', val);
const newVal = prompt(`What do you want the value to be?${config.valueHint ? '\n' + config.valueHint : ''}`, val);
if (newVal == null) return;
store.dispatch(addReferenceToCard(cardID, refType, newVal));
}
Expand Down
3 changes: 3 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,9 @@ export type ReferenceTypeConfigurationMap = {
reciprocal? : boolean,
//needsReciprocation - if true, then cards that don't reciprocate with a link will be called out.
needsReciprocation? : boolean
//If set, this will be shown in the prompt for changing the value.
//Different reference types have different idiomatic uses.
valueHint? : string
}
}

Expand Down

0 comments on commit 8a86047

Please sign in to comment.