ESLint: Set trailingComma to all and run lint fix
This commit is contained in:
parent
e9025e460c
commit
eafcd200ae
152 changed files with 871 additions and 867 deletions
|
|
@ -129,7 +129,7 @@ module.exports = defineConfig([
|
|||
tsxSingleQuote: true,
|
||||
tsSingleQuote: true,
|
||||
printWidth: 80,
|
||||
trailingComma: 'es5',
|
||||
trailingComma: 'all',
|
||||
}],
|
||||
},
|
||||
settings: {
|
||||
|
|
|
|||
|
|
@ -158,8 +158,8 @@ test('Create a blueprint with Filesystem customization', async ({
|
|||
await frame.getByRole('option', { name: '/usr' }).click();
|
||||
await expect(
|
||||
frame.getByText(
|
||||
'Sub-directories for the /usr mount point are no longer supported'
|
||||
)
|
||||
'Sub-directories for the /usr mount point are no longer supported',
|
||||
),
|
||||
).toBeVisible();
|
||||
|
||||
await frame.getByRole('button', { name: '/usr' }).click();
|
||||
|
|
|
|||
|
|
@ -66,9 +66,9 @@ test('Create a blueprint with Firewall customization', async ({
|
|||
await expect(
|
||||
frame
|
||||
.getByText(
|
||||
'Expected format: <port/port-name>:<protocol>. Example: 8080:tcp, ssh:tcp'
|
||||
'Expected format: <port/port-name>:<protocol>. Example: 8080:tcp, ssh:tcp',
|
||||
)
|
||||
.nth(0)
|
||||
.nth(0),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
|
|
@ -76,7 +76,7 @@ test('Create a blueprint with Firewall customization', async ({
|
|||
await frame.getByPlaceholder('Add disabled service').fill('1');
|
||||
await frame.getByRole('button', { name: 'Add disabled service' }).click();
|
||||
await expect(
|
||||
frame.getByText('Expected format: <service-name>. Example: sshd').nth(0)
|
||||
frame.getByText('Expected format: <service-name>. Example: sshd').nth(0),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
|
|
@ -84,7 +84,7 @@ test('Create a blueprint with Firewall customization', async ({
|
|||
await frame.getByPlaceholder('Add enabled service').fill('ťčš');
|
||||
await frame.getByRole('button', { name: 'Add enabled service' }).click();
|
||||
await expect(
|
||||
frame.getByText('Expected format: <service-name>. Example: sshd').nth(1)
|
||||
frame.getByText('Expected format: <service-name>. Example: sshd').nth(1),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ test('Create a blueprint with Hostname customization', async ({
|
|||
await fillInImageOutputGuest(page);
|
||||
await page.getByRole('button', { name: 'Hostname' }).click();
|
||||
await expect(
|
||||
page.getByRole('textbox', { name: 'hostname input' })
|
||||
page.getByRole('textbox', { name: 'hostname input' }),
|
||||
).toHaveValue(hostname + 'edited');
|
||||
await page.getByRole('button', { name: 'Cancel' }).click();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -51,26 +51,26 @@ test('Create a blueprint with Kernel customization', async ({
|
|||
await frame.getByRole('button', { name: 'Add kernel argument' }).click();
|
||||
await expect(
|
||||
frame.getByText(
|
||||
'Expected format: <kernel-argument>. Example: console=tty0'
|
||||
)
|
||||
'Expected format: <kernel-argument>. Example: console=tty0',
|
||||
),
|
||||
).toBeVisible();
|
||||
await frame.getByPlaceholder('Select kernel package').fill('new-package');
|
||||
await frame
|
||||
.getByRole('option', { name: 'Custom kernel package "new-' })
|
||||
.click();
|
||||
await expect(
|
||||
frame.getByRole('heading', { name: 'Warning alert: Custom kernel' })
|
||||
frame.getByRole('heading', { name: 'Warning alert: Custom kernel' }),
|
||||
).toBeVisible();
|
||||
await frame.getByRole('button', { name: 'Clear input' }).first().click();
|
||||
await frame.getByRole('button', { name: 'Menu toggle' }).click();
|
||||
await expect(
|
||||
frame.getByRole('option', { name: 'new-package' })
|
||||
frame.getByRole('option', { name: 'new-package' }),
|
||||
).toBeVisible();
|
||||
await frame.getByPlaceholder('Select kernel package').fill('f');
|
||||
await expect(
|
||||
frame.getByRole('option', {
|
||||
name: '"f" is not a valid kernel package name',
|
||||
})
|
||||
}),
|
||||
).toBeVisible();
|
||||
await frame.getByPlaceholder('Add kernel argument').fill('console=tty0');
|
||||
await frame.getByRole('button', { name: 'Add kernel argument' }).click();
|
||||
|
|
@ -121,7 +121,7 @@ test('Create a blueprint with Kernel customization', async ({
|
|||
await fillInImageOutputGuest(frame);
|
||||
await frame.getByRole('button', { name: 'Kernel' }).click();
|
||||
await expect(frame.getByPlaceholder('Select kernel package')).toHaveValue(
|
||||
'kernel'
|
||||
'kernel',
|
||||
);
|
||||
await expect(frame.getByText('rootwait')).toBeVisible();
|
||||
await expect(frame.getByText('console=tty0')).toBeVisible();
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ test('Create a blueprint with Locale customization', async ({
|
|||
await expect(
|
||||
frame.getByRole('button', {
|
||||
name: 'Close Western Frisian - Germany (fy_DE.UTF-8)',
|
||||
})
|
||||
}),
|
||||
).toBeEnabled();
|
||||
await frame
|
||||
.getByRole('button', {
|
||||
|
|
@ -58,7 +58,7 @@ test('Create a blueprint with Locale customization', async ({
|
|||
await expect(
|
||||
frame.getByRole('button', {
|
||||
name: 'Close Western Frisian - Germany (fy_DE.UTF-8)',
|
||||
})
|
||||
}),
|
||||
).toBeHidden();
|
||||
await frame.getByPlaceholder('Select a language').fill('fy');
|
||||
await frame
|
||||
|
|
@ -67,20 +67,20 @@ test('Create a blueprint with Locale customization', async ({
|
|||
await expect(
|
||||
frame.getByRole('button', {
|
||||
name: 'Close Western Frisian - Germany (fy_DE.UTF-8)',
|
||||
})
|
||||
}),
|
||||
).toBeEnabled();
|
||||
await frame.getByPlaceholder('Select a language').fill('aa');
|
||||
await frame
|
||||
.getByRole('option', { name: 'aa - Djibouti (aa_DJ.UTF-8)' })
|
||||
.click();
|
||||
await expect(
|
||||
frame.getByRole('button', { name: 'Close aa - Djibouti (aa_DJ.UTF-8)' })
|
||||
frame.getByRole('button', { name: 'Close aa - Djibouti (aa_DJ.UTF-8)' }),
|
||||
).toBeEnabled();
|
||||
await frame.getByPlaceholder('Select a language').fill('aa');
|
||||
await expect(
|
||||
frame.getByText(
|
||||
'aa - Djibouti (aa_DJ.UTF-8)Language already addedaa - Eritrea (aa_ER.UTF-8)aa - Ethiopia (aa_ET.UTF-8)'
|
||||
)
|
||||
'aa - Djibouti (aa_DJ.UTF-8)Language already addedaa - Eritrea (aa_ER.UTF-8)aa - Ethiopia (aa_ET.UTF-8)',
|
||||
),
|
||||
).toBeAttached();
|
||||
await frame.getByPlaceholder('Select a language').fill('xxx');
|
||||
await expect(frame.getByText('No results found for')).toBeAttached();
|
||||
|
|
@ -104,17 +104,17 @@ test('Create a blueprint with Locale customization', async ({
|
|||
await expect(
|
||||
frame.getByRole('button', {
|
||||
name: 'Close Western Frisian - Germany (fy_DE.UTF-8)',
|
||||
})
|
||||
}),
|
||||
).toBeEnabled();
|
||||
await expect(
|
||||
frame.getByRole('button', { name: 'Close aa - Djibouti (aa_DJ.UTF-8)' })
|
||||
frame.getByRole('button', { name: 'Close aa - Djibouti (aa_DJ.UTF-8)' }),
|
||||
).toBeEnabled();
|
||||
await frame.getByPlaceholder('Select a language').fill('aa');
|
||||
await frame
|
||||
.getByRole('option', { name: 'aa - Eritrea (aa_ER.UTF-8)' })
|
||||
.click();
|
||||
await expect(
|
||||
frame.getByRole('button', { name: 'Close aa - Eritrea (aa_ER.UTF-8)' })
|
||||
frame.getByRole('button', { name: 'Close aa - Eritrea (aa_ER.UTF-8)' }),
|
||||
).toBeEnabled();
|
||||
await frame.getByRole('button', { name: 'Clear input' }).click();
|
||||
await frame.getByRole('button', { name: 'Menu toggle' }).nth(1).click();
|
||||
|
|
@ -143,16 +143,16 @@ test('Create a blueprint with Locale customization', async ({
|
|||
await expect(
|
||||
frame.getByRole('button', {
|
||||
name: 'Close Western Frisian - Germany (fy_DE.UTF-8)',
|
||||
})
|
||||
}),
|
||||
).toBeEnabled();
|
||||
await expect(
|
||||
frame.getByRole('button', { name: 'Close aa - Djibouti (aa_DJ.UTF-8)' })
|
||||
frame.getByRole('button', { name: 'Close aa - Djibouti (aa_DJ.UTF-8)' }),
|
||||
).toBeEnabled();
|
||||
await expect(
|
||||
frame.getByRole('button', { name: 'Close aa - Eritrea (aa_ER.UTF-8)' })
|
||||
frame.getByRole('button', { name: 'Close aa - Eritrea (aa_ER.UTF-8)' }),
|
||||
).toBeEnabled();
|
||||
await expect(frame.getByPlaceholder('Select a keyboard')).toHaveValue(
|
||||
'ANSI-dvorak'
|
||||
'ANSI-dvorak',
|
||||
);
|
||||
await page.getByRole('button', { name: 'Cancel' }).click();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -60,36 +60,36 @@ test('Create a blueprint with OpenSCAP customization', async ({
|
|||
name: 'Draggable row draggable button /tmp xfs 1 GiB',
|
||||
})
|
||||
.getByRole('button')
|
||||
.nth(3)
|
||||
.nth(3),
|
||||
).toBeVisible();
|
||||
await frame.getByRole('button', { name: 'Additional packages' }).click();
|
||||
await frame.getByRole('button', { name: 'Selected (8)' }).click();
|
||||
await expect(frame.getByRole('gridcell', { name: 'aide' })).toBeVisible();
|
||||
await expect(frame.getByRole('gridcell', { name: 'chrony' })).toBeVisible();
|
||||
await expect(
|
||||
frame.getByRole('gridcell', { name: 'firewalld' })
|
||||
frame.getByRole('gridcell', { name: 'firewalld' }),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
frame.getByRole('gridcell', { name: 'libpwquality' })
|
||||
frame.getByRole('gridcell', { name: 'libpwquality' }),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
frame.getByRole('gridcell', { name: 'libselinux' })
|
||||
frame.getByRole('gridcell', { name: 'libselinux' }),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
frame.getByRole('gridcell', { name: 'nftables' })
|
||||
frame.getByRole('gridcell', { name: 'nftables' }),
|
||||
).toBeVisible();
|
||||
await expect(frame.getByRole('gridcell', { name: 'sudo' })).toBeVisible();
|
||||
await expect(
|
||||
frame.getByRole('gridcell', { name: 'systemd-journal-remote' })
|
||||
frame.getByRole('gridcell', { name: 'systemd-journal-remote' }),
|
||||
).toBeVisible();
|
||||
await frame.getByRole('button', { name: 'Systemd services' }).click();
|
||||
await expect(
|
||||
frame.getByText('Required by OpenSCAPcrondfirewalldsystemd-journald')
|
||||
frame.getByText('Required by OpenSCAPcrondfirewalldsystemd-journald'),
|
||||
).toBeVisible();
|
||||
await frame.getByPlaceholder('Add masked service').fill('nftables');
|
||||
await frame.getByPlaceholder('Add masked service').press('Enter');
|
||||
await expect(
|
||||
frame.getByText('Masked service already exists')
|
||||
frame.getByText('Masked service already exists'),
|
||||
).toBeVisible();
|
||||
await expect(frame.getByText('Required by OpenSCAPcupsnfs-')).toBeVisible();
|
||||
await expect(frame.getByText('nfs-server')).toBeVisible();
|
||||
|
|
@ -123,38 +123,38 @@ test('Create a blueprint with OpenSCAP customization', async ({
|
|||
await frame.getByRole('button', { name: 'Kernel' }).click();
|
||||
|
||||
await expect(
|
||||
frame.getByText('Required by OpenSCAPaudit_backlog_limit=8192audit=')
|
||||
frame.getByText('Required by OpenSCAPaudit_backlog_limit=8192audit='),
|
||||
).toBeVisible();
|
||||
await frame.getByRole('button', { name: 'Additional packages' }).click();
|
||||
await frame.getByRole('button', { name: 'Selected (10)' }).click();
|
||||
await expect(frame.getByRole('gridcell', { name: 'aide' })).toBeVisible();
|
||||
await expect(
|
||||
frame.getByRole('gridcell', { name: 'audit-libs' })
|
||||
frame.getByRole('gridcell', { name: 'audit-libs' }),
|
||||
).toBeVisible();
|
||||
await expect(frame.getByRole('gridcell', { name: 'chrony' })).toBeVisible();
|
||||
await expect(
|
||||
frame.getByRole('gridcell', { name: 'firewalld' })
|
||||
frame.getByRole('gridcell', { name: 'firewalld' }),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
frame.getByRole('gridcell', { name: 'libpwquality' })
|
||||
frame.getByRole('gridcell', { name: 'libpwquality' }),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
frame.getByRole('gridcell', { name: 'libselinux' })
|
||||
frame.getByRole('gridcell', { name: 'libselinux' }),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
frame.getByRole('gridcell', { name: 'nftables' })
|
||||
frame.getByRole('gridcell', { name: 'nftables' }),
|
||||
).toBeVisible();
|
||||
await expect(frame.getByRole('gridcell', { name: 'sudo' })).toBeVisible();
|
||||
await frame.getByRole('button', { name: 'Systemd services' }).click();
|
||||
await expect(
|
||||
frame.getByText(
|
||||
'Required by OpenSCAPauditdcrondfirewalldsystemd-journald'
|
||||
)
|
||||
'Required by OpenSCAPauditdcrondfirewalldsystemd-journald',
|
||||
),
|
||||
).toBeVisible();
|
||||
await frame.getByPlaceholder('Add masked service').fill('nftables');
|
||||
await frame.getByPlaceholder('Add masked service').press('Enter');
|
||||
await expect(
|
||||
frame.getByText('Masked service already exists')
|
||||
frame.getByText('Masked service already exists'),
|
||||
).toBeVisible();
|
||||
await expect(frame.getByText('Required by OpenSCAPcupsnfs-')).toBeVisible();
|
||||
await expect(frame.getByText('nfs-server')).toBeVisible();
|
||||
|
|
|
|||
|
|
@ -65,19 +65,19 @@ test('Create a blueprint with Systemd customization', async ({
|
|||
await frame.getByPlaceholder('Add disabled service').fill('&&');
|
||||
await frame.getByRole('button', { name: 'Add disabled service' }).click();
|
||||
await expect(
|
||||
frame.getByText('Expected format: <service-name>. Example: sshd').nth(0)
|
||||
frame.getByText('Expected format: <service-name>. Example: sshd').nth(0),
|
||||
).toBeVisible();
|
||||
|
||||
await frame.getByPlaceholder('Add enabled service').fill('áá');
|
||||
await frame.getByRole('button', { name: 'Add enabled service' }).click();
|
||||
await expect(
|
||||
frame.getByText('Expected format: <service-name>. Example: sshd').nth(1)
|
||||
frame.getByText('Expected format: <service-name>. Example: sshd').nth(1),
|
||||
).toBeVisible();
|
||||
|
||||
await frame.getByPlaceholder('Add masked service').fill('78');
|
||||
await frame.getByRole('button', { name: 'Add masked service' }).click();
|
||||
await expect(
|
||||
frame.getByText('Expected format: <service-name>. Example: sshd').nth(2)
|
||||
frame.getByText('Expected format: <service-name>. Example: sshd').nth(2),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ test('Create a blueprint with Timezone customization', async ({
|
|||
await expect(
|
||||
frame
|
||||
.getByText('Expected format: <ntp-server>. Example: time.redhat.com')
|
||||
.nth(0)
|
||||
.nth(0),
|
||||
).toBeVisible();
|
||||
await frame.getByPlaceholder('Add NTP servers').fill('0.cz.pool.ntp.org');
|
||||
await frame.getByRole('button', { name: 'Add NTP server' }).click();
|
||||
|
|
@ -86,12 +86,12 @@ test('Create a blueprint with Timezone customization', async ({
|
|||
await frame.getByLabel('Revisit Timezone step').click();
|
||||
await expect(frame.getByText('Canada/Saskatchewan')).toBeHidden();
|
||||
await expect(frame.getByPlaceholder('Select a timezone')).toHaveValue(
|
||||
'Europe/Stockholm'
|
||||
'Europe/Stockholm',
|
||||
);
|
||||
await frame.getByPlaceholder('Select a timezone').fill('Europe');
|
||||
await frame.getByRole('option', { name: 'Europe/Oslo' }).click();
|
||||
await expect(frame.getByPlaceholder('Select a timezone')).toHaveValue(
|
||||
'Europe/Oslo'
|
||||
'Europe/Oslo',
|
||||
);
|
||||
await expect(frame.getByText('0.nl.pool.ntp.org')).toBeVisible();
|
||||
await expect(frame.getByText('0.de.pool.ntp.org')).toBeVisible();
|
||||
|
|
@ -118,7 +118,7 @@ test('Create a blueprint with Timezone customization', async ({
|
|||
await fillInImageOutputGuest(page);
|
||||
await frame.getByRole('button', { name: 'Timezone' }).click();
|
||||
await expect(frame.getByPlaceholder('Select a timezone')).toHaveValue(
|
||||
'Europe/Oslo'
|
||||
'Europe/Oslo',
|
||||
);
|
||||
await expect(frame.getByText('0.nl.pool.ntp.org')).toBeVisible();
|
||||
await expect(frame.getByText('0.de.pool.ntp.org')).toBeVisible();
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export const test = oldTest.extend<WithCleanup>({
|
|||
async () => {
|
||||
await Promise.all(Array.from(cleanupFns).map(([, fn]) => fn()));
|
||||
},
|
||||
{ box: true }
|
||||
{ box: true },
|
||||
);
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -68,14 +68,14 @@ const loginCockpit = async (page: Page, user: string, password: string) => {
|
|||
try {
|
||||
// Check if the user already has administrative access
|
||||
await expect(
|
||||
page.getByRole('button', { name: 'Administrative access' })
|
||||
page.getByRole('button', { name: 'Administrative access' }),
|
||||
).toBeVisible();
|
||||
} catch {
|
||||
// If not, try to gain it
|
||||
// cockpit-image-builder needs superuser, expect an error message
|
||||
// when the user does not have admin priviliges
|
||||
await expect(
|
||||
frame.getByRole('heading', { name: 'Access is limited' })
|
||||
frame.getByRole('heading', { name: 'Access is limited' }),
|
||||
).toBeVisible();
|
||||
await page.getByRole('button', { name: 'Limited access' }).click();
|
||||
|
||||
|
|
@ -99,10 +99,10 @@ const loginCockpit = async (page: Page, user: string, password: string) => {
|
|||
|
||||
// expect to have administrative access
|
||||
await expect(
|
||||
page.getByRole('button', { name: 'Administrative access' })
|
||||
page.getByRole('button', { name: 'Administrative access' }),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
frame.getByRole('heading', { name: 'All images' })
|
||||
frame.getByRole('heading', { name: 'All images' }),
|
||||
).toBeVisible();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { ibFrame, navigateToLandingPage } from './navHelpers';
|
|||
*/
|
||||
export const createBlueprint = async (
|
||||
page: Page | FrameLocator,
|
||||
blueprintName: string
|
||||
blueprintName: string,
|
||||
) => {
|
||||
await page.getByRole('button', { name: 'Create blueprint' }).click();
|
||||
await page.getByRole('button', { name: 'Close' }).first().click();
|
||||
|
|
@ -31,7 +31,7 @@ export const createBlueprint = async (
|
|||
*/
|
||||
export const fillInDetails = async (
|
||||
page: Page | FrameLocator,
|
||||
blueprintName: string
|
||||
blueprintName: string,
|
||||
) => {
|
||||
await page.getByRole('listitem').filter({ hasText: 'Details' }).click();
|
||||
await page
|
||||
|
|
@ -86,7 +86,7 @@ export const deleteBlueprint = async (page: Page, blueprintName: string) => {
|
|||
// Check if no blueprints found -> that means no blueprint was created -> fail gracefully and do not raise error
|
||||
try {
|
||||
await expect(
|
||||
frame.getByRole('heading', { name: 'No blueprints found' })
|
||||
frame.getByRole('heading', { name: 'No blueprints found' }),
|
||||
).toBeVisible({ timeout: 5_000 }); // Shorter timeout to avoid hanging uncessarily
|
||||
return; // Fail gracefully, no blueprint to delete
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
|
|
@ -101,7 +101,7 @@ export const deleteBlueprint = async (page: Page, blueprintName: string) => {
|
|||
await frame.getByRole('menuitem', { name: 'Delete blueprint' }).click();
|
||||
await frame.getByRole('button', { name: 'Delete' }).click();
|
||||
},
|
||||
{ box: true }
|
||||
{ box: true },
|
||||
);
|
||||
};
|
||||
|
||||
|
|
@ -129,7 +129,7 @@ export const exportBlueprint = async (page: Page, blueprintName: string) => {
|
|||
*/
|
||||
export const importBlueprint = async (
|
||||
page: Page | FrameLocator,
|
||||
blueprintName: string
|
||||
blueprintName: string,
|
||||
) => {
|
||||
if (isHosted()) {
|
||||
await page.getByRole('button', { name: 'Import' }).click();
|
||||
|
|
@ -138,7 +138,7 @@ export const importBlueprint = async (
|
|||
.locator('input[type=file]')
|
||||
.setInputFiles('../../downloads/' + blueprintName + '.json');
|
||||
await expect(
|
||||
page.getByRole('textbox', { name: 'File upload' })
|
||||
page.getByRole('textbox', { name: 'File upload' }),
|
||||
).not.toBeEmpty();
|
||||
await page.getByRole('button', { name: 'Review and Finish' }).click();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ test.describe.serial('test', () => {
|
|||
await frame.getByRole('button', { name: 'Create blueprint' }).click();
|
||||
|
||||
await expect(
|
||||
frame.locator('.pf-v6-c-card__title-text').getByText(blueprintName)
|
||||
frame.locator('.pf-v6-c-card__title-text').getByText(blueprintName),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
|
|
@ -205,7 +205,7 @@ test.describe.serial('test', () => {
|
|||
if (await switchInput.isChecked()) {
|
||||
await frame.getByRole('button', { name: 'Cancel' }).click();
|
||||
await expect(
|
||||
frame.getByRole('heading', { name: 'All images' })
|
||||
frame.getByRole('heading', { name: 'All images' }),
|
||||
).toBeVisible();
|
||||
} else {
|
||||
const switchToggle = frame.locator('.pf-v6-c-switch');
|
||||
|
|
@ -219,7 +219,7 @@ test.describe.serial('test', () => {
|
|||
await frame.getByPlaceholder('Path to AWS credentials').fill(credentials);
|
||||
await frame.getByRole('button', { name: 'Submit' }).click();
|
||||
await expect(
|
||||
frame.getByRole('heading', { name: 'All images' })
|
||||
frame.getByRole('heading', { name: 'All images' }),
|
||||
).toBeVisible();
|
||||
}
|
||||
|
||||
|
|
@ -236,7 +236,7 @@ test.describe.serial('test', () => {
|
|||
|
||||
await expect(frame.getByPlaceholder('AWS bucket')).toHaveValue(bucket);
|
||||
await expect(frame.getByPlaceholder('Path to AWS credentials')).toHaveValue(
|
||||
credentials
|
||||
credentials,
|
||||
);
|
||||
await frame.getByRole('button', { name: 'Cancel' }).click();
|
||||
|
||||
|
|
@ -276,7 +276,7 @@ test.describe.serial('test', () => {
|
|||
frame.getByRole('heading', { name: 'Details' });
|
||||
await frame.getByTestId('blueprint').fill(cockpitBlueprintname);
|
||||
await expect(frame.getByTestId('blueprint')).toHaveValue(
|
||||
cockpitBlueprintname
|
||||
cockpitBlueprintname,
|
||||
);
|
||||
await frame.getByRole('button', { name: 'Next', exact: true }).click();
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ export const BlueprintActionsMenu: React.FunctionComponent<
|
|||
setShowBlueprintActionsMenu(!showBlueprintActionsMenu);
|
||||
};
|
||||
const importExportFlag = useFlagWithEphemDefault(
|
||||
'image-builder.import.enabled'
|
||||
'image-builder.import.enabled',
|
||||
);
|
||||
|
||||
const [trigger] = useLazyExportBlueprintQuery();
|
||||
|
|
@ -81,7 +81,7 @@ export const BlueprintActionsMenu: React.FunctionComponent<
|
|||
|
||||
async function handleExportBlueprint(
|
||||
blueprintName: string,
|
||||
blueprint: BlueprintExportResponse
|
||||
blueprint: BlueprintExportResponse,
|
||||
) {
|
||||
const jsonData = JSON.stringify(blueprint, null, 2);
|
||||
const blob = new Blob([jsonData], { type: 'application/json' });
|
||||
|
|
|
|||
|
|
@ -34,11 +34,11 @@ const BlueprintDiffModal = ({
|
|||
|
||||
const { data: baseBlueprint } = useGetBlueprintQuery(
|
||||
{ id: selectedBlueprintId as string, version: baseVersion || -1 },
|
||||
{ skip: !selectedBlueprintId || !baseVersion }
|
||||
{ skip: !selectedBlueprintId || !baseVersion },
|
||||
);
|
||||
const { data: blueprint } = useGetBlueprintQuery(
|
||||
{ id: selectedBlueprintId as string },
|
||||
{ skip: !selectedBlueprintId }
|
||||
{ skip: !selectedBlueprintId },
|
||||
);
|
||||
|
||||
if (!baseBlueprint || !blueprint) {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ const BlueprintVersionFilter: React.FC<blueprintVersionFilterProps> = ({
|
|||
|
||||
const onSelect = (
|
||||
_event: React.MouseEvent<Element, MouseEvent> | undefined,
|
||||
value: versionFilterType
|
||||
value: versionFilterType,
|
||||
) => {
|
||||
dispatch(setBlueprintVersionFilter(value));
|
||||
if (onFilterChange) onFilterChange();
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ const BlueprintSearch = ({ blueprintsTotal }: blueprintSearchProps) => {
|
|||
dispatch(imageBuilderApi.util.invalidateTags([{ type: 'Blueprints' }]));
|
||||
dispatch(setBlueprintSearchInput(filter.length > 0 ? filter : undefined));
|
||||
}, DEBOUNCED_SEARCH_WAIT_TIME),
|
||||
[]
|
||||
[],
|
||||
);
|
||||
React.useEffect(() => {
|
||||
return () => {
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ export const BuildImagesButton = ({ children }: BuildImagesButtonPropTypes) => {
|
|||
id: selectedBlueprintId,
|
||||
body: {
|
||||
image_types: blueprintImageType?.filter(
|
||||
(target) => !deselectedTargets.includes(target)
|
||||
(target) => !deselectedTargets.includes(target),
|
||||
),
|
||||
},
|
||||
});
|
||||
|
|
@ -74,21 +74,21 @@ export const BuildImagesButton = ({ children }: BuildImagesButtonPropTypes) => {
|
|||
setIsOpen(!isOpen);
|
||||
};
|
||||
const { data: blueprintDetails } = useGetBlueprintQuery(
|
||||
selectedBlueprintId ? { id: selectedBlueprintId } : skipToken
|
||||
selectedBlueprintId ? { id: selectedBlueprintId } : skipToken,
|
||||
);
|
||||
const blueprintImageType = blueprintDetails?.image_requests.map(
|
||||
(image) => image.image_type
|
||||
(image) => image.image_type,
|
||||
);
|
||||
|
||||
const onSelect = (
|
||||
_event: React.MouseEvent<Element, MouseEvent>,
|
||||
itemId: number
|
||||
itemId: number,
|
||||
) => {
|
||||
const imageType = blueprintImageType?.[itemId];
|
||||
|
||||
if (imageType && deselectedTargets.includes(imageType)) {
|
||||
setDeselectedTargets(
|
||||
deselectedTargets.filter((target) => target !== imageType)
|
||||
deselectedTargets.filter((target) => target !== imageType),
|
||||
);
|
||||
} else if (imageType) {
|
||||
setDeselectedTargets([...deselectedTargets, imageType]);
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ export const DeleteBlueprintModal: React.FunctionComponent<
|
|||
selectFromResult: ({ data }) => ({
|
||||
blueprintName: data?.data.find(
|
||||
(blueprint: { id: string | undefined }) =>
|
||||
blueprint.id === selectedBlueprintId
|
||||
blueprint.id === selectedBlueprintId,
|
||||
)?.name,
|
||||
}),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -71,19 +71,19 @@ export const ImportBlueprintModal: React.FunctionComponent<
|
|||
|
||||
const handleFileInputChange = (
|
||||
_event: React.ChangeEvent<HTMLInputElement> | React.DragEvent<HTMLElement>,
|
||||
file: File
|
||||
file: File,
|
||||
) => {
|
||||
setFileContent('');
|
||||
setFilename(file.name);
|
||||
};
|
||||
|
||||
async function handleRepositoryImport(
|
||||
blueprintExportedResponse: BlueprintExportResponse
|
||||
blueprintExportedResponse: BlueprintExportResponse,
|
||||
): Promise<CustomRepository[] | undefined> {
|
||||
if (isCheckedImportRepos && blueprintExportedResponse.content_sources) {
|
||||
const customRepositories: ApiRepositoryRequest[] =
|
||||
blueprintExportedResponse.content_sources.map(
|
||||
(item) => item as ApiRepositoryRequest
|
||||
(item) => item as ApiRepositoryRequest,
|
||||
);
|
||||
|
||||
try {
|
||||
|
|
@ -98,7 +98,7 @@ export const ImportBlueprintModal: React.FunctionComponent<
|
|||
repository as ApiRepositoryImportResponseRead;
|
||||
if (contentSourcesRepo.uuid) {
|
||||
newCustomRepos.push(
|
||||
...mapToCustomRepositories(contentSourcesRepo)
|
||||
...mapToCustomRepositories(contentSourcesRepo),
|
||||
);
|
||||
}
|
||||
if (repository.warnings?.length === 0 && repository.url) {
|
||||
|
|
@ -139,11 +139,11 @@ export const ImportBlueprintModal: React.FunctionComponent<
|
|||
if (isToml) {
|
||||
const tomlBlueprint = parse(fileContent);
|
||||
const blueprintFromFile = mapOnPremToHosted(
|
||||
tomlBlueprint as BlueprintItem
|
||||
tomlBlueprint as BlueprintItem,
|
||||
);
|
||||
const importBlueprintState = mapExportRequestToState(
|
||||
blueprintFromFile,
|
||||
[]
|
||||
[],
|
||||
);
|
||||
setIsOnPrem(true);
|
||||
setImportedBlueprint(importBlueprintState);
|
||||
|
|
@ -174,7 +174,7 @@ export const ImportBlueprintModal: React.FunctionComponent<
|
|||
undefined;
|
||||
const importBlueprintState = mapExportRequestToState(
|
||||
blueprintExportedResponse,
|
||||
blueprintFromFile.image_requests || []
|
||||
blueprintFromFile.image_requests || [],
|
||||
);
|
||||
|
||||
setIsOnPrem(false);
|
||||
|
|
@ -184,7 +184,7 @@ export const ImportBlueprintModal: React.FunctionComponent<
|
|||
mapOnPremToHosted(blueprintFromFile);
|
||||
const importBlueprintState = mapExportRequestToState(
|
||||
blueprintFromFileMapped,
|
||||
[]
|
||||
[],
|
||||
);
|
||||
setIsOnPrem(true);
|
||||
setImportedBlueprint(importBlueprintState);
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ export type SshKeyOnPrem = {
|
|||
};
|
||||
|
||||
export const mapOnPremToHosted = (
|
||||
blueprint: BlueprintOnPrem
|
||||
blueprint: BlueprintOnPrem,
|
||||
): BlueprintExportResponse => {
|
||||
const users = blueprint.customizations?.user?.map((u) => ({
|
||||
name: u.name,
|
||||
|
|
@ -132,7 +132,7 @@ export const mapOnPremToHosted = (
|
|||
({ baseurls, ...fs }) => ({
|
||||
baseurl: baseurls,
|
||||
...fs,
|
||||
})
|
||||
}),
|
||||
),
|
||||
packages:
|
||||
packages !== undefined || groups !== undefined
|
||||
|
|
@ -147,7 +147,7 @@ export const mapOnPremToHosted = (
|
|||
({ minsize, ...fs }) => ({
|
||||
min_size: minsize,
|
||||
...fs,
|
||||
})
|
||||
}),
|
||||
),
|
||||
fips:
|
||||
blueprint.customizations?.fips !== undefined
|
||||
|
|
@ -189,7 +189,7 @@ export const mapOnPremToHosted = (
|
|||
};
|
||||
|
||||
export const mapHostedToOnPrem = (
|
||||
blueprint: CreateBlueprintRequest
|
||||
blueprint: CreateBlueprintRequest,
|
||||
): CloudApiBlueprint => {
|
||||
const result: CloudApiBlueprint = {
|
||||
name: blueprint.name,
|
||||
|
|
@ -224,7 +224,7 @@ export const mapHostedToOnPrem = (
|
|||
mountpoint: fs.mountpoint,
|
||||
minsize: fs.min_size,
|
||||
};
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ type ToggleGroupProps = Omit<FormGroupProps<boolean>, 'isDisabled'>;
|
|||
const AWSConfigToggle = ({ value, onChange }: ToggleGroupProps) => {
|
||||
const handleChange = (
|
||||
_event: React.FormEvent<HTMLInputElement>,
|
||||
checked: boolean
|
||||
checked: boolean,
|
||||
) => {
|
||||
onChange(checked);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ export const CloudProviderConfig = () => {
|
|||
dispatch(changeAWSCredsPath(credentials));
|
||||
}
|
||||
},
|
||||
[dispatch, setEnabled]
|
||||
[dispatch, setEnabled],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export const isAwsCredsPathValid = (credsPath?: string): boolean => {
|
|||
};
|
||||
|
||||
export const isAwsStepValid = (
|
||||
config: AWSWorkerConfig | undefined
|
||||
config: AWSWorkerConfig | undefined,
|
||||
): boolean => {
|
||||
if (!config) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ export const NotReady = ({ enabled }: { enabled: boolean }) => {
|
|||
{
|
||||
superuser: 'require',
|
||||
err: 'message',
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(() => window.location.reload());
|
||||
}}
|
||||
|
|
@ -45,7 +45,7 @@ export const NotReady = ({ enabled }: { enabled: boolean }) => {
|
|||
event.preventDefault();
|
||||
cockpit.jump(
|
||||
'/system/services#/osbuild-composer.socket',
|
||||
cockpit.transport.host
|
||||
cockpit.transport.host,
|
||||
);
|
||||
}}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -309,7 +309,7 @@ const CreateImageWizard = ({ isEdit }: CreateImageWizardProps) => {
|
|||
step: WizardStepType,
|
||||
activeStep: WizardStepType,
|
||||
steps: WizardStepType[],
|
||||
goToStepByIndex: (index: number) => void
|
||||
goToStepByIndex: (index: number) => void,
|
||||
) => {
|
||||
const isVisitOptional =
|
||||
'parentId' in step && step.parentId === 'step-optional-steps';
|
||||
|
|
@ -325,7 +325,7 @@ const CreateImageWizard = ({ isEdit }: CreateImageWizardProps) => {
|
|||
}, [step.id, step.isVisited]);
|
||||
|
||||
const hasVisitedNextStep = steps.some(
|
||||
(s) => s.index > step.index && s.isVisited
|
||||
(s) => s.index > step.index && s.isVisited,
|
||||
);
|
||||
|
||||
// Only this code is different from the original
|
||||
|
|
@ -353,7 +353,7 @@ const CreateImageWizard = ({ isEdit }: CreateImageWizardProps) => {
|
|||
{
|
||||
module: AMPLITUDE_MODULE_NAME,
|
||||
isPreview: isBeta(),
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}}
|
||||
|
|
@ -389,7 +389,7 @@ const CreateImageWizard = ({ isEdit }: CreateImageWizardProps) => {
|
|||
isHidden={
|
||||
!targetEnvironments.find(
|
||||
(target: string) =>
|
||||
target === 'aws' || target === 'gcp' || target === 'azure'
|
||||
target === 'aws' || target === 'gcp' || target === 'azure',
|
||||
)
|
||||
}
|
||||
steps={[
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ const LabelInput = ({
|
|||
|
||||
const onTextInputChange = (
|
||||
_event: React.FormEvent<HTMLInputElement>,
|
||||
value: string
|
||||
value: string,
|
||||
) => {
|
||||
setInputValue(value);
|
||||
setOnStepInputErrorText('');
|
||||
|
|
@ -74,27 +74,27 @@ const LabelInput = ({
|
|||
switch (fieldName) {
|
||||
case 'ports':
|
||||
setOnStepInputErrorText(
|
||||
'Expected format: <port/port-name>:<protocol>. Example: 8080:tcp, ssh:tcp'
|
||||
'Expected format: <port/port-name>:<protocol>. Example: 8080:tcp, ssh:tcp',
|
||||
);
|
||||
break;
|
||||
case 'kernelAppend':
|
||||
setOnStepInputErrorText(
|
||||
'Expected format: <kernel-argument>. Example: console=tty0'
|
||||
'Expected format: <kernel-argument>. Example: console=tty0',
|
||||
);
|
||||
break;
|
||||
case 'kernelName':
|
||||
setOnStepInputErrorText(
|
||||
'Expected format: <kernel-name>. Example: kernel-5.14.0-284.11.1.el9_2.x86_64'
|
||||
'Expected format: <kernel-name>. Example: kernel-5.14.0-284.11.1.el9_2.x86_64',
|
||||
);
|
||||
break;
|
||||
case 'groups':
|
||||
setOnStepInputErrorText(
|
||||
'Expected format: <group-name>. Example: admin'
|
||||
'Expected format: <group-name>. Example: admin',
|
||||
);
|
||||
break;
|
||||
case 'ntpServers':
|
||||
setOnStepInputErrorText(
|
||||
'Expected format: <ntp-server>. Example: time.redhat.com'
|
||||
'Expected format: <ntp-server>. Example: time.redhat.com',
|
||||
);
|
||||
break;
|
||||
case 'enabledSystemdServices':
|
||||
|
|
@ -103,7 +103,7 @@ const LabelInput = ({
|
|||
case 'disabledServices':
|
||||
case 'enabledServices':
|
||||
setOnStepInputErrorText(
|
||||
'Expected format: <service-name>. Example: sshd'
|
||||
'Expected format: <service-name>. Example: sshd',
|
||||
);
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ type ValidationInputProp = TextInputProps &
|
|||
ariaLabel: string;
|
||||
onChange: (
|
||||
event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>,
|
||||
value: string
|
||||
value: string,
|
||||
) => void;
|
||||
isRequired?: boolean;
|
||||
warning?: string;
|
||||
|
|
@ -111,7 +111,7 @@ export const ValidatedInputAndTextArea = ({
|
|||
const getValidationState = (
|
||||
isPristine: boolean,
|
||||
errorMessage: string,
|
||||
isRequired: boolean | undefined
|
||||
isRequired: boolean | undefined,
|
||||
): ValidationResult => {
|
||||
const validated = isPristine
|
||||
? 'default'
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ const DetailsStep = () => {
|
|||
|
||||
const handleNameChange = (
|
||||
_event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>,
|
||||
name: string
|
||||
name: string,
|
||||
) => {
|
||||
dispatch(changeBlueprintName(name));
|
||||
dispatch(setIsCustomName());
|
||||
|
|
@ -36,7 +36,7 @@ const DetailsStep = () => {
|
|||
|
||||
const handleDescriptionChange = (
|
||||
_event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>,
|
||||
description: string
|
||||
description: string,
|
||||
) => {
|
||||
dispatch(changeBlueprintDescription(description));
|
||||
};
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ const FileSystemConfiguration = () => {
|
|||
mountpoint: '/home',
|
||||
min_size: '1',
|
||||
unit: 'GiB',
|
||||
})
|
||||
}),
|
||||
);
|
||||
};
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ const FileSystemConfiguration = () => {
|
|||
|
||||
const filteredTargets = (
|
||||
automaticPartitioningOnlyTargets.filter((env) =>
|
||||
environments.includes(env)
|
||||
environments.includes(env),
|
||||
) as ImageTypes[]
|
||||
).map((env) => targetOptions[env]);
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ const FileSystemConfiguration = () => {
|
|||
<Content component={ContentVariants.h3}>Configure partitions</Content>
|
||||
</Content>
|
||||
{partitions.find((partition) =>
|
||||
partition.mountpoint.includes('/usr')
|
||||
partition.mountpoint.includes('/usr'),
|
||||
) && <UsrSubDirectoriesDisabled />}
|
||||
<Content>
|
||||
<Content>
|
||||
|
|
@ -90,7 +90,7 @@ const FileSystemConfiguration = () => {
|
|||
variant="warning"
|
||||
isInline
|
||||
title={`Filesystem customizations are not applied to ${filteredTargets.join(
|
||||
' and '
|
||||
' and ',
|
||||
)} images`}
|
||||
/>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import {
|
|||
const FileSystemPartition = () => {
|
||||
const dispatch = useAppDispatch();
|
||||
const fileSystemConfigurationType = useAppSelector(
|
||||
selectFileSystemConfigurationType
|
||||
selectFileSystemConfigurationType,
|
||||
);
|
||||
const hasOscapProfile = useAppSelector(selectComplianceProfileID);
|
||||
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ const MountpointPrefix = ({ partition }: MountpointPrefixPropTypes) => {
|
|||
setIsOpen(false);
|
||||
const mountpoint = selection + (suffix.length > 0 ? '/' + suffix : '');
|
||||
dispatch(
|
||||
changePartitionMountpoint({ id: partition.id, mountpoint: mountpoint })
|
||||
changePartitionMountpoint({ id: partition.id, mountpoint: mountpoint }),
|
||||
);
|
||||
};
|
||||
|
||||
|
|
@ -241,7 +241,7 @@ const MountpointSuffix = ({ partition }: MountpointSuffixPropTypes) => {
|
|||
changePartitionMountpoint({
|
||||
id: partition.id,
|
||||
mountpoint: mountpoint,
|
||||
})
|
||||
}),
|
||||
);
|
||||
}}
|
||||
aria-label="mountpoint suffix"
|
||||
|
|
@ -292,10 +292,10 @@ const MinimumSize = ({ partition }: MinimumSizePropTypes) => {
|
|||
changePartitionMinSize({
|
||||
id: partition.id,
|
||||
min_size: minSize,
|
||||
})
|
||||
}),
|
||||
);
|
||||
dispatch(
|
||||
changePartitionUnit({ id: partition.id, unit: partition.unit })
|
||||
changePartitionUnit({ id: partition.id, unit: partition.unit }),
|
||||
);
|
||||
}
|
||||
}}
|
||||
|
|
@ -319,7 +319,7 @@ const SizeUnit = ({ partition }: SizeUnitPropTypes) => {
|
|||
changePartitionMinSize({
|
||||
id: partition.id,
|
||||
min_size: initialValue.min_size,
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
dispatch(changePartitionUnit({ id: partition.id, unit: selection }));
|
||||
|
|
@ -364,7 +364,7 @@ const SizeUnit = ({ partition }: SizeUnitPropTypes) => {
|
|||
const FileSystemTable = () => {
|
||||
const [draggedItemId, setDraggedItemId] = useState<string | null>(null);
|
||||
const [draggingToItemIndex, setDraggingToItemIndex] = useState<number | null>(
|
||||
null
|
||||
null,
|
||||
);
|
||||
const [isDragging, setIsDragging] = useState(false);
|
||||
const [tempItemOrder, setTempItemOrder] = useState<string[]>([]);
|
||||
|
|
@ -374,7 +374,7 @@ const FileSystemTable = () => {
|
|||
const itemOrder = partitions.map((partition) => partition.id);
|
||||
const dispatch = useAppDispatch();
|
||||
const isValidDrop = (
|
||||
evt: React.DragEvent<HTMLTableSectionElement | HTMLTableRowElement>
|
||||
evt: React.DragEvent<HTMLTableSectionElement | HTMLTableRowElement>,
|
||||
) => {
|
||||
const ulRect = bodyRef.current?.getBoundingClientRect();
|
||||
if (!ulRect) return false;
|
||||
|
|
@ -439,13 +439,13 @@ const FileSystemTable = () => {
|
|||
}
|
||||
const dragId = curListItem.id;
|
||||
const newDraggingToItemIndex = Array.from(
|
||||
bodyRef.current.children
|
||||
bodyRef.current.children,
|
||||
).findIndex((item) => item.id === dragId);
|
||||
if (newDraggingToItemIndex !== draggingToItemIndex && draggedItemId) {
|
||||
const tempItemOrder = moveItem(
|
||||
[...itemOrder],
|
||||
draggedItemId,
|
||||
newDraggingToItemIndex
|
||||
newDraggingToItemIndex,
|
||||
);
|
||||
move(tempItemOrder);
|
||||
setDraggingToItemIndex(newDraggingToItemIndex);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ export type FileSystemConfigurationType = 'automatic' | 'manual';
|
|||
|
||||
const FileSystemStep = () => {
|
||||
const fileSystemConfigurationType = useAppSelector(
|
||||
selectFileSystemConfigurationType
|
||||
selectFileSystemConfigurationType,
|
||||
);
|
||||
const hasIsoTargetOnly = useHasSpecificTargetOnly('image-installer');
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ const ArchSelect = () => {
|
|||
|
||||
const setArch = (
|
||||
_event: React.MouseEvent,
|
||||
selection: ImageRequest['architecture']
|
||||
selection: ImageRequest['architecture'],
|
||||
) => {
|
||||
dispatch(changeArchitecture(selection));
|
||||
setIsOpen(false);
|
||||
|
|
@ -44,7 +44,7 @@ const ArchSelect = () => {
|
|||
options.push(
|
||||
<SelectOption key={arch} value={arch}>
|
||||
{arch}
|
||||
</SelectOption>
|
||||
</SelectOption>,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ const ReleaseSelect = () => {
|
|||
return true;
|
||||
}
|
||||
return isRhel(key);
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
filteredRhel.forEach((value, key) => {
|
||||
|
|
@ -111,7 +111,7 @@ const ReleaseSelect = () => {
|
|||
description={setDescription(key as Distributions)}
|
||||
>
|
||||
{releases.get(key)}
|
||||
</SelectOption>
|
||||
</SelectOption>,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ const TargetEnvironment = () => {
|
|||
}, []);
|
||||
|
||||
const supportedEnvironments = data?.find(
|
||||
(elem) => elem.arch === arch
|
||||
(elem) => elem.arch === arch,
|
||||
)?.image_types;
|
||||
|
||||
const handleToggleEnvironment = (environment: ImageTypes) => {
|
||||
|
|
|
|||
|
|
@ -31,11 +31,11 @@ const KernelArguments = () => {
|
|||
},
|
||||
{
|
||||
skip: !complianceProfileID,
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const requiredByOpenSCAP = kernelAppend.filter((arg) =>
|
||||
oscapProfileInfo?.kernel?.append?.split(' ').includes(arg)
|
||||
oscapProfileInfo?.kernel?.append?.split(' ').includes(arg),
|
||||
);
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ const KernelName = () => {
|
|||
|
||||
if (filterValue) {
|
||||
filteredKernelPkgs = kernelOptions.filter((kernel: string) =>
|
||||
String(kernel).toLowerCase().includes(filterValue.toLowerCase())
|
||||
String(kernel).toLowerCase().includes(filterValue.toLowerCase()),
|
||||
);
|
||||
if (!filteredKernelPkgs.some((kernel) => kernel === filterValue)) {
|
||||
filteredKernelPkgs = [
|
||||
|
|
|
|||
|
|
@ -42,14 +42,14 @@ const KeyboardDropDown = () => {
|
|||
|
||||
if (filterValue) {
|
||||
filteredKeyboards = keyboardsList.filter((keyboard: string) =>
|
||||
String(keyboard).toLowerCase().includes(filterValue.toLowerCase())
|
||||
String(keyboard).toLowerCase().includes(filterValue.toLowerCase()),
|
||||
);
|
||||
if (!isOpen) {
|
||||
setIsOpen(true);
|
||||
}
|
||||
}
|
||||
setSelectOptions(
|
||||
filteredKeyboards.sort((a, b) => sortfn(a, b, filterValue))
|
||||
filteredKeyboards.sort((a, b) => sortfn(a, b, filterValue)),
|
||||
);
|
||||
|
||||
// This useEffect hook should run *only* on when the filter value changes.
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ const parseLanguageOption = (language: string) => {
|
|||
type: 'language',
|
||||
}).of(languageCode);
|
||||
const countryName = new Intl.DisplayNames(['en'], { type: 'region' }).of(
|
||||
countryCode
|
||||
countryCode,
|
||||
);
|
||||
|
||||
return `${languageName} - ${countryName} (${language})`;
|
||||
|
|
@ -72,7 +72,7 @@ const LanguagesDropDown = () => {
|
|||
|
||||
if (filterValue) {
|
||||
filteredLanguages = filteredLanguages.filter(([, parsed]) =>
|
||||
String(parsed).toLowerCase().includes(filterValue.toLowerCase())
|
||||
String(parsed).toLowerCase().includes(filterValue.toLowerCase()),
|
||||
);
|
||||
if (!isOpen) {
|
||||
setIsOpen(true);
|
||||
|
|
@ -81,7 +81,7 @@ const LanguagesDropDown = () => {
|
|||
setSelectOptions(
|
||||
filteredLanguages
|
||||
.sort((a, b) => sortfn(a[1], b[1], filterValue))
|
||||
.map(([raw]) => raw)
|
||||
.map(([raw]) => raw),
|
||||
);
|
||||
|
||||
// This useEffect hook should run *only* on when the filter value changes.
|
||||
|
|
@ -194,7 +194,7 @@ const LanguagesDropDown = () => {
|
|||
<HelperTextItem
|
||||
variant={'error'}
|
||||
>{`Unknown languages: ${unknownLanguages.join(
|
||||
', '
|
||||
', ',
|
||||
)}`}</HelperTextItem>
|
||||
</HelperText>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ export const OscapProfileInformation = ({
|
|||
},
|
||||
{
|
||||
skip: !complianceProfileID,
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const {
|
||||
|
|
@ -57,7 +57,7 @@ export const OscapProfileInformation = ({
|
|||
{
|
||||
skip:
|
||||
!allowChangingCompliancePolicy || complianceProfileID ? true : false,
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -70,7 +70,7 @@ export const OscapProfileInformation = ({
|
|||
policyID: pol.id,
|
||||
profileID: pol.ref_id,
|
||||
policyTitle: pol.title,
|
||||
})
|
||||
}),
|
||||
);
|
||||
}, [isSuccessPolicyInfo]);
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ const ComplianceSelectOption = ({ policy }: ComplianceSelectOptionPropType) => {
|
|||
const selectObj = (
|
||||
policyID: string,
|
||||
profileID: string,
|
||||
title: string
|
||||
title: string,
|
||||
): ComplianceSelectOptionValueType => ({
|
||||
policyID,
|
||||
profileID,
|
||||
|
|
@ -101,7 +101,7 @@ const PolicySelector = () => {
|
|||
distribution: release,
|
||||
policy: policyID!,
|
||||
},
|
||||
{ skip: !policyID }
|
||||
{ skip: !policyID },
|
||||
);
|
||||
|
||||
const [trigger] = useLazyGetOscapCustomizationsForPolicyQuery();
|
||||
|
|
@ -120,7 +120,7 @@ const PolicySelector = () => {
|
|||
policyID: pol.id,
|
||||
profileID: pol.ref_id,
|
||||
policyTitle: pol.title,
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -137,7 +137,7 @@ const PolicySelector = () => {
|
|||
profileID: undefined,
|
||||
policyID: undefined,
|
||||
policyTitle: undefined,
|
||||
})
|
||||
}),
|
||||
);
|
||||
clearCompliancePackages(currentProfileData?.packages || []);
|
||||
dispatch(changeFileSystemConfigurationType('automatic'));
|
||||
|
|
@ -156,7 +156,7 @@ const PolicySelector = () => {
|
|||
distribution: release,
|
||||
policy: selection.policyID,
|
||||
},
|
||||
true // preferCacheValue
|
||||
true, // preferCacheValue
|
||||
)
|
||||
.unwrap()
|
||||
.then((response) => {
|
||||
|
|
@ -166,7 +166,7 @@ const PolicySelector = () => {
|
|||
handlePackages(
|
||||
oldOscapPackages,
|
||||
newOscapPackages,
|
||||
'Required by chosen compliance policy'
|
||||
'Required by chosen compliance policy',
|
||||
);
|
||||
handleServices(response.services);
|
||||
handleKernelAppend(response.kernel?.append);
|
||||
|
|
@ -175,7 +175,7 @@ const PolicySelector = () => {
|
|||
profileID: selection.profileID,
|
||||
policyID: selection.policyID,
|
||||
policyTitle: selection.title,
|
||||
})
|
||||
}),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
@ -183,7 +183,7 @@ const PolicySelector = () => {
|
|||
|
||||
const handleSelect = (
|
||||
_event: React.MouseEvent<Element, MouseEvent>,
|
||||
selection: string
|
||||
selection: string,
|
||||
) => {
|
||||
if (selection) {
|
||||
applyChanges(selection as unknown as ComplianceSelectOptionValueType);
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ const ProfileSelector = () => {
|
|||
// @ts-ignore if openScapProfile is undefined the query is going to get skipped
|
||||
profile: profileID,
|
||||
},
|
||||
{ skip: !profileID }
|
||||
{ skip: !profileID },
|
||||
);
|
||||
|
||||
const [trigger] = useLazyGetOscapCustomizationsQuery();
|
||||
|
|
@ -118,7 +118,7 @@ const ProfileSelector = () => {
|
|||
const promises = profiles.map(async (profileID) => {
|
||||
const response = await trigger(
|
||||
{ distribution: release, profile: profileID },
|
||||
true
|
||||
true,
|
||||
).unwrap();
|
||||
|
||||
const oscap = response?.openscap;
|
||||
|
|
@ -153,7 +153,7 @@ const ProfileSelector = () => {
|
|||
}
|
||||
const trimmedFilter = filterValue.toLowerCase().trim();
|
||||
const filtered = profileDetails.filter(({ name }) =>
|
||||
name?.toLowerCase().includes(trimmedFilter)
|
||||
name?.toLowerCase().includes(trimmedFilter),
|
||||
);
|
||||
|
||||
setSelectOptions(filtered);
|
||||
|
|
@ -175,7 +175,7 @@ const ProfileSelector = () => {
|
|||
profileID: undefined,
|
||||
policyID: undefined,
|
||||
policyTitle: undefined,
|
||||
})
|
||||
}),
|
||||
);
|
||||
clearCompliancePackages(currentProfileData?.packages || []);
|
||||
dispatch(changeFileSystemConfigurationType('automatic'));
|
||||
|
|
@ -203,7 +203,7 @@ const ProfileSelector = () => {
|
|||
profileID: undefined,
|
||||
policyID: undefined,
|
||||
policyTitle: undefined,
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
@ -240,7 +240,7 @@ const ProfileSelector = () => {
|
|||
distribution: release,
|
||||
profile: selection.profileID as DistributionProfileItem,
|
||||
},
|
||||
true // preferCacheValue
|
||||
true, // preferCacheValue
|
||||
)
|
||||
.unwrap()
|
||||
.then((response) => {
|
||||
|
|
@ -250,7 +250,7 @@ const ProfileSelector = () => {
|
|||
handlePackages(
|
||||
oldOscapPackages,
|
||||
newOscapPackages,
|
||||
'Required by chosen OpenSCAP profile'
|
||||
'Required by chosen OpenSCAP profile',
|
||||
);
|
||||
handleServices(response.services);
|
||||
handleKernelAppend(response.kernel?.append);
|
||||
|
|
@ -259,7 +259,7 @@ const ProfileSelector = () => {
|
|||
profileID: selection.profileID,
|
||||
policyID: undefined,
|
||||
policyTitle: undefined,
|
||||
})
|
||||
}),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
@ -267,7 +267,7 @@ const ProfileSelector = () => {
|
|||
|
||||
const handleSelect = (
|
||||
_event: React.MouseEvent<Element, MouseEvent>,
|
||||
selection: string
|
||||
selection: string,
|
||||
) => {
|
||||
if (selection) {
|
||||
setInputValue(selection);
|
||||
|
|
@ -356,7 +356,7 @@ const ProfileSelector = () => {
|
|||
>
|
||||
{name}
|
||||
</SelectOption>
|
||||
))
|
||||
)),
|
||||
)}
|
||||
{isSuccess && selectOptions.length === 0 && (
|
||||
<SelectOption isDisabled>
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ export const useSelectorHandlers = () => {
|
|||
const handlePackages = (
|
||||
oldOscapPackages: string[],
|
||||
newOscapPackages: string[],
|
||||
reason: string
|
||||
reason: string,
|
||||
) => {
|
||||
clearCompliancePackages(oldOscapPackages);
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ export const useSelectorHandlers = () => {
|
|||
name: pkg,
|
||||
summary: reason,
|
||||
repository: 'distro',
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ const OscapContent = () => {
|
|||
// @ts-ignore if openScapProfile is undefined the query is going to get skipped
|
||||
profile: profileID,
|
||||
},
|
||||
{ skip: !profileID }
|
||||
{ skip: !profileID },
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -76,7 +76,7 @@ const OscapContent = () => {
|
|||
profileID: undefined,
|
||||
policyID: undefined,
|
||||
policyTitle: undefined,
|
||||
})
|
||||
}),
|
||||
);
|
||||
const pkgs = currentProfileData?.packages || [];
|
||||
for (const pkg of pkgs) {
|
||||
|
|
@ -102,7 +102,7 @@ const OscapContent = () => {
|
|||
},
|
||||
{
|
||||
skip: complianceType === 'openscap',
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ const PackageRecommendations = () => {
|
|||
selectedPackages: packages.map((pkg) => pkg.name),
|
||||
distribution: distribution.replace('-', ''),
|
||||
modelVersion: response.data.modelVersion,
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
})();
|
||||
|
|
@ -127,8 +127,8 @@ const PackageRecommendations = () => {
|
|||
name: pkg,
|
||||
summary: 'Added from recommended packages',
|
||||
repository: 'distro',
|
||||
})
|
||||
)
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
@ -139,7 +139,7 @@ const PackageRecommendations = () => {
|
|||
name: pkg,
|
||||
summary: 'Added from recommended packages',
|
||||
repository: 'distro',
|
||||
})
|
||||
}),
|
||||
);
|
||||
};
|
||||
|
||||
|
|
@ -264,12 +264,12 @@ const PackageRecommendations = () => {
|
|||
isPreview: isBeta(),
|
||||
packageName: pkg,
|
||||
selectedPackages: packages.map(
|
||||
(pkg) => pkg.name
|
||||
(pkg) => pkg.name,
|
||||
),
|
||||
shownRecommendations: data.packages,
|
||||
distribution: distribution.replace('-', ''),
|
||||
modelVersion: data.modelVersion,
|
||||
}
|
||||
},
|
||||
);
|
||||
addRecommendedPackage(pkg);
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@ const Packages = () => {
|
|||
: reposInTemplate
|
||||
.filter((r) => r.org_id === '-1' && !!r.url)
|
||||
.flatMap((r) =>
|
||||
r.url!.endsWith('/') ? r.url!.slice(0, -1) : r.url!
|
||||
r.url!.endsWith('/') ? r.url!.slice(0, -1) : r.url!,
|
||||
),
|
||||
limit: 500,
|
||||
include_package_sources: true,
|
||||
|
|
@ -679,7 +679,7 @@ const Packages = () => {
|
|||
}
|
||||
|
||||
let combinedPackageData = transformedDistroData.concat(
|
||||
transformedCustomData
|
||||
transformedCustomData,
|
||||
);
|
||||
|
||||
if (
|
||||
|
|
@ -696,7 +696,7 @@ const Packages = () => {
|
|||
}));
|
||||
|
||||
combinedPackageData = combinedPackageData.concat(
|
||||
transformedRecommendedData
|
||||
transformedRecommendedData,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -772,7 +772,7 @@ const Packages = () => {
|
|||
description: values.description!,
|
||||
repository: 'distro',
|
||||
package_list: values.package_list!,
|
||||
}))
|
||||
})),
|
||||
);
|
||||
}
|
||||
if (isSuccessCustomGroups) {
|
||||
|
|
@ -782,7 +782,7 @@ const Packages = () => {
|
|||
description: values.description!,
|
||||
repository: 'custom',
|
||||
package_list: values.package_list!,
|
||||
}))
|
||||
})),
|
||||
);
|
||||
}
|
||||
if (isSuccessRecommendedGroups) {
|
||||
|
|
@ -792,18 +792,18 @@ const Packages = () => {
|
|||
description: values.description!,
|
||||
repository: 'recommended',
|
||||
package_list: values.package_list!,
|
||||
}))
|
||||
})),
|
||||
);
|
||||
}
|
||||
|
||||
if (toggleSelected === 'toggle-available') {
|
||||
if (activeTabKey === Repos.INCLUDED) {
|
||||
return combinedGroupData.filter(
|
||||
(pkg) => pkg.repository !== 'recommended'
|
||||
(pkg) => pkg.repository !== 'recommended',
|
||||
);
|
||||
} else {
|
||||
return combinedGroupData.filter(
|
||||
(pkg) => pkg.repository === 'recommended'
|
||||
(pkg) => pkg.repository === 'recommended',
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -829,7 +829,7 @@ const Packages = () => {
|
|||
|
||||
const handleSearch = async (
|
||||
event: React.FormEvent<HTMLInputElement>,
|
||||
selection: string
|
||||
selection: string,
|
||||
) => {
|
||||
setSearchTerm(selection);
|
||||
setActiveTabKey(Repos.INCLUDED);
|
||||
|
|
@ -851,7 +851,7 @@ const Packages = () => {
|
|||
const handleSelect = (
|
||||
pkg: IBPackageWithRepositoryInfo,
|
||||
_: number,
|
||||
isSelecting: boolean
|
||||
isSelecting: boolean,
|
||||
) => {
|
||||
if (isSelecting) {
|
||||
if (
|
||||
|
|
@ -872,11 +872,11 @@ const Packages = () => {
|
|||
addModule({
|
||||
name: pkg.module_name || '',
|
||||
stream: pkg.stream || '',
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
setCurrentlyRemovedPackages((prev) =>
|
||||
prev.filter((curr) => curr.name !== pkg.name)
|
||||
prev.filter((curr) => curr.name !== pkg.name),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -900,7 +900,7 @@ const Packages = () => {
|
|||
const handleGroupSelect = (
|
||||
grp: GroupWithRepositoryInfo,
|
||||
_: number,
|
||||
isSelecting: boolean
|
||||
isSelecting: boolean,
|
||||
) => {
|
||||
if (isSelecting) {
|
||||
if (
|
||||
|
|
@ -941,7 +941,7 @@ const Packages = () => {
|
|||
const handlePerPageSelect = (
|
||||
_: React.MouseEvent,
|
||||
newPerPage: number,
|
||||
newPage: number
|
||||
newPage: number,
|
||||
) => {
|
||||
setPerPage(newPerPage);
|
||||
setPage(newPage);
|
||||
|
|
@ -958,7 +958,7 @@ const Packages = () => {
|
|||
const handleConfirmModalToggle = async () => {
|
||||
if (!epelRepo || !epelRepo.data) {
|
||||
throw new Error(
|
||||
`There was an error while adding the recommended repository.`
|
||||
`There was an error while adding the recommended repository.`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -970,8 +970,8 @@ const Packages = () => {
|
|||
});
|
||||
dispatch(
|
||||
addRecommendedRepository(
|
||||
(result as { data: ApiRepositoryResponseRead }).data
|
||||
)
|
||||
(result as { data: ApiRepositoryResponseRead }).data,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
dispatch(addRecommendedRepository(epelRepo.data[0]));
|
||||
|
|
@ -998,7 +998,7 @@ const Packages = () => {
|
|||
|
||||
const setPkgExpanded = (
|
||||
pkg: IBPackageWithRepositoryInfo,
|
||||
isExpanding: boolean
|
||||
isExpanding: boolean,
|
||||
) =>
|
||||
setExpandedPkgs((prevExpanded) => {
|
||||
const otherExpandedPkgs = prevExpanded.filter((p) => p.name !== pkg.name);
|
||||
|
|
@ -1013,7 +1013,7 @@ const Packages = () => {
|
|||
|
||||
const setGroupsExpanded = (
|
||||
group: GroupWithRepositoryInfo['name'],
|
||||
isExpanding: boolean
|
||||
isExpanding: boolean,
|
||||
) =>
|
||||
setExpandedGroups((prevExpanded) => {
|
||||
const otherExpandedGroups = prevExpanded.filter((g) => g !== group);
|
||||
|
|
@ -1031,7 +1031,7 @@ const Packages = () => {
|
|||
>('asc');
|
||||
|
||||
const getSortableRowValues = (
|
||||
pkg: IBPackageWithRepositoryInfo
|
||||
pkg: IBPackageWithRepositoryInfo,
|
||||
): (string | number | ApiPackageSourcesResponse[] | undefined)[] => {
|
||||
return [pkg.name, pkg.summary, pkg.stream, pkg.end_date, pkg.repository];
|
||||
};
|
||||
|
|
@ -1084,7 +1084,7 @@ const Packages = () => {
|
|||
onSort: (
|
||||
_event: React.MouseEvent,
|
||||
index: number,
|
||||
direction: 'asc' | 'desc'
|
||||
direction: 'asc' | 'desc',
|
||||
) => {
|
||||
setActiveSortIndex(index);
|
||||
setActiveSortDirection(direction);
|
||||
|
|
@ -1097,7 +1097,7 @@ const Packages = () => {
|
|||
|
||||
if (!pkg.type || pkg.type === 'package') {
|
||||
const isModuleWithSameName = modules.some(
|
||||
(module) => module.name === pkg.name
|
||||
(module) => module.name === pkg.name,
|
||||
);
|
||||
isSelected =
|
||||
packages.some((p) => p.name === pkg.name) && !isModuleWithSameName;
|
||||
|
|
@ -1109,7 +1109,7 @@ const Packages = () => {
|
|||
isSelected =
|
||||
packages.some((p) => p.name === pkg.name) &&
|
||||
modules.some(
|
||||
(m) => m.name === pkg.module_name && m.stream === pkg.stream
|
||||
(m) => m.name === pkg.module_name && m.stream === pkg.stream,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -1131,7 +1131,7 @@ const Packages = () => {
|
|||
const isModuleDisabledByPackage =
|
||||
pkg.type === 'module' &&
|
||||
packages.some(
|
||||
(p) => (!p.type || p.type === 'package') && p.name === pkg.module_name
|
||||
(p) => (!p.type || p.type === 'package') && p.name === pkg.module_name,
|
||||
);
|
||||
|
||||
const isPackageDisabledByModule =
|
||||
|
|
@ -1160,7 +1160,7 @@ const Packages = () => {
|
|||
const currentDate = new Date();
|
||||
const msPerDay = 1000 * 60 * 60 * 24;
|
||||
const differenceInDays = Math.round(
|
||||
(retirementDate.getTime() - currentDate.getTime()) / msPerDay
|
||||
(retirementDate.getTime() - currentDate.getTime()) / msPerDay,
|
||||
);
|
||||
|
||||
let icon;
|
||||
|
|
@ -1298,7 +1298,7 @@ const Packages = () => {
|
|||
</Td>
|
||||
</Tr>
|
||||
</Tbody>
|
||||
))
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -1360,7 +1360,7 @@ const Packages = () => {
|
|||
</Td>
|
||||
</Tr>
|
||||
</Tbody>
|
||||
))
|
||||
)),
|
||||
);
|
||||
}
|
||||
return rows;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ const ActivationKeyInformation = (): JSX.Element => {
|
|||
{ name: activationKey! },
|
||||
{
|
||||
skip: !activationKey,
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return (
|
||||
|
|
@ -100,7 +100,7 @@ const ActivationKeyInformation = (): JSX.Element => {
|
|||
<Tr key={index}>
|
||||
<Td>{repo.repositoryLabel}</Td>
|
||||
</Tr>
|
||||
)
|
||||
),
|
||||
)}
|
||||
</Tbody>
|
||||
</Table>
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ const ActivationKeysList = () => {
|
|||
useCreateActivationKeysMutation();
|
||||
|
||||
const recentActivationKey = window.localStorage.getItem(
|
||||
'imageBuilder.recentActivationKey'
|
||||
'imageBuilder.recentActivationKey',
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -76,7 +76,7 @@ const ActivationKeysList = () => {
|
|||
}, [dispatch, isProd]);
|
||||
|
||||
const [selectOptions, setSelectOptions] = useState<(string | undefined)[]>(
|
||||
activationKeys?.body ? activationKeys.body.map((key) => key.name) : []
|
||||
activationKeys?.body ? activationKeys.body.map((key) => key.name) : [],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -86,7 +86,7 @@ const ActivationKeysList = () => {
|
|||
filteredKeys = activationKeys?.body
|
||||
?.map((key) => key.name)
|
||||
.filter((keyName: string) =>
|
||||
String(keyName).toLowerCase().includes(filterValue.toLowerCase())
|
||||
String(keyName).toLowerCase().includes(filterValue.toLowerCase()),
|
||||
);
|
||||
if (!isOpen) {
|
||||
setIsOpen(true);
|
||||
|
|
@ -120,7 +120,7 @@ const ActivationKeysList = () => {
|
|||
|
||||
window.localStorage.setItem(
|
||||
'imageBuilder.recentActivationKey',
|
||||
defaultActivationKeyName
|
||||
defaultActivationKeyName,
|
||||
);
|
||||
dispatch(changeActivationKey(defaultActivationKeyName));
|
||||
} catch (error) {
|
||||
|
|
@ -200,8 +200,8 @@ const ActivationKeysList = () => {
|
|||
selectOptionsElement.push(
|
||||
<SelectOption key={index} value={key}>
|
||||
{key}
|
||||
</SelectOption>
|
||||
)
|
||||
</SelectOption>,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -209,7 +209,7 @@ const ActivationKeysList = () => {
|
|||
selectOptionsElement.push(
|
||||
<SelectOption key="Fetching" value="loader">
|
||||
<Spinner size="md" />
|
||||
</SelectOption>
|
||||
</SelectOption>,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -217,7 +217,7 @@ const ActivationKeysList = () => {
|
|||
selectOptionsElement.push(
|
||||
<SelectOption key="no_results" value="no_results" isDisabled>
|
||||
No results found
|
||||
</SelectOption>
|
||||
</SelectOption>,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -100,11 +100,11 @@ const Registration = () => {
|
|||
const registrationType = useAppSelector(selectRegistrationType);
|
||||
|
||||
const [showOptions, setShowOptions] = useState(
|
||||
registrationType === 'register-later'
|
||||
registrationType === 'register-later',
|
||||
);
|
||||
|
||||
const isSatelliteRegistrationEnabled = useFlag(
|
||||
'image-builder.satellite.enabled'
|
||||
'image-builder.satellite.enabled',
|
||||
);
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ const SatelliteRegistration = () => {
|
|||
|
||||
const handleTextChange = (
|
||||
_event: React.ChangeEvent<HTMLTextAreaElement>,
|
||||
value: string
|
||||
value: string,
|
||||
) => {
|
||||
dispatch(changeSatelliteCaCertificate(value));
|
||||
};
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import { ValidatedInputAndTextArea } from '../../../ValidatedInput';
|
|||
const SatelliteRegistrationCommand = () => {
|
||||
const dispatch = useAppDispatch();
|
||||
const registrationCommand = useAppSelector(
|
||||
selectSatelliteRegistrationCommand
|
||||
selectSatelliteRegistrationCommand,
|
||||
);
|
||||
const stepValidation = useRegistrationValidation();
|
||||
const registrationDocs =
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ const Repositories = () => {
|
|||
}
|
||||
|
||||
const archParam = repositoryParameters.distribution_arches.find(
|
||||
(arch) => arch.label === technicalArch
|
||||
(arch) => arch.label === technicalArch,
|
||||
);
|
||||
|
||||
return archParam?.name || technicalArch;
|
||||
|
|
@ -112,7 +112,7 @@ const Repositories = () => {
|
|||
|
||||
const readableVersions = technicalVersions.map((version) => {
|
||||
const versionParam = repositoryParameters.distribution_versions?.find(
|
||||
(v) => v.label === version
|
||||
(v) => v.label === version,
|
||||
);
|
||||
return versionParam?.name || version;
|
||||
});
|
||||
|
|
@ -127,9 +127,9 @@ const Repositories = () => {
|
|||
...customRepositories.map(({ id }) => id).flat(1),
|
||||
...payloadRepositories.map(({ id }) => id),
|
||||
...recommendedRepos.map(({ uuid }) => uuid),
|
||||
].filter((id) => !!id) as string[]
|
||||
].filter((id) => !!id) as string[],
|
||||
),
|
||||
[customRepositories, payloadRepositories, recommendedRepos]
|
||||
[customRepositories, payloadRepositories, recommendedRepos],
|
||||
);
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
|
|
@ -149,7 +149,7 @@ const Repositories = () => {
|
|||
offset: 0,
|
||||
uuid: [...initialSelectedState].join(','),
|
||||
},
|
||||
{ refetchOnMountOrArgChange: false, skip: isTemplateSelected }
|
||||
{ refetchOnMountOrArgChange: false, skip: isTemplateSelected },
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -182,7 +182,7 @@ const Repositories = () => {
|
|||
? [...selected].join(',')
|
||||
: '',
|
||||
},
|
||||
{ refetchOnMountOrArgChange: 60, skip: isTemplateSelected }
|
||||
{ refetchOnMountOrArgChange: 60, skip: isTemplateSelected },
|
||||
);
|
||||
|
||||
const refresh = () => {
|
||||
|
|
@ -193,7 +193,7 @@ const Repositories = () => {
|
|||
};
|
||||
|
||||
const addSelected = (
|
||||
repo: ApiRepositoryResponseRead | ApiRepositoryResponseRead[]
|
||||
repo: ApiRepositoryResponseRead | ApiRepositoryResponseRead[],
|
||||
) => {
|
||||
let reposToAdd: ApiRepositoryResponseRead[] = [];
|
||||
// Check if array of items
|
||||
|
|
@ -202,7 +202,7 @@ const Repositories = () => {
|
|||
(r) =>
|
||||
r.uuid &&
|
||||
!isRepoDisabled(r, selected.has(r.uuid))[0] &&
|
||||
!selected.has(r.uuid)
|
||||
!selected.has(r.uuid),
|
||||
);
|
||||
} else {
|
||||
// Then it should be a single item
|
||||
|
|
@ -217,25 +217,25 @@ const Repositories = () => {
|
|||
}
|
||||
|
||||
const customToAdd = reposToAdd.map((repo) =>
|
||||
convertSchemaToIBCustomRepo(repo!)
|
||||
convertSchemaToIBCustomRepo(repo!),
|
||||
);
|
||||
|
||||
const payloadToAdd = reposToAdd.map((repo) =>
|
||||
convertSchemaToIBPayloadRepo(repo!)
|
||||
convertSchemaToIBPayloadRepo(repo!),
|
||||
);
|
||||
|
||||
dispatch(changeCustomRepositories([...customRepositories, ...customToAdd]));
|
||||
dispatch(
|
||||
changePayloadRepositories([...payloadRepositories, ...payloadToAdd])
|
||||
changePayloadRepositories([...payloadRepositories, ...payloadToAdd]),
|
||||
);
|
||||
};
|
||||
|
||||
const clearSelected = () => {
|
||||
const recommendedReposSet = new Set(
|
||||
recommendedRepos.map(({ uuid }) => uuid)
|
||||
recommendedRepos.map(({ uuid }) => uuid),
|
||||
);
|
||||
const initiallySelected = [...selected].some(
|
||||
(uuid) => uuid && initialSelectedState.has(uuid)
|
||||
(uuid) => uuid && initialSelectedState.has(uuid),
|
||||
);
|
||||
|
||||
if (initiallySelected) {
|
||||
|
|
@ -246,34 +246,34 @@ const Repositories = () => {
|
|||
|
||||
dispatch(
|
||||
changeCustomRepositories(
|
||||
customRepositories.filter(({ id }) => recommendedReposSet.has(id))
|
||||
)
|
||||
customRepositories.filter(({ id }) => recommendedReposSet.has(id)),
|
||||
),
|
||||
);
|
||||
dispatch(
|
||||
changePayloadRepositories(
|
||||
payloadRepositories.filter(({ id }) => recommendedReposSet.has(id))
|
||||
)
|
||||
payloadRepositories.filter(({ id }) => recommendedReposSet.has(id)),
|
||||
),
|
||||
);
|
||||
};
|
||||
|
||||
const removeSelected = (
|
||||
repo: ApiRepositoryResponseRead | ApiRepositoryResponseRead[]
|
||||
repo: ApiRepositoryResponseRead | ApiRepositoryResponseRead[],
|
||||
) => {
|
||||
if ((repo as ApiRepositoryResponseRead[])?.length) {
|
||||
const itemsToRemove = new Set(
|
||||
(repo as ApiRepositoryResponseRead[]).map(({ uuid }) => uuid)
|
||||
(repo as ApiRepositoryResponseRead[]).map(({ uuid }) => uuid),
|
||||
);
|
||||
|
||||
dispatch(
|
||||
changeCustomRepositories(
|
||||
customRepositories.filter(({ id }) => !itemsToRemove.has(id))
|
||||
)
|
||||
customRepositories.filter(({ id }) => !itemsToRemove.has(id)),
|
||||
),
|
||||
);
|
||||
|
||||
dispatch(
|
||||
changePayloadRepositories(
|
||||
payloadRepositories.filter(({ id }) => !itemsToRemove.has(id))
|
||||
)
|
||||
payloadRepositories.filter(({ id }) => !itemsToRemove.has(id)),
|
||||
),
|
||||
);
|
||||
|
||||
return;
|
||||
|
|
@ -283,29 +283,29 @@ const Repositories = () => {
|
|||
if (uuidToRemove) {
|
||||
dispatch(
|
||||
changeCustomRepositories(
|
||||
customRepositories.filter(({ id }) => uuidToRemove !== id)
|
||||
)
|
||||
customRepositories.filter(({ id }) => uuidToRemove !== id),
|
||||
),
|
||||
);
|
||||
dispatch(
|
||||
changePayloadRepositories(
|
||||
payloadRepositories.filter(({ id }) => uuidToRemove !== id)
|
||||
)
|
||||
payloadRepositories.filter(({ id }) => uuidToRemove !== id),
|
||||
),
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const handleAddRemove = (
|
||||
repo: ApiRepositoryResponseRead | ApiRepositoryResponseRead[],
|
||||
selected: boolean
|
||||
selected: boolean,
|
||||
) => {
|
||||
if (selected) return addSelected(repo);
|
||||
if ((repo as ApiRepositoryResponseRead[])?.length) {
|
||||
const initiallySelectedItems = (repo as ApiRepositoryResponseRead[]).map(
|
||||
({ uuid }) => uuid
|
||||
({ uuid }) => uuid,
|
||||
);
|
||||
|
||||
const hasSome = initiallySelectedItems.some(
|
||||
(uuid) => uuid && initialSelectedState.has(uuid)
|
||||
(uuid) => uuid && initialSelectedState.has(uuid),
|
||||
);
|
||||
|
||||
if (hasSome) {
|
||||
|
|
@ -317,7 +317,7 @@ const Repositories = () => {
|
|||
const isInitiallySelected =
|
||||
(repo as ApiRepositoryResponseRead).uuid &&
|
||||
initialSelectedState.has(
|
||||
(repo as ApiRepositoryResponseRead).uuid || ''
|
||||
(repo as ApiRepositoryResponseRead).uuid || '',
|
||||
);
|
||||
if (isInitiallySelected) {
|
||||
setModalOpen(true);
|
||||
|
|
@ -352,7 +352,7 @@ const Repositories = () => {
|
|||
]);
|
||||
|
||||
const handleToggleClick = (
|
||||
toggleType: 'toggle-group-all' | 'toggle-group-selected'
|
||||
toggleType: 'toggle-group-all' | 'toggle-group-selected',
|
||||
) => {
|
||||
setPage(1);
|
||||
setToggleSelected(toggleType);
|
||||
|
|
@ -360,7 +360,7 @@ const Repositories = () => {
|
|||
|
||||
const isRepoDisabled = (
|
||||
repo: ApiRepositoryResponseRead,
|
||||
isSelected: boolean
|
||||
isSelected: boolean,
|
||||
): [boolean, string] => {
|
||||
if (isFetching) {
|
||||
return [true, 'Repository data is still fetching, please wait.'];
|
||||
|
|
@ -399,7 +399,7 @@ const Repositories = () => {
|
|||
const handlePerPageSelect = (
|
||||
_: React.MouseEvent,
|
||||
newPerPage: number,
|
||||
newPage: number
|
||||
newPage: number,
|
||||
) => {
|
||||
setPerPage(newPerPage);
|
||||
setPage(newPage);
|
||||
|
|
@ -407,7 +407,7 @@ const Repositories = () => {
|
|||
|
||||
const handleFilterRepositories = (
|
||||
e: React.FormEvent<HTMLInputElement>,
|
||||
value: string
|
||||
value: string,
|
||||
) => {
|
||||
e.preventDefault();
|
||||
setPage(1);
|
||||
|
|
@ -421,14 +421,14 @@ const Repositories = () => {
|
|||
|
||||
dispatch(
|
||||
changeCustomRepositories(
|
||||
customRepositories.filter(({ id }) => !itemsToRemove.has(id))
|
||||
)
|
||||
customRepositories.filter(({ id }) => !itemsToRemove.has(id)),
|
||||
),
|
||||
);
|
||||
|
||||
dispatch(
|
||||
changePayloadRepositories(
|
||||
payloadRepositories.filter(({ id }) => !itemsToRemove.has(id || ''))
|
||||
)
|
||||
payloadRepositories.filter(({ id }) => !itemsToRemove.has(id || '')),
|
||||
),
|
||||
);
|
||||
|
||||
setReposToRemove([]);
|
||||
|
|
@ -443,7 +443,7 @@ const Repositories = () => {
|
|||
{
|
||||
uuid: templateUuid,
|
||||
},
|
||||
{ refetchOnMountOrArgChange: true, skip: templateUuid === '' }
|
||||
{ refetchOnMountOrArgChange: true, skip: templateUuid === '' },
|
||||
);
|
||||
|
||||
const {
|
||||
|
|
@ -463,40 +463,40 @@ const Repositories = () => {
|
|||
? selectedTemplateData.repository_uuids?.join(',')
|
||||
: '',
|
||||
},
|
||||
{ refetchOnMountOrArgChange: true, skip: !isTemplateSelected }
|
||||
{ refetchOnMountOrArgChange: true, skip: !isTemplateSelected },
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (isTemplateSelected && reposInTemplate.length > 0) {
|
||||
const customReposInTemplate = reposInTemplate.filter(
|
||||
(repo) => repo.origin !== ContentOrigin.REDHAT
|
||||
(repo) => repo.origin !== ContentOrigin.REDHAT,
|
||||
);
|
||||
const redHatReposInTemplate = reposInTemplate.filter(
|
||||
(repo) => repo.origin === ContentOrigin.REDHAT
|
||||
(repo) => repo.origin === ContentOrigin.REDHAT,
|
||||
);
|
||||
|
||||
dispatch(
|
||||
changeCustomRepositories(
|
||||
customReposInTemplate.map((repo) =>
|
||||
convertSchemaToIBCustomRepo(repo!)
|
||||
)
|
||||
)
|
||||
convertSchemaToIBCustomRepo(repo!),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
dispatch(
|
||||
changePayloadRepositories(
|
||||
customReposInTemplate.map((repo) =>
|
||||
convertSchemaToIBPayloadRepo(repo!)
|
||||
)
|
||||
)
|
||||
convertSchemaToIBPayloadRepo(repo!),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
dispatch(
|
||||
changeRedHatRepositories(
|
||||
redHatReposInTemplate.map((repo) =>
|
||||
convertSchemaToIBPayloadRepo(repo!)
|
||||
)
|
||||
)
|
||||
convertSchemaToIBPayloadRepo(repo!),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}, [templateUuid, reposInTemplate]);
|
||||
|
|
@ -547,7 +547,7 @@ const Repositories = () => {
|
|||
contentList.every(
|
||||
(repo) =>
|
||||
repo.uuid &&
|
||||
isRepoDisabled(repo, selected.has(repo.uuid))[0]
|
||||
isRepoDisabled(repo, selected.has(repo.uuid))[0],
|
||||
)
|
||||
}
|
||||
/>
|
||||
|
|
@ -633,7 +633,7 @@ const Repositories = () => {
|
|||
|
||||
const [isDisabled, disabledReason] = isRepoDisabled(
|
||||
repo,
|
||||
selected.has(uuid)
|
||||
selected.has(uuid),
|
||||
);
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -28,12 +28,12 @@ import {
|
|||
import '../../../ImagesTable/ImageBuildStatus.scss';
|
||||
|
||||
const getLastIntrospection = (
|
||||
repoIntrospections: RepositoryStatusProps['repoIntrospections']
|
||||
repoIntrospections: RepositoryStatusProps['repoIntrospections'],
|
||||
) => {
|
||||
const currentDate = Date.now();
|
||||
const lastIntrospectionDate = convertStringToDate(repoIntrospections);
|
||||
const timeDeltaInSeconds = Math.floor(
|
||||
(currentDate - lastIntrospectionDate) / 1000
|
||||
(currentDate - lastIntrospectionDate) / 1000,
|
||||
);
|
||||
|
||||
if (timeDeltaInSeconds <= 60) {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ interface BulkSelectProps {
|
|||
perPage: number;
|
||||
handleAddRemove: (
|
||||
repo: ApiRepositoryResponseRead | ApiRepositoryResponseRead[],
|
||||
selected: boolean
|
||||
selected: boolean,
|
||||
) => void;
|
||||
isDisabled: boolean;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {
|
|||
|
||||
// Utility function to convert from Content Sources to Image Builder custom repo API schema
|
||||
export const convertSchemaToIBCustomRepo = (
|
||||
repo: ApiRepositoryResponseRead
|
||||
repo: ApiRepositoryResponseRead,
|
||||
) => {
|
||||
const imageBuilderRepo: CustomRepository = {
|
||||
id: repo.uuid!,
|
||||
|
|
@ -30,7 +30,7 @@ export const convertSchemaToIBCustomRepo = (
|
|||
|
||||
// Utility function to convert from Content Sources to Image Builder payload repo API schema
|
||||
export const convertSchemaToIBPayloadRepo = (
|
||||
repo: ApiRepositoryResponseRead
|
||||
repo: ApiRepositoryResponseRead,
|
||||
) => {
|
||||
const imageBuilderRepo: Repository = {
|
||||
id: repo.uuid!,
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ export const CreateSaveAndBuildBtn = ({
|
|||
const analyticsData = createAnalytics(
|
||||
requestBody as CreateBlueprintRequest,
|
||||
packages,
|
||||
isBeta
|
||||
isBeta,
|
||||
);
|
||||
analytics.track(`${AMPLITUDE_MODULE_NAME} - Blueprint Created`, {
|
||||
...analyticsData,
|
||||
|
|
@ -84,7 +84,7 @@ export const CreateSaveAndBuildBtn = ({
|
|||
module: AMPLITUDE_MODULE_NAME,
|
||||
trigger: 'blueprint_created',
|
||||
image_request_types: requestBody.image_requests.map(
|
||||
(req) => req.image_type
|
||||
(req) => req.image_type,
|
||||
),
|
||||
});
|
||||
}
|
||||
|
|
@ -133,7 +133,7 @@ export const CreateSaveButton = ({
|
|||
const dispatch = useAppDispatch();
|
||||
const [showModal, setShowModal] = useState(false);
|
||||
const wasModalSeen = window.localStorage.getItem(
|
||||
'imageBuilder.saveAndBuildModalSeen'
|
||||
'imageBuilder.saveAndBuildModalSeen',
|
||||
);
|
||||
|
||||
const SaveAndBuildImagesModal = () => {
|
||||
|
|
@ -180,7 +180,7 @@ export const CreateSaveButton = ({
|
|||
const analyticsData = createAnalytics(
|
||||
requestBody as CreateBlueprintRequest,
|
||||
packages,
|
||||
isBeta
|
||||
isBeta,
|
||||
);
|
||||
analytics.track(`${AMPLITUDE_MODULE_NAME} - Blueprint Created`, {
|
||||
...analyticsData,
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ export const EditSaveAndBuildBtn = ({
|
|||
const analyticsData = createAnalytics(
|
||||
requestBody as CreateBlueprintRequest,
|
||||
packages,
|
||||
isBeta
|
||||
isBeta,
|
||||
);
|
||||
analytics.track(`${AMPLITUDE_MODULE_NAME} - Blueprint Updated`, {
|
||||
...analyticsData,
|
||||
|
|
@ -76,7 +76,7 @@ export const EditSaveAndBuildBtn = ({
|
|||
module: AMPLITUDE_MODULE_NAME,
|
||||
trigger: 'blueprint_updated',
|
||||
image_request_types: requestBody.image_requests.map(
|
||||
(req) => req.image_type
|
||||
(req) => req.image_type,
|
||||
),
|
||||
});
|
||||
}
|
||||
|
|
@ -131,7 +131,7 @@ export const EditSaveButton = ({
|
|||
const analyticsData = createAnalytics(
|
||||
requestBody as CreateBlueprintRequest,
|
||||
packages,
|
||||
isBeta
|
||||
isBeta,
|
||||
);
|
||||
analytics.track(`${AMPLITUDE_MODULE_NAME} - Blueprint Updated`, {
|
||||
...analyticsData,
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ const Review = () => {
|
|||
toggleContent={composeExpandable(
|
||||
'Image output',
|
||||
'revisit-image-output',
|
||||
'step-image-output'
|
||||
'step-image-output',
|
||||
)}
|
||||
onToggle={(_event, isExpandedImageOutput) =>
|
||||
onToggleImageOutput(isExpandedImageOutput)
|
||||
|
|
@ -210,7 +210,7 @@ const Review = () => {
|
|||
toggleContent={composeExpandable(
|
||||
'Target environments',
|
||||
'revisit-target-environments',
|
||||
'step-image-output'
|
||||
'step-image-output',
|
||||
)}
|
||||
onToggle={(_event, isExpandedTargetEnvs) =>
|
||||
onToggleTargetEnvs(isExpandedTargetEnvs)
|
||||
|
|
@ -297,7 +297,7 @@ const Review = () => {
|
|||
toggleContent={composeExpandable(
|
||||
'Registration',
|
||||
'revisit-registration',
|
||||
'step-register'
|
||||
'step-register',
|
||||
)}
|
||||
onToggle={(_event, isExpandedRegistration) =>
|
||||
onToggleRegistration(isExpandedRegistration)
|
||||
|
|
@ -318,7 +318,7 @@ const Review = () => {
|
|||
toggleContent={composeExpandable(
|
||||
'OpenSCAP',
|
||||
'revisit-openscap',
|
||||
'step-oscap'
|
||||
'step-oscap',
|
||||
)}
|
||||
onToggle={(_event, isExpandedOscapDetail) =>
|
||||
onToggleOscapDetails(isExpandedOscapDetail)
|
||||
|
|
@ -335,7 +335,7 @@ const Review = () => {
|
|||
toggleContent={composeExpandable(
|
||||
'Compliance',
|
||||
'revisit-compliance',
|
||||
'step-oscap'
|
||||
'step-oscap',
|
||||
)}
|
||||
onToggle={(_event, isExpandedComplianceDetail) =>
|
||||
onToggleComplianceDetails(isExpandedComplianceDetail)
|
||||
|
|
@ -352,7 +352,7 @@ const Review = () => {
|
|||
toggleContent={composeExpandable(
|
||||
'File system configuration',
|
||||
'revisit-file-system',
|
||||
'step-file-system'
|
||||
'step-file-system',
|
||||
)}
|
||||
onToggle={(_event, isExpandedFSC) => onToggleFSC(isExpandedFSC)}
|
||||
isExpanded={isExpandedFSC}
|
||||
|
|
@ -366,7 +366,7 @@ const Review = () => {
|
|||
toggleContent={composeExpandable(
|
||||
'Content',
|
||||
'revisit-custom-repositories',
|
||||
'wizard-custom-repositories'
|
||||
'wizard-custom-repositories',
|
||||
)}
|
||||
onToggle={(_event, isExpandedContent) =>
|
||||
onToggleContent(isExpandedContent)
|
||||
|
|
@ -382,7 +382,7 @@ const Review = () => {
|
|||
toggleContent={composeExpandable(
|
||||
'Users',
|
||||
'revisit-users',
|
||||
'wizard-users'
|
||||
'wizard-users',
|
||||
)}
|
||||
onToggle={(_event, isExpandedUsers) => onToggleUsers(isExpandedUsers)}
|
||||
isExpanded={isExpandedUsers}
|
||||
|
|
@ -397,7 +397,7 @@ const Review = () => {
|
|||
toggleContent={composeExpandable(
|
||||
'Timezone',
|
||||
'revisit-timezone',
|
||||
'wizard-timezone'
|
||||
'wizard-timezone',
|
||||
)}
|
||||
onToggle={(_event, isExpandedTimezone) =>
|
||||
onToggleTimezone(isExpandedTimezone)
|
||||
|
|
@ -415,7 +415,7 @@ const Review = () => {
|
|||
toggleContent={composeExpandable(
|
||||
'Locale',
|
||||
'revisit-locale',
|
||||
'wizard-locale'
|
||||
'wizard-locale',
|
||||
)}
|
||||
onToggle={(_event, isExpandedLocale) =>
|
||||
onToggleLocale(isExpandedLocale)
|
||||
|
|
@ -432,7 +432,7 @@ const Review = () => {
|
|||
toggleContent={composeExpandable(
|
||||
'Hostname',
|
||||
'revisit-hostname',
|
||||
'wizard-hostname'
|
||||
'wizard-hostname',
|
||||
)}
|
||||
onToggle={(_event, isExpandedHostname) =>
|
||||
onToggleHostname(isExpandedHostname)
|
||||
|
|
@ -449,7 +449,7 @@ const Review = () => {
|
|||
toggleContent={composeExpandable(
|
||||
'Kernel',
|
||||
'revisit-kernel',
|
||||
'wizard-kernel'
|
||||
'wizard-kernel',
|
||||
)}
|
||||
onToggle={(_event, isExpandedKernel) =>
|
||||
onToggleKernel(isExpandedKernel)
|
||||
|
|
@ -468,7 +468,7 @@ const Review = () => {
|
|||
toggleContent={composeExpandable(
|
||||
'Firewall',
|
||||
'revisit-firewall',
|
||||
'wizard-firewall'
|
||||
'wizard-firewall',
|
||||
)}
|
||||
onToggle={(_event, isExpandedFirewall) =>
|
||||
onToggleFirewall(isExpandedFirewall)
|
||||
|
|
@ -487,7 +487,7 @@ const Review = () => {
|
|||
toggleContent={composeExpandable(
|
||||
'Systemd services',
|
||||
'revisit-services',
|
||||
'wizard-services'
|
||||
'wizard-services',
|
||||
)}
|
||||
onToggle={(_event, isExpandedServices) =>
|
||||
onToggleServices(isExpandedServices)
|
||||
|
|
@ -503,7 +503,7 @@ const Review = () => {
|
|||
toggleContent={composeExpandable(
|
||||
'First boot',
|
||||
'revisit-first-boot',
|
||||
'wizard-first-boot'
|
||||
'wizard-first-boot',
|
||||
)}
|
||||
onToggle={(_event, isExpandableFirstBoot) =>
|
||||
onToggleFirstBoot(isExpandableFirstBoot)
|
||||
|
|
@ -519,7 +519,7 @@ const Review = () => {
|
|||
toggleContent={composeExpandable(
|
||||
'Details',
|
||||
'revisit-details',
|
||||
'step-details'
|
||||
'step-details',
|
||||
)}
|
||||
onToggle={(_event, isExpandedImageDetail) =>
|
||||
onToggleImageDetail(isExpandedImageDetail)
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ const RepoName = ({ repoUuid }: repoPropType) => {
|
|||
contentType: 'rpm',
|
||||
origin: ContentOrigin.ALL,
|
||||
},
|
||||
{ skip: !repoUuid }
|
||||
{ skip: !repoUuid },
|
||||
);
|
||||
|
||||
const errorLoading = () => {
|
||||
|
|
@ -132,7 +132,7 @@ export const SnapshotTable = ({
|
|||
{
|
||||
uuid: template,
|
||||
},
|
||||
{ refetchOnMountOrArgChange: true, skip: template === '' }
|
||||
{ refetchOnMountOrArgChange: true, skip: template === '' },
|
||||
);
|
||||
|
||||
const { data, isSuccess, isLoading, isError } = useListRepositoriesQuery({
|
||||
|
|
@ -148,7 +148,7 @@ export const SnapshotTable = ({
|
|||
const isAfterSet = new Set(
|
||||
snapshotForDate
|
||||
.filter(({ is_after }) => is_after)
|
||||
.map(({ repository_uuid }) => repository_uuid)
|
||||
.map(({ repository_uuid }) => repository_uuid),
|
||||
);
|
||||
|
||||
const stringToDateToMMDDYYYY = (strDate: string) => {
|
||||
|
|
@ -244,7 +244,7 @@ export const RepositoriesTable = () => {
|
|||
const distribution = useAppSelector(selectDistribution);
|
||||
const repositoriesList = useAppSelector(selectCustomRepositories);
|
||||
const recommendedRepositoriesList = useAppSelector(
|
||||
selectRecommendedRepositories
|
||||
selectRecommendedRepositories,
|
||||
);
|
||||
return (
|
||||
<Panel isScrollable>
|
||||
|
|
|
|||
|
|
@ -115,13 +115,13 @@ export const ImageOutputList = () => {
|
|||
{toMonthAndYear(
|
||||
distribution === RHEL_8
|
||||
? RHEL_8_FULL_SUPPORT[1]
|
||||
: RHEL_9_FULL_SUPPORT[1]
|
||||
: RHEL_9_FULL_SUPPORT[1],
|
||||
)}
|
||||
, with optional ELS support through{' '}
|
||||
{toMonthAndYear(
|
||||
distribution === RHEL_8
|
||||
? RHEL_8_MAINTENANCE_SUPPORT[1]
|
||||
: RHEL_9_MAINTENANCE_SUPPORT[1]
|
||||
: RHEL_9_MAINTENANCE_SUPPORT[1],
|
||||
)}
|
||||
. Consider building an image with {RELEASES.get(RHEL_10)} to extend
|
||||
the support period.
|
||||
|
|
@ -149,7 +149,7 @@ export const ImageOutputList = () => {
|
|||
};
|
||||
export const FSCList = () => {
|
||||
const fileSystemConfigurationType = useAppSelector(
|
||||
selectFileSystemConfigurationType
|
||||
selectFileSystemConfigurationType,
|
||||
);
|
||||
const partitions = useAppSelector(selectPartitions);
|
||||
|
||||
|
|
@ -235,7 +235,7 @@ export const TargetEnvAWSList = () => {
|
|||
selectFromResult: ({ data }) => ({
|
||||
source: data?.data?.find((source) => source?.id === sourceId),
|
||||
}),
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return (
|
||||
|
|
@ -367,7 +367,7 @@ export const TargetEnvAzureList = () => {
|
|||
<Content component={ContentVariants.dd}>
|
||||
{
|
||||
rawAzureSources?.data?.find(
|
||||
(source) => source?.id === azureSource
|
||||
(source) => source?.id === azureSource,
|
||||
)?.name
|
||||
}
|
||||
</Content>
|
||||
|
|
@ -445,7 +445,7 @@ export const ContentList = () => {
|
|||
...customRepositories.map(({ id }) => id),
|
||||
...recommendedRepositories.map(({ uuid }) => uuid),
|
||||
] as string[],
|
||||
[customRepositories, recommendedRepositories]
|
||||
[customRepositories, recommendedRepositories],
|
||||
);
|
||||
|
||||
const [listSnapshotsByDate, { data, isSuccess, isLoading, isError }] =
|
||||
|
|
@ -470,7 +470,7 @@ export const ContentList = () => {
|
|||
]);
|
||||
|
||||
const duplicatePackages = packages.filter(
|
||||
(item, index) => packages.indexOf(item) !== index
|
||||
(item, index) => packages.indexOf(item) !== index,
|
||||
);
|
||||
|
||||
const noRepositoriesSelected =
|
||||
|
|
@ -484,7 +484,7 @@ export const ContentList = () => {
|
|||
{
|
||||
uuid: template,
|
||||
},
|
||||
{ refetchOnMountOrArgChange: true, skip: template === '' }
|
||||
{ refetchOnMountOrArgChange: true, skip: template === '' },
|
||||
);
|
||||
|
||||
const snapshottingText = useMemo(() => {
|
||||
|
|
@ -522,7 +522,7 @@ export const ContentList = () => {
|
|||
: template
|
||||
? 'Use content from the content template'
|
||||
: `Repositories as of ${yyyyMMddFormat(
|
||||
new Date(snapshotDate)
|
||||
new Date(snapshotDate),
|
||||
)}`
|
||||
}
|
||||
hasAutoWidth
|
||||
|
|
@ -657,7 +657,7 @@ export const RegisterNowList = () => {
|
|||
{ name: activationKey },
|
||||
{
|
||||
skip: !activationKey,
|
||||
}
|
||||
},
|
||||
);
|
||||
return (
|
||||
<>
|
||||
|
|
|
|||
|
|
@ -37,19 +37,19 @@ const ServicesInput = () => {
|
|||
},
|
||||
{
|
||||
skip: !complianceProfileID,
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const disabledRequiredByOpenSCAP = disabledServices.filter((service) =>
|
||||
oscapProfileInfo?.services?.disabled?.includes(service)
|
||||
oscapProfileInfo?.services?.disabled?.includes(service),
|
||||
);
|
||||
|
||||
const maskedRequiredByOpenSCAP = maskedServices.filter((service) =>
|
||||
oscapProfileInfo?.services?.masked?.includes(service)
|
||||
oscapProfileInfo?.services?.masked?.includes(service),
|
||||
);
|
||||
|
||||
const enabledRequiredByOpenSCAP = enabledServices.filter((service) =>
|
||||
oscapProfileInfo?.services?.enabled?.includes(service)
|
||||
oscapProfileInfo?.services?.enabled?.includes(service),
|
||||
);
|
||||
|
||||
return (
|
||||
|
|
@ -60,7 +60,7 @@ const ServicesInput = () => {
|
|||
placeholder="Add enabled service"
|
||||
validator={isServiceValid}
|
||||
list={enabledServices.filter(
|
||||
(service) => !enabledRequiredByOpenSCAP.includes(service)
|
||||
(service) => !enabledRequiredByOpenSCAP.includes(service),
|
||||
)}
|
||||
requiredList={enabledRequiredByOpenSCAP}
|
||||
requiredCategoryName="Required by OpenSCAP"
|
||||
|
|
@ -78,7 +78,7 @@ const ServicesInput = () => {
|
|||
validator={isServiceValid}
|
||||
list={disabledServices.filter(
|
||||
(service) =>
|
||||
!oscapProfileInfo?.services?.disabled?.includes(service)
|
||||
!oscapProfileInfo?.services?.disabled?.includes(service),
|
||||
)}
|
||||
requiredList={disabledRequiredByOpenSCAP}
|
||||
requiredCategoryName="Required by OpenSCAP"
|
||||
|
|
@ -95,7 +95,7 @@ const ServicesInput = () => {
|
|||
placeholder="Add masked service"
|
||||
validator={isServiceValid}
|
||||
list={maskedServices.filter(
|
||||
(service) => !oscapProfileInfo?.services?.masked?.includes(service)
|
||||
(service) => !oscapProfileInfo?.services?.masked?.includes(service),
|
||||
)}
|
||||
requiredList={maskedRequiredByOpenSCAP}
|
||||
requiredCategoryName="Required by OpenSCAP"
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ const ConditionalTooltip = ({ show, children, setDisabled, ...rest }: Props) =>
|
|||
{children &&
|
||||
cloneElement(
|
||||
children,
|
||||
setDisabled ? { isDisabled: setDisabled } : undefined
|
||||
setDisabled ? { isDisabled: setDisabled } : undefined,
|
||||
)}
|
||||
</div>
|
||||
</Tooltip>
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ export default function Snapshot() {
|
|||
const isTemplatesEnabled = useFlag('image-builder.templates.enabled');
|
||||
|
||||
const handleOptionChange = (
|
||||
option: 'latest' | 'snapshotDate' | 'template'
|
||||
option: 'latest' | 'snapshotDate' | 'template',
|
||||
): void => {
|
||||
setSelectedOption(option);
|
||||
switch (option) {
|
||||
|
|
|
|||
|
|
@ -51,12 +51,12 @@ const Templates = () => {
|
|||
limit: perPage,
|
||||
offset: perPage * (page - 1),
|
||||
},
|
||||
{ refetchOnMountOrArgChange: 60 }
|
||||
{ refetchOnMountOrArgChange: 60 },
|
||||
);
|
||||
|
||||
const handleRowSelect = (
|
||||
templateUuid: string | undefined,
|
||||
templateName: string | undefined
|
||||
templateName: string | undefined,
|
||||
): void => {
|
||||
if (templateUuid) {
|
||||
dispatch(changeTemplate(templateUuid));
|
||||
|
|
@ -69,7 +69,7 @@ const Templates = () => {
|
|||
const handlePerPageSelect = (
|
||||
_: React.MouseEvent,
|
||||
newPerPage: number,
|
||||
newPage: number
|
||||
newPage: number,
|
||||
) => {
|
||||
setPerPage(newPerPage);
|
||||
setPage(newPage);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ export const AwsAccountId = () => {
|
|||
{
|
||||
id: parseInt(sourceId as string),
|
||||
},
|
||||
{ skip: sourceId === undefined || sourceId === '' }
|
||||
{ skip: sourceId === undefined || sourceId === '' },
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ export const AwsSourcesSelect = () => {
|
|||
const chosenSource = sources?.find((source) => source?.id === sourceId);
|
||||
|
||||
const [selectOptions, setSelectOptions] = useState<(string | undefined)[]>(
|
||||
sources ? sources.map((source) => source?.name) : []
|
||||
sources ? sources.map((source) => source?.name) : [],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -49,7 +49,7 @@ export const AwsSourcesSelect = () => {
|
|||
filteredSources = sources
|
||||
.map((source) => source?.name)
|
||||
.filter((source: string) =>
|
||||
String(source).toLowerCase().includes(filterValue.toLowerCase())
|
||||
String(source).toLowerCase().includes(filterValue.toLowerCase()),
|
||||
);
|
||||
if (!isOpen) {
|
||||
setIsOpen(true);
|
||||
|
|
@ -85,7 +85,7 @@ export const AwsSourcesSelect = () => {
|
|||
|
||||
const handleSelect = (
|
||||
_event: React.MouseEvent<Element, MouseEvent>,
|
||||
value: string
|
||||
value: string,
|
||||
) => {
|
||||
const source = sources?.find((source) => source?.name === value);
|
||||
dispatch(changeAwsSourceId(source?.id));
|
||||
|
|
@ -114,15 +114,15 @@ export const AwsSourcesSelect = () => {
|
|||
selectOptionsElement.push(
|
||||
<SelectOption key={index} value={key}>
|
||||
{key}
|
||||
</SelectOption>
|
||||
)
|
||||
</SelectOption>,
|
||||
),
|
||||
);
|
||||
|
||||
if (isFetching) {
|
||||
selectOptionsElement.push(
|
||||
<SelectOption key="fetching" value="loader">
|
||||
<Spinner size="lg" />
|
||||
</SelectOption>
|
||||
</SelectOption>,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -130,7 +130,7 @@ export const AwsSourcesSelect = () => {
|
|||
selectOptionsElement.push(
|
||||
<SelectOption key="no_results" value="no_results" isDisabled>
|
||||
No results found
|
||||
</SelectOption>
|
||||
</SelectOption>,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ const AWSRegion = ({ value, onChange }: FormGroupProps<string>) => {
|
|||
|
||||
const onSelect = (
|
||||
_event: React.MouseEvent<Element, MouseEvent> | undefined,
|
||||
value: string | number | undefined
|
||||
value: string | number | undefined,
|
||||
) => {
|
||||
onChange(value as string);
|
||||
setIsOpen(false);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ export const AzureAuthButton = () => {
|
|||
const tenantId = useAppSelector(selectAzureTenantId);
|
||||
const guidRegex = new RegExp(
|
||||
'^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$',
|
||||
'i'
|
||||
'i',
|
||||
);
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export const AzureResourceGroups = () => {
|
|||
{ id: parseInt(azureSource as string) },
|
||||
{
|
||||
skip: !azureSource,
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// use a static empty array to avoid an infinite render loop in useEffect functions depending
|
||||
|
|
@ -54,7 +54,7 @@ export const AzureResourceGroups = () => {
|
|||
|
||||
if (filterValue) {
|
||||
filteredGroups = resourceGroups.filter((group: string) =>
|
||||
String(group).toLowerCase().includes(filterValue.toLowerCase())
|
||||
String(group).toLowerCase().includes(filterValue.toLowerCase()),
|
||||
);
|
||||
if (!isOpen) {
|
||||
setIsOpen(true);
|
||||
|
|
@ -86,7 +86,7 @@ export const AzureResourceGroups = () => {
|
|||
|
||||
const setResourceGroup = (
|
||||
_event: React.MouseEvent<Element, MouseEvent>,
|
||||
selection: string
|
||||
selection: string,
|
||||
) => {
|
||||
const resource =
|
||||
resourceGroups.find((resource) => resource === selection) || '';
|
||||
|
|
|
|||
|
|
@ -53,18 +53,18 @@ export const AzureSourcesSelect = () => {
|
|||
{ id: parseInt(azureSource as string) },
|
||||
{
|
||||
skip: !azureSource,
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const [selectOptions, setSelectOptions] = useState<(string | undefined)[]>(
|
||||
rawSources?.data?.map((source) => source?.name) || []
|
||||
rawSources?.data?.map((source) => source?.name) || [],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (isFetchingDetails || !isSuccessDetails) return;
|
||||
dispatch(changeAzureTenantId(sourceDetails?.azure?.tenant_id || ''));
|
||||
dispatch(
|
||||
changeAzureSubscriptionId(sourceDetails?.azure?.subscription_id || '')
|
||||
changeAzureSubscriptionId(sourceDetails?.azure?.subscription_id || ''),
|
||||
);
|
||||
}, [
|
||||
isFetchingDetails,
|
||||
|
|
@ -81,7 +81,7 @@ export const AzureSourcesSelect = () => {
|
|||
filteredSources = rawSources?.data
|
||||
?.map((source) => source?.name)
|
||||
.filter((source: string) =>
|
||||
String(source).toLowerCase().includes(filterValue.toLowerCase())
|
||||
String(source).toLowerCase().includes(filterValue.toLowerCase()),
|
||||
);
|
||||
if (!isOpen) {
|
||||
setIsOpen(true);
|
||||
|
|
@ -116,10 +116,10 @@ export const AzureSourcesSelect = () => {
|
|||
|
||||
const handleSelect = (
|
||||
_event: React.MouseEvent<Element, MouseEvent>,
|
||||
sourceName: string
|
||||
sourceName: string,
|
||||
) => {
|
||||
const sourceId = rawSources?.data?.find(
|
||||
(source) => source?.name === sourceName
|
||||
(source) => source?.name === sourceName,
|
||||
)?.id;
|
||||
dispatch(changeAzureSource(sourceId || ''));
|
||||
dispatch(changeAzureResourceGroup(''));
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ const RemoveUserModal = ({
|
|||
const nextTabIndex = calculateNewIndex(
|
||||
tabIndex,
|
||||
activeTabKey,
|
||||
users.length
|
||||
users.length,
|
||||
);
|
||||
|
||||
setActiveTabKey(nextTabIndex);
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ const UserInfo = () => {
|
|||
const nextTabIndex = calculateNewIndex(
|
||||
tabIndex,
|
||||
activeTabKey,
|
||||
users.length
|
||||
users.length,
|
||||
);
|
||||
setActiveTabKey(nextTabIndex);
|
||||
setIndex(nextTabIndex);
|
||||
|
|
@ -97,31 +97,31 @@ const UserInfo = () => {
|
|||
|
||||
const handleNameChange = (
|
||||
_e: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>,
|
||||
value: string
|
||||
value: string,
|
||||
) => {
|
||||
dispatch(setUserNameByIndex({ index: index, name: value }));
|
||||
};
|
||||
|
||||
const handlePasswordChange = (
|
||||
_event: React.FormEvent<HTMLInputElement>,
|
||||
value: string
|
||||
value: string,
|
||||
) => {
|
||||
dispatch(setUserPasswordByIndex({ index: index, password: value }));
|
||||
};
|
||||
|
||||
const handleSshKeyChange = (
|
||||
_event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>,
|
||||
value: string
|
||||
value: string,
|
||||
) => {
|
||||
dispatch(setUserSshKeyByIndex({ index: index, sshKey: value }));
|
||||
};
|
||||
|
||||
const handleCheckboxChange = (
|
||||
_event: React.FormEvent<HTMLInputElement>,
|
||||
value: boolean
|
||||
value: boolean,
|
||||
) => {
|
||||
dispatch(
|
||||
setUserAdministratorByIndex({ index: index, isAdministrator: value })
|
||||
setUserAdministratorByIndex({ index: index, isAdministrator: value }),
|
||||
);
|
||||
};
|
||||
|
||||
|
|
@ -164,7 +164,7 @@ const UserInfo = () => {
|
|||
{Object.entries(getValidationByIndex(index).errors).some(
|
||||
([field, error]) =>
|
||||
Boolean(error) &&
|
||||
!(field === 'userName' && error === 'Required value')
|
||||
!(field === 'userName' && error === 'Required value'),
|
||||
) && (
|
||||
<Icon status="danger">
|
||||
<ExclamationCircleIcon title="Validation error" />
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
function calculateNewIndex(
|
||||
tabIndex: number,
|
||||
activeTabKey: number,
|
||||
usersLength: number
|
||||
usersLength: number,
|
||||
) {
|
||||
const tabIndexNum = tabIndex;
|
||||
let nextTabIndex = activeTabKey;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ export const PasswordValidatedInput = ({
|
|||
|
||||
const { validationState } = checkPasswordValidity(
|
||||
value,
|
||||
environments.includes('azure')
|
||||
environments.includes('azure'),
|
||||
);
|
||||
const { ruleLength, ruleCharacters } = validationState;
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ export const useCheckRepositoriesAvailability = () => {
|
|||
},
|
||||
{
|
||||
skip: skip,
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const { data: freshRepos, isSuccess } = useMemo(() => {
|
||||
|
|
@ -64,7 +64,7 @@ export const useCheckRepositoriesAvailability = () => {
|
|||
// Transform the fresh repos array into a Set to access its elements in O(1)
|
||||
// complexity later in the for loop.
|
||||
const freshReposUrls = new Set(
|
||||
freshRepos?.data?.map((freshRepo) => freshRepo.url)
|
||||
freshRepos?.data?.map((freshRepo) => freshRepo.url),
|
||||
);
|
||||
for (const customRepo of customRepositories) {
|
||||
if (customRepo.baseurl && !freshReposUrls.has(customRepo.baseurl[0])) {
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ import { GcpAccountType, GcpShareMethod } from '../steps/TargetEnvironment/Gcp';
|
|||
*/
|
||||
export const mapRequestFromState = (
|
||||
store: Store,
|
||||
orgID: string
|
||||
orgID: string,
|
||||
): CreateBlueprintRequest | CockpitCreateBlueprintRequest => {
|
||||
const state = store.getState();
|
||||
const imageRequests = getImageRequests(state);
|
||||
|
|
@ -174,17 +174,17 @@ const getLatestRelease = (distribution: Distributions) => {
|
|||
};
|
||||
|
||||
function commonRequestToState(
|
||||
request: BlueprintResponse | CreateBlueprintRequest
|
||||
request: BlueprintResponse | CreateBlueprintRequest,
|
||||
) {
|
||||
const gcp = request.image_requests.find(
|
||||
(image) => image.image_type === 'gcp'
|
||||
(image) => image.image_type === 'gcp',
|
||||
);
|
||||
const aws = request.image_requests.find(
|
||||
(image) => image.image_type === 'aws'
|
||||
(image) => image.image_type === 'aws',
|
||||
);
|
||||
|
||||
const azure = request.image_requests.find(
|
||||
(image) => image.image_type === 'azure'
|
||||
(image) => image.image_type === 'azure',
|
||||
);
|
||||
|
||||
const snapshotDateFromRequest =
|
||||
|
|
@ -272,7 +272,7 @@ function commonRequestToState(
|
|||
? {
|
||||
mode: 'manual' as FileSystemConfigurationType,
|
||||
partitions: request.customizations?.filesystem.map((fs) =>
|
||||
convertFilesystemToPartition(fs)
|
||||
convertFilesystemToPartition(fs),
|
||||
),
|
||||
}
|
||||
: {
|
||||
|
|
@ -298,7 +298,7 @@ function commonRequestToState(
|
|||
? 'withGoogle'
|
||||
: 'withInsights') as GcpShareMethod,
|
||||
accountType: gcpUploadOptions?.share_with_accounts?.[0].split(
|
||||
':'
|
||||
':',
|
||||
)[0] as GcpAccountType,
|
||||
email: gcpUploadOptions?.share_with_accounts?.[0].split(':')[1] || '',
|
||||
},
|
||||
|
|
@ -408,7 +408,7 @@ export const mapRequestToState = (request: BlueprintResponse): wizardState => {
|
|||
};
|
||||
|
||||
export function mapToCustomRepositories(
|
||||
repo: ApiRepositoryImportResponseRead
|
||||
repo: ApiRepositoryImportResponseRead,
|
||||
): CustomRepository[] {
|
||||
if (!repo.uuid) return [];
|
||||
return [
|
||||
|
|
@ -432,7 +432,7 @@ export function mapToCustomRepositories(
|
|||
*/
|
||||
export const mapExportRequestToState = (
|
||||
request: BlueprintExportResponse,
|
||||
image_requests: ImageRequest[]
|
||||
image_requests: ImageRequest[],
|
||||
): wizardState => {
|
||||
const wizardMode = 'create';
|
||||
const blueprintResponse: CreateBlueprintRequest = {
|
||||
|
|
@ -462,7 +462,7 @@ const getFirstBootScript = (files?: File[]): string => {
|
|||
};
|
||||
|
||||
const getImageRequests = (
|
||||
state: RootState
|
||||
state: RootState,
|
||||
): ImageRequest[] | CockpitImageRequest[] => {
|
||||
const imageTypes = selectImageTypes(state);
|
||||
const snapshotDate = selectSnapshotDate(state);
|
||||
|
|
@ -484,13 +484,13 @@ const getImageRequests = (
|
|||
|
||||
const getSatelliteCommand = (files?: File[]): string => {
|
||||
const satelliteCommandFile = files?.find(
|
||||
(file) => file.path === SATELLITE_PATH
|
||||
(file) => file.path === SATELLITE_PATH,
|
||||
);
|
||||
return satelliteCommandFile?.data ? atob(satelliteCommandFile.data) : '';
|
||||
};
|
||||
|
||||
const uploadTypeByTargetEnv = (
|
||||
imageType: ImageTypes
|
||||
imageType: ImageTypes,
|
||||
): UploadTypes | CockpitUploadTypes => {
|
||||
switch (imageType) {
|
||||
case 'aws':
|
||||
|
|
@ -520,7 +520,7 @@ const uploadTypeByTargetEnv = (
|
|||
};
|
||||
const getImageOptions = (
|
||||
imageType: ImageTypes,
|
||||
state: RootState
|
||||
state: RootState,
|
||||
):
|
||||
| AwsUploadRequestOptions
|
||||
| AzureUploadRequestOptions
|
||||
|
|
@ -715,7 +715,7 @@ const getFileSystem = (state: RootState): Filesystem[] | undefined => {
|
|||
return {
|
||||
min_size: convertToBytes(
|
||||
partition.min_size,
|
||||
getConversionFactor(partition.unit)
|
||||
getConversionFactor(partition.unit),
|
||||
),
|
||||
mountpoint: partition.mountpoint,
|
||||
};
|
||||
|
|
@ -761,7 +761,7 @@ const getTimezone = (state: RootState) => {
|
|||
|
||||
const getSubscription = (
|
||||
state: RootState,
|
||||
orgID: string
|
||||
orgID: string,
|
||||
): Subscription | undefined => {
|
||||
const registrationType = selectRegistrationType(state);
|
||||
const activationKey = selectActivationKey(state);
|
||||
|
|
@ -775,7 +775,7 @@ const getSubscription = (
|
|||
|
||||
if (activationKey === undefined) {
|
||||
throw new Error(
|
||||
'Activation key unexpectedly undefined while generating subscription customization'
|
||||
'Activation key unexpectedly undefined while generating subscription customization',
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -845,7 +845,7 @@ const getCustomRepositories = (state: RootState) => {
|
|||
|
||||
for (const repo in recommendedRepositories) {
|
||||
customAndRecommendedRepositories.push(
|
||||
convertSchemaToIBCustomRepo(recommendedRepositories[repo])
|
||||
convertSchemaToIBCustomRepo(recommendedRepositories[repo]),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -863,7 +863,7 @@ const getPayloadRepositories = (state: RootState) => {
|
|||
|
||||
for (const repo in recommendedRepositories) {
|
||||
payloadAndRecommendedRepositories.push(
|
||||
convertSchemaToIBPayloadRepo(recommendedRepositories[repo])
|
||||
convertSchemaToIBPayloadRepo(recommendedRepositories[repo]),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { Distributions, ImageRequest } from '../../../store/imageBuilderApi';
|
|||
|
||||
export const generateDefaultName = (
|
||||
distribution: Distributions,
|
||||
arch: ImageRequest['architecture']
|
||||
arch: ImageRequest['architecture'],
|
||||
) => {
|
||||
const date = new Date();
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ export function useRegistrationValidation(): StepValidation {
|
|||
const registrationType = useAppSelector(selectRegistrationType);
|
||||
const activationKey = useAppSelector(selectActivationKey);
|
||||
const registrationCommand = useAppSelector(
|
||||
selectSatelliteRegistrationCommand
|
||||
selectSatelliteRegistrationCommand,
|
||||
);
|
||||
const caCertificate = useAppSelector(selectSatelliteCaCertificate);
|
||||
|
||||
|
|
@ -127,7 +127,7 @@ export function useRegistrationValidation(): StepValidation {
|
|||
{ name: activationKey! },
|
||||
{
|
||||
skip: !activationKey,
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (
|
||||
|
|
@ -168,7 +168,7 @@ export function useRegistrationValidation(): StepValidation {
|
|||
}
|
||||
try {
|
||||
const match = registrationCommand?.match(
|
||||
/Bearer\s+([\w-]+\.[\w-]+\.[\w-]+)/
|
||||
/Bearer\s+([\w-]+\.[\w-]+\.[\w-]+)/,
|
||||
);
|
||||
if (!match) {
|
||||
Object.assign(errors, { command: 'Invalid or missing token' });
|
||||
|
|
@ -410,10 +410,10 @@ export function useFirewallValidation(): StepValidation {
|
|||
|
||||
const duplicatePorts = getListOfDuplicates(firewall.ports);
|
||||
const duplicateDisabledServices = getListOfDuplicates(
|
||||
firewall.services.disabled
|
||||
firewall.services.disabled,
|
||||
);
|
||||
const duplicateEnabledServices = getListOfDuplicates(
|
||||
firewall.services.enabled
|
||||
firewall.services.enabled,
|
||||
);
|
||||
|
||||
const portsError =
|
||||
|
|
@ -425,13 +425,13 @@ export function useFirewallValidation(): StepValidation {
|
|||
const duplicateDisabledServicesError =
|
||||
duplicateDisabledServices.length > 0
|
||||
? `Includes duplicate disabled services: ${duplicateDisabledServices.join(
|
||||
', '
|
||||
', ',
|
||||
)}`
|
||||
: '';
|
||||
const duplicateEnabledServicesError =
|
||||
duplicateEnabledServices.length > 0
|
||||
? `Includes duplicate enabled services: ${duplicateEnabledServices.join(
|
||||
', '
|
||||
', ',
|
||||
)}`
|
||||
: '';
|
||||
const disabledServicesError =
|
||||
|
|
@ -509,19 +509,19 @@ export function useServicesValidation(): StepValidation {
|
|||
const duplicateDisabledServicesError =
|
||||
duplicateDisabledServices.length > 0
|
||||
? `Includes duplicate disabled services: ${duplicateDisabledServices.join(
|
||||
', '
|
||||
', ',
|
||||
)}`
|
||||
: '';
|
||||
const duplicateMaskedServicesError =
|
||||
duplicateMaskedServices.length > 0
|
||||
? `Includes duplicate masked services: ${duplicateMaskedServices.join(
|
||||
', '
|
||||
', ',
|
||||
)}`
|
||||
: '';
|
||||
const duplicateEnabledServicesError =
|
||||
duplicateEnabledServices.length > 0
|
||||
? `Includes duplicate enabled services: ${duplicateEnabledServices.join(
|
||||
', '
|
||||
', ',
|
||||
)}`
|
||||
: '';
|
||||
|
||||
|
|
@ -547,7 +547,7 @@ export function useServicesValidation(): StepValidation {
|
|||
const validateUserName = (
|
||||
users: UserWithAdditionalInfo[],
|
||||
userName: string,
|
||||
currentIndex: number
|
||||
currentIndex: number,
|
||||
): string => {
|
||||
if (!userName) {
|
||||
return 'Required value';
|
||||
|
|
@ -558,7 +558,7 @@ const validateUserName = (
|
|||
|
||||
// check for duplicate names
|
||||
const count = users.filter(
|
||||
(user, index) => user.name === userName && index !== currentIndex
|
||||
(user, index) => user.name === userName && index !== currentIndex,
|
||||
).length;
|
||||
if (count > 0) {
|
||||
return 'Username already exists';
|
||||
|
|
@ -591,7 +591,7 @@ export function useUsersValidation(): UsersStepValidation {
|
|||
const sshKeyError = validateSshKey(users[index].ssh_key);
|
||||
const isPasswordValid = checkPasswordValidity(
|
||||
users[index].password,
|
||||
environments.includes('azure')
|
||||
environments.includes('azure'),
|
||||
).isValid;
|
||||
const passwordError =
|
||||
users[index].password && !isPasswordValid ? 'Invalid password' : '';
|
||||
|
|
@ -643,7 +643,7 @@ export function useUsersValidation(): UsersStepValidation {
|
|||
|
||||
export const checkPasswordValidity = (
|
||||
password: string,
|
||||
isAzure: boolean
|
||||
isAzure: boolean,
|
||||
): PasswordValidationResult => {
|
||||
if (!password) {
|
||||
return {
|
||||
|
|
@ -686,7 +686,7 @@ export const checkPasswordValidity = (
|
|||
const getStrength = (
|
||||
strCount: number,
|
||||
rulesCount: number,
|
||||
isAzure: boolean
|
||||
isAzure: boolean,
|
||||
): PasswordValidationResult['strength'] => {
|
||||
return isAzure && strCount >= 6 && rulesCount >= 3
|
||||
? { variant: 'success', icon: <CheckCircleIcon />, text: 'Strong' }
|
||||
|
|
@ -743,7 +743,7 @@ export function useDetailsValidation(): StepValidation {
|
|||
setUniqueName(true);
|
||||
});
|
||||
},
|
||||
UNIQUE_VALIDATION_DELAY // If name is empty string, instantly return
|
||||
UNIQUE_VALIDATION_DELAY, // If name is empty string, instantly return
|
||||
);
|
||||
|
||||
return () => {
|
||||
|
|
|
|||
|
|
@ -10,13 +10,13 @@ export const isAwsAccountIdValid = (awsAccountId: string | undefined) => {
|
|||
|
||||
export const isAzureTenantGUIDValid = (azureTenantGUID: string) => {
|
||||
return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(
|
||||
azureTenantGUID
|
||||
azureTenantGUID,
|
||||
);
|
||||
};
|
||||
|
||||
export const isAzureSubscriptionIdValid = (azureSubscriptionId: string) => {
|
||||
return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(
|
||||
azureSubscriptionId
|
||||
azureSubscriptionId,
|
||||
);
|
||||
};
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ export const isUserNameValid = (userName: string) => {
|
|||
const isLengthValid = userName.length <= 32;
|
||||
const isNotNumericOnly = !/^\d+$/.test(userName);
|
||||
const isPatternValid = /^[a-zA-Z0-9][a-zA-Z0-9_.-]*[a-zA-Z0-9_$]$/.test(
|
||||
userName
|
||||
userName,
|
||||
);
|
||||
|
||||
return isLengthValid && isNotNumericOnly && isPatternValid;
|
||||
|
|
@ -78,7 +78,7 @@ export const isSshKeyValid = (sshKey: string) => {
|
|||
// 3. Optional comment at the end.
|
||||
const isPatternValid =
|
||||
/^(ssh-(rsa|dss|ed25519)|ecdsa-sha2-nistp(256|384|521))\s+[A-Za-z0-9+/=]+(\s+\S+)?$/.test(
|
||||
sshKey
|
||||
sshKey,
|
||||
);
|
||||
return isPatternValid;
|
||||
};
|
||||
|
|
@ -108,7 +108,7 @@ export const isHostnameValid = (hostname: string) => {
|
|||
return (
|
||||
hostname.length < 65 &&
|
||||
/^(([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])$/.test(
|
||||
hostname
|
||||
hostname,
|
||||
)
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ const CloneRow = ({ clone }: CloneRowPropTypes) => {
|
|||
{
|
||||
id: clone.id,
|
||||
},
|
||||
{ pollingInterval: pollingInterval }
|
||||
{ pollingInterval: pollingInterval },
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ const AwsSourceName = ({ id }: AwsSourceNamePropTypes) => {
|
|||
};
|
||||
|
||||
const parseGcpSharedWith = (
|
||||
sharedWith: GcpUploadRequestOptions['share_with_accounts']
|
||||
sharedWith: GcpUploadRequestOptions['share_with_accounts'],
|
||||
) => {
|
||||
if (sharedWith) {
|
||||
const splitGCPSharedWith = sharedWith[0].split(':');
|
||||
|
|
@ -150,7 +150,7 @@ export const AwsDetails = ({ compose }: AwsDetailsPropTypes) => {
|
|||
|
||||
if (!isAwsUploadRequestOptions(options)) {
|
||||
throw TypeError(
|
||||
`Error: options must be of type AwsUploadRequestOptions, not ${typeof options}.`
|
||||
`Error: options must be of type AwsUploadRequestOptions, not ${typeof options}.`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -254,7 +254,7 @@ export const AzureDetails = ({ compose }: AzureDetailsPropTypes) => {
|
|||
|
||||
if (!isAzureUploadRequestOptions(options)) {
|
||||
throw TypeError(
|
||||
`Error: options must be of type AzureUploadRequestOptions, not ${typeof options}.`
|
||||
`Error: options must be of type AzureUploadRequestOptions, not ${typeof options}.`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -265,7 +265,7 @@ export const AzureDetails = ({ compose }: AzureDetailsPropTypes) => {
|
|||
|
||||
if (uploadStatus && !isAzureUploadStatus(uploadStatus)) {
|
||||
throw TypeError(
|
||||
`Error: uploadStatus must be of type AzureUploadStatus, not ${typeof uploadStatus}.`
|
||||
`Error: uploadStatus must be of type AzureUploadStatus, not ${typeof uploadStatus}.`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -343,7 +343,7 @@ export const GcpDetails = ({ compose }: GcpDetailsPropTypes) => {
|
|||
|
||||
if (!isGcpUploadRequestOptions(options)) {
|
||||
throw TypeError(
|
||||
`Error: options must be of type GcpUploadRequestOptions, not ${typeof options}.`
|
||||
`Error: options must be of type GcpUploadRequestOptions, not ${typeof options}.`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -351,7 +351,7 @@ export const GcpDetails = ({ compose }: GcpDetailsPropTypes) => {
|
|||
|
||||
if (uploadStatus && !isGcpUploadStatus(uploadStatus)) {
|
||||
throw TypeError(
|
||||
`Error: uploadStatus must be of type GcpUploadStatus, not ${typeof uploadStatus}.`
|
||||
`Error: uploadStatus must be of type GcpUploadStatus, not ${typeof uploadStatus}.`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -431,7 +431,7 @@ export const OciDetails = ({ compose }: OciDetailsPropTypes) => {
|
|||
|
||||
if (options && !isOciUploadStatus(options)) {
|
||||
throw TypeError(
|
||||
`Error: uploadStatus must be of type OciUploadStatus, not ${typeof options}.`
|
||||
`Error: uploadStatus must be of type OciUploadStatus, not ${typeof options}.`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ const ImagesTable = () => {
|
|||
useAppSelector(selectBlueprintSearchInput) || SEARCH_INPUT;
|
||||
const blueprintVersionFilter = useAppSelector(selectBlueprintVersionFilter);
|
||||
const blueprintVersionFilterAPI = useAppSelector(
|
||||
selectBlueprintVersionFilterAPI
|
||||
selectBlueprintVersionFilterAPI,
|
||||
);
|
||||
const blueprintsOffset = useAppSelector(selectOffset) || PAGINATION_OFFSET;
|
||||
const blueprintsLimit = useAppSelector(selectLimit) || PAGINATION_LIMIT;
|
||||
|
|
@ -129,10 +129,10 @@ const ImagesTable = () => {
|
|||
{
|
||||
selectFromResult: ({ data }) => ({
|
||||
selectedBlueprintVersion: data?.data.find(
|
||||
(blueprint: BlueprintItem) => blueprint.id === selectedBlueprintId
|
||||
(blueprint: BlueprintItem) => blueprint.id === selectedBlueprintId,
|
||||
)?.version,
|
||||
}),
|
||||
}
|
||||
},
|
||||
);
|
||||
const onSetPage: OnSetPage = (_, page) => setPage(page);
|
||||
|
||||
|
|
@ -177,7 +177,7 @@ const ImagesTable = () => {
|
|||
'edge-installer',
|
||||
],
|
||||
},
|
||||
{ skip: !!selectedBlueprintId }
|
||||
{ skip: !!selectedBlueprintId },
|
||||
);
|
||||
|
||||
const data = selectedBlueprintId ? blueprintsComposes : composesData;
|
||||
|
|
@ -310,14 +310,14 @@ type ImagesTableRowPropTypes = {
|
|||
|
||||
const ImagesTableRow = ({ compose, rowIndex }: ImagesTableRowPropTypes) => {
|
||||
const [pollingInterval, setPollingInterval] = useState(
|
||||
STATUS_POLLING_INTERVAL
|
||||
STATUS_POLLING_INTERVAL,
|
||||
);
|
||||
|
||||
const { data: composeStatus } = useGetComposeStatusQuery(
|
||||
{
|
||||
composeId: compose.id,
|
||||
},
|
||||
{ pollingInterval: pollingInterval }
|
||||
{ pollingInterval: pollingInterval },
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -404,7 +404,7 @@ type OciRowPropTypes = {
|
|||
|
||||
const OciRow = ({ compose, rowIndex }: OciRowPropTypes) => {
|
||||
const daysToExpiration = Math.floor(
|
||||
computeHoursToExpiration(compose.created_at) / 24
|
||||
computeHoursToExpiration(compose.created_at) / 24,
|
||||
);
|
||||
const isExpired = daysToExpiration >= OCI_STORAGE_EXPIRATION_TIME_IN_DAYS;
|
||||
|
||||
|
|
@ -492,7 +492,7 @@ const AwsRow = ({ compose, composeStatus, rowIndex }: AwsRowPropTypes) => {
|
|||
composeStatus,
|
||||
navigate,
|
||||
analytics,
|
||||
userData?.identity.internal?.account_id
|
||||
userData?.identity.internal?.account_id,
|
||||
)}
|
||||
/>
|
||||
);
|
||||
|
|
@ -633,7 +633,7 @@ const Row = ({
|
|||
items={defaultActions(
|
||||
compose,
|
||||
analytics,
|
||||
userData?.identity.internal?.account_id
|
||||
userData?.identity.internal?.account_id,
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
|
|
@ -651,7 +651,7 @@ const Row = ({
|
|||
const defaultActions = (
|
||||
compose: ComposesResponseItem,
|
||||
analytics: Analytics,
|
||||
account_id: string | undefined
|
||||
account_id: string | undefined,
|
||||
) => {
|
||||
const name = `request-${compose.id}.json`;
|
||||
|
||||
|
|
@ -661,7 +661,7 @@ const defaultActions = (
|
|||
<a
|
||||
className="ib-subdued-link"
|
||||
href={`data:text/plain;charset=utf-8,${encodeURIComponent(
|
||||
JSON.stringify(compose.request, null, ' ')
|
||||
JSON.stringify(compose.request, null, ' '),
|
||||
)}`}
|
||||
download={name}
|
||||
onClick={() => {
|
||||
|
|
@ -685,7 +685,7 @@ const awsActions = (
|
|||
status: ComposeStatus | undefined,
|
||||
navigate: NavigateFunction,
|
||||
analytics: Analytics,
|
||||
account_id: string | undefined
|
||||
account_id: string | undefined,
|
||||
) => {
|
||||
return [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ const ImagesTableToolbar: React.FC<imagesTableToolbarProps> = ({
|
|||
const selectedBlueprintId = useAppSelector(selectSelectedBlueprintId);
|
||||
const blueprintSearchInput = useAppSelector(selectBlueprintSearchInput);
|
||||
const blueprintVersionFilterAPI = useAppSelector(
|
||||
selectBlueprintVersionFilterAPI
|
||||
selectBlueprintVersionFilterAPI,
|
||||
);
|
||||
|
||||
const searchParams: GetBlueprintComposesApiArg = {
|
||||
|
|
@ -84,14 +84,14 @@ const ImagesTableToolbar: React.FC<imagesTableToolbarProps> = ({
|
|||
{
|
||||
selectFromResult: ({ data }) => {
|
||||
const bp = data?.data.find(
|
||||
(blueprint: BlueprintItem) => blueprint.id === selectedBlueprintId
|
||||
(blueprint: BlueprintItem) => blueprint.id === selectedBlueprintId,
|
||||
);
|
||||
return {
|
||||
selectedBlueprintName: bp?.name,
|
||||
selectedBlueprintVersion: bp?.version,
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const latestImageVersion = blueprintsComposes?.data[0]?.blueprint_version;
|
||||
|
|
@ -125,7 +125,7 @@ const ImagesTableToolbar: React.FC<imagesTableToolbarProps> = ({
|
|||
|
||||
const { data: blueprintDetails } = useGetBlueprintQuery(
|
||||
{ id: selectedBlueprintId! },
|
||||
{ skip: !selectedBlueprintId }
|
||||
{ skip: !selectedBlueprintId },
|
||||
);
|
||||
|
||||
const { trigger: fixupBlueprint } = useFixupBlueprintMutation();
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ const ProvisioningLink = ({
|
|||
scope: 'provisioning',
|
||||
module: './ProvisioningWizard',
|
||||
},
|
||||
{}
|
||||
{},
|
||||
);
|
||||
|
||||
const { permissions, isLoading: isLoadingPermission } =
|
||||
|
|
@ -126,7 +126,7 @@ const ProvisioningLink = ({
|
|||
// Recomputing this value on every render made the modal crash. Using a state
|
||||
// helps avoiding this situation as the value is only set the first time.
|
||||
const [appendTo] = useState(
|
||||
document.querySelector(MODAL_ANCHOR) as HTMLElement
|
||||
document.querySelector(MODAL_ANCHOR) as HTMLElement,
|
||||
);
|
||||
|
||||
const selectedBlueprintId = useAppSelector(selectSelectedBlueprintId);
|
||||
|
|
@ -137,10 +137,10 @@ const ProvisioningLink = ({
|
|||
{
|
||||
selectFromResult: ({ data }) => ({
|
||||
selectedBlueprintVersion: data?.data.find(
|
||||
(blueprint: BlueprintItem) => blueprint.id === selectedBlueprintId
|
||||
(blueprint: BlueprintItem) => blueprint.id === selectedBlueprintId,
|
||||
)?.version,
|
||||
}),
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (
|
||||
|
|
@ -270,7 +270,7 @@ export const OciInstance = ({ compose, isExpired }: OciInstancePropTypes) => {
|
|||
|
||||
if (options && !isOciUploadStatus(options)) {
|
||||
throw TypeError(
|
||||
`Error: options must be of type OciUploadStatus, not ${typeof options}.`
|
||||
`Error: options must be of type OciUploadStatus, not ${typeof options}.`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -404,7 +404,7 @@ export const AwsS3Instance = ({
|
|||
|
||||
if (options && !isAwss3UploadStatus(options)) {
|
||||
throw TypeError(
|
||||
`Error: options must be of type Awss3UploadStatus, not ${typeof options}.`
|
||||
`Error: options must be of type Awss3UploadStatus, not ${typeof options}.`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -485,7 +485,7 @@ const ErrorStatus = ({ icon, text, error }: ErrorStatusPropTypes) => {
|
|||
variant="link"
|
||||
onClick={() =>
|
||||
navigator.clipboard.writeText(
|
||||
reason + '\n\n' + detailsArray.join('\n')
|
||||
reason + '\n\n' + detailsArray.join('\n'),
|
||||
)
|
||||
}
|
||||
className="pf-v6-u-pl-0 pf-v6-u-mt-md"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ type NewAlertPropTypes = {
|
|||
|
||||
export const NewAlert = ({ setShowAlert }: NewAlertPropTypes) => {
|
||||
const isAlertDismissed = window.localStorage.getItem(
|
||||
'imageBuilder.newFeatureNewCustomizationsAlertDismissed'
|
||||
'imageBuilder.newFeatureNewCustomizationsAlertDismissed',
|
||||
);
|
||||
const [displayAlert, setDisplayAlert] = useState(!isAlertDismissed);
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ export const NewAlert = ({ setShowAlert }: NewAlertPropTypes) => {
|
|||
setDisplayAlert(false);
|
||||
window.localStorage.setItem(
|
||||
'imageBuilder.newFeatureNewCustomizationsAlertDismissed',
|
||||
'true'
|
||||
'true',
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ import { resolveRelPath } from '../../Utilities/path';
|
|||
const generateRequests = (
|
||||
composeId: string,
|
||||
composeStatus: ComposeStatus,
|
||||
regions: string[]
|
||||
regions: string[],
|
||||
) => {
|
||||
return regions.map((region) => {
|
||||
const options =
|
||||
|
|
@ -72,7 +72,7 @@ const RegionsSelect = ({ composeId, handleClose }: RegionsSelectPropTypes) => {
|
|||
const [isOpen, setIsOpen] = useState(false);
|
||||
const [isSaving, setIsSaving] = useState(false);
|
||||
const [validated, setValidated] = useState<ValidatedOptions>(
|
||||
ValidatedOptions.default
|
||||
ValidatedOptions.default,
|
||||
);
|
||||
|
||||
const initialRegions = AWS_REGIONS;
|
||||
|
|
@ -87,7 +87,7 @@ const RegionsSelect = ({ composeId, handleClose }: RegionsSelectPropTypes) => {
|
|||
|
||||
if (inputValue) {
|
||||
newSelectOptions = initialRegions.filter((region) =>
|
||||
region.value.toLowerCase().includes(inputValue.toLowerCase())
|
||||
region.value.toLowerCase().includes(inputValue.toLowerCase()),
|
||||
);
|
||||
|
||||
// When no options are found after filtering, display 'No results found'
|
||||
|
|
@ -112,7 +112,7 @@ const RegionsSelect = ({ composeId, handleClose }: RegionsSelectPropTypes) => {
|
|||
|
||||
const onTextInputChange = (
|
||||
_event: React.FormEvent<HTMLInputElement>,
|
||||
value: string
|
||||
value: string,
|
||||
) => {
|
||||
setInputValue(value);
|
||||
};
|
||||
|
|
@ -122,7 +122,7 @@ const RegionsSelect = ({ composeId, handleClose }: RegionsSelectPropTypes) => {
|
|||
setSelected(
|
||||
selected.includes(value)
|
||||
? selected.filter((selection) => selection !== value)
|
||||
: [...selected, value]
|
||||
: [...selected, value],
|
||||
);
|
||||
setValidated(ValidatedOptions.success);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ export const ImageBuilderHeader = ({
|
|||
const prefetchTargets = useBackendPrefetch('getArchitectures');
|
||||
|
||||
const importExportFlag = useFlagWithEphemDefault(
|
||||
'image-builder.import.enabled'
|
||||
'image-builder.import.enabled',
|
||||
);
|
||||
const [showImportModal, setShowImportModal] = useState(false);
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ export const useCloneComposeWithNotification = () => {
|
|||
`Your image is being shared to ${cloneRequest.region} region`,
|
||||
error: () => 'Your image could not be shared',
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ export const useComposeBPWithNotification = () => {
|
|||
success: () => 'Image is being built',
|
||||
error: () => 'Image could not be built',
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ export const useCreateBPWithNotification = (options?: HookOptions) => {
|
|||
success: () => 'Blueprint was created',
|
||||
error: () => 'Blueprint could not be created',
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ export const useDeleteBPWithNotification = (options?: HookOptions) => {
|
|||
success: () => 'Blueprint was deleted',
|
||||
error: () => 'Blueprint could not be deleted',
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ export const useFixupBPWithNotification = (options?: HookOptions) => {
|
|||
success: () => 'Blueprint was fixed',
|
||||
error: () => 'Blueprint could not be fixed',
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -53,9 +53,9 @@ export function useMutationWithNotification<
|
|||
},
|
||||
>(
|
||||
mutationHook: (
|
||||
options?: HookOptions
|
||||
options?: HookOptions,
|
||||
) => readonly [TypedMutationTrigger<Result, Arg, BaseQueryFn>, State],
|
||||
{ options, messages }: MutationOptions<Arg>
|
||||
{ options, messages }: MutationOptions<Arg>,
|
||||
) {
|
||||
const [trigger, state] = mutationHook(options);
|
||||
const addNotification = useAddNotification();
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ export const useUpdateBPWithNotification = (options?: HookOptions) => {
|
|||
success: () => 'Blueprint was updated',
|
||||
error: () => 'Blueprint could not be updated',
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
return {
|
||||
trigger: updateBlueprint,
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@ import { useFlagWithEphemDefault } from './Utilities/useGetEnvironment';
|
|||
|
||||
const LandingPage = lazy(() => import('./Components/LandingPage/LandingPage'));
|
||||
const ImportImageWizard = lazy(
|
||||
() => import('./Components/CreateImageWizard/ImportImageWizard')
|
||||
() => import('./Components/CreateImageWizard/ImportImageWizard'),
|
||||
);
|
||||
const CreateImageWizard = lazy(() => import('./Components/CreateImageWizard'));
|
||||
|
||||
export const Router = () => {
|
||||
const importExportFlag = useFlagWithEphemDefault(
|
||||
'image-builder.import.enabled'
|
||||
'image-builder.import.enabled',
|
||||
);
|
||||
return (
|
||||
<Routes>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { CreateBlueprintRequest } from '../store/imageBuilderApi';
|
|||
export const createAnalytics = (
|
||||
requestBody: CreateBlueprintRequest,
|
||||
packages: IBPackageWithRepositoryInfo[],
|
||||
isBeta: () => boolean
|
||||
isBeta: () => boolean,
|
||||
) => {
|
||||
const analyticsData = {
|
||||
image_name: requestBody.name,
|
||||
|
|
@ -13,10 +13,10 @@ export const createAnalytics = (
|
|||
distribution: requestBody.distribution,
|
||||
openscap: requestBody.customizations.openscap,
|
||||
image_request_types: requestBody.image_requests.map(
|
||||
(req) => req.image_type
|
||||
(req) => req.image_type,
|
||||
),
|
||||
image_request_architectures: requestBody.image_requests.map(
|
||||
(req) => req.architecture
|
||||
(req) => req.architecture,
|
||||
),
|
||||
image_requests: requestBody.image_requests,
|
||||
organization: requestBody.customizations.subscription?.organization,
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ const getKeyForDistribution = (distribution: string): string =>
|
|||
* @returns The matching EPEL repository definition, or `undefined` if no match is found.
|
||||
*/
|
||||
export const getEpelDefinitionForDistribution = (
|
||||
distribution: string
|
||||
distribution: string,
|
||||
): EpelRepoDefinition | undefined =>
|
||||
epelMap.get(getKeyForDistribution(distribution));
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ export const getEpelDefinitionForDistribution = (
|
|||
* @returns The URL for the EPEL repository, or `undefined` if no match is found.
|
||||
*/
|
||||
export const getEpelUrlForDistribution = (
|
||||
distribution: string
|
||||
distribution: string,
|
||||
): string | undefined => getEpelDefinitionForDistribution(distribution)?.url;
|
||||
|
||||
/**
|
||||
|
|
@ -67,7 +67,7 @@ export const getEpelUrlForDistribution = (
|
|||
* @returns The version number for the EPEL repository, or `undefined` if no match is found.
|
||||
*/
|
||||
export const getEpelVersionForDistribution = (
|
||||
distribution: string
|
||||
distribution: string,
|
||||
): string | undefined => {
|
||||
const split = getKeyForDistribution(distribution).split('-');
|
||||
return split.length > 1 ? split[1] : undefined;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
const sortfn = (
|
||||
a: string | undefined,
|
||||
b: string | undefined,
|
||||
searchTerm: string
|
||||
searchTerm: string,
|
||||
) => {
|
||||
if (!a) {
|
||||
return -1;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue