-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disambiguate Schema Name, Schema Variant Name, and Schema Variant Dis…
…play Name across the UI. On import, if there's no display name, hydrate with Schema name. Same thing on regenerate. This is a step towards schema names being immutable.
- Loading branch information
1 parent
025c47a
commit d0c5633
Showing
27 changed files
with
186 additions
and
94 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ use telemetry::prelude::*; | |
use thiserror::Error; | ||
|
||
use crate::actor_view::ActorView; | ||
use crate::{pk, DalContext, Timestamp, UserPk}; | ||
use crate::{pk, DalContext, Timestamp, User, UserPk}; | ||
use crate::{Tenancy, TransactionsError}; | ||
|
||
#[remain::sorted] | ||
|
@@ -23,6 +23,8 @@ pub enum HistoryEventError { | |
StandardModel(String), | ||
#[error("transactions error: {0}")] | ||
Transactions(#[from] TransactionsError), | ||
#[error("user error: {0}")] | ||
User(String), | ||
} | ||
|
||
pub type HistoryEventResult<T> = Result<T, HistoryEventError>; | ||
|
@@ -41,6 +43,16 @@ impl HistoryActor { | |
HistoryActor::SystemInit => "unknown-backend".to_string(), | ||
} | ||
} | ||
pub async fn email(&self, ctx: &DalContext) -> HistoryEventResult<String> { | ||
Ok(match self { | ||
HistoryActor::SystemInit => "[email protected]".to_string(), | ||
HistoryActor::User(user_pk) => User::get_by_pk_or_error(ctx, *user_pk) | ||
.await | ||
.map_err(|e| HistoryEventError::User(e.to_string()))? | ||
.email() | ||
.clone(), | ||
}) | ||
} | ||
} | ||
|
||
impl From<UserPk> for HistoryActor { | ||
|
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.