1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2024-12-25 00:11:36 +01:00

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

Release v5.1.4

See merge request turris/reforis/foris-js!133
This commit is contained in:
Aleksandr Gumroian 2020-09-25 17:43:10 +02:00
commit ed7cf34e76
8 changed files with 27 additions and 9 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "foris",
"version": "5.1.3",
"version": "5.1.4",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"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": {

View File

@ -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;

View File

@ -1,11 +1,11 @@
/*
* 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">

View File

@ -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>

View File

@ -157,6 +157,7 @@ function DeviceForm({
choices={getHwmodeChoices(formData)}
value={formData.hwmode}
helpText={HELP_TEXTS.hwmode}
inline
onChange={setFormValue((value) => ({
devices: {
[deviceIndex]: {

View File

@ -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=\\"\\"

View File

@ -22,7 +22,7 @@ exports[`<RebootButton/> Render modal. 1`] = `
<h5
class="modal-title"
>
Reboot confirmation
Warning!
</h5>
<button
class="close"