-
Notifications
You must be signed in to change notification settings - Fork 9
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
Zrušení SigningRules, zjednodušení logiky #124
Conversation
…ic. Now students can register anywhere without any validation.
int subjectId, | ||
CancellationToken cancellationToken); | ||
public Task<List<StudentSubjectRegistration>> GetBySubjectAsync( | ||
int id, |
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.
subjectId
, ať je to čitelnější
var user = applicationAuthenticationService.GetCurrentUser(); | ||
Contract.Requires<InvalidOperationException>(user.StudentId is not null); | ||
|
||
// Todo: change to query? |
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.
Potřebuješ nějaká filtrační kritéria? Join do dalších tabulek? Stránkování/řazení dat? ...jinak nemá Query moc smysl.
|
||
[Parameter] public EventCallback OnRegistrationChanged { get; set; } | ||
|
||
[Inject] protected IHxMessageBoxService MessageBox { get; set; } | ||
[Inject] protected IHxMessengerService Messenger { get; set; } | ||
[Inject] protected ISubjectRegistrationsManagerFacade SubjectRegistrationsManagerFacade { get; set; } | ||
[Inject] protected IStudentSubjectRegistrationsDataStore StudentSubjectRegistrationsDataStore { get; set; } |
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.
S tímhle jediným si nejsem jist, jestli je dobrý nápad cachovat registrace na klientovi v DataStore. Přijde mi, že to je transakčních charakter dat, který by se měl vždy brát čerstvý ze serveru (API).
|
||
return request.ApplyTo(data); | ||
StateHasChanged(); |
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.
Nemělo by být potřeba. Něco ti bez toho nefungovalo?
await SubjectRegistrationsManagerFacade.CancelRegistrationAsync(Dto.FromValue(registrationId)); | ||
await SubjectRegistrationsManagerFacade.CancelRegistrationAsync(Dto.FromValue(studentsRegistrationForThisSubject.Id)); | ||
|
||
// Invalidate data store |
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.
DataStore má na sobě na toto připravenou metodu Clear()
<SearchTemplate> | ||
<strong class="d-none d-sm-block">Zápisové pravidlo:</strong> | ||
<SigningRulePicker Value="subjectListFilter.SigningRuleId" | ||
ValueChanged="HandleSigningRuleFilterChanged" | ||
ValueExpression="() => subjectListFilter.SigningRuleId" | ||
RestrictStudentGrade="true" | ||
NullText="-neurčeno-" /> | ||
</SearchTemplate> |
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.
Zde bych místo toho uvítal filtr na ročník, i když studenti ho asi budou mít aplikovaný tak jako tak?
private bool hasUnresolvedChanges = false; | ||
public void RegistrationsChanged() | ||
{ | ||
hasUnresolvedChanges = true; | ||
} |
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.
Místo toho rovnou použij Clear
(je vypublikoovaná na interface).
No description provided.