docs(core): Add slash command /spend for ticket and ticket comments

ref: #284 closes #286
This commit is contained in:
2024-09-13 22:24:19 +09:30
parent 64577cf806
commit 7894ac5522
5 changed files with 66 additions and 14 deletions

0
app/core/lib/__init__.py Normal file
View File

View File

@ -1,6 +1,6 @@
import re
from core.lib.slash_commands.duration import Duration
from .duration import Duration
class SlashCommands(

View File

@ -2,25 +2,24 @@ import re
class Duration:
"""Duration Slash Command
# This summary is used for the user documentation
"""The command keyword is `spend` and you can also use `spent`. The formatting for the time
after the command, is `<digit>` then either `h`, `m`, `s` for hours, minutes and seconds respectively.
The command keyword is `spend` and you can also use `spent`. The formatting for the time
after the command, is <digit> then either `h`, `m`, `s` for hours, minutes and seconds respectively.
Valid commands are as follows:
Valid commands are as follows:
- /spend 1h1ms
- /spend 1h1ms
- /spend 1h 1m 1s
- /spend 1h 1m 1s
For this command to process the following conditions must be met:
For this command to process the following conditions must be met:
- There is either a `<new line>` (`\n`) or a `<space>` char immediatly before the slash `/`
- There is either a `<new line>` (`\\n`) or a `<space>` char immediatly before the slash `/`
- There is a `<space>` char after the command keyword, i.e. `/spend<space>1h`
- There is a `<space>` char after the command keyword, i.e. `/spend<space>1h`
- _Optional_ `<space>` char between the time blocks.
"""
- _Optional_ `<space>` char between the time blocks.
"""
time_spent: str = r'[\s|\n]\/(?P<command>[spend|spent]+)\s(?P<time>(?P<hours>\d+h)?\s?(?P<minutes>[\d]{1,2}m)?\s?(?P<seconds>\d+[s])?)[\s|\n]?'

View File

@ -9,6 +9,59 @@ about: https://gitlab.com/nofusscomputing/infrastructure/configuration-managemen
The ticketing system within Centurion ERP is common to all ticket types. The differences are primarily fields and the value of fields.
## Features
- Commenting
- Related Tickets
- Slash commands
- Ticket Types:
- Changes
- Incidents
- Problems
- Request
- Project Task
## Commenting
Comment types are:
- Standard _All Ticket types_
- Notification _Change, Incident, Problem, Project Tasks and Request tickets._
- Solution _Change, Incident, Problem, Project Tasks and Request tickets._
- Task _Change, Incident, Problem, Project Tasks and Request tickets._
## Slash Commands
Slash commands are a quick action that is specified after a slash command. As the name implies, the command starts with a slash `/`. The following slash commands are available:
- Time Spent `/spend`, `/spent`
### Time Spent
::: app.core.lib.slash_commands.Duration
options:
inherited_members: false
members: []
show_bases: false
show_submodules: false
summary: true
## Ticket Types
::: app.core.models.ticket.ticket.Ticket.TicketType

View File

@ -24,7 +24,7 @@ prepare:
markdown-mkdocs-lint:
PATH=${PATH}:node_modules/.bin markdownlint-cli2 "docs/*.md docs/**/*.md docs/**/**/*.md docs/**/**/**/*.md docs/**/**/**/**/**/*.md #CHANGELOG.md !gitlab-ci !website-template"
PATH=${PATH}:node_modules/.bin markdownlint-cli2 docs/*.md docs/**/*.md docs/**/**/*.md docs/**/**/**/*.md docs/**/**/**/**/**/*.md !CHANGELOG.md !gitlab-ci !website-template
docs-lint: markdown-mkdocs-lint