Giter Club home page Giter Club logo

slack-in-your-time's People

Contributors

dependabot[bot] avatar hoonsubin avatar

Watchers

 avatar  avatar

slack-in-your-time's Issues

add slack payload related unit tests

Add unit test for the application using nock to simulate predefined slack payloads.
The unit test must test the following functions:

  • read a message from a channel with multiple users in multiple time zones
  • parse the message content and check for references to time
  • send conversion message blocks to the channel
  • check user ack() function for conversion
  • etc.

add time selection feature

Problem

Currently, the bot will automatically parse the message that contains a reference to time. However, the parsed DateTime object may not always be correct. Or it might be parsed in a different context (ex: different timezone from the one mentioned in the message).

Related line: https://github.com/TeamSTEP/slack-in-your-time/blob/master/src/helper/messageFormat.ts#L72

Solution

Add a DateTime selection block in the bot message and allow the user to select the time before they confirm to convert it to everyone's timezone. The default time will be based on the parsed DateTime.

{
	"blocks": [
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Convert this time? (List time)"
			}
		},
		{
			"type": "actions",
			"elements": [
				{
					"type": "datepicker",
					"initial_date": "1990-04-28",
					"placeholder": {
						"type": "plain_text",
						"text": "Date",
						"emoji": true
					},
					"action_id": "datepicker-action"
				},
				{
					"type": "timepicker",
					"initial_time": "13:37",
					"placeholder": {
						"type": "plain_text",
						"text": "Select time",
						"emoji": true
					},
					"action_id": "timepicker-action"
				},
				{
					"type": "static_select",
					"placeholder": {
						"type": "plain_text",
						"text": "Time Zone",
						"emoji": true
					},
					"options": [
						{
							"text": {
								"type": "plain_text",
								"text": "JST (UTC+9:00)",
								"emoji": true
							},
							"value": "value-0"
						},
						{
							"text": {
								"type": "plain_text",
								"text": "MST (UTC-07:00)",
								"emoji": true
							},
							"value": "value-1"
						},
						{
							"text": {
								"type": "plain_text",
								"text": "AFT (UTC+04:30)",
								"emoji": true
							},
							"value": "value-2"
						}
					],
					"action_id": "static_select-input"
				},
				{
					"type": "button",
					"text": {
						"type": "plain_text",
						"text": "Send converted time",
						"emoji": true
					},
					"value": "click_me_123",
					"style": "primary",
					"action_id": "actionId-1"
				},
				{
					"type": "button",
					"text": {
						"type": "plain_text",
						"text": "Cancel",
						"emoji": true
					},
					"value": "click_me_123",
					"style": "danger",
					"action_id": "actionId-2"
				}
			]
		}
	]
}

add Slack OAuth redirection

Implement this app with Firebase authentication and Firestore to allow public distribution of this app across workspaces

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.