feat(dal,sdf,app): Reimplement variant_defs endpoints#3474
Conversation
7b17567 to
0ed72ce
Compare
|
bors try |
tryBuild succeeded: |
|
bors try |
tryBuild succeeded: |
8836957 to
67e467b
Compare
580efa5 to
d895c55
Compare
|
bors try |
tryBuild succeeded: |
|
|
||
| export const assetDisplayName = (asset: Asset | AssetListEntry) => | ||
| (asset.menuName ?? "").length === 0 ? asset.name : asset.menuName; | ||
| (asset.displayName ?? "").length === 0 ? asset.name : asset.displayName; |
There was a problem hiding this comment.
Yes. menuName was very old and we should have refactored it long ago.
| set_default_schema_variant_id( | ||
| ctx, | ||
| change_set_id, | ||
| &mut schema, | ||
| schema_spec | ||
| .data() | ||
| .as_ref() | ||
| .and_then(|data| data.default_schema_variant()), | ||
| variant_spec.unique_id(), | ||
| variant.id(), | ||
| ) | ||
| .await?; |
| pub fn display_name(&self) -> Option<String> { | ||
| self.display_name.clone() | ||
| } | ||
|
|
||
| pub fn link(&self) -> Option<String> { | ||
| self.link.clone() | ||
| } | ||
|
|
||
| pub fn description(&self) -> Option<String> { | ||
| self.description.clone() | ||
| } |
There was a problem hiding this comment.
nit: feel free to ignore. We could use self.<option-field>.as_deref() so that we allow the caller to decide to clone.
|
|
||
| #[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] | ||
| #[serde(rename_all = "camelCase")] | ||
| pub struct SchemaVariantMetadataJson { |
There was a problem hiding this comment.
I love it! Great doc comments.
| } | ||
|
|
||
| impl SchemaVariantJson { | ||
| // pub fn to_spec( |
There was a problem hiding this comment.
Are we keeping this commented out because it is functionality we wish to restore soon?
There was a problem hiding this comment.
this is functionality that will come back!
| .unwrap_or(DEFAULT_SCHEMA_VARIANT_COLOR.into()), | ||
| component_type: variant_spec_data.component_type.into(), | ||
| link: variant_spec_data.link.as_ref().map(|l| l.to_string()), | ||
| description: None, // XXX - does this exist? |
There was a problem hiding this comment.
Let's remove it in a follow up PR if not!
| }) | ||
| } | ||
|
|
||
| pub fn compile_return_types(ty: FuncBackendResponseType, kind: FuncBackendKind) -> &'static str { |
|
Three things:
|
nickgerace
left a comment
There was a problem hiding this comment.
Followed up on #3474 (comment) and the comments have been cleaned up accordingly.
Great job!
c2f3fdc to
e6818ac
Compare
As we are moving away from the concept of SchemaVariantDefinitions, we want to move the metadata that was part of a SchemaVariantDefinition to be part of the SchemaVariant This will allow us to start bringing back the authoring workflow without the need to have the concept of a SchemaVariantDefinition
By creating an edge between these nodes on the graph, we can understand what Asset func was used to create the schema variant
This still needs to be enhanced with all of the funcs associated with a schema variant. We need to ensure that those funcs are included as edges during the import process of a package
This was originally an edge but as this is a 1:1 mapping of func to schema variant it creates, we can make it part of the NodeWeight itself
Variant definitions no longer exist so we now use variants as the route instead
e6818ac to
0e43468
Compare
|
lgtm, executed basic sanity test of product and everything that should work is working |
|
bors try |
tryBuild succeeded: |
|
bors merge |
|
Build succeeded: |
3497: Remove unused schema variant def module and unused auth prototype code (ENG-2426) r=nickgerace a=nickgerace ## Description `SchemaVariantDefinition` no longer exists in the new engine, so this PR removes its remains from the dal. <img src="https://media0.giphy.com/media/kVgCBJOy3PuHdqT5xQ/giphy.gif"/> ## Additional Note This is a follow-up to #3474. Co-authored-by: Nick Gerace <nick@systeminit.com>
As we are moving away from the concept of SchemaVariantDefinitions, we want to move the metadata that was part of a SchemaVariantDefinition to be part of the SchemaVariant
This will allow us to start bringing back the authoring workflow without the need to have the concept of a SchemaVariantDefinition
This PR also re-implements the get_variant_def endpoint as well as renaming variant_def to be variant in the API routes