buildListing()

in source/idea/idea-cluster-manager/webapp/src/pages/virtual-desktops/virtual-desktop-software-stacks.tsx [664:789]


    buildListing() {
        return (
            <IdeaListView
                ref={this.listing}
                title="Software Stacks"
                preferencesKey={"software-stack"}
                showPreferences={true}
                description="Manage your Virtual Desktop Software Stacks"
                selectionType="single"
                primaryAction={{
                    id: "register-software-stack",
                    text: "Register Software Stack",
                    onClick: () => {
                        this.showRegisterSoftwareStackForm();
                    },
                }}
                secondaryActionsDisabled={!this.isSelected()}
                secondaryActions={[
                    {
                        id: "edit-software-stack",
                        text: "Edit Stack",
                        disabled: !this.isSelected(),
                        onClick: () => {
                            this.showEditSoftwareStackForm();
                        }
                    },
                    {
                        id: "delete-software-stack",
                        text: "Delete Stack",
                        disabled: !this.isSelected(),
                        onClick: () => {
                            this.getVirtualDesktopAdminClient()
                            .listSessions({
                                filters: [this.convertSoftwareStackObjectToSocaFilter()]
                            })
                            .then((result) => {
                                this.setState(
                                    {
                                        selectedSoftwareStackSessionsList: result.listing!
                                    },
                                    () => {
                                        this.showDeleteSoftwareStackConfirmModal();
                                    }
                                )
                            })
                            .catch((error) => {
                                this.setFlashMessage(error.message, "error");
                            });
                        },
                    },
                ]}
                showPaginator={true}
                showFilters={true}
                filterType="select"
                selectFilters={[
                    {
                        name: "$all",
                    },
                    {
                        name: "base_os",
                        choices: [
                            {
                                title: "All Operating Systems",
                                value: "",
                            },
                            {
                                title: "Amazon Linux 2",
                                value: "amazonlinux2",
                            },
                            {
                                title: "Windows",
                                value: "windows",
                            },
                            {
                                title: "RHEL 8",
                                value: "rhel8"
                            },
                            {
                                title: "RHEL 9",
                                value: "rhel9"
                            }
                        ],
                    },
                ]}
                onFilter={(filters) => {
                    return filters;
                }}
                onRefresh={() => {
                    this.setState(
                        {
                            softwareStackSelected: false,
                        },
                        () => {
                            this.getListing().fetchRecords();
                        }
                    );
                }}
                onSelectionChange={() => {
                    this.setState({
                        softwareStackSelected: true,
                    });
                }}
                onFetchRecords={() => {
                    return this.getVirtualDesktopAdminClient()
                        .listSoftwareStacks({
                            disabled_also: true,
                            filters: this.getListing().getFilters(),
                            paginator: this.getListing().getPaginator(),
                        })
                        .catch((error) => {
                            this.props.onFlashbarChange({
                                items: [
                                    {
                                        content: error.message,
                                        type: "error",
                                        dismissible: true,
                                    },
                                ],
                            });
                            throw error;
                        });
                }}
                columnDefinitions={VIRTUAL_DESKTOP_SOFTWARE_STACKS_TABLE_COLUMN_DEFINITIONS}
            />
        );
    }