forked from opensearch-project/OpenSearch-Dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MD][Cred mngment] - PoC Create credential (#9)
[MD][Cred mngment] - PoC Create credential 1. Add UX page for credential creation, with create button call server side creation API 2. Add frontend routing to the UX page
- Loading branch information
Showing
22 changed files
with
516 additions
and
213 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
24 changes: 24 additions & 0 deletions
24
src/plugins/credential_management/public/components/breadsrumbs.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,24 @@ | ||
import { i18n } from '@osd/i18n'; | ||
|
||
export function getListBreadcrumbs() { | ||
return [ | ||
{ | ||
text: i18n.translate('credentialManagement.credentials.listBreadcrumb', { | ||
defaultMessage: 'Credentials', | ||
}), | ||
href: `/`, | ||
}, | ||
]; | ||
} | ||
|
||
export function getCreateBreadcrumbs() { | ||
return [ | ||
...getListBreadcrumbs(), | ||
{ | ||
text: i18n.translate('credentialManagement.credentials.createBreadcrumb', { | ||
defaultMessage: 'Create credentials', | ||
}), | ||
href: `/create`, | ||
}, | ||
]; | ||
} |
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
90 changes: 90 additions & 0 deletions
90
...ential_management/public/components/create_credential_wizard/components/header/header.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,90 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { EuiBetaBadge, EuiSpacer, EuiTitle, EuiText, EuiCode, EuiLink } from '@elastic/eui'; | ||
|
||
import { i18n } from '@osd/i18n'; | ||
import { FormattedMessage } from '@osd/i18n/react'; | ||
import { DocLinksStart } from 'opensearch-dashboards/public'; | ||
import { useOpenSearchDashboards } from '../../../../../../opensearch_dashboards_react/public'; | ||
import { CredentialManagementContext } from '../../../../types'; | ||
// TODO: Update the header content | ||
export const Header = ({ | ||
isBeta = true, | ||
docLinks, | ||
}: { | ||
isBeta?: boolean; | ||
docLinks: DocLinksStart; | ||
}) => { | ||
const changeTitle = useOpenSearchDashboards<CredentialManagementContext>().services.chrome | ||
.docTitle.change; | ||
const createCredentialHeader = i18n.translate('credentialManagement.createIndexPatternHeader', | ||
{ | ||
defaultMessage: 'Create Credential', | ||
} | ||
); | ||
|
||
changeTitle(createCredentialHeader); | ||
|
||
return ( | ||
<div> | ||
<EuiTitle> | ||
<h1> | ||
{createCredentialHeader} | ||
{isBeta ? ( | ||
<> | ||
{' '} | ||
<EuiBetaBadge | ||
label={i18n.translate('credentialManagement.createCredential.betaLabel', { | ||
defaultMessage: 'Beta', | ||
})} | ||
/> | ||
</> | ||
) : null} | ||
</h1> | ||
</EuiTitle> | ||
<EuiSpacer size="s" /> | ||
<EuiText> | ||
<p> | ||
<FormattedMessage | ||
id="credentialManagement.createCredential.description" | ||
defaultMessage="A credential can be attached to multiple sources. For example, {credential} can be attached to two data sources {first} and {second}." | ||
values={{ | ||
credential: <EuiCode>username-password-credential</EuiCode>, | ||
first: <EuiCode>os-service-log</EuiCode>, | ||
second: <EuiCode>os-application-log</EuiCode>, | ||
}} | ||
/> | ||
<br /> | ||
{/* // <HeaderBreadcrumbs /> */} | ||
<EuiLink | ||
href={docLinks.links.noDocumentation.indexPatterns.introduction} | ||
target="_blank" | ||
external | ||
> | ||
<FormattedMessage | ||
id="credentialManagement.createCredential.documentation" | ||
defaultMessage="Read documentation" | ||
/> | ||
</EuiLink> | ||
</p> | ||
</EuiText> | ||
{prompt ? ( | ||
<> | ||
<EuiSpacer size="m" /> | ||
{prompt} | ||
</> | ||
) : null} | ||
</div> | ||
); | ||
}; |
12 changes: 12 additions & 0 deletions
12
...dential_management/public/components/create_credential_wizard/components/header/index.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,12 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export { Header } from './header'; |
Oops, something went wrong.