Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cases] Update UI to use the new connector's API #149276

Merged
merged 38 commits into from
Jan 31, 2023
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
8edad49
Create getCaseConnectors hook
cnasikas Jan 19, 2023
816e8e1
Show push info
cnasikas Jan 20, 2023
c906ce4
Get fields from the new API
cnasikas Jan 20, 2023
c2eaf8c
Remove button & callout components from usePushToService
cnasikas Jan 21, 2023
71e543d
Move isValid and connectorName to edit connector component
cnasikas Jan 21, 2023
fe1d996
Reset form based on key
cnasikas Jan 22, 2023
2e6a8c6
Remove spacer on last item in CasesCallouts
cnasikas Jan 22, 2023
f9ce0d4
Move push button and callouts to seperate files
cnasikas Jan 22, 2023
085f86f
Improve styles
cnasikas Jan 22, 2023
865accf
Contruct connector on submit inside edit connector component
cnasikas Jan 22, 2023
a46c8c3
Fixes
cnasikas Jan 22, 2023
dad1ec6
Silent errors from actions client
cnasikas Jan 23, 2023
75c3c57
Minor fixes
cnasikas Jan 23, 2023
a482321
Adding oldest push timestamp
jonathan-buttner Jan 24, 2023
5d57d65
Fix tests and types
cnasikas Jan 25, 2023
db30357
Merge branch 'main' into get_connectors_info_from_server
cnasikas Jan 25, 2023
f5f4913
Merge branch 'cases-first-push-info' into get_connectors_info_from_se…
cnasikas Jan 25, 2023
7f9d189
Improve tests
cnasikas Jan 25, 2023
39162ce
Fix i18n
cnasikas Jan 25, 2023
ec5e1c7
Add more tests
cnasikas Jan 25, 2023
c50cde7
Fix bug
cnasikas Jan 25, 2023
304c450
Fix tests
cnasikas Jan 25, 2023
fb62ecc
Adding new external services field
jonathan-buttner Jan 25, 2023
d6e8fe2
Clarifying date field names
jonathan-buttner Jan 25, 2023
7296f8a
Merge branch 'main' into get_connectors_info_from_server
cnasikas Jan 25, 2023
965d17d
Merge branch 'cases-latest-push-info' into get_connectors_info_from_s…
cnasikas Jan 25, 2023
54963b3
Get external service from case connectors
cnasikas Jan 26, 2023
c31815f
Add API unit test
cnasikas Jan 26, 2023
8aee8e0
PR feedback
cnasikas Jan 26, 2023
b5b626b
Merge branch 'main' into get_connectors_info_from_server
cnasikas Jan 27, 2023
fc04401
PR feedback
cnasikas Jan 27, 2023
183a915
Fix types
cnasikas Jan 27, 2023
56611dc
Fix tests
cnasikas Jan 27, 2023
908ca2d
Merge branch 'main' into get_connectors_info_from_server
cnasikas Jan 30, 2023
5cbd246
Fix conflicts
cnasikas Jan 30, 2023
9b00d2a
Rename action connectors apis
cnasikas Jan 30, 2023
50554fe
PR feedback
cnasikas Jan 30, 2023
45eeba9
Merge branch 'main' into get_connectors_info_from_server
cnasikas Jan 31, 2023
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
Prev Previous commit
Next Next commit
Clarifying date field names
  • Loading branch information
jonathan-buttner committed Jan 25, 2023
commit d6e8fe222fa17b4014162c09f3bdb8fc9a64add4
4 changes: 2 additions & 2 deletions x-pack/plugins/cases/common/api/connectors/get_connectors.ts
Original file line number Diff line number Diff line change
@@ -16,8 +16,8 @@ const CaseConnectorPushInfoRt = rt.intersection([
}),
rt.partial(
rt.type({
latestPushDate: rt.string,
oldestPushDate: rt.string,
latestUserActionPushDate: rt.string,
oldestUserActionPushDate: rt.string,
externalService: CaseExternalServiceBasicRt,
}).props
),
Original file line number Diff line number Diff line change
@@ -276,8 +276,8 @@ const createConnectorInfoResult = ({
needsToBePushed,
hasBeenPushed: hasBeenPushed(enrichedPushInfo),
externalService: enrichedPushInfo?.externalService,
latestPushDate: enrichedPushInfo?.latestPushDate.toISOString(),
oldestPushDate: enrichedPushInfo?.oldestPushDate.toISOString(),
latestUserActionPushDate: enrichedPushInfo?.latestPushDate.toISOString(),
oldestUserActionPushDate: enrichedPushInfo?.oldestPushDate.toISOString(),
},
};
}
Original file line number Diff line number Diff line change
@@ -303,7 +303,9 @@ export default ({ getService }: FtrProviderContext): void => {
const latestPush = pushes[pushes.length - 1];

expect(Object.keys(connectors).length).to.be(2);
expect(connectors[serviceNow2.id].push.latestPushDate).to.eql(latestPush.created_at);
expect(connectors[serviceNow2.id].push.latestUserActionPushDate).to.eql(
latestPush.created_at
);
expect(connectors[serviceNow2.id].push.externalService?.connector_id).to.eql(
serviceNow2.id
);
@@ -328,8 +330,8 @@ export default ({ getService }: FtrProviderContext): void => {

expect(Object.keys(connectors).length).to.be(1);
expect(connectors).to.have.property(connector.id);
expect(connectors[connector.id].push.latestPushDate).to.be(undefined);
expect(connectors[connector.id].push.oldestPushDate).to.be(undefined);
expect(connectors[connector.id].push.latestUserActionPushDate).to.be(undefined);
expect(connectors[connector.id].push.oldestUserActionPushDate).to.be(undefined);
});

it('sets latestPushDate to the most recent push date and oldestPushDate to the first push date', async () => {
@@ -367,8 +369,12 @@ export default ({ getService }: FtrProviderContext): void => {
const latestPush = pushes[pushes.length - 1];

expect(Object.keys(connectors).length).to.be(1);
expect(connectors[connector.id].push.latestPushDate).to.eql(latestPush.created_at);
expect(connectors[connector.id].push.oldestPushDate).to.eql(oldestPush.created_at);
expect(connectors[connector.id].push.latestUserActionPushDate).to.eql(
latestPush.created_at
);
expect(connectors[connector.id].push.oldestUserActionPushDate).to.eql(
oldestPush.created_at
);
});
});