1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 06:49:40 +02:00

refactor(namespace): migrate namespace edit to react [r8s-125] (#38)

This commit is contained in:
Ali 2024-12-11 10:15:46 +13:00 committed by GitHub
parent 40c7742e46
commit ce7e0d8d60
108 changed files with 3183 additions and 2194 deletions

View file

@ -26,6 +26,7 @@ import { Service } from '../../types';
import { columns } from './columns';
import { createStore } from './datatable-store';
import { ServiceRowData } from './types';
const storageKey = 'k8sServicesDatatable';
const settingsStore = createStore(storageKey);
@ -104,7 +105,7 @@ export function ServicesDatatable() {
function useServicesRowData(
services: Service[],
namespaces?: Namespaces
): Service[] {
): ServiceRowData[] {
return useMemo(
() =>
services.map((service) => ({
@ -119,9 +120,12 @@ function useServicesRowData(
// needed to apply custom styling to the row cells and not globally.
// required in the AC's for this ticket.
function servicesRenderRow(row: Row<Service>, highlightedItemId?: string) {
function servicesRenderRow(
row: Row<ServiceRowData>,
highlightedItemId?: string
) {
return (
<Table.Row<Service>
<Table.Row<ServiceRowData>
cells={row.getVisibleCells()}
className={clsx('[&>td]:!py-4 [&>td]:!align-top', {
active: highlightedItemId === row.id,
@ -136,7 +140,7 @@ interface SelectedService {
}
type TableActionsProps = {
selectedItems: Service[];
selectedItems: ServiceRowData[];
};
function TableActions({ selectedItems }: TableActionsProps) {