mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-04 10:30:00 -06:00
Compare commits
3 Commits
backport-7
...
4.4.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d12ef3ef4e | ||
|
|
7260a1a3a4 | ||
|
|
5b308d10dc |
@@ -74,7 +74,7 @@ export const extractYoutubeId = (url: string): string | null => {
|
||||
};
|
||||
|
||||
export const extractVimeoId = (url: string): string | null => {
|
||||
const regExp = /vimeo\.com\/(\d+)/;
|
||||
const regExp = /vimeo\.com\/(?:video\/)?(\d+)/;
|
||||
const match = regExp.exec(url);
|
||||
|
||||
if (match?.[1]) {
|
||||
@@ -85,7 +85,7 @@ export const extractVimeoId = (url: string): string | null => {
|
||||
};
|
||||
|
||||
export const extractLoomId = (url: string): string | null => {
|
||||
const regExp = /loom\.com\/share\/([a-zA-Z0-9]+)/;
|
||||
const regExp = /loom\.com\/(?:share|embed)\/([a-zA-Z0-9]+)/;
|
||||
const match = regExp.exec(url);
|
||||
|
||||
if (match?.[1]) {
|
||||
|
||||
@@ -145,6 +145,7 @@ interface UploadAreaProps {
|
||||
onDragOver: (e: React.DragEvent<HTMLLabelElement>) => void;
|
||||
onDrop: (e: React.DragEvent<HTMLLabelElement>) => void;
|
||||
showUploader: boolean;
|
||||
uploadedFiles: UploadedFile[];
|
||||
}
|
||||
|
||||
function UploadArea({
|
||||
@@ -160,6 +161,7 @@ function UploadArea({
|
||||
onDragOver,
|
||||
onDrop,
|
||||
showUploader,
|
||||
uploadedFiles,
|
||||
}: Readonly<UploadAreaProps>): React.JSX.Element | null {
|
||||
if (!showUploader) {
|
||||
return null;
|
||||
@@ -201,7 +203,7 @@ function UploadArea({
|
||||
accept={acceptAttribute}
|
||||
onChange={onFileChange}
|
||||
disabled={disabled}
|
||||
required={required}
|
||||
required={uploadedFiles.length > 0 ? false : required}
|
||||
dir={dir}
|
||||
aria-label="File upload"
|
||||
aria-describedby={`${inputId}-label`}
|
||||
@@ -323,6 +325,7 @@ function FileUpload({
|
||||
onDragOver={handleDragOver}
|
||||
onDrop={handleDrop}
|
||||
showUploader={showUploader}
|
||||
uploadedFiles={uploadedFiles}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -27,7 +27,7 @@ export const checkForVimeoUrl = (url: string): boolean => {
|
||||
|
||||
if (vimeoUrl.protocol !== "https:") return false;
|
||||
|
||||
const vimeoDomains = ["www.vimeo.com", "vimeo.com"];
|
||||
const vimeoDomains = ["www.vimeo.com", "vimeo.com", "player.vimeo.com"];
|
||||
const hostname = vimeoUrl.hostname;
|
||||
|
||||
return vimeoDomains.includes(hostname);
|
||||
@@ -77,7 +77,7 @@ const extractYoutubeId = (url: string): string | null => {
|
||||
};
|
||||
|
||||
const extractVimeoId = (url: string): string | null => {
|
||||
const regExp = /vimeo\.com\/(?<videoId>\d+)/;
|
||||
const regExp = /vimeo\.com\/(?:video\/)?(?<videoId>\d+)/;
|
||||
const match = regExp.exec(url);
|
||||
|
||||
return match?.groups?.videoId ?? null;
|
||||
|
||||
@@ -173,7 +173,8 @@ export function BlockConditional({
|
||||
}
|
||||
|
||||
// For other element types, check if required fields are empty
|
||||
if (element.required && isEmptyResponse(response)) {
|
||||
// CTA elements should not block navigation even if marked required (as they are informational)
|
||||
if (element.type !== TSurveyElementTypeEnum.CTA && element.required && isEmptyResponse(response)) {
|
||||
form.requestSubmit();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ export const checkForVimeoUrl = (url: string): boolean => {
|
||||
|
||||
if (vimeoUrl.protocol !== "https:") return false;
|
||||
|
||||
const vimeoDomains = ["www.vimeo.com", "vimeo.com"];
|
||||
const vimeoDomains = ["www.vimeo.com", "vimeo.com", "player.vimeo.com"];
|
||||
const hostname = vimeoUrl.hostname;
|
||||
|
||||
return vimeoDomains.includes(hostname);
|
||||
@@ -77,7 +77,7 @@ export const extractYoutubeId = (url: string): string | null => {
|
||||
};
|
||||
|
||||
const extractVimeoId = (url: string): string | null => {
|
||||
const regExp = /vimeo\.com\/(\d+)/;
|
||||
const regExp = /vimeo\.com\/(?:video\/)?(\d+)/;
|
||||
const match = url.match(regExp);
|
||||
|
||||
if (match && match[1]) {
|
||||
@@ -87,7 +87,7 @@ const extractVimeoId = (url: string): string | null => {
|
||||
};
|
||||
|
||||
const extractLoomId = (url: string): string | null => {
|
||||
const regExp = /loom\.com\/share\/([a-zA-Z0-9]+)/;
|
||||
const regExp = /loom\.com\/(?:share|embed)\/([a-zA-Z0-9]+)/;
|
||||
const match = url.match(regExp);
|
||||
|
||||
if (match && match[1]) {
|
||||
|
||||
Reference in New Issue
Block a user