-
Notifications
You must be signed in to change notification settings - Fork 137
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
768 Add ViewMessages Intent & SearchCriteria Context #797
Closed
symphony-jean-michael
wants to merge
15
commits into
finos:master
from
symphony-jean-michael:feature/ViewMessages
Closed
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
100f416
Add SearchCriteria Context
symphony-jean-michael 2eb75d8
Lint file
symphony-jean-michael a57e625
Remove the html entitites
symphony-jean-michael 6e1c104
Add SeachCriteria link
symphony-jean-michael f236082
Merge remote-tracking branch 'upstream/master' into feature/ViewMessages
symphony-jean-michael 864f756
Update the description to be more generic
symphony-jean-michael 5f9b52c
Reorder links
symphony-jean-michael b517682
Update descriptions
symphony-jean-michael 6ab7ece
Restore the HTML entities
symphony-jean-michael a54ae60
Rename contexts in criteria
symphony-jean-michael 2b9931a
Rename fdc3.searchCriteria into fdc3.chat.searchCriteria
symphony-jean-michael e1bb738
Empty criteria
symphony-jean-michael 0172785
Rename SearchCriteria in ChatSearchCriteria
symphony-jean-michael 89d2fec
Rename searchCriteria in chatSearchCriteria
symphony-jean-michael 41b3384
Add ViewMessages entry in the unreleased section of the changelog.md
symphony-jean-michael File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
id: ChatSearchCriteria | ||
sidebar_label: ChatSearchCriteria | ||
title: ChatSearchCriteria | ||
hide_title: true | ||
--- | ||
# `ChatSearchCriteria` | ||
|
||
A context type that represents a simple search criterion, based on a list of other context objects, that can be used to search or filter messages in a chat application. | ||
|
||
## Type | ||
|
||
`fdc3.chat.searchCriteria` | ||
|
||
## Schema | ||
|
||
https://fdc3.finos.org/schemas/next/chatSearchCriteria.schema.json | ||
|
||
## Details | ||
|
||
| Property | Type | Required | Example Value | | ||
|------------------|-----------------|----------|----------------------| | ||
| `type` | string | Yes | `'fdc3.chat.searchCriteria'` | | ||
| `criteria` | (Instrument |<br>Contact |<br>Organization |<br>string)[] | Yes | <pre>[<br>  {<br>    "type": "fdc3.instrument",<br>    "id": {<br>      "ticker": "AAPL"<br>    }<br>  },<br>  {<br>    "type": "fdc3.contact",<br>    "name":"Jane Doe",<br>    "id": {<br>      "email": "jane.doe@mail.com"<br>    }<br>  },<br>  {<br>    "type": "fdc3.organization",<br>    "name":"Symphony",<br>  },<br>  "#OrderID45788422",<br>]</pre> | | ||
|
||
⚠️ Operators (and/or/not) are not defined in `fdc3.chat.searchCriteria`. It is up to the application that processes the FDC3 Intent to choose and apply the operators between the criteria. | ||
|
||
Empty search criteria can be supported to allow resetting of filters. | ||
|
||
## Example | ||
|
||
```js | ||
const searchCriteria = { | ||
type: "fdc3.chat.searchCriteria", | ||
criteria: [ | ||
{ | ||
type: "fdc3.instrument", | ||
id: { | ||
ticker: "AAPL" | ||
} | ||
}, | ||
{ | ||
type: "fdc3.contact", | ||
name: "Jane Doe", | ||
id: { | ||
email: "jane.doe@mail.com" | ||
} | ||
}, | ||
{ | ||
type: "fdc3.organization", | ||
name: "Symphony" | ||
}, | ||
"#OrderID45788422" | ||
] | ||
} | ||
|
||
fdc3.raiseIntent('ViewMessages', searchCriteria); | ||
``` | ||
|
||
## See Also | ||
|
||
Intents | ||
|
||
* [ViewMessages](../../intents/ref/ViewMessages) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
--- | ||
id: ViewMessages | ||
sidebar_label: ViewMessages | ||
title: ViewMessages | ||
hide_title: true | ||
--- | ||
# `ViewMessages` | ||
|
||
Search and display a list of messages (for example in a chat application or CRM) to the user. | ||
|
||
## Intent Name | ||
|
||
`ViewMessages` | ||
|
||
## Display Name | ||
|
||
`View Messages` | ||
|
||
## Possible Contexts | ||
|
||
* [ChatSearchCriteria](../../context/ref/ChatSearchCriteria) | ||
|
||
## Example | ||
|
||
Request display of messages relating to a specific `fdc3.instrument` (representing a ticker): | ||
```js | ||
const searchCriteria = { | ||
type: "fdc3.chat.searchCriteria", | ||
criteria: [ | ||
{ | ||
type: "fdc3.instrument", | ||
id: { | ||
ticker: "AAPL" | ||
} | ||
} | ||
] | ||
} | ||
|
||
fdc3.raiseIntent('ViewMessages', searchCriteria); | ||
``` | ||
|
||
Request display of messages relating to a specific `fdc3.contact`: | ||
|
||
```js | ||
const searchCriteria = { | ||
type: "fdc3.chat.searchCriteria", | ||
criteria: [ | ||
{ | ||
type: "fdc3.contact", | ||
name: "Jane Doe", | ||
id: { | ||
email: "jane.doe@mail.com" | ||
} | ||
} | ||
] | ||
} | ||
|
||
fdc3.raiseIntent('ViewMessages', searchCriteria); | ||
``` | ||
|
||
Request display of messages relating to a specific `fdc3.organization`: | ||
|
||
```js | ||
const searchCriteria = { | ||
type: "fdc3.chat.searchCriteria", | ||
criteria: [ | ||
{ | ||
type: "fdc3.organization", | ||
name: "Symphony" | ||
} | ||
] | ||
} | ||
|
||
fdc3.raiseIntent('ViewMessages', searchCriteria); | ||
``` | ||
|
||
Request display of messages relating to a specific **phrase**: | ||
|
||
```js | ||
const searchCriteria = { | ||
type: "fdc3.chat.searchCriteria", | ||
criteria: [ | ||
"#OrderID45788422" | ||
] | ||
} | ||
|
||
fdc3.raiseIntent('ViewMessages', searchCriteria); | ||
``` | ||
|
||
Request display of messages matching _multiple_ criteria: | ||
```js | ||
const searchCriteria = { | ||
type: "fdc3.chat.searchCriteria", | ||
criteria: [ | ||
{ | ||
type: "fdc3.contact", | ||
name: "Jane Doe", | ||
id: { | ||
email: "jane.doe@mail.com" | ||
} | ||
}, | ||
{ | ||
type: "fdc3.organization", | ||
name: "Symphony" | ||
}, | ||
"#OrderID45788422" | ||
] | ||
} | ||
|
||
fdc3.raiseIntent('ViewMessages', searchCriteria); | ||
``` | ||
|
||
## See Also | ||
|
||
Context | ||
|
||
* [ChatSearchCriteria](../../context/ref/ChatSearchCriteria) | ||
* [Instrument](../../context/ref/Instrument) | ||
* [Contact](../../context/ref/Contact) | ||
* [Organization](../../context/ref/Organization) | ||
|
||
Intents | ||
|
||
* [ViewChat](ViewChat) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://fdc3.finos.org/schemas/next/chatSearchCriteria.schema.json", | ||
"type": "object", | ||
"title": "ChatSearchCriteria", | ||
"allOf": [{ "$ref": "context.schema.json#" }], | ||
"properties": { | ||
"type": { "const": "fdc3.chat.searchCriteria" }, | ||
"criteria": { | ||
"type": "array", | ||
"items": { | ||
"anyOf": [ | ||
{ "$ref":"instrument.schema.json#" }, | ||
{ "$ref": "organization.schema.json#" }, | ||
{ "$ref": "contact.schema.json#" }, | ||
{ "type": "string" } | ||
] | ||
} | ||
} | ||
}, | ||
"required": ["criteria"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
website/static/schemas/next/chatSearchCriteria.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://fdc3.finos.org/schemas/next/chatSearchCriteria.schema.json", | ||
"type": "object", | ||
"title": "ChatSearchCriteria", | ||
"allOf": [{ "$ref": "context.schema.json#" }], | ||
"properties": { | ||
"type": { "const": "fdc3.chat.searchCriteria" }, | ||
"criteria": { | ||
"type": "array", | ||
"items": { | ||
"anyOf": [ | ||
{ "$ref":"instrument.schema.json#" }, | ||
{ "$ref": "organization.schema.json#" }, | ||
{ "$ref": "contact.schema.json#" }, | ||
{ "type": "string" } | ||
] | ||
} | ||
} | ||
}, | ||
"required": ["criteria"] | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ha, good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks :)