Skip to content
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

Merged
merged 7 commits into from
Apr 9, 2024

Conversation

hakenr
Copy link
Member

@hakenr hakenr commented Apr 8, 2024

No description provided.

int subjectId,
CancellationToken cancellationToken);
public Task<List<StudentSubjectRegistration>> GetBySubjectAsync(
int id,
Copy link
Member Author

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?
Copy link
Member Author

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; }
Copy link
Member Author

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();
Copy link
Member Author

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
Copy link
Member Author

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()

Comment on lines -10 to -17
<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>
Copy link
Member Author

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?

Comment on lines +29 to +33
private bool hasUnresolvedChanges = false;
public void RegistrationsChanged()
{
hasUnresolvedChanges = true;
}
Copy link
Member Author

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).

@Xopabyteh Xopabyteh merged commit ff7887b into mensagymnazium:master Apr 9, 2024
1 check failed
Xopabyteh added a commit that referenced this pull request Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants