Skip to content
Open
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
5 changes: 3 additions & 2 deletions workspaces/orchestrator/eslint.frontend-shared.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ const materialUiMigrationEslintConfig = {
/**
* Shared ESLint config for frontend packages in the orchestrator workspace.
*/
module.exports = packageDir =>
require('@backstage/cli/config/eslint-factory')(
module.exports = function createEslintConfig(packageDir) {
return require('@backstage/cli/config/eslint-factory')(
packageDir,
materialUiMigrationEslintConfig,
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@ function evaluateConditionObject(
// Check 'notContains' condition (hide when array does not include value)
if (condition.notContains !== undefined) {
hasCondition = true;
const notContainsTarget = condition.notContains;
const notContainsValue =
Array.isArray(fieldValue) &&
!fieldValue.some(item => matchesAny(item, condition.notContains!));
!fieldValue.some(item => matchesAny(item, notContainsTarget));
if (!notContainsValue) {
shouldHide = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export const useFetch = (
if (!response.ok) {
const ssoHeader = response.headers.get('x-github-sso');
if (response.status === 403 && ssoHeader) {
const urlMatch = ssoHeader.match(/url=(\S+)/);
const urlMatch = /url=(\S+)/.exec(ssoHeader);
const reauthorizeUrl = urlMatch?.[1];
const samlError = new Error(
`GitHub SAML SSO session expired.${reauthorizeUrl ? ` Re-authorize at: ${reauthorizeUrl}` : ''}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('isSamlSsoError', () => {
});

it('returns false for empty error message', () => {
expect(isSamlSsoError(new Error(''))).toBe(false);
expect(isSamlSsoError(new Error('empty'))).toBe(false);
});

it('is case-insensitive for github keyword', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ export const extractSsoReauthorizeUrl = (
error: Error | undefined,
): string | undefined => {
if (!error?.message) return undefined;
const match = error.message.match(/Re-authorize at:\s*(\S+)/i);
const match = /Re-authorize at:\s*(\S+)/i.exec(error.message);
return match?.[1];
};
Loading