Coder Social home page Coder Social logo

seratch / slack-timesheet Goto Github PK

View Code? Open in Web Editor NEW
21.0 3.0 0.0 525 KB

Timesheet, a Slack automation platform app for managing work hours

Home Page: https://api.slack.com/automation

License: MIT License

TypeScript 100.00%
automation deno slack timesheet timesheets typescript

slack-timesheet's Introduction

Timesheet in Slack

This is a sample application that illustrates how to build a tool for managing work hours using Slack's automation platform.

If you wish to track your personal activities beyond business hours, this app also offers a method to manage your lifelogs!

Setup

Before getting started, first make sure you have a development workspace where you have permission to install apps. Please note that the features in this project require that the workspace be part of a Slack paid plan.

Install the Slack CLI

To use this template, you need to install and configure the Slack CLI. Step-by-step instructions can be found in our Quickstart Guide.

Clone the Template

Start by cloning this repository:

# Clone this project onto your machine
$ slack create slack-timesheet -t seratch/slack-timesheet
# Change into the project directory
$ cd slack-timesheet

Getting Started

I am confident that this app is designed to be extremely user-friendly. As soon as you install the app onto your Slack workspace and share the link trigger of the workflow app either in a canvas document or as a channel message, you'll be up and running immediately!

Deploy The App

To deploy the app, simply run the slack deploy command in the root directory of the cloned app.

$ slack deploy
? Choose a deployed environment Install to a new workspace or organization
? Install to a new workspace or organization acme-corp T03E94MJU

๐Ÿ”” If you leave this workspace or organization, you can no longer manage the installed apps
   Installed apps will belong to the workspace or organization if you leave the workspace

๐Ÿ“š App Manifest
   Created app manifest for "Timesheet" in "Acme Corp"

๐Ÿ  App Install
   Installing "Timesheet" app to "Acme Corp"
   Updated app icon: assets/icon.png
   Finished in 5.5s

โšก Listing triggers installed to the app...
   There are no triggers installed for the app

โšก Create a trigger
   Searching for trigger definition files under 'triggers/*'...
   Found 2 trigger definition files

? Choose a trigger definition file: triggers/open_timesheet_en-us.ts

โšก Trigger successfully created!

   Timesheet Ft0639P6UJ1Z (shortcut)
   Created: 2023-10-29 22:48:35 +09:00 (1 second ago)
   Collaborators:
     Kaz Sera @seratch U03E94MK0
   Can be found and used by:
     everyone in the workspace
   https://slack.com/shortcuts/Ft063YR*****/ab6f8c4c8bfb********************

๐ŸŽ App packaged and ready to deploy
   0.042MB was packaged in 3.2s

๐Ÿš€ Timesheet deployed in 15.2s
   App Owner:  seratch (U03E94MK0)
   Workspace:  Acme Corp (T03E94MJU)
   Dashboard:  https://slack.com/apps/A0636U9P3PX

๐ŸŒฉ  Visit your workspace or organization to try out your live app!
   When you make any changes, update your app by re-running slack deploy

๐Ÿ’Œ We would love to know how things are going
   Survey your development experience with slack feedback --name platform-improvements

$

Launch The App

This Timesheet app intracts with you only within a single modal view. To launch this modal dialog, click on the link trigger, which was generated when you deployed the app, as shown below. Upon initial startup, the app will prompt you to specify your preferred language, country, and app mode. Following this, you'll be fully equipped to monitor your work time via the app!

Typically, you would click only the "Start/Finish Work" and "Start/Finish Break Time" buttons. There's no need to click anything else as long as you're keeping track of work and break times during your business hours. Sometimes, you may forget to press these buttons. In such cases, you can edit your entries as needed from the top page. Moreover, you can also input days off you have taken. This data will allow you to effortlessly verify if you are fulfilling the necessary work hours with consideration of day offs.

Calendar View

To check/edit past inputs, you can use the Calendar view from the menu.

This feature can be particularly beneficial when setting time off information in advance. It allows you to navigate to a future date when you're taking time off. When you want to get a comprehensive view of the current month, the Monthly Report feature, which I will detail next, should prove to be even more convenient.

Monthly Report

The Monthly Report feature can be helpful not just at the end of each month, but at any given time. By accessing this page, you're able to look back and reflect upon how the current month has been progressing so far.

If you click the "Send this in DM" button located in the upper right corner, a message containing a replicated report from the app will be delivered to you. Conveniently, the message also provides the raw JSON data as an attachment. Often, employees are required to input work data into a unfied corporate system. In such instances, utilizing the JSON data (e.g., writing a script, converting the JSON data structure to a required format) could help you achieve smooth data integration.

Projects

The "Project Code" management is an optional and advanced feature. This feature is typically used for managing detailed, segmental work hours for a particular purpose, project, or team. You can utilize project codes for tracking these specifics. Once you register a minimum of one active project code, this app will prompt all end-users to select a project code whenever they start their work time.

By default, setting a project code is optional. However, if your organization consistently requires all employees to set a code, you can modify the source code, functions/internals/views.ts, by removing the "optional": true flag in the relevant sections.

Organization Policies

As an admin, you have the ability to manage policies that apply across your organization. These policies can become crucial when evaluating this application's utility for real business operations. For instance, in accordance with Japanese labor law, it is considered a best practice to limit manually created time records. In light of this strict policy, it is mandatory for employees to use a time card or an equivalent. One of the built-in organization policies allows this app to function as a virtual time card, thereby adhering to such regulations.

Admin Privileges

By default, this app does not assign admin privileges to any user. In this scenario, all users have the right to utilize the admin features, such as managing project codes, organization policies, and downloading the monthly report for admins. To modify this for production use cases, you can add user ID rows to the admin_users datastore table as shown below:

# Enabling two admin users
slack datastore put '{"datastore": "admin_users","item": {"user": "W111111"}}'
slack datastore put '{"datastore": "admin_users","item": {"user": "W222222"}}'

Once these records are stored, the users aside from "W111111" and "W222222" will no longer have permission to access the admin features.

Other Features

The development of this app has just begun, and it's still undergoing significant evolution! We are actively working on more features, including permission control, holiday considration, and more customization options. If you're interested, you can examine the datastore tables and function code to learn what the latest app can do.

Feedback

Whenever you have have any suggestions, questions, or discover a bug within this app, please feel free to submit an inquiry on this repository's issue tracker!

slack-timesheet's People

Contributors

seratch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

slack-timesheet's Issues

Add an admin feature to bulk download monthly reports

At present, this app enables individual time entry submitters to download their personal monthly reports. Yet, adhering to stringent policies may require organization managers to obtain this data without manual modifications. Moreover, downloading data for each person individually is a considerably inefficient process. To address these issues, the app needs an admin feature allowing the download of monthly report data of multiple people as a unified JSON data file in DM with the app.

Enable automated deployments to staging env

Like this example does, I want this project to automate the deployment to my staging Slack workspace. Instead of committing .slack/apps.json and .slack/config.json, the GH Actions job can add the files right before running the slack deploy command with a service token.

Add unit tests

This project needs unit tests to prevent possible future regressions. Moreover, enabling a GitHub Actions job to execute these unit tests should also be initiated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.