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:
parent
40c7742e46
commit
ce7e0d8d60
108 changed files with 3183 additions and 2194 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue