1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2025-06-16 13:46:16 +02:00

Compare commits

..

13 Commits

Author SHA1 Message Date
7e0752fc17 Merge branch 'dev' into 'master'
Dev

See merge request turris/reforis/foris-js!228
2024-07-26 16:12:26 +02:00
4c5aeed26e Merge branch 'bump-603' into 'dev'
Bump v6.0.3

See merge request turris/reforis/foris-js!227
2024-07-26 16:08:09 +02:00
d90e39a570 Bump v6.0.3
* Update WiFiQRCode component
2024-07-26 17:06:38 +03:00
2e2f326ade Merge branch 'wifi-qr-icon' into 'dev'
Update WiFiQRCode component

See merge request turris/reforis/foris-js!226
2024-07-26 14:26:00 +02:00
541ca7a784 Update WiFiQRCode component
Remove custom QR icon image with a standard fontawesome icon
2024-07-25 17:31:30 +03:00
8e0c60a576 Merge branch 'dev' into 'master'
Dev

See merge request turris/reforis/foris-js!225
2024-06-28 14:22:41 +02:00
928cf716d6 Merge branch 'bump-602' into 'dev'
Bump v6.0.2

See merge request turris/reforis/foris-js!224
2024-06-28 13:08:32 +02:00
bd8d5bc8cb Bump v6.0.2
* Add className prop to CheckBox and Radio components
2024-06-28 14:03:19 +03:00
804e0022eb Update Snapshots 2024-06-28 10:30:25 +03:00
d69398ac06 Add className prop to CheckBox and Radio components 2024-06-28 10:29:41 +03:00
e297410f16 Merge branch 'dev' into 'master'
Dev

See merge request turris/reforis/foris-js!223
2024-06-26 15:05:29 +02:00
0ea5d43c75 Merge branch 'dev' into 'master'
Bump v6.0.0

See merge request turris/reforis/foris-js!220
2024-06-11 14:29:46 +02:00
bee4bee300 Merge branch 'dev' into 'master'
Dev

See merge request turris/reforis/foris-js!215
2024-01-19 19:56:06 +01:00
8 changed files with 49 additions and 38 deletions

View File

@ -8,15 +8,27 @@ and this project adheres to
## [Unreleased] ## [Unreleased]
## [6.0.3] - 2024-07-26
### Changed
- Updated WiFiQRCode component
## [6.0.2] - 2024-06-28
### Added
- Added className prop to CheckBox and Radio components
## [6.0.1] - 2024-06-26 ## [6.0.1] - 2024-06-26
### Added ### Added
- Add className prop to Switch component - Added className prop to Switch component
### Changed ### Changed
- Update dependencies in package.json - Updated dependencies in package.json
- NPM audit fix - NPM audit fix
## [6.0.0] - 2024-06-11 ## [6.0.0] - 2024-06-11
@ -325,7 +337,9 @@ and this project adheres to
## [0.0.7] - 2019-09-02 ## [0.0.7] - 2019-09-02
[unreleased]: [unreleased]:
https://gitlab.nic.cz/turris/reforis/foris-js/-/compare/v6.0.1...master 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
[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.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 [6.0.0]: https://gitlab.nic.cz/turris/reforis/foris-js/-/compare/v5.6.1...v6.0.0
[5.6.1]: https://gitlab.nic.cz/turris/reforis/foris-js/-/compare/v5.6.0...v5.6.1 [5.6.1]: https://gitlab.nic.cz/turris/reforis/foris-js/-/compare/v5.6.0...v5.6.1

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "foris", "name": "foris",
"version": "6.0.1", "version": "6.0.3",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "foris", "name": "foris",
"version": "6.0.1", "version": "6.0.3",
"license": "GPL-3.0", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"axios": "^1.7.2", "axios": "^1.7.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "foris", "name": "foris",
"version": "6.0.1", "version": "6.0.3",
"description": "Foris JS library is a set of components and utils for reForis application and plugins.", "description": "Foris JS library is a set of components and utils for reForis application and plugins.",
"author": "CZ.NIC, z.s.p.o.", "author": "CZ.NIC, z.s.p.o.",
"repository": { "repository": {

View File

@ -17,17 +17,19 @@ CheckBox.propTypes = {
helpText: PropTypes.string, helpText: PropTypes.string,
/** Control if checkbox is clickable */ /** Control if checkbox is clickable */
disabled: PropTypes.bool, disabled: PropTypes.bool,
/** Additional class name */
className: PropTypes.string,
}; };
CheckBox.defaultProps = { CheckBox.defaultProps = {
disabled: false, disabled: false,
}; };
function CheckBox({ label, helpText, disabled, ...props }) { function CheckBox({ label, helpText, disabled, className, ...props }) {
const uid = useUID(); const uid = useUID();
return ( return (
<div className="mb-3 form-check"> <div className={`${className || "mb-3"} form-check`.trim()}>
<input <input
className="form-check-input" className="form-check-input"
type="checkbox" type="checkbox"

View File

@ -83,12 +83,13 @@ Radio.propTypes = {
id: PropTypes.string.isRequired, id: PropTypes.string.isRequired,
inline: PropTypes.bool, inline: PropTypes.bool,
helpText: PropTypes.string, helpText: PropTypes.string,
className: PropTypes.string,
}; };
export function Radio({ label, id, helpText, inline, ...props }) { export function Radio({ label, id, helpText, inline, className, ...props }) {
return ( return (
<div <div
className={`mb-2 ${inline ? "form-check form-check-inline" : ""}`.trim()} className={`${className || "mb-3"} ${inline ? "form-check form-check-inline" : ""}`.trim()}
> >
<input <input
id={id} id={id}

View File

@ -11,7 +11,7 @@ exports[`<RadioSet/> Render radio set 1`] = `
Radios set label Radios set label
</label> </label>
<div <div
class="mb-2" class="mb-3"
> >
<input <input
checked="" checked=""
@ -29,7 +29,7 @@ exports[`<RadioSet/> Render radio set 1`] = `
</label> </label>
</div> </div>
<div <div
class="mb-2" class="mb-3"
> >
<input <input
class="form-check-input me-2" class="form-check-input me-2"
@ -46,7 +46,7 @@ exports[`<RadioSet/> Render radio set 1`] = `
</label> </label>
</div> </div>
<div <div
class="mb-2" class="mb-3"
> >
<input <input
class="form-check-input me-2" class="form-check-input me-2"

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2019 CZ.NIC z.s.p.o. (http://www.nic.cz/) * Copyright (C) 2019-2024 CZ.NIC z.s.p.o. (https://www.nic.cz/)
* *
* This is free software, licensed under the GNU General Public License v3. * This is free software, licensed under the GNU General Public License v3.
* See /LICENSE for more information. * See /LICENSE for more information.
@ -18,15 +18,12 @@ import {
ModalFooter, ModalFooter,
ModalHeader, ModalHeader,
} from "../../bootstrap/Modal"; } from "../../bootstrap/Modal";
import { ForisURLs } from "../../utils/forisUrls";
WiFiQRCode.propTypes = { WiFiQRCode.propTypes = {
SSID: PropTypes.string.isRequired, SSID: PropTypes.string.isRequired,
password: PropTypes.string.isRequired, password: PropTypes.string.isRequired,
}; };
const QR_ICON_PATH = `${ForisURLs.static}/imgs/QR_icon.svg`;
export default function WiFiQRCode({ SSID, password }) { export default function WiFiQRCode({ SSID, password }) {
const [modal, setModal] = useState(false); const [modal, setModal] = useState(false);
@ -40,11 +37,10 @@ export default function WiFiQRCode({ SSID, password }) {
setModal(true); setModal(true);
}} }}
> >
<img <i
width="20" className="fa-solid fa-qrcode"
src={QR_ICON_PATH} title={_("Show QR code")}
alt="QR" aria-label={_("Show QR code")}
style={{ opacity: 0.67 }}
/> />
</button> </button>
{modal ? ( {modal ? (

View File

@ -5,7 +5,7 @@ exports[`<WiFiSettings/> Snapshot 2.4 GHz 1`] = `
- First value - First value
+ Second value + Second value
@@ -243,207 +243,95 @@ @@ -242,207 +242,95 @@
value="0" value="0"
> >
auto auto
@ -339,7 +339,7 @@ exports[`<WiFiSettings/> Snapshot guest network. 1`] = `
- First value - First value
+ Second value + Second value
@@ -527,10 +527,94 @@ @@ -526,10 +526,93 @@
<small> <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. 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> </small>
@ -370,11 +370,10 @@ exports[`<WiFiSettings/> Snapshot guest network. 1`] = `
+ class="input-group-text" + class="input-group-text"
+ type="button" + type="button"
+ > + >
+ <img + <i
+ alt="QR" + aria-label="Show QR code"
+ src="/reforis/static/reforis/imgs/QR_icon.svg" + class="fa-solid fa-qrcode"
+ style="opacity: 0.67;" + title="Show QR code"
+ width="20"
+ /> + />
+ </button> + </button>
+ </div> + </div>
@ -434,7 +433,7 @@ exports[`<WiFiSettings/> Snapshot guest network. 1`] = `
class="form-check form-switch mb-3 d-flex align-items-center" class="form-check form-switch mb-3 d-flex align-items-center"
> >
<input <input
@@ -553,10 +637,11 @@ @@ -552,10 +635,11 @@
<div <div
class="text-end" class="text-end"
> >
@ -453,7 +452,7 @@ exports[`<WiFiSettings/> Snapshot one module enabled. 1`] = `
- First value - First value
+ Second value + Second value
@@ -21,10 +21,516 @@ @@ -21,10 +21,515 @@
> >
Wi-Fi 1 Wi-Fi 1
</h2> </h2>
@ -482,11 +481,10 @@ exports[`<WiFiSettings/> Snapshot one module enabled. 1`] = `
+ class="input-group-text" + class="input-group-text"
+ type="button" + type="button"
+ > + >
+ <img + <i
+ alt="QR" + aria-label="Show QR code"
+ src="/reforis/static/reforis/imgs/QR_icon.svg" + class="fa-solid fa-qrcode"
+ style="opacity: 0.67;" + title="Show QR code"
+ width="20"
+ /> + />
+ </button> + </button>
+ </div> + </div>
@ -568,7 +566,7 @@ exports[`<WiFiSettings/> Snapshot one module enabled. 1`] = `
+ GHz + GHz
+ </label> + </label>
+ <div + <div
+ class="mb-2 form-check form-check-inline" + class="mb-3 form-check form-check-inline"
+ > + >
+ <input + <input
+ class="form-check-input me-2" + class="form-check-input me-2"
@ -585,7 +583,7 @@ exports[`<WiFiSettings/> Snapshot one module enabled. 1`] = `
+ </label> + </label>
+ </div> + </div>
+ <div + <div
+ class="mb-2 form-check form-check-inline" + class="mb-3 form-check form-check-inline"
+ > + >
+ <input + <input
+ checked="" + checked=""