-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3429: feat(dal,sdf) delete and create array/map items from prop editor r=vbustamante a=vbustamante <img src="https://media2.giphy.com/media/wQq7MBdNdxU2MjeBNI/giphy.gif"/> CLOSES ENG-2393 CLOSES ENG-2394 CLOSES ENG-2395 CLOSES ENG-2396 3440: feat(dal, sdf-server): Restore Abandon ChangeSet Route r=stack72 a=stack72 Co-authored-by: Victor Bustamante <[email protected]> Co-authored-by: wendybujalski <[email protected]> Co-authored-by: stack72 <[email protected]>
- Loading branch information
Showing
11 changed files
with
603 additions
and
128 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
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,12 +1,14 @@ | ||
pub use test_exclusive_schema_bethesda_secret::migrate_test_exclusive_schema_bethesda_secret; | ||
pub use test_exclusive_schema_fallout::migrate_test_exclusive_schema_fallout; | ||
pub use test_exclusive_schema_katy_perry::migrate_test_exclusive_schema_katy_perry; | ||
pub use test_exclusive_schema_pirate::migrate_test_exclusive_schema_pirate; | ||
pub use test_exclusive_schema_starfield::migrate_test_exclusive_schema_starfield; | ||
pub use test_exclusive_schema_swifty::migrate_test_exclusive_schema_swifty; | ||
|
||
mod schema_helpers; | ||
mod test_exclusive_schema_bethesda_secret; | ||
mod test_exclusive_schema_fallout; | ||
mod test_exclusive_schema_katy_perry; | ||
mod test_exclusive_schema_pirate; | ||
mod test_exclusive_schema_starfield; | ||
mod test_exclusive_schema_swifty; | ||
|
||
pub use test_exclusive_schema_bethesda_secret::migrate_test_exclusive_schema_bethesda_secret; | ||
pub use test_exclusive_schema_fallout::migrate_test_exclusive_schema_fallout; | ||
pub use test_exclusive_schema_katy_perry::migrate_test_exclusive_schema_katy_perry; | ||
pub use test_exclusive_schema_starfield::migrate_test_exclusive_schema_starfield; | ||
pub use test_exclusive_schema_swifty::migrate_test_exclusive_schema_swifty; |
108 changes: 108 additions & 0 deletions
108
lib/dal-test/src/schemas/test_exclusive_schema_pirate.rs
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,108 @@ | ||
use crate::schemas::schema_helpers::{build_asset_func, create_identity_func}; | ||
use dal::pkg::import_pkg_from_pkg; | ||
use dal::{pkg, prop::PropPath, ComponentType}; | ||
use dal::{BuiltinsResult, DalContext, PropKind}; | ||
use si_pkg::SchemaSpecData; | ||
use si_pkg::{ | ||
AttrFuncInputSpec, AttrFuncInputSpecKind, PkgSpec, PropSpec, SchemaSpec, SchemaVariantSpec, | ||
SchemaVariantSpecData, SiPkg, | ||
}; | ||
|
||
pub async fn migrate_test_exclusive_schema_pirate(ctx: &DalContext) -> BuiltinsResult<()> { | ||
let mut builder = PkgSpec::builder(); | ||
|
||
builder | ||
.name("pirate") | ||
.version("2024-03-12") | ||
.created_by("System Initiative"); | ||
|
||
let identity_func_spec = create_identity_func(); | ||
|
||
// Create Scaffold Func | ||
let fn_name = "test:scaffoldPirateAsset"; | ||
let authoring_schema_func = build_asset_func(fn_name).await?; | ||
|
||
let schema = SchemaSpec::builder() | ||
.name("pirate") | ||
.data( | ||
SchemaSpecData::builder() | ||
.name("pirate") | ||
.category("test exclusive") | ||
.category_name("pirate") | ||
.build() | ||
.expect("schema spec data build"), | ||
) | ||
.variant( | ||
SchemaVariantSpec::builder() | ||
.name("v0") | ||
.unique_id("pirate_sv") | ||
.data( | ||
SchemaVariantSpecData::builder() | ||
.name("v0") | ||
.color("#ff00ff") | ||
.func_unique_id(&authoring_schema_func.unique_id) | ||
.component_type(ComponentType::Component) | ||
.build() | ||
.expect("build variant spec data"), | ||
) | ||
.domain_prop( | ||
PropSpec::builder() | ||
.name("name") | ||
.kind(PropKind::String) | ||
.func_unique_id(&identity_func_spec.unique_id) | ||
.input( | ||
AttrFuncInputSpec::builder() | ||
.kind(AttrFuncInputSpecKind::Prop) | ||
.name("identity") | ||
.prop_path(PropPath::new(["root", "si", "name"])) | ||
.build()?, | ||
) | ||
.build()?, | ||
) | ||
.domain_prop( | ||
PropSpec::builder() | ||
.name("parrot_names") | ||
.kind(PropKind::Array) | ||
.type_prop( | ||
PropSpec::builder() | ||
.kind(PropKind::String) | ||
.name("parrot_name") | ||
.build()?, | ||
) | ||
.build()?, | ||
) | ||
.domain_prop( | ||
PropSpec::builder() | ||
.name("treasure") | ||
.kind(PropKind::Map) | ||
.type_prop( | ||
PropSpec::builder() | ||
.kind(PropKind::String) | ||
.name("location") | ||
.build()?, | ||
) | ||
.build()?, | ||
) | ||
.build()?, | ||
) | ||
.build()?; | ||
|
||
let spec = builder | ||
.func(identity_func_spec) | ||
.func(authoring_schema_func) | ||
.schema(schema) | ||
.build()?; | ||
|
||
let pkg = SiPkg::load_from_spec(spec)?; | ||
import_pkg_from_pkg( | ||
ctx, | ||
&pkg, | ||
Some(pkg::ImportOptions { | ||
schemas: Some(vec!["pirate".into()]), | ||
..Default::default() | ||
}), | ||
) | ||
.await?; | ||
|
||
Ok(()) | ||
} |
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
Oops, something went wrong.