Reorganizace skeletonu, aktualizace app-vite a quasaru
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
export const isRequestPending = {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
};
|
||||
export const defaultValues = {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: () => ({})
|
||||
}
|
||||
@@ -1,20 +1,19 @@
|
||||
export const isRequired = (val) => !!val || "Toto pole je povinné";
|
||||
export const isValidEmail = (email) => {
|
||||
const patternEmail = /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,10})+$/;
|
||||
return !!patternEmail.test(email) || "Tento e-mail není platný";
|
||||
const patternEmail = /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,10})+$/;
|
||||
return !!patternEmail.test(email) || "Tento e-mail není platný";
|
||||
};
|
||||
export const minLength = (length) => (val) => val.length >= length || `Zadej alespoň ${length} znaky`
|
||||
export const maxLength = (length) => (val) => val.length <= length || `Zadej maximálně ${length} znaků`
|
||||
|
||||
|
||||
export const isEmptyArray = () => (val) => {
|
||||
return (val && val.length !== 0) || "Select item, please";
|
||||
return (val && val.length !== 0) || "Select item, please";
|
||||
};
|
||||
|
||||
export const isNumber = () => (val) => {
|
||||
return !isNaN(val) || "Only numbers are allowed";
|
||||
return !isNaN(val) || "Only numbers are allowed";
|
||||
};
|
||||
|
||||
export const hasNoWhitespace = () => (val) => {
|
||||
return /^\S*$/.test(val) || "Don't use whitespaces";
|
||||
return /^\S*$/.test(val) || "Don't use whitespaces";
|
||||
};
|
||||
|
||||
+39
-20
@@ -1,22 +1,41 @@
|
||||
export const metaData = ({title, description, keywords, image}) => {
|
||||
return {
|
||||
title: title || "",
|
||||
titleTemplate(title) {
|
||||
return title !== '' ? `${title} - Polétání.cz` : 'Polétání.cz'
|
||||
},
|
||||
meta: {
|
||||
description: {name: "description", content: description || ""},
|
||||
keywords: {name: "keywords", content: (keywords || []).join(", ")},
|
||||
ogImage: image ? {property: "og:image", content: image} : undefined,
|
||||
ogTitle: {
|
||||
property: "og:title",
|
||||
content: title,
|
||||
template(ogTitle) {
|
||||
return (!ogTitle || ogTitle === '') ? "Polétání.cz" : `${ogTitle} - Polétání.cz`
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const stripHtml = (str) => {
|
||||
if (!str)
|
||||
return '';
|
||||
else
|
||||
str = str.toString();
|
||||
|
||||
return str.replace(/<[^>]+>/ig, '');
|
||||
}
|
||||
|
||||
export const commonKeywords = ["zápisník", "létání", "ultralight", "letectví", "fotogalerie", "výlet", "vyhlídkový let", "navigační let"];
|
||||
export const commonKeywords = [
|
||||
"zápisník", "létání", "ultralight", "letectví", "fotogalerie", "výlet", "vyhlídkový let", "navigační let"
|
||||
];
|
||||
|
||||
|
||||
export const metaData = ({title, description, keywords, image}) => {
|
||||
|
||||
const filteredKeywords = (keywords || []).filter(kw => !!kw);
|
||||
const filteredDescription = stripHtml(description);
|
||||
|
||||
return {
|
||||
title: title || "",
|
||||
titleTemplate(title) {
|
||||
return title !== '' ? `${title} - Polétání.cz` : 'Polétání.cz'
|
||||
},
|
||||
meta: {
|
||||
description: {name: "description", content: filteredDescription || ""},
|
||||
keywords: {name: "keywords", content: (filteredKeywords || commonKeywords).join(", ")},
|
||||
ogImage: image ? {property: "og:image", content: image} : undefined,
|
||||
ogTitle: {
|
||||
property: "og:title",
|
||||
content: title,
|
||||
template(ogTitle) {
|
||||
return (!ogTitle || ogTitle === '') ? "Polétání.cz" : `${ogTitle} - Polétání.cz`
|
||||
}
|
||||
},
|
||||
ogDescription: {
|
||||
property: "og:description", content: filteredDescription,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user