Skip to content

Commit

Permalink
Fixed double padding in recurring actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bisht-richa authored and cbbayburt committed Jul 23, 2024
1 parent 832b987 commit bd209bf
Show file tree
Hide file tree
Showing 7 changed files with 232 additions and 223 deletions.
5 changes: 4 additions & 1 deletion java/code/src/com/suse/manager/webui/utils/ViewHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ public enum ViewHelper {
"/rhn/manager/systems/keys",
"/rhn/manager/audit/cve",
"/rhn/errata/Search.do",
"/rhn/audit/scap/Search.do"
"/rhn/audit/scap/Search.do",
"/rhn/manager/schedule/recurring-actions",
"/rhn/manager/schedule/maintenance/calendars",
"/rhn/manager/multiorg/recurring-actions"
);

ViewHelper() { }
Expand Down
1 change: 1 addition & 0 deletions web/html/src/components/icontag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ function IconTag(props: Props) {
"sort-down": "fa fa-arrow-circle-down",
"sort-up": "fa fa-arrow-circle-up",
spinner: "fa fa-spinner fa-spin",
"spacewalk-icon-salt": "fa spacewalk-icon-salt",
"system-state": "fa spacewalk-icon-salt-add",
"system-bare-metal-legend": "fa fa-1-5x spacewalk-icon-bare-metal",
"system-bare-metal": "fa spacewalk-icon-bare-metal",
Expand Down
3 changes: 3 additions & 0 deletions web/html/src/core/spa/view-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ const BOOTSTRAP_READY_PAGES: string[] = [
"/rhn/manager/audit/cve",
"/rhn/errata/Search.do",
"/rhn/audit/scap/Search.do",
"/rhn/manager/schedule/recurring-actions",
"/rhn/manager/schedule/maintenance/calendars",
"/rhn/manager/multiorg/recurring-actions",
];

export const onEndNavigate = () => {
Expand Down
124 changes: 66 additions & 58 deletions web/html/src/manager/maintenance/details/schedule-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { WebCalendar } from "manager/maintenance/calendar/web-calendar";
import { AsyncButton } from "components/buttons";
import { DeleteDialog } from "components/dialog/DeleteDialog";
import { ModalButton } from "components/dialog/ModalButton";
import { IconTag } from "components/icontag";
import { SystemLink } from "components/links";
import { Utils as MessagesUtils } from "components/messages";
import { MessageType } from "components/messages";
import { BootstrapPanel } from "components/panels/BootstrapPanel";
import { InnerPanel } from "components/panels/InnerPanel";
import { TabLabel } from "components/tab-container";
import { Column } from "components/table/Column";
import { SearchField } from "components/table/SearchField";
Expand Down Expand Up @@ -166,64 +166,72 @@ const SystemPicker = (props: SystemPickerProps) => {

return (
<>
<InnerPanel
title={t("Assigned Systems")}
icon="fa-desktop"
buttons={[
<Toggler
text={t("Cancel affected actions")}
className="btn"
handler={() => setCancelActions(!isCancelActions)}
value={isCancelActions}
/>,
isCancelActions && selectedSystems.length > 0 ? (
<ModalButton
target="cancel-confirm"
text={t("Save Changes")}
className="btn-success"
disabled={!hasChanges}
/>
) : (
<AsyncButton action={onAssign} defaultType="btn-success" text={t("Save Changes")} disabled={!hasChanges} />
),
]}
<h2>
<IconTag type="event-type-system" />
{t("Assigned Systems")}
</h2>
<div className="clearfix mb-3">
<div className="pull-right btn-group">
{[
<Toggler
text={t("Cancel affected actions")}
className="btn"
handler={() => setCancelActions(!isCancelActions)}
value={isCancelActions}
/>,
isCancelActions && selectedSystems.length > 0 ? (
<ModalButton
target="cancel-confirm"
text={t("Save Changes")}
className="btn-success"
disabled={!hasChanges}
/>
) : (
<AsyncButton
action={onAssign}
defaultType="btn-success"
text={t("Save Changes")}
disabled={!hasChanges}
/>
),
]}
</div>
</div>
<Table
data="/rhn/manager/api/maintenance/schedule/systems"
identifier={(system) => system.id}
searchField={<SearchField placeholder={t("Search systems")} />}
selectable
selectedItems={selectedSystems}
onSelect={onSelect}
initialSortColumnKey="name"
>
<Table
data="/rhn/manager/api/maintenance/schedule/systems"
identifier={(system) => system.id}
searchField={<SearchField placeholder={t("Search systems")} />}
selectable
selectedItems={selectedSystems}
onSelect={onSelect}
initialSortColumnKey="name"
>
<Column
columnKey="name"
sortable
header={t("System")}
cell={(system) => (
<SystemLink id={system.id} newWindow>
{system.name}
</SystemLink>
)}
/>
<Column
columnKey="scheduleName"
sortable
header={t("Current Schedule")}
cell={(system) =>
system.scheduleId &&
(system.scheduleId === props.scheduleId ? (
<span>{system.scheduleName}</span>
) : (
<a href={`/rhn/manager/schedule/maintenance/schedules#/details/${system.scheduleId}`}>
{system.scheduleName}
</a>
))
}
/>
</Table>
</InnerPanel>
<Column
columnKey="name"
sortable
header={t("System")}
cell={(system) => (
<SystemLink id={system.id} newWindow>
{system.name}
</SystemLink>
)}
/>
<Column
columnKey="scheduleName"
sortable
header={t("Current Schedule")}
cell={(system) =>
system.scheduleId &&
(system.scheduleId === props.scheduleId ? (
<span>{system.scheduleName}</span>
) : (
<a href={`/rhn/manager/schedule/maintenance/schedules#/details/${system.scheduleId}`}>
{system.scheduleName}
</a>
))
}
/>
</Table>
<CancelActionsDialog id="cancel-confirm" onConfirmAsync={onAssign} />
</>
);
Expand Down
57 changes: 27 additions & 30 deletions web/html/src/manager/maintenance/list/maintenance-windows-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import * as React from "react";
import { useState } from "react";

import { Button } from "components/buttons";
import { InnerPanel } from "components/panels/InnerPanel";
import { IconTag } from "components/icontag";
import { HelpLink } from "components/utils";

import MaintenanceCalendarList from "./calendar-list";
import MaintenanceScheduleList from "./schedule-list";
Expand Down Expand Up @@ -34,41 +35,37 @@ const MaintenanceWindowsList = (props: MaintenanceListProps) => {

return (
<div>
<InnerPanel
title={t("Maintenance") + " " + (type === "schedule" ? t("Schedules") : t("Calendars"))}
icon="spacewalk-icon-schedule"
buttons={buttons}
helpUrl="reference/schedule/maintenance-windows.html"
summary={
type === "schedule"
<>
<h1>
<IconTag type="header-schedule" />
{type === "schedule" ? t("Maintenance Schedules") : t("Maintenance Calendars")}
<HelpLink url="reference/schedule/maintenance-windows.html" />
</h1>
<p>
{type === "schedule"
? t("Below is a list of Maintenance Schedules available to the current user.")
: t("Below is a list of Maintenance Calendars available to the current user.")
}
>
<div className="panel panel-default">
<div className="panel-heading">
<div>
<h3>{t(type === "schedule" ? "Schedules" : "Calendars")}</h3>
</div>
</div>
{(type === "schedule" && (
<MaintenanceScheduleList
: t("Below is a list of Maintenance Calendars available to the current user.")}
</p>
<div className="pull-right btn-group">{buttons}</div>
<h3>{t(type === "schedule" ? "Schedules" : "Calendars")}</h3>

{(type === "schedule" && (
<MaintenanceScheduleList
data={props.data}
onSelect={props.onSelect}
onEdit={props.onEdit}
onDelete={props.onDelete}
/>
)) ||
(type === "calendar" && (
<MaintenanceCalendarList
data={props.data}
onSelect={props.onSelect}
onEdit={props.onEdit}
onDelete={props.onDelete}
/>
)) ||
(type === "calendar" && (
<MaintenanceCalendarList
data={props.data}
onSelect={props.onSelect}
onEdit={props.onEdit}
onDelete={props.onDelete}
/>
))}
</div>
</InnerPanel>
))}
</>
</div>
);
};
Expand Down
Loading

0 comments on commit bd209bf

Please sign in to comment.