Skip to content

Commit 23aa47f

Browse files
authored
Merge pull request #75 from garyray-k/alphabetizeMentorRequestOptions
alphabetize options presented to users of Mentor Request
2 parents 1aef63a + 9d0b4d0 commit 23aa47f

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

pybot/endpoints/slack/commands.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ async def slash_mentor(command: Command, app: SirBot):
4646

4747
dialog = mentor_request_attachments(services, mentors, skillsets)
4848

49-
response = {"attachments": dialog, "channel": command["user_id"], "as_user": True}
49+
response = {
50+
"attachments": dialog,
51+
"channel": command["user_id"],
52+
"as_user": True,
53+
"text": "Thank you for signing up for a 30 minute mentoring session. Please fill out the form below:"
54+
}
55+
5056
await app.plugins["slack"].api.query(methods.CHAT_POST_MESSAGE, response)
5157

5258

pybot/endpoints/slack/message_templates/commands.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def mentor_request_attachments(services, mentors, skillsets):
2929
"text": "Service",
3030
"name": "service",
3131
"options": [
32-
{"text": service, "value": service} for service in services
32+
{"text": service, "value": service} for service in sorted(services)
3333
],
3434
}
3535
],
@@ -44,7 +44,7 @@ def mentor_request_attachments(services, mentors, skillsets):
4444
"text": "Skillset",
4545
"name": "skillset",
4646
"options": [
47-
{"text": skillset, "value": skillset} for skillset in skillsets
47+
{"text": skillset, "value": skillset} for skillset in sorted(skillsets)
4848
],
4949
},
5050
{
@@ -65,7 +65,7 @@ def mentor_request_attachments(services, mentors, skillsets):
6565
"text": "Specific Mentor",
6666
"name": "mentor",
6767
"options": [
68-
{"text": mentor, "value": mentor} for mentor in mentors
68+
{"text": mentor, "value": mentor} for mentor in sorted(mentors)
6969
],
7070
},
7171
{
@@ -99,9 +99,9 @@ def mentor_request_attachments(services, mentors, skillsets):
9999
"name": "group",
100100
"value": "",
101101
"options": [
102-
{"text": "Veteran", "value": "Veteran"},
103102
{"text": "Active Duty", "value": "Active Duty"},
104103
{"text": "Military Spouse", "value": "Military Spouse"},
104+
{"text": "Veteran", "value": "Veteran"},
105105
],
106106
}
107107
],

0 commit comments

Comments
 (0)