Skip to content

Commit

Permalink
review II
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierM committed Mar 31, 2020
1 parent 0d886ef commit cabd244
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions x-pack/legacy/plugins/siem/public/lib/kibana/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,19 @@ export const useCurrentUser = (): AuthenticatedElasticUser | null => {
if (!didCancel) {
setUser(convertToCamelCase<AuthenticatedUser, AuthenticatedElasticUser>(response));
}
} else {
setUser({
username: i18n.translate('xpack.siem.getCurrentUser.unknownUser', {
defaultMessage: 'Unknown',
}),
email: '',
fullName: '',
roles: [],
enabled: false,
authenticationRealm: { name: '', type: '' },
lookupRealm: { name: '', type: '' },
authenticationProvider: '',
});
}
} catch (error) {
if (!didCancel) {
Expand Down
24 changes: 12 additions & 12 deletions x-pack/plugins/case/server/routes/api/cases/push_case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export function initPushCaseUserActionApi({
client,
caseId,
options: {
filter: `not ${CASE_COMMENT_SAVED_OBJECT}.attributes.pushed_at: *`,
fields: [],
page: 1,
perPage: 1,
Expand All @@ -72,7 +71,6 @@ export function initPushCaseUserActionApi({
client,
caseId,
options: {
filter: `not ${CASE_COMMENT_SAVED_OBJECT}.attributes.pushed_at: *`,
fields: [],
page: 1,
perPage: totalCommentsFindByCases.total,
Expand Down Expand Up @@ -105,16 +103,18 @@ export function initPushCaseUserActionApi({
}),
caseService.patchComments({
client,
comments: comments.saved_objects.map(comment => ({
commentId: comment.id,
updatedAttributes: {
pushed_at: pushedDate,
pushed_by: { username, full_name, email },
updated_at: pushedDate,
updated_by: { username, full_name, email },
},
version: comment.version,
})),
comments: comments.saved_objects
.filter(comment => comment.attributes.pushed_at == null)
.map(comment => ({
commentId: comment.id,
updatedAttributes: {
pushed_at: pushedDate,
pushed_by: { username, full_name, email },
updated_at: pushedDate,
updated_by: { username, full_name, email },
},
version: comment.version,
})),
}),
userActionService.postUserActions({
client,
Expand Down

0 comments on commit cabd244

Please sign in to comment.