option values are aliased always from now on
This commit is contained in:
@@ -62,6 +62,10 @@ service TableDefinition {
|
|||||||
// Physical column names and identities remain unchanged.
|
// Physical column names and identities remain unchanged.
|
||||||
rpc SetColumnPresentation(SetColumnPresentationRequest) returns (SetColumnPresentationResponse);
|
rpc SetColumnPresentation(SetColumnPresentationRequest) returns (SetColumnPresentationResponse);
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
|
||||||
// Shows or hides one column in bundled data-entry forms. This is presentation
|
// Shows or hides one column in bundled data-entry forms. This is presentation
|
||||||
// metadata only: hidden columns remain available to data APIs, scripts and
|
// metadata only: hidden columns remain available to data APIs, scripts and
|
||||||
// backend calculations.
|
// backend calculations.
|
||||||
@@ -525,6 +529,10 @@ message ColumnBehavior {
|
|||||||
// True when bundled data-entry clients should not render this column.
|
// True when bundled data-entry clients should not render this column.
|
||||||
// This is not an authorization boundary; data APIs still expose the column.
|
// This is not an authorization boundary; data APIs still expose the column.
|
||||||
bool hidden_from_forms = 6;
|
bool hidden_from_forms = 6;
|
||||||
|
|
||||||
|
// User-selected labels for stable option values. Empty means clients display
|
||||||
|
// the canonical value. Writes may submit either value or alias.
|
||||||
|
repeated OptionValueAlias option_value_aliases = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
// A script that targets a specific column in a table.
|
// A script that targets a specific column in a table.
|
||||||
@@ -561,6 +569,30 @@ message SetColumnPresentationResponse {
|
|||||||
int64 row_version = 4;
|
int64 row_version = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// One stable machine value and its optional user-visible/input alias.
|
||||||
|
message OptionValueAlias {
|
||||||
|
string value = 1;
|
||||||
|
string alias = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SetColumnOptionAliasesRequest {
|
||||||
|
string profile_name = 1;
|
||||||
|
string table_name = 2;
|
||||||
|
int64 column_id = 3;
|
||||||
|
// Partial sets are supported; omitted values use their canonical spelling.
|
||||||
|
// An empty list removes every alias from the column.
|
||||||
|
repeated OptionValueAlias aliases = 4;
|
||||||
|
int64 expected_row_version = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SetColumnOptionAliasesResponse {
|
||||||
|
bool success = 1;
|
||||||
|
string message = 2;
|
||||||
|
int64 column_id = 3;
|
||||||
|
repeated OptionValueAlias aliases = 4;
|
||||||
|
int64 row_version = 5;
|
||||||
|
}
|
||||||
|
|
||||||
message SetColumnFormVisibilityRequest {
|
message SetColumnFormVisibilityRequest {
|
||||||
string profile_name = 1;
|
string profile_name = 1;
|
||||||
string table_name = 2;
|
string table_name = 2;
|
||||||
|
|||||||
Binary file not shown.
@@ -524,7 +524,7 @@ pub struct TableDetail {
|
|||||||
}
|
}
|
||||||
/// Server-owned behavior for one logical column returned in table details.
|
/// Server-owned behavior for one logical column returned in table details.
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
#[derive(serde::Serialize, serde::Deserialize)]
|
||||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
pub struct ColumnBehavior {
|
pub struct ColumnBehavior {
|
||||||
/// True when the server created the column as a companion of another column.
|
/// True when the server created the column as a companion of another column.
|
||||||
#[prost(bool, tag = "1")]
|
#[prost(bool, tag = "1")]
|
||||||
@@ -545,6 +545,10 @@ pub struct ColumnBehavior {
|
|||||||
/// This is not an authorization boundary; data APIs still expose the column.
|
/// This is not an authorization boundary; data APIs still expose the column.
|
||||||
#[prost(bool, tag = "6")]
|
#[prost(bool, tag = "6")]
|
||||||
pub hidden_from_forms: bool,
|
pub hidden_from_forms: bool,
|
||||||
|
/// User-selected labels for stable option values. Empty means clients display
|
||||||
|
/// the canonical value. Writes may submit either value or alias.
|
||||||
|
#[prost(message, repeated, tag = "7")]
|
||||||
|
pub option_value_aliases: ::prost::alloc::vec::Vec<OptionValueAlias>,
|
||||||
}
|
}
|
||||||
/// A script that targets a specific column in a table.
|
/// A script that targets a specific column in a table.
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
#[derive(serde::Serialize, serde::Deserialize)]
|
||||||
@@ -599,6 +603,45 @@ pub struct SetColumnPresentationResponse {
|
|||||||
#[prost(int64, tag = "4")]
|
#[prost(int64, tag = "4")]
|
||||||
pub row_version: i64,
|
pub row_version: i64,
|
||||||
}
|
}
|
||||||
|
/// One stable machine value and its optional user-visible/input alias.
|
||||||
|
#[derive(serde::Serialize, serde::Deserialize)]
|
||||||
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||||
|
pub struct OptionValueAlias {
|
||||||
|
#[prost(string, tag = "1")]
|
||||||
|
pub value: ::prost::alloc::string::String,
|
||||||
|
#[prost(string, tag = "2")]
|
||||||
|
pub alias: ::prost::alloc::string::String,
|
||||||
|
}
|
||||||
|
#[derive(serde::Serialize, serde::Deserialize)]
|
||||||
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
|
pub struct SetColumnOptionAliasesRequest {
|
||||||
|
#[prost(string, tag = "1")]
|
||||||
|
pub profile_name: ::prost::alloc::string::String,
|
||||||
|
#[prost(string, tag = "2")]
|
||||||
|
pub table_name: ::prost::alloc::string::String,
|
||||||
|
#[prost(int64, tag = "3")]
|
||||||
|
pub column_id: i64,
|
||||||
|
/// Partial sets are supported; omitted values use their canonical spelling.
|
||||||
|
/// An empty list removes every alias from the column.
|
||||||
|
#[prost(message, repeated, tag = "4")]
|
||||||
|
pub aliases: ::prost::alloc::vec::Vec<OptionValueAlias>,
|
||||||
|
#[prost(int64, tag = "5")]
|
||||||
|
pub expected_row_version: i64,
|
||||||
|
}
|
||||||
|
#[derive(serde::Serialize, serde::Deserialize)]
|
||||||
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
|
pub struct SetColumnOptionAliasesResponse {
|
||||||
|
#[prost(bool, tag = "1")]
|
||||||
|
pub success: bool,
|
||||||
|
#[prost(string, tag = "2")]
|
||||||
|
pub message: ::prost::alloc::string::String,
|
||||||
|
#[prost(int64, tag = "3")]
|
||||||
|
pub column_id: i64,
|
||||||
|
#[prost(message, repeated, tag = "4")]
|
||||||
|
pub aliases: ::prost::alloc::vec::Vec<OptionValueAlias>,
|
||||||
|
#[prost(int64, tag = "5")]
|
||||||
|
pub row_version: i64,
|
||||||
|
}
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
#[derive(serde::Serialize, serde::Deserialize)]
|
||||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||||
pub struct SetColumnFormVisibilityRequest {
|
pub struct SetColumnFormVisibilityRequest {
|
||||||
@@ -1391,6 +1434,37 @@ pub mod table_definition_client {
|
|||||||
);
|
);
|
||||||
self.inner.unary(req, path, codec).await
|
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(
|
||||||
|
&mut self,
|
||||||
|
request: impl tonic::IntoRequest<super::SetColumnOptionAliasesRequest>,
|
||||||
|
) -> std::result::Result<
|
||||||
|
tonic::Response<super::SetColumnOptionAliasesResponse>,
|
||||||
|
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/SetColumnOptionAliases",
|
||||||
|
);
|
||||||
|
let mut req = request.into_request();
|
||||||
|
req.extensions_mut()
|
||||||
|
.insert(
|
||||||
|
GrpcMethod::new(
|
||||||
|
"komp_ac.table_definition.TableDefinition",
|
||||||
|
"SetColumnOptionAliases",
|
||||||
|
),
|
||||||
|
);
|
||||||
|
self.inner.unary(req, path, codec).await
|
||||||
|
}
|
||||||
/// Shows or hides one column in bundled data-entry forms. This is presentation
|
/// Shows or hides one column in bundled data-entry forms. This is presentation
|
||||||
/// metadata only: hidden columns remain available to data APIs, scripts and
|
/// metadata only: hidden columns remain available to data APIs, scripts and
|
||||||
/// backend calculations.
|
/// backend calculations.
|
||||||
@@ -1586,6 +1660,15 @@ pub mod table_definition_server {
|
|||||||
tonic::Response<super::SetColumnPresentationResponse>,
|
tonic::Response<super::SetColumnPresentationResponse>,
|
||||||
tonic::Status,
|
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(
|
||||||
|
&self,
|
||||||
|
request: tonic::Request<super::SetColumnOptionAliasesRequest>,
|
||||||
|
) -> std::result::Result<
|
||||||
|
tonic::Response<super::SetColumnOptionAliasesResponse>,
|
||||||
|
tonic::Status,
|
||||||
|
>;
|
||||||
/// Shows or hides one column in bundled data-entry forms. This is presentation
|
/// Shows or hides one column in bundled data-entry forms. This is presentation
|
||||||
/// metadata only: hidden columns remain available to data APIs, scripts and
|
/// metadata only: hidden columns remain available to data APIs, scripts and
|
||||||
/// backend calculations.
|
/// backend calculations.
|
||||||
@@ -2319,6 +2402,55 @@ pub mod table_definition_server {
|
|||||||
};
|
};
|
||||||
Box::pin(fut)
|
Box::pin(fut)
|
||||||
}
|
}
|
||||||
|
"/komp_ac.table_definition.TableDefinition/SetColumnOptionAliases" => {
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
struct SetColumnOptionAliasesSvc<T: TableDefinition>(pub Arc<T>);
|
||||||
|
impl<
|
||||||
|
T: TableDefinition,
|
||||||
|
> tonic::server::UnaryService<super::SetColumnOptionAliasesRequest>
|
||||||
|
for SetColumnOptionAliasesSvc<T> {
|
||||||
|
type Response = super::SetColumnOptionAliasesResponse;
|
||||||
|
type Future = BoxFuture<
|
||||||
|
tonic::Response<Self::Response>,
|
||||||
|
tonic::Status,
|
||||||
|
>;
|
||||||
|
fn call(
|
||||||
|
&mut self,
|
||||||
|
request: tonic::Request<super::SetColumnOptionAliasesRequest>,
|
||||||
|
) -> Self::Future {
|
||||||
|
let inner = Arc::clone(&self.0);
|
||||||
|
let fut = async move {
|
||||||
|
<T as TableDefinition>::set_column_option_aliases(
|
||||||
|
&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 = SetColumnOptionAliasesSvc(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/SetColumnFormVisibility" => {
|
"/komp_ac.table_definition.TableDefinition/SetColumnFormVisibility" => {
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
struct SetColumnFormVisibilitySvc<T: TableDefinition>(pub Arc<T>);
|
struct SetColumnFormVisibilitySvc<T: TableDefinition>(pub Arc<T>);
|
||||||
|
|||||||
2
server
2
server
Submodule server updated: bcccf8253c...825a5bcf32
Reference in New Issue
Block a user