Freeze order of documents in Slack message
Signed-off-by: Émile Ré <nemile.re@gmail.com>
This commit is contained in:
@@ -609,7 +609,7 @@ FROM
|
||||
WHERE
|
||||
%s
|
||||
AND trust_center_access_id = @trust_center_access_id
|
||||
ORDER BY created_at ASC
|
||||
ORDER BY id ASC
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
@@ -683,7 +683,7 @@ SET
|
||||
WHEN status = 'GRANTED'::trust_center_document_access_status THEN 'REVOKED'::trust_center_document_access_status
|
||||
ELSE 'REJECTED'::trust_center_document_access_status
|
||||
END,
|
||||
updated_at = @updated_at
|
||||
updated_at = @updated_at
|
||||
WHERE
|
||||
%s
|
||||
AND trust_center_access_id = @trust_center_access_id
|
||||
@@ -756,7 +756,7 @@ SET
|
||||
WHEN status = 'GRANTED'::trust_center_document_access_status THEN 'REVOKED'::trust_center_document_access_status
|
||||
ELSE 'REJECTED'::trust_center_document_access_status
|
||||
END,
|
||||
updated_at = @updated_at
|
||||
updated_at = @updated_at
|
||||
WHERE
|
||||
%s
|
||||
AND trust_center_access_id = @trust_center_access_id
|
||||
@@ -1170,7 +1170,8 @@ SET
|
||||
status = CASE
|
||||
WHEN status = 'GRANTED'::trust_center_document_access_status THEN 'REVOKED'::trust_center_document_access_status
|
||||
ELSE 'REJECTED'::trust_center_document_access_status
|
||||
END
|
||||
END,
|
||||
updated_at = @updated_at
|
||||
WHERE
|
||||
%s
|
||||
AND trust_center_access_id = @trust_center_access_id
|
||||
|
||||
@@ -396,20 +396,6 @@ func (s *SlackMessageService) buildAccessRequestMessage(
|
||||
reports []SlackMessageReport,
|
||||
files []SlackMessageFile,
|
||||
) (map[string]any, error) {
|
||||
var documentIDs []string
|
||||
var reportIDs []string
|
||||
var fileIDs []string
|
||||
|
||||
for _, doc := range documents {
|
||||
documentIDs = append(documentIDs, doc.ID)
|
||||
}
|
||||
for _, rep := range reports {
|
||||
reportIDs = append(reportIDs, rep.ID)
|
||||
}
|
||||
for _, file := range files {
|
||||
fileIDs = append(fileIDs, file.ID)
|
||||
}
|
||||
|
||||
base, err := baseurl.Parse(s.svc.baseURL)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot parse base URL: %w", err)
|
||||
@@ -421,9 +407,6 @@ func (s *SlackMessageService) buildAccessRequestMessage(
|
||||
OrganizationID string
|
||||
Domain string
|
||||
SlackMessageID string
|
||||
DocumentIDs []string
|
||||
ReportIDs []string
|
||||
FileIDs []string
|
||||
Documents []SlackMessageDocument
|
||||
Reports []SlackMessageReport
|
||||
Files []SlackMessageFile
|
||||
@@ -433,9 +416,6 @@ func (s *SlackMessageService) buildAccessRequestMessage(
|
||||
OrganizationID: organizationID.String(),
|
||||
Domain: base.Host(),
|
||||
SlackMessageID: slackMessageID.String(),
|
||||
DocumentIDs: documentIDs,
|
||||
ReportIDs: reportIDs,
|
||||
FileIDs: fileIDs,
|
||||
Documents: documents,
|
||||
Reports: reports,
|
||||
Files: files,
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
"type": "button",
|
||||
"text": {
|
||||
"type": "plain_text",
|
||||
"text": "✅ Grant All"
|
||||
"text": "Grant All"
|
||||
},
|
||||
"action_id": "accept_all",
|
||||
"value": "{{.SlackMessageID}}",
|
||||
@@ -34,7 +34,7 @@
|
||||
"type": "button",
|
||||
"text": {
|
||||
"type": "plain_text",
|
||||
"text": "❌ Reject/Revoke All"
|
||||
"text": "Reject/Revoke All"
|
||||
},
|
||||
"action_id": "reject_all",
|
||||
"value": "{{.SlackMessageID}}",
|
||||
@@ -44,7 +44,7 @@
|
||||
"type": "button",
|
||||
"text": {
|
||||
"type": "plain_text",
|
||||
"text": "👁️ View Requests"
|
||||
"text": "View Requests"
|
||||
},
|
||||
"url": "https://{{.Domain}}/organizations/{{.OrganizationID}}/trust-center/access"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user