Commit ed7cf34e authored by Aleksandr Gumroian's avatar Aleksandr Gumroian 🚀

Merge branch 'release-v5.1.4' into 'dev'

Release v5.1.4

See merge request !133
parents 69723f6b aaf4087c
Pipeline #69585 passed with stages
in 3 minutes and 27 seconds
{
"name": "foris",
"version": "5.1.3",
"version": "5.1.4",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......
{
"name": "foris",
"version": "5.1.3",
"version": "5.1.4",
"description": "Set of components and utils for Foris and its plugins.",
"author": "CZ.NIC, z.s.p.o.",
"repository": {
......
......@@ -37,7 +37,11 @@ Alert.defaultProps = {
export function Alert({ type, onDismiss, children }) {
return (
<div className={`alert alert-dismissible alert-${type}`}>
<div
className={`alert ${
onDismiss ? "alert-dismissible" : ""
} alert-${type}`}
>
{onDismiss ? (
<button type="button" className="close" onClick={onDismiss}>
&times;
......
/*
* Copyright (C) 2019 CZ.NIC z.s.p.o. (http://www.nic.cz/)
* Copyright (C) 2020 CZ.NIC z.s.p.o. (http://www.nic.cz/)
*
* This is free software, licensed under the GNU General Public License v3.
* See /LICENSE for more information.
*/
import React, { useRef } from "react";
import React, { useRef, useEffect } from "react";
import PropTypes from "prop-types";
import { Portal } from "../utils/Portal";
......@@ -31,6 +31,19 @@ export function Modal({ shown, setShown, scrollable, children }) {
useClickOutside(dialogRef, () => setShown(false));
useEffect(() => {
const handleEsc = (event) => {
if (event.keyCode === 27) {
setShown(false);
}
};
window.addEventListener("keydown", handleEsc);
return () => {
window.removeEventListener("keydown", handleEsc);
};
}, [setShown]);
return (
<Portal containerId="modal-container">
<div className={`modal fade ${shown ? "show" : ""}`} role="dialog">
......
......@@ -63,7 +63,7 @@ RebootModal.propTypes = {
function RebootModal({ shown, setShown, onReboot }) {
return (
<Modal shown={shown} setShown={setShown}>
<ModalHeader setShown={setShown} title={_("Reboot confirmation")} />
<ModalHeader setShown={setShown} title={_("Warning!")} />
<ModalBody>
<p>{_("Are you sure you want to restart the router?")}</p>
</ModalBody>
......
......@@ -157,6 +157,7 @@ function DeviceForm({
choices={getHwmodeChoices(formData)}
value={formData.hwmode}
helpText={HELP_TEXTS.hwmode}
inline
onChange={setFormValue((value) => ({
devices: {
[deviceIndex]: {
......
......@@ -570,7 +570,7 @@ exports[`<WiFiSettings/> Snapshot one module enabled. 1`] = `
+ GHz
+ </label>
+ <div
+ class=\\"custom-control custom-radio\\"
+ class=\\"custom-control custom-radio custom-control-inline\\"
+ >
+ <input
+ class=\\"custom-control-input\\"
......@@ -587,7 +587,7 @@ exports[`<WiFiSettings/> Snapshot one module enabled. 1`] = `
+ </label>
+ </div>
+ <div
+ class=\\"custom-control custom-radio\\"
+ class=\\"custom-control custom-radio custom-control-inline\\"
+ >
+ <input
+ checked=\\"\\"
......
......@@ -22,7 +22,7 @@ exports[`<RebootButton/> Render modal. 1`] = `
<h5
class="modal-title"
>
Reboot confirmation
Warning!
</h5>
<button
class="close"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment