-
Notifications
You must be signed in to change notification settings - Fork 0
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
Language with dataset service #70
base: kavilla/dataset-manager
Are you sure you want to change the base?
Conversation
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
groupName: 'Index patterns', | ||
children: indexPatterns, | ||
isLeaf: false, | ||
hasNext: false, | ||
}; |
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.
nice
* Retrieves the supported query languages for this dataset type. | ||
* @returns {Promise<string[]>} A promise that resolves to an array of supported language names. | ||
*/ | ||
supportedLanguages: () => string[]; |
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.
pass the dataset here. ppl and sql arent supported in opensearch serverless yet
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
* Any modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
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.
/* | |
* SPDX-License-Identifier: Apache-2.0 | |
* | |
* The OpenSearch Contributors require contributions made to | |
* this file be licensed under the Apache-2.0 license or a | |
* compatible open source license. | |
* | |
* Any modifications Copyright OpenSearch Contributors. See | |
* GitHub history for details. | |
*/ | |
/* | |
* Licensed to Elasticsearch B.V. under one or more contributor | |
* license agreements. See the NOTICE file distributed with | |
* this work for additional information regarding copyright | |
* ownership. Elasticsearch B.V. licenses this file to you under | |
* the Apache License, Version 2.0 (the "License"); you may | |
* not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, | |
* software distributed under the License is distributed on an | |
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
* KIND, either express or implied. See the License for the | |
* specific language governing permissions and limitations | |
* under the License. | |
*/ |
public initDataset = async () => { | ||
await this.datasetService.init(); | ||
}; | ||
|
||
public registerType = (type: DatasetTypeConfig) => { | ||
this.datasetService.registerType(type); | ||
}; | ||
|
||
public getDatasetType = (type: string) => { | ||
return this.datasetService.getType(type); | ||
}; | ||
|
||
public getDatasetTypes = () => { | ||
return this.datasetService.getTypes(); | ||
}; | ||
|
||
public getLanguage = (language: string) => { | ||
return this.languageService.getLanguage(language); | ||
}; | ||
|
||
private getDefaultLanguage() { | ||
return ( | ||
this.storage.get('userQueryLanguage') || | ||
this.uiSettings.get(UI_SETTINGS.SEARCH_QUERY_LANGUAGE) | ||
); | ||
} | ||
|
||
public getLanguages = () => { | ||
return this.languageService.getLanguages(); | ||
}; | ||
|
||
public registerLanguage = (languageConfig: LanguageConfig) => { | ||
this.languageService.registerLanguage(languageConfig); | ||
}; |
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.
just export the services. Don't re-export each function like this. Its easier. Only export functions here if you need to combine logic between the two services or something else
const existingIndexPattern = await indexPatterns.get(dataFrame.name!, true); | ||
const dataset = await indexPatterns.create( | ||
dataFrameToSpec(dataFrame, existingIndexPattern?.id), | ||
!existingIndexPattern?.id | ||
); | ||
indexPatterns.saveToCache(dataSetName, dataSet); | ||
indexPatterns.saveToCache(dataset.id!, dataset); |
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.
Why do we still need this?
}; | ||
|
||
const enhancement = this.props.settings.getQueryEnhancements(newQuery.language); | ||
const fields = enhancement?.fields; | ||
const fields = language?.fields; |
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.
const fields = language?.fields; | |
const fieldProps = language?.fields; |
@@ -111,14 +108,17 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) { | |||
return { | |||
from: | |||
props.dateRangeFrom || | |||
queryUiEnhancement?.dateRange?.initialFrom || | |||
queryLanguage?.searchBar?.dateRange?.initialFrom || |
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.
nit: Do we need initialFrom and intiialTo? was this there in the legacy languages too?
initialFrom: moment().subtract(2, 'days').toISOString(), | ||
initialTo: moment().add(2, 'days').toISOString(), |
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.
Why do we need this?
@@ -3,85 +3,105 @@ | |||
* SPDX-License-Identifier: Apache-2.0 | |||
*/ | |||
|
|||
/* |
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.
2 Licences
@@ -151,7 +145,7 @@ export const DatasetExplorer = ({ | |||
</div> | |||
); | |||
})} | |||
{!!!path[path.length - 1]?.isLeaf && <LoadingEmptyColumn isLoading={loading} />} | |||
{!!!path[path.length - 1]?.hasNext && <LoadingEmptyColumn isLoading={loading} />} |
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.
the boolean logic here needs to be flipped
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Description
Issues Resolved
Screenshot
Testing the changes
Check List
yarn test:jest
yarn test:jest_integration