Skip to content

Commit 538d02e

Browse files
Apply suggestions from code review
Co-authored-by: Braden MacDonald <[email protected]>
1 parent 3a96b58 commit 538d02e

3 files changed

Lines changed: 9 additions & 10 deletions

File tree

src/taxonomy/tag-list/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** Tag list table modes - see explanation in `<TagListTable>` component (`src/taxonomy/tag-list/TagListTable.tsx`) */
12
const TABLE_MODES = {
23
VIEW: 'view',
34
DRAFT: 'draft',

src/taxonomy/tag-list/tagTree.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export class TagTree {
9595
}
9696
}
9797

98+
/** For extra robustness, we verify that there are no cycles in the data. (The backend also guarantees this.) */
9899
private validateNoCycles(items: TagData[]) {
99100
const parentByValue: { [key: string]: string | null } = {};
100101
for (const item of items) {

src/taxonomy/tree-table/EditableCell.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,21 @@ import OptionalExpandLink from '../tag-list/OptionalExpandLink';
1212

1313
/**
1414
* Props for the EditableCell component.
15-
* @interface EditableCellProps
16-
* @property {string} [initialValue] - The initial value to display in the cell
17-
* @property {function} [onKeyDown] - Callback function triggered on keyboard events
18-
* @property {function} [onChange] - Callback function triggered when the input value changes
19-
* @property {string} [errorMessage] - Error message to display if validation fails
20-
* @property {boolean} [isSaving] - Indicates whether the cell value is currently being saved to the server
21-
* @property {boolean} [autoFocus] - If true, the input field will automatically receive focus when the cell
22-
* enters edit mode
23-
* @property {function} [getInlineValidationMessage] - Function that returns a validation message to be displayed
24-
* based on the current input value.
2515
*/
2616
interface EditableCellProps {
17+
/** The initial value to display in the cell */
2718
initialValue?: string;
19+
/** Callback function triggered on keyboard events */
2820
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
21+
/** Callback function triggered when the input value changes */
2922
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
23+
/** Error message to display if validation fails */
3024
errorMessage?: string;
25+
/** Indicates whether the cell value is currently being saved to the server */
3126
isSaving?: boolean;
27+
/** If true, the input field will automatically receive focus when the cell enters edit mode */
3228
autoFocus?: boolean;
29+
/** Function that returns a validation message to be displayed based on the current input value. */
3330
getInlineValidationMessage?: (value: string) => string;
3431
}
3532

0 commit comments

Comments
 (0)