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

feat: favourite package UI #101

Merged
merged 1 commit into from
Mar 14, 2024
Merged

feat: favourite package UI #101

merged 1 commit into from
Mar 14, 2024

Conversation

janbritz
Copy link
Contributor

Closes #100.

Ein Paket kann nun über die UI (ent-)favorisiert werden. Der 'Favourites'-Tab updatet hierbei simultan.
Das Icon und der Text vom Favorisieren-Button updaten sich in allen Tabs, in denen das Paket zu finden ist.
favourite_example

Ein Paket kann, auch nachdem es ausgewählt wurde, (ent-)favorisiert werden.
favourite_example_2

@janbritz janbritz linked an issue Feb 27, 2024 that may be closed by this pull request
amd/src/package_search/mutations.js Outdated Show resolved Hide resolved
amd/src/package_search/mutations.js Show resolved Hide resolved
amd/src/package_search/mutations.js Show resolved Hide resolved
amd/src/package_search/mutations.js Show resolved Hide resolved
amd/src/package_search/mutations.js Outdated Show resolved Hide resolved
edit_questionpy_form.php Outdated Show resolved Hide resolved
styles.css Outdated Show resolved Hide resolved
Comment on lines +87 to +89
$usercontext = context_user::instance($USER->id);
$ufservice = \core_favourites\service_factory::get_service_for_user_context($usercontext);
$packagearray['isfavourite'] = $ufservice->favourite_exists('qtype_questionpy', 'package', $package->id, $usercontext);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vielleicht wäre es sinnvoll, den Code zum Abrufen und Ändern des favourite-Status in die Package Klasse zu verschieben. Oder in eine eigene Helper-Klasse. Du benutzt den ja sowohl hier als auch in dem Webservice.

Base automatically changed from feat/favourite-package-endpoint to dev March 1, 2024 15:35
@MartinGauk MartinGauk merged commit 0b02b76 into dev Mar 14, 2024
6 of 10 checks passed
@MartinGauk MartinGauk deleted the feat/favourite-package-ui branch March 14, 2024 12:34
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.

Favorisierung von Paketen über die UI
3 participants