mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2025-06-17 13:56:15 +02:00
Compare commits
4 Commits
2f73516384
...
v6.0.2
Author | SHA1 | Date | |
---|---|---|---|
8e0c60a576 | |||
e297410f16 | |||
0ea5d43c75 | |||
bee4bee300 |
@ -8,12 +8,6 @@ and this project adheres to
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [6.0.3] - 2024-07-26
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated WiFiQRCode component
|
||||
|
||||
## [6.0.2] - 2024-06-28
|
||||
|
||||
### Added
|
||||
@ -337,8 +331,7 @@ and this project adheres to
|
||||
## [0.0.7] - 2019-09-02
|
||||
|
||||
[unreleased]:
|
||||
https://gitlab.nic.cz/turris/reforis/foris-js/-/compare/v6.0.3...master
|
||||
[6.0.3]: https://gitlab.nic.cz/turris/reforis/foris-js/-/compare/v6.0.2...v6.0.3
|
||||
https://gitlab.nic.cz/turris/reforis/foris-js/-/compare/v6.0.2...master
|
||||
[6.0.2]: https://gitlab.nic.cz/turris/reforis/foris-js/-/compare/v6.0.1...v6.0.2
|
||||
[6.0.1]: https://gitlab.nic.cz/turris/reforis/foris-js/-/compare/v6.0.0...v6.0.1
|
||||
[6.0.0]: https://gitlab.nic.cz/turris/reforis/foris-js/-/compare/v5.6.1...v6.0.0
|
||||
|
105
package-lock.json
generated
105
package-lock.json
generated
@ -1,18 +1,14 @@
|
||||
{
|
||||
"name": "foris",
|
||||
"version": "6.0.3",
|
||||
"version": "6.0.2",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "foris",
|
||||
"version": "6.0.3",
|
||||
"version": "6.0.2",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-svg-core": "^6.6.0",
|
||||
"@fortawesome/free-regular-svg-icons": "^6.6.0",
|
||||
"@fortawesome/free-solid-svg-icons": "^6.6.0",
|
||||
"@fortawesome/react-fontawesome": "^0.2.2",
|
||||
"axios": "^1.7.2",
|
||||
"immutability-helper": "^3.1.1",
|
||||
"moment": "^2.30.1",
|
||||
@ -26,6 +22,7 @@
|
||||
"@babel/plugin-transform-runtime": "^7.24.7",
|
||||
"@babel/preset-env": "^7.24.7",
|
||||
"@babel/preset-react": "^7.24.7",
|
||||
"@fortawesome/fontawesome-free": "^6.5.2",
|
||||
"@testing-library/react": "^8.0.9",
|
||||
"babel-loader": "^8.1.0",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
@ -2088,59 +2085,16 @@
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@fortawesome/fontawesome-common-types": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.6.0.tgz",
|
||||
"integrity": "sha512-xyX0X9mc0kyz9plIyryrRbl7ngsA9jz77mCZJsUkLl+ZKs0KWObgaEBoSgQiYWAsSmjz/yjl0F++Got0Mdp4Rw==",
|
||||
"node_modules/@fortawesome/fontawesome-free": {
|
||||
"version": "6.5.2",
|
||||
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.5.2.tgz",
|
||||
"integrity": "sha512-hRILoInAx8GNT5IMkrtIt9blOdrqHOnPBH+k70aWUAqPZPgopb9G5EQJFpaBx/S8zp2fC+mPW349Bziuk1o28Q==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/@fortawesome/fontawesome-svg-core": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.6.0.tgz",
|
||||
"integrity": "sha512-KHwPkCk6oRT4HADE7smhfsKudt9N/9lm6EJ5BVg0tD1yPA5hht837fB87F8pn15D8JfTqQOjhKTktwmLMiD7Kg==",
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-common-types": "6.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/@fortawesome/free-regular-svg-icons": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.6.0.tgz",
|
||||
"integrity": "sha512-Yv9hDzL4aI73BEwSEh20clrY8q/uLxawaQ98lekBx6t9dQKDHcDzzV1p2YtBGTtolYtNqcWdniOnhzB+JPnQEQ==",
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-common-types": "6.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/@fortawesome/free-solid-svg-icons": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.6.0.tgz",
|
||||
"integrity": "sha512-IYv/2skhEDFc2WGUcqvFJkeK39Q+HyPf5GHUrT/l2pKbtgEIv1al1TKd6qStR5OIwQdN1GZP54ci3y4mroJWjA==",
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-common-types": "6.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/@fortawesome/react-fontawesome": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@fortawesome/react-fontawesome/-/react-fontawesome-0.2.2.tgz",
|
||||
"integrity": "sha512-EnkrprPNqI6SXJl//m29hpaNzOp1bruISWaOiRtkMi/xSvHJlzc2j2JAYS7egxt/EbjSNV/k6Xy0AQI6vB2+1g==",
|
||||
"dependencies": {
|
||||
"prop-types": "^15.8.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@fortawesome/fontawesome-svg-core": "~1 || ~6",
|
||||
"react": ">=16.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@humanwhocodes/config-array": {
|
||||
"version": "0.11.14",
|
||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
|
||||
@ -20262,42 +20216,11 @@
|
||||
"integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==",
|
||||
"dev": true
|
||||
},
|
||||
"@fortawesome/fontawesome-common-types": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.6.0.tgz",
|
||||
"integrity": "sha512-xyX0X9mc0kyz9plIyryrRbl7ngsA9jz77mCZJsUkLl+ZKs0KWObgaEBoSgQiYWAsSmjz/yjl0F++Got0Mdp4Rw=="
|
||||
},
|
||||
"@fortawesome/fontawesome-svg-core": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.6.0.tgz",
|
||||
"integrity": "sha512-KHwPkCk6oRT4HADE7smhfsKudt9N/9lm6EJ5BVg0tD1yPA5hht837fB87F8pn15D8JfTqQOjhKTktwmLMiD7Kg==",
|
||||
"requires": {
|
||||
"@fortawesome/fontawesome-common-types": "6.6.0"
|
||||
}
|
||||
},
|
||||
"@fortawesome/free-regular-svg-icons": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.6.0.tgz",
|
||||
"integrity": "sha512-Yv9hDzL4aI73BEwSEh20clrY8q/uLxawaQ98lekBx6t9dQKDHcDzzV1p2YtBGTtolYtNqcWdniOnhzB+JPnQEQ==",
|
||||
"requires": {
|
||||
"@fortawesome/fontawesome-common-types": "6.6.0"
|
||||
}
|
||||
},
|
||||
"@fortawesome/free-solid-svg-icons": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.6.0.tgz",
|
||||
"integrity": "sha512-IYv/2skhEDFc2WGUcqvFJkeK39Q+HyPf5GHUrT/l2pKbtgEIv1al1TKd6qStR5OIwQdN1GZP54ci3y4mroJWjA==",
|
||||
"requires": {
|
||||
"@fortawesome/fontawesome-common-types": "6.6.0"
|
||||
}
|
||||
},
|
||||
"@fortawesome/react-fontawesome": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@fortawesome/react-fontawesome/-/react-fontawesome-0.2.2.tgz",
|
||||
"integrity": "sha512-EnkrprPNqI6SXJl//m29hpaNzOp1bruISWaOiRtkMi/xSvHJlzc2j2JAYS7egxt/EbjSNV/k6Xy0AQI6vB2+1g==",
|
||||
"requires": {
|
||||
"prop-types": "^15.8.1"
|
||||
}
|
||||
"@fortawesome/fontawesome-free": {
|
||||
"version": "6.5.2",
|
||||
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.5.2.tgz",
|
||||
"integrity": "sha512-hRILoInAx8GNT5IMkrtIt9blOdrqHOnPBH+k70aWUAqPZPgopb9G5EQJFpaBx/S8zp2fC+mPW349Bziuk1o28Q==",
|
||||
"dev": true
|
||||
},
|
||||
"@humanwhocodes/config-array": {
|
||||
"version": "0.11.14",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "foris",
|
||||
"version": "6.0.3",
|
||||
"version": "6.0.2",
|
||||
"description": "Foris JS library is a set of components and utils for reForis application and plugins.",
|
||||
"author": "CZ.NIC, z.s.p.o.",
|
||||
"repository": {
|
||||
@ -14,10 +14,6 @@
|
||||
"license": "GPL-3.0",
|
||||
"main": "./src/index.js",
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-svg-core": "^6.6.0",
|
||||
"@fortawesome/free-regular-svg-icons": "^6.6.0",
|
||||
"@fortawesome/free-solid-svg-icons": "^6.6.0",
|
||||
"@fortawesome/react-fontawesome": "^0.2.2",
|
||||
"axios": "^1.7.2",
|
||||
"immutability-helper": "^3.1.1",
|
||||
"moment": "^2.30.1",
|
||||
@ -38,6 +34,7 @@
|
||||
"@babel/plugin-transform-runtime": "^7.24.7",
|
||||
"@babel/preset-env": "^7.24.7",
|
||||
"@babel/preset-react": "^7.24.7",
|
||||
"@fortawesome/fontawesome-free": "^6.5.2",
|
||||
"@testing-library/react": "^8.0.9",
|
||||
"babel-loader": "^8.1.0",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
|
@ -7,8 +7,6 @@
|
||||
|
||||
import React from "react";
|
||||
|
||||
import { faMinus, faPlus } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import Input from "./Input";
|
||||
@ -62,7 +60,7 @@ function NumberInput({ onChange, inlineText, value, ...props }) {
|
||||
onMouseUp={() => enableIncrease(false)}
|
||||
aria-label="Increase"
|
||||
>
|
||||
<FontAwesomeIcon icon={faPlus} />
|
||||
<i className="fas fa-plus" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
@ -71,7 +69,7 @@ function NumberInput({ onChange, inlineText, value, ...props }) {
|
||||
onMouseUp={() => enableDecrease(false)}
|
||||
aria-label="Decrease"
|
||||
>
|
||||
<FontAwesomeIcon icon={faMinus} />
|
||||
<i className="fas fa-minus" />
|
||||
</button>
|
||||
</Input>
|
||||
);
|
||||
|
@ -7,8 +7,6 @@
|
||||
|
||||
import React, { useState } from "react";
|
||||
|
||||
import { faEye, faEyeSlash } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import Input from "./Input";
|
||||
@ -46,10 +44,8 @@ function PasswordInput({ withEye, newPass, ...props }) {
|
||||
setHidden((shouldBeHidden) => !shouldBeHidden);
|
||||
}}
|
||||
>
|
||||
<FontAwesomeIcon
|
||||
icon={isHidden ? faEye : faEyeSlash}
|
||||
style={{ width: "1.25rem" }}
|
||||
className="text-dark"
|
||||
<i
|
||||
className={`fa ${isHidden ? "fa-eye" : "fa-eye-slash"}`}
|
||||
/>
|
||||
</button>
|
||||
)}
|
||||
|
@ -25,7 +25,7 @@ exports[`<NumberInput/> Render number input 1`] = `
|
||||
type="button"
|
||||
>
|
||||
<i
|
||||
class="fa"
|
||||
class="fas fa-plus"
|
||||
/>
|
||||
</button>
|
||||
<button
|
||||
@ -34,7 +34,7 @@ exports[`<NumberInput/> Render number input 1`] = `
|
||||
type="button"
|
||||
>
|
||||
<i
|
||||
class="fa"
|
||||
class="fas fa-minus"
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2024 CZ.NIC z.s.p.o. (https://www.nic.cz/)
|
||||
* Copyright (C) 2019 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.
|
||||
@ -7,7 +7,6 @@
|
||||
|
||||
import React, { useState } from "react";
|
||||
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import PropTypes from "prop-types";
|
||||
import QRCode from "qrcode.react";
|
||||
|
||||
@ -19,12 +18,15 @@ import {
|
||||
ModalFooter,
|
||||
ModalHeader,
|
||||
} from "../../bootstrap/Modal";
|
||||
import { ForisURLs } from "../../utils/forisUrls";
|
||||
|
||||
WiFiQRCode.propTypes = {
|
||||
SSID: PropTypes.string.isRequired,
|
||||
password: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
const QR_ICON_PATH = `${ForisURLs.static}/imgs/QR_icon.svg`;
|
||||
|
||||
export default function WiFiQRCode({ SSID, password }) {
|
||||
const [modal, setModal] = useState(false);
|
||||
|
||||
@ -38,11 +40,11 @@ export default function WiFiQRCode({ SSID, password }) {
|
||||
setModal(true);
|
||||
}}
|
||||
>
|
||||
<FontAwesomeIcon
|
||||
icon="fa-solid fa-qrcode"
|
||||
title={_("Show QR code")}
|
||||
aria-label={_("Show QR code")}
|
||||
className="text-dark"
|
||||
<img
|
||||
width="20"
|
||||
src={QR_ICON_PATH}
|
||||
alt="QR"
|
||||
style={{ opacity: 0.67 }}
|
||||
/>
|
||||
</button>
|
||||
{modal ? (
|
||||
@ -86,10 +88,7 @@ function QRCodeModal({ shown, setShown, SSID, password }) {
|
||||
createAndDownloadPdf(SSID, password);
|
||||
}}
|
||||
>
|
||||
<FontAwesomeIcon
|
||||
icon="fa-solid fa-file-download"
|
||||
className="me-2"
|
||||
/>
|
||||
<i className="fas fa-file-download me-2" />
|
||||
{_("Download PDF")}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
|
@ -5,7 +5,7 @@ exports[`<WiFiSettings/> Snapshot 2.4 GHz 1`] = `
|
||||
- First value
|
||||
+ Second value
|
||||
|
||||
@@ -240,207 +240,95 @@
|
||||
@@ -243,207 +243,95 @@
|
||||
value="0"
|
||||
>
|
||||
auto
|
||||
@ -339,7 +339,7 @@ exports[`<WiFiSettings/> Snapshot guest network. 1`] = `
|
||||
- First value
|
||||
+ Second value
|
||||
|
||||
@@ -524,10 +524,91 @@
|
||||
@@ -527,10 +527,94 @@
|
||||
<small>
|
||||
Enables Wi-Fi for guests, which is separated from LAN network. Devices connected to this network are allowed to access the internet, but aren't allowed to access other devices and the configuration interface of the router. Parameters of the guest network can be set in the Guest network tab.
|
||||
</small>
|
||||
@ -370,8 +370,11 @@ exports[`<WiFiSettings/> Snapshot guest network. 1`] = `
|
||||
+ class="input-group-text"
|
||||
+ type="button"
|
||||
+ >
|
||||
+ <i
|
||||
+ class="fa"
|
||||
+ <img
|
||||
+ alt="QR"
|
||||
+ src="/reforis/static/reforis/imgs/QR_icon.svg"
|
||||
+ style="opacity: 0.67;"
|
||||
+ width="20"
|
||||
+ />
|
||||
+ </button>
|
||||
+ </div>
|
||||
@ -409,7 +412,7 @@ exports[`<WiFiSettings/> Snapshot guest network. 1`] = `
|
||||
+ type="button"
|
||||
+ >
|
||||
+ <i
|
||||
+ class="fa"
|
||||
+ class="fa fa-eye"
|
||||
+ />
|
||||
+ </button>
|
||||
+ </div>
|
||||
@ -431,7 +434,7 @@ exports[`<WiFiSettings/> Snapshot guest network. 1`] = `
|
||||
class="form-check form-switch mb-3 d-flex align-items-center"
|
||||
>
|
||||
<input
|
||||
@@ -550,10 +631,11 @@
|
||||
@@ -553,10 +637,11 @@
|
||||
<div
|
||||
class="text-end"
|
||||
>
|
||||
@ -450,7 +453,7 @@ exports[`<WiFiSettings/> Snapshot one module enabled. 1`] = `
|
||||
- First value
|
||||
+ Second value
|
||||
|
||||
@@ -21,10 +21,513 @@
|
||||
@@ -21,10 +21,516 @@
|
||||
>
|
||||
Wi-Fi 1
|
||||
</h2>
|
||||
@ -479,8 +482,11 @@ exports[`<WiFiSettings/> Snapshot one module enabled. 1`] = `
|
||||
+ class="input-group-text"
|
||||
+ type="button"
|
||||
+ >
|
||||
+ <i
|
||||
+ class="fa"
|
||||
+ <img
|
||||
+ alt="QR"
|
||||
+ src="/reforis/static/reforis/imgs/QR_icon.svg"
|
||||
+ style="opacity: 0.67;"
|
||||
+ width="20"
|
||||
+ />
|
||||
+ </button>
|
||||
+ </div>
|
||||
@ -517,7 +523,7 @@ exports[`<WiFiSettings/> Snapshot one module enabled. 1`] = `
|
||||
+ type="button"
|
||||
+ >
|
||||
+ <i
|
||||
+ class="fa"
|
||||
+ class="fa fa-eye"
|
||||
+ />
|
||||
+ </button>
|
||||
+ </div>
|
||||
|
@ -1,10 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2024 CZ.NIC z.s.p.o. (https://www.nic.cz/)
|
||||
* Copyright (C) 2019 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 from "react";
|
||||
|
||||
import mockAxios from "jest-mock-axios";
|
||||
import moment from "moment-timezone";
|
||||
import "./mockGlobals";
|
||||
@ -26,8 +26,3 @@ jest.doMock("moment", () => {
|
||||
return moment;
|
||||
});
|
||||
Date.now = jest.fn(() => new Date(Date.UTC(2019, 1, 1, 12, 13, 14)).valueOf());
|
||||
|
||||
// Mock Font Awesome v6 library
|
||||
jest.mock("@fortawesome/react-fontawesome", () => ({
|
||||
FontAwesomeIcon: () => <i className="fa" />,
|
||||
}));
|
||||
|
Reference in New Issue
Block a user