Merge branch 'clean_deprecations' of github.com:Znarvl/backstage into clean_deprecations
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-backend-module-msgraph': patch
|
||||
---
|
||||
|
||||
Added cause information to logged warnings
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/core-components': patch
|
||||
---
|
||||
|
||||
Add optional step to SimpleStepper
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-vault-backend': patch
|
||||
---
|
||||
|
||||
Added `errorHandler()` middleware to `router` to prevent crashes caused by fatal errors in plugin backend
|
||||
@@ -91,3 +91,23 @@ export const CompletionStep = (args: StepperProps) => {
|
||||
};
|
||||
|
||||
CompletionStep.args = defaultArgs;
|
||||
|
||||
export const OptionalStep = (args: StepperProps) => {
|
||||
return (
|
||||
<SimpleStepper {...args}>
|
||||
<SimpleStepperStep
|
||||
title="Step 1 (Optional)"
|
||||
actions={{
|
||||
showSkip: true,
|
||||
}}
|
||||
>
|
||||
<div>This is the content for step 1</div>
|
||||
</SimpleStepperStep>
|
||||
<SimpleStepperStep title="Step 2">
|
||||
<div>This is the content for step 2</div>
|
||||
</SimpleStepperStep>
|
||||
</SimpleStepper>
|
||||
);
|
||||
};
|
||||
|
||||
ConditionalButtons.args = defaultArgs;
|
||||
|
||||
@@ -145,4 +145,32 @@ describe('Stepper', () => {
|
||||
|
||||
expect(rendered.getByText('FinalStepNext')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('Handles skipStep property', async () => {
|
||||
const rendered = await renderInTestApp(
|
||||
<Stepper>
|
||||
<Step title="Step 0" data-testid="step0">
|
||||
<div>step0</div>
|
||||
</Step>
|
||||
<Step title="Step 1" actions={{ showSkip: true }} data-testid="step1">
|
||||
<div>step1</div>
|
||||
</Step>
|
||||
<Step title="Step 2" data-testid="step2">
|
||||
<div>step2</div>
|
||||
</Step>
|
||||
<Step title="Step 3" data-testid="step3">
|
||||
<div>step3</div>
|
||||
</Step>
|
||||
</Stepper>,
|
||||
);
|
||||
|
||||
fireEvent.click(getTextInSlide(rendered, 0)('Next') as Node);
|
||||
expect(rendered.getByText('step1')).toBeInTheDocument();
|
||||
|
||||
fireEvent.click(getTextInSlide(rendered, 1)('Skip') as Node);
|
||||
expect(rendered.getByText('step2')).toBeInTheDocument();
|
||||
|
||||
fireEvent.click(getTextInSlide(rendered, 2)('Back') as Node);
|
||||
expect(rendered.getByText('step1')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -45,6 +45,10 @@ interface NextBtnProps extends CommonBtnProps {
|
||||
last?: boolean;
|
||||
stepIndex: number;
|
||||
}
|
||||
interface SkipBtnProps extends CommonBtnProps {
|
||||
disabled?: boolean;
|
||||
stepIndex: number;
|
||||
}
|
||||
interface BackBtnProps extends CommonBtnProps {
|
||||
disabled?: boolean;
|
||||
stepIndex: number;
|
||||
@@ -71,6 +75,18 @@ const NextBtn = ({
|
||||
</Button>
|
||||
);
|
||||
|
||||
const SkipBtn = ({ text, handleClick, disabled, stepIndex }: SkipBtnProps) => (
|
||||
<Button
|
||||
variant="outlined"
|
||||
color="primary"
|
||||
disabled={disabled}
|
||||
data-testid={`skipButton-${stepIndex}`}
|
||||
onClick={handleClick}
|
||||
>
|
||||
{text || 'Skip'}
|
||||
</Button>
|
||||
);
|
||||
|
||||
const BackBtn = ({ text, handleClick, disabled, stepIndex }: BackBtnProps) => (
|
||||
<Button
|
||||
onClick={handleClick}
|
||||
@@ -138,6 +154,17 @@ export const SimpleStepperFooter = ({
|
||||
stepIndex={stepIndex}
|
||||
/>
|
||||
)}
|
||||
{actions.showSkip && (
|
||||
<SkipBtn
|
||||
text={actions.skipText}
|
||||
handleClick={handleNext}
|
||||
disabled={
|
||||
(!!stepperLength && stepIndex >= stepperLength) ||
|
||||
(!!actions.canSkip && !actions.canSkip())
|
||||
}
|
||||
stepIndex={stepIndex}
|
||||
/>
|
||||
)}
|
||||
{[undefined, true].includes(actions.showNext) && (
|
||||
<NextBtn
|
||||
text={actions.nextText}
|
||||
|
||||
@@ -31,6 +31,11 @@ export type StepActions = {
|
||||
canRestart?: () => boolean;
|
||||
onRestart?: () => void;
|
||||
restartText?: string;
|
||||
|
||||
showSkip?: boolean;
|
||||
canSkip?: () => boolean;
|
||||
onSkip?: () => void;
|
||||
skipText?: string;
|
||||
};
|
||||
|
||||
export type StepProps = {
|
||||
|
||||
@@ -122,7 +122,7 @@ export async function readMicrosoftGraphUsers(
|
||||
120,
|
||||
);
|
||||
} catch (e) {
|
||||
options.logger.warn(`Unable to load photo for ${user.id}`);
|
||||
options.logger.warn(`Unable to load photo for ${user.id}, ${e}`);
|
||||
}
|
||||
|
||||
const entity = await transformer(user, userPhoto);
|
||||
@@ -206,7 +206,7 @@ export async function readMicrosoftGraphUsersInGroups(
|
||||
expand: options.userExpand,
|
||||
});
|
||||
} catch (e) {
|
||||
options.logger.warn(`Unable to load user for ${userId}`);
|
||||
options.logger.warn(`Unable to load user for ${userId}, ${e}`);
|
||||
}
|
||||
if (user) {
|
||||
try {
|
||||
@@ -217,7 +217,7 @@ export async function readMicrosoftGraphUsersInGroups(
|
||||
120,
|
||||
);
|
||||
} catch (e) {
|
||||
options.logger.warn(`Unable to load userphoto for ${userId}`);
|
||||
options.logger.warn(`Unable to load userphoto for ${userId}, ${e}`);
|
||||
}
|
||||
|
||||
const entity = await transformer(user, userPhoto);
|
||||
|
||||
@@ -20,6 +20,7 @@ import { Logger } from 'winston';
|
||||
import express, { Router } from 'express';
|
||||
import { VaultClient } from './vaultApi';
|
||||
import { TaskRunner, PluginTaskScheduler } from '@backstage/backend-tasks';
|
||||
import { errorHandler } from '@backstage/backend-common';
|
||||
|
||||
/**
|
||||
* Environment values needed by the VaultBuilder
|
||||
@@ -145,6 +146,7 @@ export class VaultBuilder {
|
||||
res.json({ items: secrets });
|
||||
});
|
||||
|
||||
router.use(errorHandler());
|
||||
return router;
|
||||
}
|
||||
}
|
||||
|
||||
+22
-11
@@ -7874,14 +7874,14 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"loader-utils@npm:^1.1.0, loader-utils@npm:^1.2.3":
|
||||
version: 1.4.0
|
||||
resolution: "loader-utils@npm:1.4.0"
|
||||
"loader-utils@npm:^1.2.3":
|
||||
version: 1.4.1
|
||||
resolution: "loader-utils@npm:1.4.1"
|
||||
dependencies:
|
||||
big.js: ^5.2.2
|
||||
emojis-list: ^3.0.0
|
||||
json5: ^1.0.1
|
||||
checksum: d150b15e7a42ac47d935c8b484b79e44ff6ab4c75df7cc4cb9093350cf014ec0b17bdb60c5d6f91a37b8b218bd63b973e263c65944f58ca2573e402b9a27e717
|
||||
checksum: ea0b648cba0194e04a90aab6270619f0e35be009e33a443d9e642e93056cd49e6ca4c9678bd1c777a2392551bc5f4d0f24a87f5040608da1274aa84c6eebb502
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -7896,6 +7896,17 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"loader-utils@npm:^2.0.3":
|
||||
version: 2.0.4
|
||||
resolution: "loader-utils@npm:2.0.4"
|
||||
dependencies:
|
||||
big.js: ^5.2.2
|
||||
emojis-list: ^3.0.0
|
||||
json5: ^2.1.2
|
||||
checksum: a5281f5fff1eaa310ad5e1164095689443630f3411e927f95031ab4fb83b4a98f388185bb1fe949e8ab8d4247004336a625e9255c22122b815bb9a4c5d8fc3b7
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"locate-path@npm:^3.0.0":
|
||||
version: 3.0.0
|
||||
resolution: "locate-path@npm:3.0.0"
|
||||
@@ -9756,25 +9767,25 @@ __metadata:
|
||||
linkType: hard
|
||||
|
||||
"react-hot-loader@npm:^4.13.0":
|
||||
version: 4.13.0
|
||||
resolution: "react-hot-loader@npm:4.13.0"
|
||||
version: 4.13.1
|
||||
resolution: "react-hot-loader@npm:4.13.1"
|
||||
dependencies:
|
||||
fast-levenshtein: ^2.0.6
|
||||
global: ^4.3.0
|
||||
hoist-non-react-statics: ^3.3.0
|
||||
loader-utils: ^1.1.0
|
||||
loader-utils: ^2.0.3
|
||||
prop-types: ^15.6.1
|
||||
react-lifecycles-compat: ^3.0.4
|
||||
shallowequal: ^1.1.0
|
||||
source-map: ^0.7.3
|
||||
peerDependencies:
|
||||
"@types/react": "^15.0.0 || ^16.0.0 || ^17.0.0 "
|
||||
react: "^15.0.0 || ^16.0.0 || ^17.0.0 "
|
||||
react-dom: "^15.0.0 || ^16.0.0 || ^17.0.0 "
|
||||
"@types/react": ^15.0.0 || ^16.0.0 || ^17.0.0
|
||||
react: ^15.0.0 || ^16.0.0 || ^17.0.0
|
||||
react-dom: ^15.0.0 || ^16.0.0 || ^17.0.0
|
||||
peerDependenciesMeta:
|
||||
"@types/react":
|
||||
optional: true
|
||||
checksum: effdbf4644ce912ae20ad94be62083970c74b26a59fe24ed0024cf73190a5b3edf59650cb693bdd7b70791df8ab8530de273d73b895c4831a91da8a76683e3a3
|
||||
checksum: f90890d5160dcb2bfae4022cba065d8e5c26b86f34c4604cbbdd39f5e4dfd82c05c317bb05ef3d4da2aa0be7e8e205c905daea1af40d3a7ef0d07c3d289da11c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
@@ -22730,8 +22730,8 @@ __metadata:
|
||||
linkType: hard
|
||||
|
||||
"eslint-plugin-deprecation@npm:^1.3.2":
|
||||
version: 1.3.2
|
||||
resolution: "eslint-plugin-deprecation@npm:1.3.2"
|
||||
version: 1.3.3
|
||||
resolution: "eslint-plugin-deprecation@npm:1.3.3"
|
||||
dependencies:
|
||||
"@typescript-eslint/experimental-utils": ^5.0.0
|
||||
tslib: ^2.3.1
|
||||
@@ -22739,7 +22739,7 @@ __metadata:
|
||||
peerDependencies:
|
||||
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
|
||||
typescript: ^3.7.5 || ^4.0.0
|
||||
checksum: 763776eec6af02ad442bf9ed7e73da198da6969b51418b43f79b3f0a27395e85e9988a3b182e61fab7812a35e17539ba72464d1123a87cc25b195288cbd0c31d
|
||||
checksum: 5e14d7bc8245a14784623632d43a6210880a4aad4c029fd44686a5516c248287f32406ff230f6e9d238784854b24cd09da953ec8f73d9d19a7c4b3905884e432
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user