mirror of
				https://gitlab.nic.cz/turris/reforis/foris-js.git
				synced 2025-11-03 23:00:31 +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:
		
							
								
								
									
										2
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
    "name": "foris",
 | 
			
		||||
    "version": "5.1.3",
 | 
			
		||||
    "version": "5.1.4",
 | 
			
		||||
    "lockfileVersion": 1,
 | 
			
		||||
    "requires": true,
 | 
			
		||||
    "dependencies": {
 | 
			
		||||
 
 | 
			
		||||
@@ -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": {
 | 
			
		||||
 
 | 
			
		||||
@@ -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}>
 | 
			
		||||
                    ×
 | 
			
		||||
 
 | 
			
		||||
@@ -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">
 | 
			
		||||
 
 | 
			
		||||
@@ -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"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user