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

Compare commits

...

14 Commits

Author SHA1 Message Date
8d75b5ec6e Bump v5.1.9
* Fix trailing space in Modal classes
* Change formFieldsSize of ResetWiFiSettings card
* Increase bottom margin of formFieldsSize
2021-01-20 11:42:24 +01:00
c1aa1948b4 Merge branch 'fix-wifi-layout' into 'dev'
Fix Wi-Fi layout

See merge request turris/reforis/foris-js!145
2021-01-19 16:42:17 +01:00
8c110ebf52 NPM audit fix 2021-01-18 23:31:43 +01:00
abb5be53aa Fix trailing space in Modal classes 2021-01-18 23:10:39 +01:00
af0fb80e45 Update Snapshots 2021-01-18 23:10:39 +01:00
688192504f Change formFieldsSize of ResetWiFiSettings card 2021-01-18 22:06:20 +01:00
b8e5dbec8d Increase bottom margin of formFieldsSize 2021-01-18 22:05:56 +01:00
fde751a25f Merge branch 'check-installed-plugins' into 'dev'
Add isPluginInstalled function

See merge request turris/reforis/foris-js!143
2020-12-20 18:47:06 +01:00
79006cfb99 Bump v5.1.8 2020-12-19 00:25:44 +01:00
de398901f3 Add isPluginInstalled function 2020-12-19 00:14:05 +01:00
56173d4959 Merge branch 'add-storage-link' into 'dev'
Add storage link

See merge request turris/reforis/foris-js!141
2020-11-27 17:09:55 +01:00
7c837d041e Bump v5.1.7 2020-11-27 15:37:07 +01:00
473c81f9a4 Add storage link 2020-11-27 15:37:02 +01:00
15567a7dde Merge branch 'release-516' into 'dev'
Bump v5.1.6

Closes #18

See merge request turris/reforis/foris-js!139
2020-11-27 12:30:39 +01:00
10 changed files with 1870 additions and 2592 deletions

4388
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "foris",
"version": "5.1.6",
"version": "5.1.9",
"description": "Set of components and utils for Foris and its plugins.",
"author": "CZ.NIC, z.s.p.o.",
"repository": {
@ -14,7 +14,7 @@
"license": "GPL-3.0",
"main": "./src/index.js",
"dependencies": {
"axios": "^0.19.2",
"axios": "^0.21.1",
"immutability-helper": "3.0.1",
"moment": "^2.24.0",
"qrcode.react": "^0.9.3",
@ -29,7 +29,7 @@
"react-router-dom": "^5.1.2"
},
"devDependencies": {
"@babel/cli": "^7.8.4",
"@babel/cli": "^7.12.10",
"@babel/core": "^7.9.0",
"@babel/plugin-transform-runtime": "^7.9.0",
"@babel/preset-env": "^7.9.0",
@ -53,10 +53,10 @@
"react": "16.9.0",
"react-dom": "16.9.0",
"react-router-dom": "^5.1.2",
"react-styleguidist": "^10.6.2",
"react-styleguidist": "^11.1.5",
"snapshot-diff": "^0.7.0",
"style-loader": "^1.2.1",
"webpack": "^4.43.0"
"webpack": "^5.15.0"
},
"scripts": {
"lint": "eslint src",

View File

@ -69,7 +69,7 @@ export function Modal({ shown, setShown, scrollable, size, children }) {
>
<div
ref={dialogRef}
className={`modal-dialog ${modalSize} modal-dialog-centered ${
className={`${modalSize.trim()} modal-dialog modal-dialog-centered ${
scrollable ? "modal-dialog-scrollable" : ""
}`.trim()}
role="document"

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 CZ.NIC z.s.p.o. (http://www.nic.cz/)
* Copyright (C) 2019-2021 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,5 +7,5 @@
/** Bootstrap column size for form fields */
// eslint-disable-next-line import/prefer-default-export
export const formFieldsSize = "card p-4 col-sm-12 col-lg-12 p-0 mb-3";
export const formFieldsSize = "card p-4 col-sm-12 col-lg-12 p-0 mb-4";
export const buttonFormFieldsSize = "col-sm-12 col-lg-12 p-0 mb-3";

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 CZ.NIC z.s.p.o. (http://www.nic.cz/)
* Copyright (C) 2019-2021 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.
@ -13,7 +13,7 @@ import { useAlert } from "../../alertContext/AlertContext";
import { ALERT_TYPES } from "../../bootstrap/Alert";
import { useAPIPost } from "../../api/hooks";
import { API_STATE } from "../../api/utils";
import { buttonFormFieldsSize } from "../../bootstrap/constants";
import { formFieldsSize } from "../../bootstrap/constants";
ResetWiFiSettings.propTypes = {
ws: PropTypes.object.isRequired,
@ -51,7 +51,7 @@ export default function ResetWiFiSettings({ ws, endpoint }) {
}
return (
<>
<div className={formFieldsSize}>
<h2>{_("Reset Wi-Fi Settings")}</h2>
<p>
{_(`
@ -59,7 +59,7 @@ If a number of wireless cards doesn't match, you may try to reset the Wi-Fi sett
current Wi-Fi configuration and restore the default values.
`)}
</p>
<div className={`${buttonFormFieldsSize} text-right`}>
<div className="text-right">
<Button
className="btn-warning"
forisFormSize
@ -70,6 +70,6 @@ current Wi-Fi configuration and restore the default values.
{_("Reset Wi-Fi Settings")}
</Button>
</div>
</>
</div>
);
}

View File

@ -251,7 +251,7 @@ exports[`<WiFiSettings/> Snapshot 2.4 GHz 1`] = `
exports[`<WiFiSettings/> Snapshot both modules disabled. 1`] = `
<DocumentFragment>
<div
class="card p-4 col-sm-12 col-lg-12 p-0 mb-3"
class="card p-4 col-sm-12 col-lg-12 p-0 mb-4"
>
<form>
<div
@ -309,24 +309,28 @@ exports[`<WiFiSettings/> Snapshot both modules disabled. 1`] = `
</div>
</form>
</div>
<h2>
Reset Wi-Fi Settings
</h2>
<p>
<div
class="card p-4 col-sm-12 col-lg-12 p-0 mb-4"
>
<h2>
Reset Wi-Fi Settings
</h2>
<p>
If a number of wireless cards doesn't match, you may try to reset the Wi-Fi settings. Note that this will remove the
current Wi-Fi configuration and restore the default values.
</p>
<div
class="col-sm-12 col-lg-12 p-0 mb-3 text-right"
>
<button
class="btn btn-warning col-sm-12 col-md-3 col-lg-2"
type="button"
</p>
<div
class="text-right"
>
Reset Wi-Fi Settings
</button>
<button
class="btn btn-warning col-sm-12 col-md-3 col-lg-2"
type="button"
>
Reset Wi-Fi Settings
</button>
</div>
</div>
</DocumentFragment>
`;

View File

@ -10,7 +10,7 @@ exports[`<RebootButton/> Render modal. 1`] = `
role="dialog"
>
<div
class="modal-dialog modal-dialog-centered"
class="modal-dialog modal-dialog-centered"
role="document"
>
<div

View File

@ -70,6 +70,7 @@ export { ErrorMessage } from "./utils/ErrorMessage";
export { useClickOutside } from "./utils/hooks";
export { toLocaleDateString } from "./utils/datetime";
export { displayCard } from "./utils/displayCard";
export { isPluginInstalled } from "./utils/isPluginInstalled";
// Foris URL
export { ForisURLs, REFORIS_URL_PREFIX } from "./utils/forisUrls";

View File

@ -20,6 +20,8 @@ export const ForisURLs = {
updates: `${REFORIS_URL_PREFIX}/package-management/updates`,
},
storage: `${REFORIS_URL_PREFIX}/storage`,
// Notifications links are used with <Link/> inside Router, thus url subdir is not required.
overview: "/overview",
notifications: "/overview#notifications",

View File

@ -0,0 +1,9 @@
/*
* 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.
*/
export const isPluginInstalled = (pluginName) =>
ForisPlugins.some((plugin) => plugin.name === pluginName);