rtCamp / frappe-slack-connector

Frappe app that integrates the Leave Management module with Slack
GNU Affero General Public License v3.0
3 stars 2 forks source link

feat: timesheet slash command and bugfixes #60

Open ananyo141 opened 1 day ago

ananyo141 commented 1 day ago

Please provide enough information so that others can review your pull request:

This PR introduces the /timesheet slash command and daily timesheet notification to be sent to users who haven't filled their timesheet.

Explain the details for making this change. What existing problem does the pull request solve?

Also fixes bug, in Leave Module

  1. If the employee has applied for a half day (first/second), consequent time offs are reflected as half day instead of full day.
  2. Show an error modal for permission issue or others if the user is unable to accept/reject requests.

QA List

NOTE: Things to be done after merge:

  1. Create a new slash command (/timesheet) from the dashboard at https://api.slack.com/apps with the given URL: https://erp.rtcamp.com/api/method/frappe_slack_connector.api.slash_timesheet.slash_timesheet
  2. In slack settings page, setup the departments that should receive the daily timesheet notifications
  3. In slack settings page, add a new Email template. Make sure, use_html checkbox is ticked. Example:
    
    Hi {{ mention }},
    Just a _friendly reminder_ to fill in your timesheet for {{ date }}. If you've already logged your hours but haven't reached the total working hours for the day, please update your entires.

Reported Time: {{ logged_time }} Hrs Daily Norm: {{ daily_norm }} Hrs

Thank you!



- [ ]  Sync Slack Data
- [ ]  Connect Slack Manually for User
- [ ]  Test Message for attendance
- [ ]  Attendance Updates
    - [ ]  Sent daily at given time
    - [ ]  Later leaves are sent to the thread
    - [ ]  First Half / Second Half Leaves are marked as such
- [ ]  Leave Application
    - [ ]  /apply-leave command
    - [ ]  Approval/Rejection sent to Leave Approver
    - [ ]  Notification sent to applier
    - [ ]  Half day Checkbox
- [ ]  Timesheet
    - [ ]  Notification only sent to selected departments
    - [ ]  /timesheet command
    - [ ]  Notification button to open timesheet modal
    - [ ]  Project and Task Filters

> Screenshots/GIFs

<img width="441" alt="Screenshot 2024-10-17 at 4 26 43 PM" src="https://github.com/user-attachments/assets/68d6f017-600e-4fe8-8814-10846fc91265">
<img width="557" alt="Screenshot 2024-10-16 at 8 17 10 PM" src="https://github.com/user-attachments/assets/fe866729-8707-41e3-9b31-71b16b3e68ef">

![Screenshot 2024-10-14 at 6 04 58 PM](https://github.com/user-attachments/assets/e5e2e4ae-07b2-47e5-abc9-6d90cc032f54)
zeel-codder commented 4 hours ago

@ananyo141, please give logical PR titles and reduce PR descriptions. Add issue references in the description if possible, rather than putting a whole list of issues separately.

Like this:

ananyo141 commented 4 hours ago

Shortened the list, added the instructions to follow after merge before QA list @zeel-codder