Skip to content
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

fix: Ui5 codemod adjustments #3449

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/components/BusolaExtensions/BusolaExtensionDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@ export function BusolaExtensionDetails({ name, namespace }) {
<>
<Button
disabled={currentVersion === getLatestVersion()}
icon="forward"
iconEnd
endIcon="forward"
onClick={() => {
const newBusolaExtension = migrateToLatest(configmap);
updateBusolaExtension(newBusolaExtension, configmap);
Expand Down
2 changes: 1 addition & 1 deletion src/components/BusolaExtensions/ColumnsInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function ColumnsInput({ value: columns, setValue: setColumns }) {

if (!columns?.length) {
return (
<MessageStrip design="Warning" hideCloseButton>
<MessageStrip design="Critical" hideCloseButton>
{t('extensibility.starter-modal.messages.no-columns')}
</MessageStrip>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Clusters/components/AddClusterDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function AddClusterDialog() {
open={showWizard}
className="add-cluster-wizard-dialog"
headerText={t('clusters.add.title')}
onAfterClose={() => setShowWizard(false)}
onClose={() => setShowWizard(false)}
>
<ErrorBoundary>
<AddClusterDialogComponent />
Expand Down
6 changes: 2 additions & 4 deletions src/components/Clusters/components/AddClusterWizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ export function AddClusterWizard({ kubeconfig, setKubeconfig, config }) {
className="cluster-wizard__buttons__sticky"
/>
</WizardStep>

{kubeconfig && (!hasAuth || !hasOneContext) && (
<WizardStep
titleText={t('clusters.wizard.authentication')}
Expand Down Expand Up @@ -202,7 +201,6 @@ export function AddClusterWizard({ kubeconfig, setKubeconfig, config }) {
/>
</WizardStep>
)}

<WizardStep
titleText={t('clusters.wizard.storage')}
selected={
Expand Down Expand Up @@ -232,8 +230,8 @@ export function AddClusterWizard({ kubeconfig, setKubeconfig, config }) {
<Popover
opener="storageDescriptionOpener"
open={showTitleDescription}
onAfterClose={() => setShowTitleDescription(false)}
placementType="Right"
onClose={() => setShowTitleDescription(false)}
placement="End"
>
<Text className="description">
{t('clusters.storage.info')}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Clusters/components/AuthForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export function AuthForm({
<div className="add-cluster__content-container">
<Title level="H5">{t('clusters.wizard.update')}</Title>
<MessageStrip
design="Warning"
design="Critical"
hideCloseButton
className="sap-margin-y-small"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export function KubeconfigFileUpload({ onKubeconfigTextAdded }) {
<Popover
opener="descriptionOpener"
open={showTitleDescription}
onAfterClose={() => setShowTitleDescription(false)}
placementType="Right"
onClose={() => setShowTitleDescription(false)}
placement="End"
>
<Text className="description">{t('clusters.wizard.intro')}</Text>
</Popover>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,22 +154,20 @@ export const ClusterValidation = () => {
headerActions={
<>
<Button
icon="play"
iconEnd
endIcon="play"
onClick={scan}
disabled={!!scanProgress || !scanReady}
>
{t('cluster-validation.scan.buttons.scan')}
</Button>
<Button
icon="settings"
iconEnd
endIcon="settings"
onClick={configure}
disabled={!!scanProgress || !scanReady}
>
{t('cluster-validation.scan.buttons.configure')}
</Button>
<Button icon="reset" iconEnd onClick={clear} disabled={!scanProgress}>
<Button endIcon="reset" onClick={clear} disabled={!scanProgress}>
{t('cluster-validation.scan.buttons.clear')}
</Button>
</>
Expand All @@ -193,7 +191,6 @@ export const ClusterValidation = () => {
/>
</FlexBox>
</Section>

{scanProgress && (
<Section
titleText={t('cluster-validation.scan.progress')}
Expand All @@ -213,20 +210,18 @@ export const ClusterValidation = () => {
}
valueState={
scanProgress && scanProgress.total === scanProgress.scanned
? 'Success'
? 'Positive'
: 'None'
}
style={{ width: '96%', padding: '5px 2%' }}
/>
</Section>
)}

{scanResult && (
<Section titleText={t('cluster-validation.scan.result')}>
<ScanResultTree scanResult={scanResult} />
</Section>
)}

{createPortal(
<ClusterValidationConfigurationDialog
show={isConfigurationOpen}
Expand Down Expand Up @@ -275,7 +270,7 @@ const Section = ({
<CardHeader
titleText={titleText}
subtitleText={subtitleText}
status={status}
additionalText={status}
/>
) : (
header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export function ClusterValidationConfigurationDialog({

return (
<Dialog
onAfterClose={onCancel}
onClose={onCancel}
open={show}
headerText={t('cluster-validation.scan.common.headers.configuration')}
footer={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function Modules({ storeKeys, resource, onChange, schema, required }) {
const Items = parsedOptions?.name?.map((name, index) => {
if (!name)
return (
<MessageStrip design="Warning" hideCloseButton>
<MessageStrip design="Critical" hideCloseButton>
{t('extensibility.widgets.modules.no-modules')}
</MessageStrip>
);
Expand Down Expand Up @@ -213,7 +213,7 @@ export function Modules({ storeKeys, resource, onChange, schema, required }) {
</div>
{parsedOptions?.betaAlert && isBeta && isChecked ? (
<MessageStrip
design="Warning"
design="Critical"
hideCloseButton
className="alert sap-margin-y-small"
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Extensibility/components-form/MultiType.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function MultiType({
<SegmentedButtonItem
compact
key={type}
pressed={type === selectedType}
selected={type === selectedType}
onClick={() => {
onChange &&
onChange({
Expand Down
3 changes: 1 addition & 2 deletions src/components/Extensibility/components/ExternalLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ export const ExternalLink = ({
if (structure.type === 'button') {
return (
<Button
icon="inspect"
iconEnd
className="sap-margin-x-tiny"
endIcon="inspect"
onClick={() => {
const newWindow = window.open(href, '_blank', 'noopener, noreferrer');
if (newWindow) newWindow.opener = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ export function ExternalLinkButton({ structure }) {

return (
<Button
icon="inspect"
iconEnd
endIcon="inspect"
design={structure?.emphasized ? 'Emphasized' : 'Default'}
inline={true}
onClick={() => {
Expand Down
3 changes: 1 addition & 2 deletions src/components/Extensibility/components/ResourceButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ export function ResourceButton({
return (
<Button
design="Emphasized"
icon={structure?.icon}
iconEnd
endIcon={structure?.icon}
inline={true}
onClick={() =>
navigate(
Expand Down
2 changes: 1 addition & 1 deletion src/components/Extensibility/components/Wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function Wizard({ value, structure, singleRootResource }) {
open={showWizard}
className="wizard-dialog"
headerText={t('extensibility.wizard.headers.name') + ' ' + wizardName}
onAfterClose={() => setShowWizard(false)}
onClose={() => setShowWizard(false)}
>
<ErrorBoundary onClose={handleCloseModal}>
<ExtensibilityWizard
Expand Down
4 changes: 2 additions & 2 deletions src/components/KymaModules/KymaModulesAddModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export default function KymaModulesAddModule({
{checkIfSelectedModuleIsBeta() ? (
<MessageStrip
key={'beta'}
design="Warning"
design="Critical"
hideCloseButton
className="sap-margin-top-small"
>
Expand All @@ -273,7 +273,7 @@ export default function KymaModulesAddModule({
</MessageStrip>
) : (
<MessageStrip
design="Warning"
design="Critical"
hideCloseButton
className="sap-margin-top-small"
>
Expand Down
4 changes: 2 additions & 2 deletions src/components/KymaModules/KymaModulesCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ export default function KymaModulesCreate({ resource, ...props }) {
{checkIfSelectedModuleIsBeta() ? (
<MessageStrip
key={'beta'}
design="Warning"
design="Critical"
hideCloseButton
className="sap-margin-top-tiny"
>
Expand All @@ -429,7 +429,7 @@ export default function KymaModulesCreate({ resource, ...props }) {
</>
) : (
<MessageStrip
design="Warning"
design="Critical"
hideCloseButton
className="sap-margin-top-small"
>
Expand Down
4 changes: 1 addition & 3 deletions src/components/Preferences/Preferences.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function Preferences() {

return (
<Dialog
onAfterClose={handleCloseModal}
onClose={handleCloseModal}
open={isModalOpen}
headerText={t('navigation.preferences.title')}
footer={
Expand All @@ -86,7 +86,6 @@ export function Preferences() {
<TabContainer
tabLayout="Inline"
contentBackgroundDesign="Transparent"
fixed
>
<Tab
style={{ padding: '-16px -32px' }}
Expand All @@ -107,7 +106,6 @@ export function Preferences() {
<TabContainer
tabLayout="Inline"
contentBackgroundDesign="Transparent"
fixed
>
<Tab
key="cluster-interaction"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ export default function ResourceValidationSettings() {
{!choosePolicies && (
<Button
design="Transparent"
icon="customize"
iconEnd
endIcon="customize"
onClick={enablePolicyCustomization}
>
{t('settings.clusters.resourcesValidation.customize')}
Expand All @@ -162,8 +161,7 @@ export default function ResourceValidationSettings() {
{choosePolicies && (
<Button
design="Transparent"
icon="reset"
iconEnd
endIcon="reset"
onClick={disablePolicyCustomization}
>
{t('settings.clusters.resourcesValidation.reset')}
Expand Down
2 changes: 1 addition & 1 deletion src/resources/Events/EventDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const Specification = event => {
aria-label="Warning"
icon={<Icon name="warning" />}
className="has-tooltip sap-margin-begin-tiny"
state="Warning"
state="Critical"
/>
) : (
<ObjectStatus
Expand Down
2 changes: 1 addition & 1 deletion src/resources/Events/EventList.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function EventList({
aria-label="Warning"
icon={<Icon name="warning" />}
className="has-tooltip"
state="Warning"
state="Critical"
/>
</Tooltip>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const ValidationWarnings = ({ resource, validationSchema }) => {
if (!validationSchema)
return (
<MessageStrip
design="Warning"
design="Critical"
hideCloseButton
className="sap-margin-bottom-small"
>
Expand Down
6 changes: 4 additions & 2 deletions src/resources/Namespaces/YamlUpload/YamlResourcesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,17 @@ export function YamlResourcesList({ resourcesData }) {
header={
<CardHeader
titleText={t('upload-yaml.upload-progress')}
status={resources?.length + '/' + uploadedResources?.length}
additionalText={
resources?.length + '/' + uploadedResources?.length
}
/>
}
>
<ProgressIndicator
value={getPercentage()}
valueState={
resources?.length === uploadedResources?.length
? 'Success'
? 'Positive'
: 'None'
}
className="sap-margin-x-small"
Expand Down
2 changes: 1 addition & 1 deletion src/resources/Namespaces/YamlUpload/YamlUploadDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function YamlUploadDialog() {
return (
<Dialog
open={openAdd}
onAfterClose={() => setShowAdd(false)}
onClose={() => setShowAdd(false)}
headerText={t('upload-yaml.title')}
footer={<Bar design="Footer" endContent={<>{actions}</>} />}
className="yaml-upload-modal__dialog"
Expand Down
2 changes: 1 addition & 1 deletion src/resources/RoleBindings/GenericRoleBindingCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function GenericRoleBindingCreate({
/>
{!jp.value(binding, '$.subjects.length') && (
<MessageStrip
design="Warning"
design="Critical"
hideCloseButton
className="sap-margin-top-small"
>
Expand Down
2 changes: 1 addition & 1 deletion src/resources/Roles/InvalidRoleError.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function InvalidRoleError({ rule }) {
return (
isRuleInvalid(rule) && (
<MessageStrip
design="Warning"
design="Critical"
hideCloseButton
className="sap-margin-top-small"
>
Expand Down
3 changes: 1 addition & 2 deletions src/resources/Roles/RuleInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export function RuleInput({ rule, rules, setRules }) {
newItemActionWidth={2}
newItemAction={
loading ? (
<BusyIndicator size="Small" active={true} delay="0" />
<BusyIndicator size="S" active={true} delay="0" />
) : (
<Button
design="Transparent"
Expand All @@ -158,7 +158,6 @@ export function RuleInput({ rule, rules, setRules }) {
</Button>,
]}
/>

{loadable && (
<MessageStrip
design="Information"
Expand Down
2 changes: 1 addition & 1 deletion src/resources/ServiceAccounts/ServiceAccountCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export default function ServiceAccountCreate({
}
/>
{shouldCreateSecret && (
<MessageStrip design="Warning" hideCloseButton>
<MessageStrip design="Critical" hideCloseButton>
{t('service-accounts.associated-secret.warning')}
</MessageStrip>
)}
Expand Down
Loading
Loading