-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Tree API type auto-generated by backend
This unfortunately involves a lot of renaming churn, since the openapi description calls it 'Tree', rather than 'TreeI'. However, this is a good thing to do anyway, since having the bare-bones outline component being called 'Tree' would be confusing when we have some other, fancier, tree component as well.
- Loading branch information
Showing
6 changed files
with
39 additions
and
23 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
14 changes: 7 additions & 7 deletions
14
...imer-components/src/Tree/Tree.stories.tsx → ...s/src/TreeOutline/TreeOutline.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
packages/primer-components/src/Tree/Tree.tsx → ...omponents/src/TreeOutline/TreeOutline.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { TreeOutline } from "./TreeOutline"; | ||
|
||
export default TreeOutline; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
export interface TreeI { | ||
nodeId: number; | ||
label: string; | ||
/* NB: 'children' is treated specially by react, leading to weird errors. | ||
* Let's avoid that word. | ||
*/ | ||
childTrees: TreeI[]; | ||
/** | ||
* | ||
* @export | ||
* @interface Tree | ||
*/ | ||
export interface Tree { | ||
/** | ||
* | ||
* @type {Array<Tree>} | ||
* @memberof Tree | ||
*/ | ||
childTrees: Array<Tree>; | ||
/** | ||
* | ||
* @type {number} | ||
* @memberof Tree | ||
*/ | ||
nodeId: number; | ||
/** | ||
* | ||
* @type {string} | ||
* @memberof Tree | ||
*/ | ||
label: string; | ||
} | ||
|