Skip to content

Commit

Permalink
Redirect to ns admin\serviceaccounts UI to add one
Browse files Browse the repository at this point in the history
  • Loading branch information
radhikav1 committed Sep 27, 2023
1 parent 1b4457c commit f40978d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 5 deletions.
44 changes: 39 additions & 5 deletions app/cdap/components/CaskWizards/AddNamespace/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,55 @@ export default class AddNamespaceWizard extends Component {
namespaceId: newNamespaceId,
});
let buttonLabel = T.translate(`${PREFIX}.callToAction`, { namespaceId: newNamespaceId });
let linkLabel = T.translate('features.Wizard.GoToHomePage');
this.setState({
successInfo: {
message,
buttonLabel,
buttonUrl: window.getAbsUIUrl({
namespaceId: newNamespaceId,
}),
linkLabel,
linkUrl: `${window.getAbsUIUrl({
namespaceId: currentNamespaceId,
})}/control`,
links: this.getLinks(newNamespaceId, currentNamespaceId),
},
});
}

isNamespacedServiceAccountsEnabled() {
return window.CDAP_CONFIG.featureFlags['feature.namespaced.service.accounts.enabled']
? true
: false;
// return true; // for testing , remove before commit
}

getLinks(newNamespaceId, currentNamespaceId) {
if (this.isNamespacedServiceAccountsEnabled()) {
return [
{
linkLabel: T.translate(`${PREFIX}.callToActionAddServiceAccnts`, {
namespaceId: newNamespaceId,
}),
linkUrl: `${window.getAbsUIUrl({
namespaceId: currentNamespaceId,
})}/details/serviceaccounts`,
},
{
linkLabel: T.translate('features.Wizard.GoToHomePage'),
linkUrl: `${window.getAbsUIUrl({
namespaceId: currentNamespaceId,
})}/control`,
},
];
} else {
return [
{
linkLabel: T.translate('features.Wizard.GoToHomePage'),
linkUrl: `${window.getAbsUIUrl({
namespaceId: currentNamespaceId,
})}/control`,
},
];
}
}

render() {
return (
<div>
Expand Down
1 change: 1 addition & 0 deletions app/cdap/text/text-en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3301,6 +3301,7 @@ features:
title: Warning
Wizard:
Add-Namespace:
callToActionAddServiceAccnts: Add service account to '{namespaceId}'
callToAction:
primary: Switch to '{namespaceId}'
headerlabel: Add namespace
Expand Down

0 comments on commit f40978d

Please sign in to comment.