-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
On generic schema viewer, display "Hierarchical" value (#5184)
Bonus: replace function isGeneric -> isGenericSchema
- Loading branch information
1 parent
9730d08
commit d657460
Showing
10 changed files
with
44 additions
and
25 deletions.
There are no files selected for viewing
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 @@ | ||
In schema viewer, we now display `Hierarchical` value for generics. |
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
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
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,8 +1,24 @@ | ||
import { IModelSchema } from "@/state/atoms/schema.atom"; | ||
import { isGeneric } from "@/utils/common"; | ||
import { | ||
IModelSchema, | ||
IProfileSchema, | ||
iGenericSchema, | ||
iNodeSchema, | ||
} from "@/state/atoms/schema.atom"; | ||
|
||
export const isOfKind = (kind: string, schema: IModelSchema) => { | ||
if (schema.kind === kind) return true; | ||
if (!isGeneric(schema) && schema.inherit_from?.includes(kind)) return true; | ||
if (!isGenericSchema(schema) && schema.inherit_from?.includes(kind)) return true; | ||
return false; | ||
}; | ||
|
||
export const isGenericSchema = (schema: IModelSchema): schema is iGenericSchema => { | ||
return "used_by" in schema; | ||
}; | ||
|
||
export const isNodeSchema = (schema: IModelSchema): schema is iNodeSchema => { | ||
return "inherit_from" in schema; | ||
}; | ||
|
||
export const isProfileSchema = (schema: IModelSchema): schema is IProfileSchema => { | ||
return schema.namespace === "Profile"; | ||
}; |
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
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