-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
User and applications suggestions for entities (#15345)
* add metapilot app oss side config * add metapilot app oss side config * suggestions changes * locales * pushing progress * localisation * add suggestions count button * locales * fix tests * add tests * fix sonar issues * fix tests and cleanup * fix unit tests (cherry picked from commit 14f280b)
- Loading branch information
Showing
45 changed files
with
1,223 additions
and
133 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
openmetadata-ui/src/main/resources/ui/cypress/common/Utils/Login.ts
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,48 @@ | ||
/* | ||
* Copyright 2024 Collate. | ||
* Licensed 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. | ||
*/ | ||
import { interceptURL } from '../common'; | ||
|
||
/** | ||
* Try Performing login with the given username and password. | ||
* Particularly used for testing login. | ||
* | ||
* @param {string} username - The username for login | ||
* @param {string} password - The password for login | ||
* @return {void} | ||
*/ | ||
export const performLogin = (username, password) => { | ||
cy.visit('/'); | ||
interceptURL('POST', '/api/v1/users/login', 'loginUser'); | ||
cy.get('[id="email"]').should('be.visible').clear().type(username); | ||
cy.get('[id="password"]').should('be.visible').clear().type(password); | ||
|
||
// Don't want to show any popup in the tests | ||
cy.setCookie(`STAR_OMD_USER_${username.split('@')[0]}`, 'true'); | ||
|
||
// Get version and set cookie to hide version banner | ||
cy.request({ | ||
method: 'GET', | ||
url: `api/v1/system/version`, | ||
}).then((res) => { | ||
const version = res.body.version; | ||
const versionCookie = `VERSION_${version | ||
.split('-')[0] | ||
.replaceAll('.', '_')}`; | ||
|
||
cy.setCookie(versionCookie, 'true'); | ||
window.localStorage.setItem('loggedInUsers', username.split('@')[0]); | ||
}); | ||
|
||
cy.get('.ant-btn').contains('Login').should('be.visible').click(); | ||
cy.wait('@loginUser'); | ||
}; |
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
10 changes: 10 additions & 0 deletions
10
openmetadata-ui/src/main/resources/ui/cypress/tsconfig.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,10 @@ | ||
{ | ||
"compilerOptions": { | ||
"rootDir": "./", | ||
"downlevelIteration": true, | ||
"target": "ES5", | ||
"lib": ["dom", "dom.iterable", "ES2020.Promise", "es2021"], | ||
"types": ["cypress", "node", "@cypress/grep"] | ||
}, | ||
"include": ["./**/*.ts"] | ||
} |
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
12 changes: 0 additions & 12 deletions
12
openmetadata-ui/src/main/resources/ui/src/assets/svg/MetaPilotApplication.svg
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
openmetadata-ui/src/main/resources/ui/src/components/AppRouter/withSuggestions.tsx
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,24 @@ | ||
/* | ||
* Copyright 2024 Collate. | ||
* Licensed 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. | ||
*/ | ||
import React, { FC } from 'react'; | ||
import SuggestionsProvider from '../Suggestions/SuggestionsProvider/SuggestionsProvider'; | ||
|
||
export const withSuggestions = | ||
(Component: FC) => | ||
(props: JSX.IntrinsicAttributes & { children?: React.ReactNode }) => { | ||
return ( | ||
<SuggestionsProvider> | ||
<Component {...props} /> | ||
</SuggestionsProvider> | ||
); | ||
}; |
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
18 changes: 18 additions & 0 deletions
18
...c/components/Settings/Applications/ApplicationsProvider/ApplicationsProvider.interface.ts
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,18 @@ | ||
/* | ||
* Copyright 2024 Collate. | ||
* Licensed 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. | ||
*/ | ||
import { App } from '../../../../generated/entity/applications/app'; | ||
|
||
export type ApplicationsContextType = { | ||
applications: App[]; | ||
loading: boolean; | ||
}; |
Oops, something went wrong.