1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2024-11-14 17:35:35 +01:00

Merge branch 'dev' into 'master'

Release v4.4.0.

See merge request turris/reforis/foris-js!104
This commit is contained in:
Bogdan Bodnar 2020-03-13 22:16:42 +01:00
commit 9a2547a6c2
10 changed files with 4656 additions and 815 deletions

5451
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "foris",
"version": "4.3.1",
"version": "4.4.0",
"description": "Set of components and utils for Foris and its plugins.",
"author": "CZ.NIC, z.s.p.o.",
"repository": {
@ -41,7 +41,7 @@
"babel-polyfill": "^6.26.0",
"eslint": "^6.8.0",
"eslint-config-reforis": "^1.0.0",
"jest": "^24.9.0",
"jest": "^25.1.0",
"jest-mock-axios": "^3.2.0",
"moment-timezone": "^0.5.27",
"prop-types": "15.7.2",

View File

@ -9,7 +9,7 @@ import {
useCallback, useEffect, useReducer, useState,
} from "react";
import { ForisURLs } from "../forisUrls";
import { ForisURLs } from "../utils/forisUrls";
import {
API_ACTIONS, API_METHODS, API_STATE, getErrorPayload, HEADERS, TIMEOUT,
} from "./utils";

View File

@ -10,7 +10,7 @@ import PropTypes from "prop-types";
import { useAPIPost } from "../api/hooks";
import { API_STATE } from "../api/utils";
import { ForisURLs } from "../forisUrls";
import { ForisURLs } from "../utils/forisUrls";
import { Button } from "../bootstrap/Button";
import {

View File

@ -9,7 +9,7 @@ import React, { useState } from "react";
import QRCode from "qrcode.react";
import PropTypes from "prop-types";
import { ForisURLs } from "../../forisUrls";
import { ForisURLs } from "../../utils/forisUrls";
import { Button } from "../../bootstrap/Button";
import {
Modal, ModalBody, ModalFooter, ModalHeader,

View File

@ -12,7 +12,7 @@ import {
validateIPv6Address,
validateIPv6Prefix,
validateMAC,
} from "validations";
} from "utils/validations";
describe("Validation functions", () => {
it("validateIPv4Address valid", () => {

View File

@ -67,7 +67,7 @@ export { useClickOutside } from "./utils/hooks";
export { toLocaleDateString } from "./utils/datetime";
// Foris URL
export { ForisURLs, REFORIS_URL_PREFIX } from "./forisUrls";
export { ForisURLs, REFORIS_URL_PREFIX } from "./utils/forisUrls";
// Validation
export {
@ -78,7 +78,7 @@ export {
validateDUID,
validateMAC,
validateMultipleEmails,
} from "./validations";
} from "./utils/validations";
// Alert context
export { AlertContextProvider, useAlert } from "./alertContext/AlertContext";

View File

@ -23,7 +23,7 @@ const REs = {
IPv4: /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
IPv6: /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,
IPv6Prefix: /^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0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a-fA-F0-9]{2}$/,
MultipleEmails: /^([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+ *)( *, *[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+ *)*$/,

View File

@ -7,7 +7,7 @@
/* eslint no-console: "off" */
import { ForisURLs } from "../forisUrls";
import { ForisURLs } from "../utils/forisUrls";
const PROTOCOL = window.location.protocol === "http:" ? "ws" : "wss";