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
|
WHERE
|
||||||
%s
|
%s
|
||||||
AND trust_center_access_id = @trust_center_access_id
|
AND trust_center_access_id = @trust_center_access_id
|
||||||
ORDER BY created_at ASC
|
ORDER BY id ASC
|
||||||
`
|
`
|
||||||
|
|
||||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||||
@@ -1170,7 +1170,8 @@ SET
|
|||||||
status = CASE
|
status = CASE
|
||||||
WHEN status = 'GRANTED'::trust_center_document_access_status THEN 'REVOKED'::trust_center_document_access_status
|
WHEN status = 'GRANTED'::trust_center_document_access_status THEN 'REVOKED'::trust_center_document_access_status
|
||||||
ELSE 'REJECTED'::trust_center_document_access_status
|
ELSE 'REJECTED'::trust_center_document_access_status
|
||||||
END
|
END,
|
||||||
|
updated_at = @updated_at
|
||||||
WHERE
|
WHERE
|
||||||
%s
|
%s
|
||||||
AND trust_center_access_id = @trust_center_access_id
|
AND trust_center_access_id = @trust_center_access_id
|
||||||
|
|||||||
@@ -396,20 +396,6 @@ func (s *SlackMessageService) buildAccessRequestMessage(
|
|||||||
reports []SlackMessageReport,
|
reports []SlackMessageReport,
|
||||||
files []SlackMessageFile,
|
files []SlackMessageFile,
|
||||||
) (map[string]any, error) {
|
) (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)
|
base, err := baseurl.Parse(s.svc.baseURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("cannot parse base URL: %w", err)
|
return nil, fmt.Errorf("cannot parse base URL: %w", err)
|
||||||
@@ -421,9 +407,6 @@ func (s *SlackMessageService) buildAccessRequestMessage(
|
|||||||
OrganizationID string
|
OrganizationID string
|
||||||
Domain string
|
Domain string
|
||||||
SlackMessageID string
|
SlackMessageID string
|
||||||
DocumentIDs []string
|
|
||||||
ReportIDs []string
|
|
||||||
FileIDs []string
|
|
||||||
Documents []SlackMessageDocument
|
Documents []SlackMessageDocument
|
||||||
Reports []SlackMessageReport
|
Reports []SlackMessageReport
|
||||||
Files []SlackMessageFile
|
Files []SlackMessageFile
|
||||||
@@ -433,9 +416,6 @@ func (s *SlackMessageService) buildAccessRequestMessage(
|
|||||||
OrganizationID: organizationID.String(),
|
OrganizationID: organizationID.String(),
|
||||||
Domain: base.Host(),
|
Domain: base.Host(),
|
||||||
SlackMessageID: slackMessageID.String(),
|
SlackMessageID: slackMessageID.String(),
|
||||||
DocumentIDs: documentIDs,
|
|
||||||
ReportIDs: reportIDs,
|
|
||||||
FileIDs: fileIDs,
|
|
||||||
Documents: documents,
|
Documents: documents,
|
||||||
Reports: reports,
|
Reports: reports,
|
||||||
Files: files,
|
Files: files,
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
"type": "button",
|
"type": "button",
|
||||||
"text": {
|
"text": {
|
||||||
"type": "plain_text",
|
"type": "plain_text",
|
||||||
"text": "✅ Grant All"
|
"text": "Grant All"
|
||||||
},
|
},
|
||||||
"action_id": "accept_all",
|
"action_id": "accept_all",
|
||||||
"value": "{{.SlackMessageID}}",
|
"value": "{{.SlackMessageID}}",
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
"type": "button",
|
"type": "button",
|
||||||
"text": {
|
"text": {
|
||||||
"type": "plain_text",
|
"type": "plain_text",
|
||||||
"text": "❌ Reject/Revoke All"
|
"text": "Reject/Revoke All"
|
||||||
},
|
},
|
||||||
"action_id": "reject_all",
|
"action_id": "reject_all",
|
||||||
"value": "{{.SlackMessageID}}",
|
"value": "{{.SlackMessageID}}",
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
"type": "button",
|
"type": "button",
|
||||||
"text": {
|
"text": {
|
||||||
"type": "plain_text",
|
"type": "plain_text",
|
||||||
"text": "👁️ View Requests"
|
"text": "View Requests"
|
||||||
},
|
},
|
||||||
"url": "https://{{.Domain}}/organizations/{{.OrganizationID}}/trust-center/access"
|
"url": "https://{{.Domain}}/organizations/{{.OrganizationID}}/trust-center/access"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user