Skip to content

Commit

Permalink
Merge branch 'master' into hackathon-2022-global-task-inbox
Browse files Browse the repository at this point in the history
* master: (74 commits)
  Fix category store (#1330)
  add 72px to avoid teambar (#1329)
  🎉 use new RDP/LHS by default 🎉  (#1322)
  MM-44754, MM-45087: Playbooks LHS Team Sidebar (#1327)
  [MM-45728] Favoriting runs (#1328)
  requested update timeline event (#1324)
  Filter playbooks for LHS (#1325)
  MM-45352: Run Details Page - RHS E2E (#1326)
  [MM-44755] Favoriting Playbooks (#1312)
  track role for playbookRun at server + new request-update/get-involved events (#1309)
  fix rhs issues (#1316)
  MM-45676: Increase margin between title and checklist box (#1320)
  fine tune run title control + toggle open in dotmenu (#1315)
  finish run to last pos + get involved modal + no-navigate (#1319)
  Make buttons non-editable for viewers (#1318)
  use followers noun to be consistent (#1323)
  MM-45575 Playbook member migration. (#1317)
  MM-44722: Checklist improvements (#1311)
  Rdp ux feedback batch (#1314)
  recover kebab and request update as participant (#1308)
  ...
  • Loading branch information
trilopin committed Jul 15, 2022
2 parents 8e95c71 + 5dfbc81 commit e327d14
Show file tree
Hide file tree
Showing 225 changed files with 8,412 additions and 1,785 deletions.
18 changes: 18 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,23 @@ commands:
paths:
- ./webapp/node_modules

npm-e2e-dependencies:
description: "Get E2E tests JavaScript dependencies"
steps:
- restore_cache:
name: Restore E2E npm cache
key: v1-e2e-npm-{{ checksum "./tests-e2e/package-lock.json" }}-{{ arch }}
- run:
name: Getting E2E JavaScript dependencies
command: |
cd tests-e2e
NODE_ENV=development npm install --ignore-scripts --no-save
- save_cache:
name: Save E2E npm cache
key: v1-e2e-npm-{{ checksum "./tests-e2e/package-lock.json" }}-{{ arch }}
paths:
- ./tests-e2e/node_modules

deploy:
parameters:
bucket:
Expand Down Expand Up @@ -158,6 +175,7 @@ jobs:
- checkout
- *restore_go_cache
- npm-dependencies
- npm-e2e-dependencies
- run:
name: Checking code style
command: |
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ ifneq ($(HAS_WEBAPP),)
cd webapp && npm run check-types
endif

cd tests-e2e && npm run check

ifneq ($(HAS_SERVER),)
@if ! [ -x "$$(command -v golangci-lint)" ]; then \
echo "golangci-lint is not installed. Please see https://github.com/golangci/golangci-lint#install for installation instructions."; \
Expand Down
8 changes: 8 additions & 0 deletions assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,13 @@
{
"id": "app.user.digest.tasks.zero_assigned",
"translation": "You have 0 assigned tasks."
},
{
"id": "app.user.run.request_get_involved",
"translation": "@here — @{{.Name}} wants to get involved in this run. To let them become a member of the run, please add them to this channel.\n"
},
{
"id": "app.user.run.request_update",
"translation": "@here — @{{.Name}} requested a status update.\n"
}
]
19 changes: 13 additions & 6 deletions client/playbook_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,19 @@ type Metadata struct {
type TimelineEventType string

const (
PlaybookRunCreated TimelineEventType = "incident_created"
TaskStateModified TimelineEventType = "task_state_modified"
StatusUpdated TimelineEventType = "status_updated"
OwnerChanged TimelineEventType = "owner_changed"
AssigneeChanged TimelineEventType = "assignee_changed"
RanSlashCommand TimelineEventType = "ran_slash_command"
PlaybookRunCreated TimelineEventType = "incident_created"
TaskStateModified TimelineEventType = "task_state_modified"
StatusUpdated TimelineEventType = "status_updated"
StatusUpdateRequested TimelineEventType = "status_update_requested"
OwnerChanged TimelineEventType = "owner_changed"
AssigneeChanged TimelineEventType = "assignee_changed"
RanSlashCommand TimelineEventType = "ran_slash_command"
EventFromPost TimelineEventType = "event_from_post"
UserJoinedLeft TimelineEventType = "user_joined_left"
PublishedRetrospective TimelineEventType = "published_retrospective"
CanceledRetrospective TimelineEventType = "canceled_retrospective"
RunFinished TimelineEventType = "run_finished"
RunRestored TimelineEventType = "run_restored"
)

// TimelineEvent represents an event recorded to a playbook run's timeline.
Expand Down
30 changes: 30 additions & 0 deletions client/playbook_runs.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,36 @@ func (s *PlaybookRunService) UpdateStatus(ctx context.Context, playbookRunID str
return nil
}

func (s *PlaybookRunService) RequestUpdate(ctx context.Context, playbookRunID, userID string) error {
requestURL := fmt.Sprintf("runs/%s/request-update", playbookRunID)
req, err := s.client.newRequest(http.MethodPost, requestURL, nil)
if err != nil {
return err
}

resp, err := s.client.do(ctx, req, nil)
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("expected status code %d", http.StatusOK)
}

return err
}

func (s *PlaybookRunService) RequestGetInvolved(ctx context.Context, playbookRunID, userID string) error {
requestURL := fmt.Sprintf("runs/%s/request-get-involved", playbookRunID)
req, err := s.client.newRequest(http.MethodPost, requestURL, nil)
if err != nil {
return err
}

resp, err := s.client.do(ctx, req, nil)
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("expected status code %d", http.StatusOK)
}

return err
}

func (s *PlaybookRunService) Finish(ctx context.Context, playbookRunID string) error {
finishURL := fmt.Sprintf("runs/%s/finish", playbookRunID)
req, err := s.client.newRequest(http.MethodPut, finishURL, nil)
Expand Down
2 changes: 1 addition & 1 deletion server/api/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func (a *ActionsHandler) updateChannelAction(w http.ResponseWriter, r *http.Requ
return
}

err := a.channelActionsService.Update(newChannelAction)
err := a.channelActionsService.Update(newChannelAction, userID)
if err != nil {
a.HandleErrorWithCode(w, http.StatusInternalServerError, fmt.Sprintf("unable to update action with ID %q", newChannelAction.ID), err)
return
Expand Down
2 changes: 1 addition & 1 deletion server/api/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (h *BotHandler) notifyAdmins(w http.ResponseWriter, r *http.Request) {
return
}

if err := h.poster.NotifyAdmins(payload.MessageType, userID, h.pluginAPI.System.IsEnterpriseReady()); err != nil {
if err := h.poster.NotifyAdmins(payload.MessageType, userID, !h.pluginAPI.System.IsEnterpriseReady()); err != nil {
h.HandleError(w, err)
return
}
Expand Down
Loading

0 comments on commit e327d14

Please sign in to comment.