From 67d5839e09adb30fdd3b36b88c27d23bb9df0567 Mon Sep 17 00:00:00 2001 From: Nick Gerace Date: Wed, 26 Jun 2024 17:27:35 -0400 Subject: [PATCH] Ensure secret field order is correct This commit ensures the secret field order is correct by using ordered props. Assets may need to be regenerated from other changes (e.g. props can only be ordered on recent main) in order to see this effect. Signed-off-by: Nick Gerace --- lib/dal/src/secret/definition_view.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/dal/src/secret/definition_view.rs b/lib/dal/src/secret/definition_view.rs index b5a4e020b3..385c5bdc4c 100644 --- a/lib/dal/src/secret/definition_view.rs +++ b/lib/dal/src/secret/definition_view.rs @@ -66,12 +66,11 @@ impl SecretDefinitionView { secret_definition_prop_id: PropId, ) -> SecretDefinitionViewResult { // Now, find all the fields of the definition. - let field_prop_ids = Prop::direct_child_prop_ids(ctx, secret_definition_prop_id).await?; + let field_props = Prop::direct_child_props_ordered(ctx, secret_definition_prop_id).await?; // Assemble the form data views. let mut form_data_views = Vec::new(); - for field_prop_id in field_prop_ids { - let field_prop = Prop::get_by_id_or_error(ctx, field_prop_id).await?; + for field_prop in field_props { form_data_views.push(SecretFormDataView { name: field_prop.name, kind: field_prop.kind.to_string(),