-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore/trigger operations btns redesign (#477)
* updated * delete handler * review * fix * timezone 0 sign
- Loading branch information
1 parent
17d714c
commit 556db51
Showing
20 changed files
with
217 additions
and
169 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.64 KB
(96%)
playwright/snapshots/TriggerInfo/triggerinfo--description-in-multiple-line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.72 KB
(96%)
playwright/snapshots/TriggerInfo/triggerinfo--not-everyday.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.55 KB
(96%)
...ht/snapshots/TriggerInfo/triggerinfo--with-maintenance-and-maintenance-info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.36 KB
(97%)
playwright/snapshots/TriggerInfo/triggerinfo--with-maintenance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.89 KB
(91%)
playwright/snapshots/TriggerInfo/triggerinfo--with-throttling.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from "react"; | ||
import { Link } from "@skbkontur/react-ui/components/Link"; | ||
import { MenuItem } from "@skbkontur/react-ui"; | ||
|
||
interface ILinkMenuItemProps { | ||
link?: string; | ||
icon?: React.ReactElement; | ||
onClick?: () => void; | ||
children: React.ReactElement | string; | ||
} | ||
|
||
export const LinkMenuItem = ({ link, icon, onClick, children }: ILinkMenuItemProps) => { | ||
return ( | ||
<MenuItem | ||
href={link} | ||
component={({ href, ...rest }) => { | ||
return ( | ||
<Link | ||
onClick={onClick} | ||
icon={icon} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
href={href} | ||
{...rest} | ||
/> | ||
); | ||
}} | ||
> | ||
{children} | ||
</MenuItem> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from "react"; | ||
import { Schedule } from "../../../Domain/Schedule"; | ||
import { format, addMinutes, startOfDay } from "date-fns"; | ||
import { getUTCDate } from "../../../helpers/DateUtil"; | ||
|
||
export function ScheduleView(props: { data: Schedule }): React.ReactElement { | ||
const { data } = props; | ||
const { days, startOffset, endOffset, tzOffset } = data; | ||
|
||
const startTime = format(addMinutes(startOfDay(getUTCDate()), startOffset), "HH:mm"); | ||
|
||
const endTime = format(addMinutes(startOfDay(getUTCDate()), endOffset), "HH:mm"); | ||
|
||
const timeZone = format(addMinutes(startOfDay(getUTCDate()), Math.abs(tzOffset)), "HH:mm"); | ||
|
||
const timeZoneSign = tzOffset < 0 ? "+" : "−"; | ||
const enabledDays = days.filter(({ enabled }) => enabled); | ||
|
||
return ( | ||
<> | ||
{days.length === enabledDays.length | ||
? "Everyday" | ||
: enabledDays.map(({ name }) => name).join(", ")}{" "} | ||
{startTime}—{endTime} (GMT {tzOffset !== 0 && timeZoneSign} | ||
{timeZone}) | ||
</> | ||
); | ||
} |
Oops, something went wrong.