-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Episode-entity relationship form #126
Conversation
include agent episodes form in agent form
simplify delete control
tooltips in agent form
fields = [ | ||
"id", | ||
"episode", | ||
"agent", | ||
"entity", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"entity_type" does not exist on the model, so it does not belong here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very impressive how you managed to implement this despite the sparsity of the documentation. Well done!
I have a lot of nit-picky comments, but functionally, the code works great! Consider it approved after you've covered my remarks.
def resolve_episodes( | ||
parent: AgentDescription, info: ResolveInfo | ||
) -> QuerySet[EpisodeAgent]: | ||
return EpisodeAgent.objects.filter(agent=parent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return EpisodeAgent.objects.filter(agent=parent) | |
return EpisodeAgentType.get_queryset(EpisodeAgent.objects, info).filter(agent=parent) |
def resolve_episodes( | ||
parent: LetterDescription, info: ResolveInfo | ||
) -> QuerySet[EpisodeLetter]: | ||
return EpisodeLetter.objects.filter(letter=parent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return EpisodeLetter.objects.filter(letter=parent) | |
return EpisodeLetterType.get_queryset(EpisodeLetter.objects, info).filter(letter=parent) |
frontend/src/app/data-entry/agent-form/agent-episodes-form/agent-episodes-form.component.html
Show resolved
Hide resolved
} | ||
|
||
get linkedObjectName(): string { | ||
return this.linkTo == 'episode' ? 'episode' : this.entityName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return this.linkTo == 'episode' ? 'episode' : this.entityName; | |
return this.linkTo == 'episode' ?? this.entityName; |
(All of these getters would be sweet computed()
s by the way, but that's something to consider when we're less strapped for time.)
actionIcons = actionIcons; | ||
|
||
constructor( | ||
query: DataEntryEpisodeEntityLinkGQL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private
? Also a better name than query
would be helpful.
if (linkTo == 'episode') { | ||
return 'episodes'; | ||
} | ||
const routes = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This object is very similar to entityTypeNames
in utils.ts
. For consistency's sake, please put this object there as well. (You can maybe merge them as well, or derive one from the other). If you've done that, you can replace this function's body with return linkTo == 'episode' ? 'episodes' : entityTypeRoutes[entityType];
This adds forms for:
Close #125
Includes:
name
anddescription
are non-nullable in the query output.EpisodeEntitiesComponent
to be used in the episode form for agents, locations, gifts, and letters.AgentEpisodesComponent
to be used in the agent form. This one is not directly reusable (yet).EpisodeLinkComponent
andCollapsibleCardComponent
as more basic building blocks.Not (yet) included:
AgentEpisodesComponent
.