-
Notifications
You must be signed in to change notification settings - Fork 918
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[discover] update interfaces and selector (#7835)
* dataset handler and move manager Signed-off-by: Kawika Avilla <[email protected]> * Adds new Data selector Signed-off-by: Ashwin P Chandran <[email protected]> fixes loading state Signed-off-by: Ashwin P Chandran <[email protected]> * start wiring into the selector Signed-off-by: Kawika Avilla <[email protected]> no more white screen Signed-off-by: Kawika Avilla <[email protected]> updating handler Signed-off-by: Kawika Avilla <[email protected]> rendering data Signed-off-by: Kawika Avilla <[email protected]> data structures working ok Signed-off-by: Kawika Avilla <[email protected]> need to add datasets Signed-off-by: Kawika Avilla <[email protected]> clean up Signed-off-by: Kawika Avilla <[email protected]> deleted unneeded types Signed-off-by: Kawika Avilla <[email protected]> * still working on the data structure and field Signed-off-by: Kawika Avilla <[email protected]> * still not working. the leaf logic isnt right i believe Signed-off-by: Kawika Avilla <[email protected]> * indices Signed-off-by: Kawika Avilla <[email protected]> * pushing datasets Signed-off-by: Kawika Avilla <[email protected]> * fix index pattern Signed-off-by: Kawika Avilla <[email protected]> * fixes with column Signed-off-by: Kawika Avilla <[email protected]> * working creation step Signed-off-by: Kawika Avilla <[email protected]> * get dataset from state in use index pattern Signed-off-by: Kawika Avilla <[email protected]> * dataset selector working Signed-off-by: Kawika Avilla <[email protected]> * update ppl interceptor Signed-off-by: Kawika Avilla <[email protected]> * add dataset service Signed-off-by: Kawika Avilla <[email protected]> * language service Signed-off-by: Kawika Avilla <[email protected]> * wired up but the dataset is off Signed-off-by: Kawika Avilla <[email protected]> * Address review comments Signed-off-by: Kawika Avilla <[email protected]> * ppl query Signed-off-by: Kawika Avilla <[email protected]> * dql and lucene working again Signed-off-by: Kawika Avilla <[email protected]> * fix issue that would deselect dataset Signed-off-by: Kawika Avilla <[email protected]> * language switches and sets the query correctly Signed-off-by: Kawika Avilla <[email protected]> * upating query Signed-off-by: Kawika Avilla <[email protected]> * fix the styling a little Signed-off-by: Kawika Avilla <[email protected]> * little bit width Signed-off-by: Kawika Avilla <[email protected]> * submit on update Signed-off-by: Kawika Avilla <[email protected]> * fix sql Signed-off-by: Kawika Avilla <[email protected]> * ppl working better Signed-off-by: Kawika Avilla <[email protected]> * need to still fix the aggregations Signed-off-by: Kawika Avilla <[email protected]> * gotta fix the aggs and still need to update dql lucene dataset Signed-off-by: Kawika Avilla <[email protected]> * use patch Signed-off-by: Kawika Avilla <[email protected]> * Metadata slice Signed-off-by: Kawika Avilla <[email protected]> * index pattern updates Signed-off-by: Kawika Avilla <[email protected]> * types and datasource prepend Signed-off-by: Kawika Avilla <[email protected]> --------- Signed-off-by: Kawika Avilla <[email protected]> Signed-off-by: Ashwin P Chandran <[email protected]> Co-authored-by: Ashwin P Chandran <[email protected]>
- Loading branch information
Showing
115 changed files
with
2,171 additions
and
3,915 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
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,46 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { DataStructure, CachedDataStructure } from './types'; | ||
|
||
export interface DataStructureCache { | ||
get: (id: string) => CachedDataStructure | undefined; | ||
set: (id: string, value: CachedDataStructure) => CachedDataStructure; | ||
clear: (id: string) => void; | ||
clearAll: () => void; | ||
} | ||
|
||
export function createDataStructureCache(): DataStructureCache { | ||
const cache: Record<string, CachedDataStructure> = {}; | ||
|
||
const dataStructureCache: DataStructureCache = { | ||
get: (id: string) => { | ||
return cache[id]; | ||
}, | ||
set: (id: string, value: CachedDataStructure) => { | ||
cache[id] = value; | ||
return value; | ||
}, | ||
clear: (id: string) => { | ||
delete cache[id]; | ||
}, | ||
// TODO: call this on log out | ||
clearAll: () => { | ||
Object.keys(cache).forEach((key) => delete cache[key]); | ||
}, | ||
}; | ||
|
||
return dataStructureCache; | ||
} | ||
|
||
export function toCachedDataStructure(dataStructure: DataStructure): CachedDataStructure { | ||
return { | ||
id: dataStructure.id, | ||
title: dataStructure.title, | ||
type: dataStructure.type, | ||
parent: dataStructure.parent?.id || '', | ||
children: dataStructure.children?.map((child) => child.id) || [], | ||
}; | ||
} |
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
Oops, something went wrong.