diff --git a/client-gui2 b/client-gui2 index c4d5a9d2..fbb19315 160000 --- a/client-gui2 +++ b/client-gui2 @@ -1 +1 @@ -Subproject commit c4d5a9d22bb669d711971d1cbf84a3389ef61fbe +Subproject commit fbb193158022958de058f268cf425578fa6005b8 diff --git a/common/proto/table_definition.proto b/common/proto/table_definition.proto index 87573a2c..a4df95ee 100644 --- a/common/proto/table_definition.proto +++ b/common/proto/table_definition.proto @@ -62,6 +62,10 @@ service TableDefinition { // Physical column names and identities remain unchanged. rpc SetColumnPresentation(SetColumnPresentationRequest) returns (SetColumnPresentationResponse); + // Replaces the columns whose values identify rows to users. This is + // presentation metadata and may be changed after rows have been stored. + rpc SetRowDisplayColumns(SetRowDisplayColumnsRequest) returns (SetRowDisplayColumnsResponse); + // Replaces the optional user-visible aliases for a fixed-option column. // Stored values remain stable machine values and scripts never depend on labels. rpc SetColumnOptionAliases(SetColumnOptionAliasesRequest) returns (SetColumnOptionAliasesResponse); @@ -587,6 +591,23 @@ message SetColumnPresentationResponse { int64 row_version = 4; } +// Atomically replaces the columns whose values identify rows in pickers and +// link labels. Their order is the order in which their values are displayed. +message SetRowDisplayColumnsRequest { + string profile_name = 1; + string table_name = 2; + repeated string row_display_columns = 3; + // Row version returned by GetProfileDetails when this metadata was read. + int64 expected_row_version = 4; +} + +message SetRowDisplayColumnsResponse { + bool success = 1; + repeated string row_display_columns = 2; + // New row version after the update, or the current version for a no-op. + int64 row_version = 3; +} + // One public option name. `value` identifies the option by its current public // alias and `alias` is its desired public alias; stored values remain internal. message OptionValueAlias { diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index 54a97cb0..0ef56abb 100644 Binary files a/common/src/proto/descriptor.bin and b/common/src/proto/descriptor.bin differ diff --git a/common/src/proto/komp_ac.table_definition.rs b/common/src/proto/komp_ac.table_definition.rs index 5ae3147a..6cad1562 100644 --- a/common/src/proto/komp_ac.table_definition.rs +++ b/common/src/proto/komp_ac.table_definition.rs @@ -628,6 +628,32 @@ pub struct SetColumnPresentationResponse { #[prost(int64, tag = "4")] pub row_version: i64, } +/// Atomically replaces the columns whose values identify rows in pickers and +/// link labels. Their order is the order in which their values are displayed. +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct SetRowDisplayColumnsRequest { + #[prost(string, tag = "1")] + pub profile_name: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub table_name: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "3")] + pub row_display_columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Row version returned by GetProfileDetails when this metadata was read. + #[prost(int64, tag = "4")] + pub expected_row_version: i64, +} +#[derive(serde::Serialize, serde::Deserialize)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct SetRowDisplayColumnsResponse { + #[prost(bool, tag = "1")] + pub success: bool, + #[prost(string, repeated, tag = "2")] + pub row_display_columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// New row version after the update, or the current version for a no-op. + #[prost(int64, tag = "3")] + pub row_version: i64, +} /// One public option name. `value` identifies the option by its current public /// alias and `alias` is its desired public alias; stored values remain internal. #[derive(serde::Serialize, serde::Deserialize)] @@ -1494,6 +1520,37 @@ pub mod table_definition_client { ); self.inner.unary(req, path, codec).await } + /// Replaces the columns whose values identify rows to users. This is + /// presentation metadata and may be changed after rows have been stored. + pub async fn set_row_display_columns( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic_prost::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/komp_ac.table_definition.TableDefinition/SetRowDisplayColumns", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "komp_ac.table_definition.TableDefinition", + "SetRowDisplayColumns", + ), + ); + self.inner.unary(req, path, codec).await + } /// Replaces the optional user-visible aliases for a fixed-option column. /// Stored values remain stable machine values and scripts never depend on labels. pub async fn set_column_option_aliases( @@ -1720,6 +1777,15 @@ pub mod table_definition_server { tonic::Response, tonic::Status, >; + /// Replaces the columns whose values identify rows to users. This is + /// presentation metadata and may be changed after rows have been stored. + async fn set_row_display_columns( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// Replaces the optional user-visible aliases for a fixed-option column. /// Stored values remain stable machine values and scripts never depend on labels. async fn set_column_option_aliases( @@ -2457,6 +2523,55 @@ pub mod table_definition_server { }; Box::pin(fut) } + "/komp_ac.table_definition.TableDefinition/SetRowDisplayColumns" => { + #[allow(non_camel_case_types)] + struct SetRowDisplayColumnsSvc(pub Arc); + impl< + T: TableDefinition, + > tonic::server::UnaryService + for SetRowDisplayColumnsSvc { + type Response = super::SetRowDisplayColumnsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::set_row_display_columns( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = SetRowDisplayColumnsSvc(inner); + let codec = tonic_prost::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } "/komp_ac.table_definition.TableDefinition/SetColumnOptionAliases" => { #[allow(non_camel_case_types)] struct SetColumnOptionAliasesSvc(pub Arc); diff --git a/server b/server index 466aa31d..6b63dde5 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit 466aa31dabc9cb46c53849c64ee36f804a346715 +Subproject commit 6b63dde568b71c9e651168336660b73b12d3db41