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

Add CLI command to remove notifications from an announcement #840

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

mwinkens
Copy link
Contributor

@mwinkens mwinkens commented Sep 20, 2024

closes #839

Help

$ php occ announcementcenter:remove-notifications --help
Description:
  Remove notifications of announcement by id

Usage:
  announcementcenter:remove-notifications <id>

Arguments:
  id                    Id of announcement to remove notifications from

Options:
  -h, --help            Display help for the given command. When no command is given display help for the list command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
      --no-warnings     Skip global warnings, show command output only
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Guide

  • list announcements:
$ php occ announcementcenter:list
ID  |Subject                 |Message                                           
----|------------------------|--------------------------------------------------
70  |test21                  |test21                                            
69  |test20                  |test20 linebreak                                  
68  |test19                  |test19                                            
60  |test17                  |test17                                            
59  |test16                  |test16                                            
58  |test15                  |test15                                            
57  |test14                  |test14                                            
56  |test13                  |test13                                            
55  |test12                  |test12                                            
51  |test9                   |test9                                             
And more ...
  • remove notifications by ID:
$ php occ announcementcenter:remove-notifications 70
Successfully removed notifications from accouncement #70

Roadmap

  • Tests
  • Manual tests

@mwinkens mwinkens self-assigned this Sep 20, 2024
@mwinkens mwinkens force-pushed the cli-remove-notifications branch from d742503 to 2fdaa89 Compare September 20, 2024 13:17
@mwinkens mwinkens changed the title Add CLI command to remove notificitions from an announcement Add CLI command to remove notifications from an announcement Sep 20, 2024
@mwinkens
Copy link
Contributor Author

I guess I can never do this first try, maybe I should add a githook for some local tests before committing

@mwinkens mwinkens force-pushed the cli-remove-notifications branch from 702c960 to a72bab7 Compare September 20, 2024 13:27
@mwinkens
Copy link
Contributor Author

mwinkens commented Sep 20, 2024

@nickvergessen this is ready for review 🎉

Here a joke for the weekend: I wrote this code first try and it worked immediately, but I needed 5 tries until the linter was happy!

Edit: and maybe one day I'll be able to properly type 'notifications' and 'announcements'

@nickvergessen nickvergessen force-pushed the cli-remove-notifications branch from 8838b98 to d13c2d2 Compare September 30, 2024 09:17
Signed-off-by: Marvin Winkens <m.winkens@fz-juelich.de>
@nickvergessen nickvergessen force-pushed the cli-remove-notifications branch from d13c2d2 to 7705cf0 Compare September 30, 2024 09:18
@nickvergessen nickvergessen merged commit 5c170d8 into nextcloud:main Sep 30, 2024
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

disable notifications via occ
2 participants