Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
0c12da8
Moved slack functionality into a new slack directory.
ocielliottc Feb 6, 2025
4ede442
Moved handling of Slack submissions, added code to read slack message…
ocielliottc Feb 7, 2025
6ada313
Process the response from users prompt asking to post kudos in Check-…
ocielliottc Feb 7, 2025
2885adc
Translate channel referencs to channel names and escape the kudos con…
ocielliottc Feb 7, 2025
899ecad
Merge branch 'develop' into feature-2868/pull-slack-kudos-in
ocielliottc Feb 7, 2025
3874759
Persist the last import timestamp so that we can get messages posted …
ocielliottc Feb 10, 2025
173f552
Moved SlackSearch into the slack services directory.
ocielliottc Feb 10, 2025
8d2607d
Fixed test errors.
ocielliottc Feb 10, 2025
f72b174
Fixed incorrect column reference.
ocielliottc Feb 11, 2025
b4a0c91
Added a test for the slack kudos.
ocielliottc Feb 11, 2025
0e2b322
For testing purposes, the send date could be equal.
ocielliottc Feb 11, 2025
69f0655
Added a comment about slack message subtype and removed unused imports.
ocielliottc Feb 11, 2025
29634b9
Automatically approve private kudos.
ocielliottc Feb 11, 2025
c445b87
Only newly created publicly visible kudos do not have a approve date.
ocielliottc Feb 11, 2025
a445f23
Initial changes to implement Kudos modification.
ocielliottc Feb 12, 2025
70a25c5
Fixed tests.
ocielliottc Feb 12, 2025
2457660
Added the kudos update DTO and a test for updating kudos.
ocielliottc Feb 12, 2025
5a75399
Added a check for at least one recipient and more tests.
ocielliottc Feb 12, 2025
c2c3a0d
Fixed lack of update after updating sent kudos.
ocielliottc Feb 12, 2025
4d70e1f
Bump koa from 2.15.3 to 2.15.4 in /web-ui
dependabot[bot] Feb 12, 2025
43be791
Merge pull request #2882 from objectcomputing/dependabot/npm_and_yarn…
mkimberlin Feb 12, 2025
3326812
Merge branch 'develop' into feature-2870/edit-kudos
mkimberlin Feb 12, 2025
544b5ec
Clear approval for public kudos if the text changes.
ocielliottc Feb 13, 2025
3287751
Remove the unused reason reason text field.
ocielliottc Feb 13, 2025
c31f64a
Merge branch 'feature-2870/edit-kudos' of github.com:objectcomputing/…
ocielliottc Feb 13, 2025
cd7b9f1
Undo date approved changes for private kudos and fixed the method tha…
ocielliottc Feb 13, 2025
8aa3f26
Merge pull request #2881 from objectcomputing/feature-2870/edit-kudos
mkimberlin Feb 13, 2025
7d905d1
Added a filter for kudos, similar to the feedback filter.
ocielliottc Feb 13, 2025
c64a114
Fixed incorrect kudos action after edit.
ocielliottc Feb 13, 2025
c8826ba
Implement a tooltip for the surplus icon with the names of the extra …
ocielliottc Feb 13, 2025
b50e0eb
Use the same surplus renderer for team kudos.
ocielliottc Feb 13, 2025
efa3d23
Remove unnecessary (and possibly duplicate key).
ocielliottc Feb 14, 2025
14cd1d9
Wrap text in Typography to avoid React Mui warning.
ocielliottc Feb 14, 2025
9488fc5
Search for names in kudos text and link any that are unambiguous.
ocielliottc Feb 14, 2025
a5009a6
Make the paths /kudos/received and /kudos/sent go to the kudos page s…
ocielliottc Feb 14, 2025
3b46afa
Validate tab names on load.
ocielliottc Feb 14, 2025
e833935
Merge pull request #2883 from objectcomputing/feature-2871/filter-kudos
mkimberlin Feb 14, 2025
b8d40ea
Merge branch 'develop' into feature-2872/kudos-surplus-tooltip
mkimberlin Feb 14, 2025
63c8d95
Bump dompurify from 3.2.0 to 3.2.4 in /web-ui
dependabot[bot] Feb 14, 2025
f0198f1
Merge branch 'develop' into feature-2875/link-recipient-names
mkimberlin Feb 14, 2025
29e3d94
Merge branch 'develop' into feature-2874/received-sent-tabs-linkable
mkimberlin Feb 14, 2025
5ed94d0
Added a public kudos tab.
ocielliottc Feb 17, 2025
b68fe7b
Merge pull request #2889 from objectcomputing/dependabot/npm_and_yarn…
mkimberlin Feb 17, 2025
f143d4a
Merge branch 'develop' into feature-2872/kudos-surplus-tooltip
mkimberlin Feb 17, 2025
1e60cbd
Merge pull request #2884 from objectcomputing/feature-2872/kudos-surp…
mkimberlin Feb 17, 2025
b4eae48
Merge branch 'develop' into feature-2875/link-recipient-names
mkimberlin Feb 17, 2025
79c4029
Merge branch 'develop' into feature-2874/received-sent-tabs-linkable
mkimberlin Feb 17, 2025
d3fc66f
Added new selector method for getting active or inactive profiles (us…
ocielliottc Feb 17, 2025
32b36be
Updated to have the tooltips.
ocielliottc Feb 17, 2025
a2adc20
Merge branch 'develop' into feature-2873/public-kudos-tab
ocielliottc Feb 17, 2025
3b73a48
Added a test for KudosCard.
ocielliottc Feb 17, 2025
f7a6851
Updated the KudosCard test to include an active and an inactive sender.
ocielliottc Feb 17, 2025
56c1cd4
If a supervisor is terminated, this would blow up on the check for su…
ocielliottc Feb 17, 2025
1b5145d
Allow a user to view their self-review for closed review periods.
ocielliottc Feb 17, 2025
a6f5ff6
Merge branch 'develop' into feature-2868/pull-slack-kudos-in
ocielliottc Feb 17, 2025
918a1d0
No need to call the kudos creator if the message list is empty.
ocielliottc Feb 17, 2025
67c8df8
Switch from a scheduled task to being triggered when the check servic…
ocielliottc Feb 17, 2025
00cc1dd
Use the SlackReaderReplacement for the native test.
ocielliottc Feb 17, 2025
7a371a0
Skip messages posted by bot users too.
ocielliottc Feb 17, 2025
af4a92d
Merge pull request #2886 from objectcomputing/feature-2875/link-recip…
mkimberlin Feb 17, 2025
2fb18b7
Merge branch 'develop' into feature-2874/received-sent-tabs-linkable
mkimberlin Feb 17, 2025
8241865
Merge pull request #2887 from objectcomputing/feature-2874/received-s…
mkimberlin Feb 17, 2025
772a711
Converted selectActiveOrInactiveProfile to a standard selector
mkimberlin Feb 17, 2025
652deda
Added permission for view terminated profile and adjusted app context…
mkimberlin Feb 17, 2025
d9bc550
Merge branch 'develop' into bugfix-2885/kudos-from-terminated-members
mkimberlin Feb 17, 2025
fc89b61
Merge branch 'bugfix-2885/kudos-from-terminated-members' of github.co…
mkimberlin Feb 17, 2025
4fc9065
Merge pull request #2891 from objectcomputing/bugfix-2885/kudos-from-…
mkimberlin Feb 18, 2025
317298c
Merge branch 'develop' into feature-2888/view-closed-self-reviews
mkimberlin Feb 18, 2025
3d4cb57
Merge pull request #2892 from objectcomputing/feature-2888/view-close…
mkimberlin Feb 18, 2025
3322a31
Merge branch 'develop' into feature-2873/public-kudos-tab
ocielliottc Feb 18, 2025
6a73655
Not all kudos being deleted are pending.
ocielliottc Feb 18, 2025
e5b8a96
Allow admins to edit approved kudos from the management screen.
ocielliottc Feb 18, 2025
602417d
Merge branch 'develop' into feature-2868/pull-slack-kudos-in
ocielliottc Feb 18, 2025
1a72af3
Merge pull request #2890 from objectcomputing/feature-2873/public-kud…
mkimberlin Feb 18, 2025
e1878b3
Merge branch 'develop' into feature-2868/pull-slack-kudos-in
ocielliottc Feb 18, 2025
f4aed83
Remove slack messages sent by our bot in the event that a user change…
ocielliottc Feb 18, 2025
515e513
Updated the test to match how slack messages are now sent.
ocielliottc Feb 18, 2025
1c99460
Removed the Run Search button and run the search whenever the skills …
ocielliottc Feb 18, 2025
cf8cce0
Updated the test snapshot.
ocielliottc Feb 18, 2025
11c2594
Updated github actions workflows to provide SLACK_KUDOS_CHANNEL_ID value
mkimberlin Feb 18, 2025
9364239
Merge pull request #2876 from objectcomputing/feature-2868/pull-slack…
mkimberlin Feb 18, 2025
f40943d
Merge branch 'develop' into feature-2893/remove-run-search-button
mkimberlin Feb 18, 2025
37def8e
Remove the Run Search button from the Team Skills report.
ocielliottc Feb 18, 2025
1424f7b
Merge branch 'feature-2893/remove-run-search-button' of github.com:ob…
ocielliottc Feb 18, 2025
5e47a29
Bump nokogiri from 1.16.5 to 1.18.3 in /docs
dependabot[bot] Feb 19, 2025
1da833f
Added a custom query to the MemberSkillRepository to filter out skill…
ocielliottc Feb 19, 2025
f9dc433
Added a terminated member to one of the tests.
ocielliottc Feb 19, 2025
9b2147c
Merge pull request #2896 from objectcomputing/dependabot/bundler/docs…
mkimberlin Feb 20, 2025
d558dfc
Merge branch 'develop' into feature-2894/custom-skill-query
mkimberlin Feb 20, 2025
0031caf
Merge pull request #2897 from objectcomputing/feature-2894/custom-ski…
mkimberlin Feb 27, 2025
e967874
Bump uri from 0.13.0 to 0.13.2 in /docs
dependabot[bot] Mar 3, 2025
4cc8836
added flag for ignoring birthday celebrations
mkimberlin Mar 5, 2025
34d888d
Make the db column name snake case
mkimberlin Mar 5, 2025
f0d9b18
Fixed issues with duplicate current user profile in state, added pref…
mkimberlin Mar 5, 2025
f4094c2
Fixed test compile error
mkimberlin Mar 5, 2025
97ad236
Merge pull request #2899 from objectcomputing/dependabot/bundler/docs…
mkimberlin Mar 5, 2025
a36c6ec
Merge branch 'develop' into feature-2898/suppress-birthday-flag
mkimberlin Mar 5, 2025
80eb9f1
Merge pull request #2900 from objectcomputing/feature-2898/suppress-b…
mkimberlin Mar 5, 2025
cbb053b
Merge branch 'release/0.8' into develop
mkimberlin Mar 5, 2025
71fc0be
Bumped version to 0.8.15
mkimberlin Mar 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/gradle-build-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jobs:
--set-env-vars "^@^MICRONAUT_ENVIRONMENTS=cloud,google,gcp" \
--set-env-vars "SLACK_WEBHOOK_URL=${{ secrets.SLACK_WEBHOOK_URL }}" \
--set-env-vars "SLACK_BOT_TOKEN=${{ secrets.SLACK_BOT_TOKEN }}" \
--set-env-vars "SLACK_KUDOS_CHANNEL_ID=${{ secrets.SLACK_KUDOS_CHANNEL_ID }}" \
--set-env-vars "SLACK_SIGNING_SECRET=${{ secrets.SLACK_PULSE_SIGNING_SECRET }}" \
--platform "managed" \
--max-instances 8 \
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/gradle-deploy-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ jobs:
--set-env-vars "SLACK_WEBHOOK_URL=${{ secrets.SLACK_WEBHOOK_URL }}" \
--set-env-vars "SLACK_BOT_TOKEN=${{ secrets.SLACK_BOT_TOKEN }}" \
--set-env-vars "SLACK_SIGNING_SECRET=${{ secrets.SLACK_PULSE_SIGNING_SECRET }}" \
--set-env-vars "SLACK_KUDOS_CHANNEL_ID=${{ secrets.SLACK_KUDOS_CHANNEL_ID }}" \
--platform "managed" \
--max-instances 2 \
--allow-unauthenticated
1 change: 1 addition & 0 deletions .github/workflows/gradle-deploy-native-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ jobs:
--set-env-vars "^@^MICRONAUT_ENVIRONMENTS=dev,cloud,google,gcp" \
--set-env-vars "SLACK_WEBHOOK_URL=${{ secrets.SLACK_WEBHOOK_URL }}" \
--set-env-vars "SLACK_BOT_TOKEN=${{ secrets.SLACK_BOT_TOKEN }}" \
--set-env-vars "SLACK_KUDOS_CHANNEL_ID=${{ secrets.SLACK_KUDOS_CHANNEL_ID }}" \
--set-env-vars "SLACK_SIGNING_SECRET=${{ secrets.SLACK_PULSE_SIGNING_SECRET }}" \
--platform "managed" \
--max-instances 2 \
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3'
services:
postgresql:
image: postgres:17.2
Expand Down
18 changes: 10 additions & 8 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
mini_portile2 (2.8.8)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
Expand All @@ -228,25 +229,26 @@ GEM
mutex_m (0.2.0)
net-http (0.4.1)
uri
nokogiri (1.16.5-aarch64-linux)
nokogiri (1.18.3)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.16.5-arm-linux)
nokogiri (1.18.3-aarch64-linux-gnu)
racc (~> 1.4)
nokogiri (1.16.5-arm64-darwin)
nokogiri (1.18.3-arm-linux-gnu)
racc (~> 1.4)
nokogiri (1.16.5-x86-linux)
nokogiri (1.18.3-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.5-x86_64-darwin)
nokogiri (1.18.3-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.5-x86_64-linux)
nokogiri (1.18.3-x86_64-linux-gnu)
racc (~> 1.4)
octokit (4.25.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (5.0.4)
racc (1.7.3)
racc (1.8.1)
rake (13.1.0)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
Expand Down Expand Up @@ -275,7 +277,7 @@ GEM
unf_ext
unf_ext (0.0.9.1)
unicode-display_width (1.8.0)
uri (0.13.0)
uri (0.13.2)
webrick (1.8.2)

PLATFORMS
Expand Down
2 changes: 1 addition & 1 deletion server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
id "jacoco"
}

version "0.8.14"
version "0.8.15"
group "com.objectcomputing.checkins"

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ public static class SlackConfig {

@NotBlank
private String signingSecret;

@NotBlank
private String kudosChannel;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
package com.objectcomputing.checkins.notifications.social_media;

import com.objectcomputing.checkins.configuration.CheckInsConfiguration;

import com.slack.api.Slack;
import com.slack.api.methods.MethodsClient;
import com.slack.api.methods.request.chat.ChatPostMessageRequest;
import com.slack.api.methods.response.chat.ChatPostMessageResponse;
import com.slack.api.methods.request.chat.ChatDeleteRequest;
import com.slack.api.methods.response.chat.ChatDeleteResponse;
import com.slack.api.methods.request.conversations.ConversationsOpenRequest;
import com.slack.api.methods.response.conversations.ConversationsOpenResponse;

import jakarta.inject.Singleton;
import jakarta.inject.Inject;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

@Singleton
public class SlackSender {
private static final Logger LOG = LoggerFactory.getLogger(SlackSender.class);

@Inject
private CheckInsConfiguration configuration;

public boolean send(List<String> userIds, String slackBlocks) {
// See if we have a token.
String token = configuration.getApplication()
.getSlack().getBotToken();
if (token != null && !slackBlocks.isEmpty()) {
MethodsClient client = Slack.getInstance().methods(token);

try {
ConversationsOpenResponse openResponse =
client.conversationsOpen(ConversationsOpenRequest.builder()
.users(userIds)
.returnIm(true)
.build());
if (!openResponse.isOk()) {
LOG.error("Unable to open the conversation");
return false;
}

return send(openResponse.getChannel().getId(), slackBlocks);
} catch(Exception ex) {
LOG.error("SlackSender.send: " + ex.toString());
return false;
}
} else {
LOG.error("Missing token or missing slack blocks");
return false;
}
}

public boolean send(String channelId, String slackBlocks) {
// See if we have a token.
String token = configuration.getApplication()
.getSlack().getBotToken();
if (token != null && !slackBlocks.isEmpty()) {
MethodsClient client = Slack.getInstance().methods(token);

try {
ChatPostMessageRequest request = ChatPostMessageRequest
.builder()
.channel(channelId)
.blocksAsString(slackBlocks)
.build();

// Send it to Slack
ChatPostMessageResponse response = client.chatPostMessage(request);

if (!response.isOk()) {
LOG.error("Unable to send the chat message: " +
response.getError());
}

return response.isOk();
} catch(Exception ex) {
LOG.error("SlackSender.send: " + ex.toString());
return false;
}
} else {
LOG.error("Missing token or missing slack blocks");
return false;
}
}

public boolean delete(String channel, String ts) {
// See if we have a token.
String token = configuration.getApplication()
.getSlack().getBotToken();
if (token != null) {
MethodsClient client = Slack.getInstance().methods(token);

try {
ChatDeleteRequest request = ChatDeleteRequest
.builder()
.channel(channel)
.ts(ts)
.build();

// Send it to Slack
ChatDeleteResponse response = client.chatDelete(request);

if (!response.isOk()) {
LOG.error("Unable to delete the chat message: " +
response.getError());
}

return response.isOk();
} catch(Exception ex) {
LOG.error("SlackSender.delete: " + ex.toString());
return false;
}
} else {
LOG.error("Missing token or missing slack blocks");
return false;
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public Kudos create(@Body @Valid KudosCreateDTO kudos) {
}

@Put
public Kudos update(@Body @Valid KudosUpdateDTO kudos) {
return kudosServices.update(kudos);
}

@Put("/approve")
public Kudos approve(@Body @Valid Kudos kudos) {
return kudosServices.approve(kudos);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.objectcomputing.checkins.services.kudos;

import com.objectcomputing.checkins.notifications.social_media.SlackSearch;
import com.objectcomputing.checkins.services.slack.SlackSearch;
import com.objectcomputing.checkins.services.kudos.kudos_recipient.KudosRecipientServices;
import com.objectcomputing.checkins.services.kudos.kudos_recipient.KudosRecipient;
import com.objectcomputing.checkins.services.memberprofile.MemberProfileServices;
Expand All @@ -22,10 +22,6 @@

@Singleton
public class KudosConverter {
private record InternalBlock(
List<LayoutBlock> blocks
) {}

private final MemberProfileServices memberProfileServices;
private final KudosRecipientServices kudosRecipientServices;
private final SlackSearch slackSearch;
Expand Down Expand Up @@ -61,9 +57,8 @@ public String toSlackBlock(Kudos kudos) {
.elements(content).build();
RichTextBlock richTextBlock = RichTextBlock.builder()
.elements(List.of(element)).build();
InternalBlock block = new InternalBlock(List.of(richTextBlock));
Gson mapper = GsonFactory.createSnakeCase();
return mapper.toJson(block);
return mapper.toJson(List.of(richTextBlock));
}

private RichTextSectionElement.TextStyle boldItalic() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ public interface KudosServices {

Kudos save(KudosCreateDTO kudos);

Kudos update(KudosUpdateDTO kudos);

Kudos approve(Kudos kudos);

Kudos savePreapproved(KudosCreateDTO kudos);

List<KudosResponseDTO> getRecent();

KudosResponseDTO getById(UUID id);
Expand Down
Loading
Loading