-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from Cognigy/fix/#87752-message-collation-iss…
…ue-for-data-only-messages fix: #87752 message collation logic overhaul using react context and object oriented approach
- Loading branch information
Showing
8 changed files
with
233 additions
and
7 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,12 +19,16 @@ jobs: | |
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "22" | ||
|
||
- name: Install ESLint | ||
run: | | ||
npm install [email protected] | ||
npm install @microsoft/eslint-formatter-sarif@2.1.7 | ||
npm install @microsoft/eslint-formatter-sarif | ||
- name: Run ESLint | ||
run: npx eslint . | ||
|
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,20 @@ | ||
import React, { createContext } from "react"; | ||
import { CollateMessage } from "src/utils"; | ||
|
||
// Create the context with undefined as initial value | ||
const CollationContext = createContext<CollateMessage | undefined>(undefined); | ||
|
||
// Provider props type | ||
interface CollationProviderProps { | ||
children: React.ReactNode; | ||
sessionId?: string; | ||
} | ||
|
||
// Provider component | ||
function CollationProvider({ children }: CollationProviderProps) { | ||
const instance = new CollateMessage(); | ||
|
||
return <CollationContext.Provider value={instance}>{children}</CollationContext.Provider>; | ||
} | ||
|
||
export { CollationContext, CollationProvider }; |
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