justicenation / slashclock

/clock concept as a new Slack app
GNU General Public License v3.0
0 stars 0 forks source link

Help page describing available commands #23

Closed martyychang closed 6 years ago

martyychang commented 6 years ago

When a user is new to slashClock, it would be helpful for the user to get a quick overview of all available commands. If not displayed all in one place, it would at least be helpful for the user to see all available commands and then have some means to get more detailed information on any one command.

martyychang commented 6 years ago

UX-wise, I'm thinking of an experience where /clock help is the generic go-to for people looking for in-app assistance with using the commands. From there, more detailed help can be obtained with longer commands like /clock help in and /clock help out.

martyychang commented 6 years ago

As a note on the technical design for the feature, I don't think it makes sense to store giant strings in Apex or custom labels to hold the text that should be returned back to Slack. I then debated whether to use Document files vs. StaticResource files to hold Slack-flavored Markdown text, and below was my analysis of the two options.

Document Static Resource
Uses file storage. Contact Manager, Group, Professional, Enterprise, Performance, and Unlimited Editions are allocated 10 GB of file storage per org. Orgs are allocated additional file storage based on the number of standard user licenses. A single static resource can be up to 5 MB in size, and an organization can have up to 250 MB of static resources, total
Accessible by non-developers Inaccessible by non-developers
Can be shared in folders No fine-grained sharing control
Tracked in metadata Also tracked in metadata
Requires SOQL in Apex for access Also requires SOQL in Apex for access

Given the above I think using the Document object would be the best approach.

martyychang commented 6 years ago

Interesting... the document that is retrieved from Salesforce includes an actual file extension, meaning unless the unique name conflicts with another file's unique name, it would be fine for me to omit the extension as part of the unique name. Screenshot below shows the duplicate Markdown extension qualifier.

image

martyychang commented 6 years ago

I'm getting a "List has no rows for assignment to SObject" error... which upon further reflection is likely caused by the fact that Document records aren't visible to Apex tests by default. This could be one of the drawbacks to using the Document object instead of static resources... but if I roll with the approach then I should try setting up some dummy documents in my test setup.

martyychang commented 6 years ago

Another issue I'm encountering with the use of documents is the following error in Sublime Text 3 with MavensMage...

Operation: Compiling: HelpCommand.md
Timestamp: Mon, 15 Jan 2018 15:11:18
   Result: [OPERATION FAILED]: HelpCommand: An object 'HelpCommand' of type CustomMetadata was named in package.xml, but was not found in zipped directory
martyychang commented 6 years ago

Interesting... the above issue must be a bug with MavensMate, where it's detecting the .md extension and treating the file as a custom metadata file. I changed the file extension to .txt and was able to now edit the file in Sublime Text 3 and save, with a successful compile to Salesforce.