Media File improvements + separate DEV testing instance for cloudinary.
This commit is contained in:
@@ -10757,6 +10757,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>updating</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
<folder_node>
|
<folder_node>
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ export const uploadToCloudinary = async (
|
|||||||
let takenat;
|
let takenat;
|
||||||
if (fileType.includes("image")) {
|
if (fileType.includes("image")) {
|
||||||
const exif = await exifr.parse(file);
|
const exif = await exifr.parse(file);
|
||||||
console.log(`exif`, exif);
|
|
||||||
takenat = exif && exif.DateTimeOriginal;
|
takenat = exif && exif.DateTimeOriginal;
|
||||||
}
|
}
|
||||||
const documentInsert = await client.mutate({
|
const documentInsert = await client.mutate({
|
||||||
@@ -141,7 +141,7 @@ export const uploadToCloudinary = async (
|
|||||||
uploaded_by: uploaded_by,
|
uploaded_by: uploaded_by,
|
||||||
key: key,
|
key: key,
|
||||||
type: fileType,
|
type: fileType,
|
||||||
extension: extension,
|
extension: cloudinaryUploadResponse.data.format || extension,
|
||||||
bodyshopid: bodyshop.id,
|
bodyshopid: bodyshop.id,
|
||||||
size: cloudinaryUploadResponse.data.bytes || file.size,
|
size: cloudinaryUploadResponse.data.bytes || file.size,
|
||||||
takenat,
|
takenat,
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { DownCircleFilled } from "@ant-design/icons";
|
import { DownCircleFilled } from "@ant-design/icons";
|
||||||
import { useApolloClient, useMutation } from "@apollo/client";
|
import { useApolloClient, useMutation } from "@apollo/client";
|
||||||
import { Button, Dropdown, Menu, notification, Popconfirm } from "antd";
|
import { Button, Dropdown, Menu, notification, Popconfirm } from "antd";
|
||||||
import moment from "moment";
|
|
||||||
import React, { useMemo } from "react";
|
import React, { useMemo } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
|
|||||||
@@ -31,7 +31,9 @@ function JobsDocumentsComponent({
|
|||||||
acc.images.push({
|
acc.images.push({
|
||||||
src: `${
|
src: `${
|
||||||
process.env.REACT_APP_CLOUDINARY_ENDPOINT
|
process.env.REACT_APP_CLOUDINARY_ENDPOINT
|
||||||
}/${DetermineFileType(value.type)}/upload/${value.key}`,
|
}/${DetermineFileType(value.type)}/upload/${value.key}${
|
||||||
|
value.extension ? `.${value.extension}` : ""
|
||||||
|
}`,
|
||||||
thumbnail: `${
|
thumbnail: `${
|
||||||
process.env.REACT_APP_CLOUDINARY_ENDPOINT
|
process.env.REACT_APP_CLOUDINARY_ENDPOINT
|
||||||
}/${DetermineFileType(value.type)}/upload/${
|
}/${DetermineFileType(value.type)}/upload/${
|
||||||
@@ -51,13 +53,17 @@ function JobsDocumentsComponent({
|
|||||||
let thumb;
|
let thumb;
|
||||||
switch (fileType) {
|
switch (fileType) {
|
||||||
case "video":
|
case "video":
|
||||||
thumb = `${process.env.REACT_APP_CLOUDINARY_ENDPOINT}/${fileType}/upload/c_fill,f_png,h_250,w_250/${value.key}`;
|
thumb = `${process.env.REACT_APP_CLOUDINARY_ENDPOINT}/${fileType}/upload/${process.env.REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS}/${value.key}`;
|
||||||
break;
|
break;
|
||||||
case "raw":
|
case "raw":
|
||||||
thumb = `${window.location.origin}/file.png`;
|
thumb = `${window.location.origin}/file.png`;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
thumb = `${process.env.REACT_APP_CLOUDINARY_ENDPOINT}/${fileType}/upload/${process.env.REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS}/${value.key}`;
|
thumb = `${
|
||||||
|
process.env.REACT_APP_CLOUDINARY_ENDPOINT
|
||||||
|
}/${fileType}/upload/${
|
||||||
|
process.env.REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS
|
||||||
|
}/${value.key}${value.extension ? `.${value.extension}` : ""}`;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,9 +71,9 @@ function JobsDocumentsComponent({
|
|||||||
acc.other.push({
|
acc.other.push({
|
||||||
src: `${
|
src: `${
|
||||||
process.env.REACT_APP_CLOUDINARY_ENDPOINT
|
process.env.REACT_APP_CLOUDINARY_ENDPOINT
|
||||||
}/${fileType}/upload/${fileType === "video" ? "q_auto/" : ""}${
|
}/${fileType}/upload/${value.key}${
|
||||||
value.key
|
value.extension ? `.${value.extension}` : ""
|
||||||
}${fileType === "raw" ? `.${value.extension}` : ""}`,
|
}`,
|
||||||
thumbnail: thumb,
|
thumbnail: thumb,
|
||||||
tags: [
|
tags: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export const GET_DOCUMENTS_BY_JOB = gql`
|
|||||||
type
|
type
|
||||||
size
|
size
|
||||||
takenat
|
takenat
|
||||||
|
extension
|
||||||
bill {
|
bill {
|
||||||
id
|
id
|
||||||
invoice_number
|
invoice_number
|
||||||
|
|||||||
@@ -683,7 +683,8 @@
|
|||||||
"deleting_cloudinary": "Error deleting document from storage. {{message}}",
|
"deleting_cloudinary": "Error deleting document from storage. {{message}}",
|
||||||
"getpresignurl": "Error obtaining presigned URL for document. {{message}}",
|
"getpresignurl": "Error obtaining presigned URL for document. {{message}}",
|
||||||
"insert": "Unable to upload file. {{message}}",
|
"insert": "Unable to upload file. {{message}}",
|
||||||
"nodocuments": "There are no documents."
|
"nodocuments": "There are no documents.",
|
||||||
|
"updating": "Error updating document. {{error}}"
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"confirmdelete": "Are you sure you want to delete these documents. This CANNOT be undone.",
|
"confirmdelete": "Are you sure you want to delete these documents. This CANNOT be undone.",
|
||||||
|
|||||||
@@ -683,7 +683,8 @@
|
|||||||
"deleting_cloudinary": "",
|
"deleting_cloudinary": "",
|
||||||
"getpresignurl": "Error al obtener la URL prescrita para el documento. {{message}}",
|
"getpresignurl": "Error al obtener la URL prescrita para el documento. {{message}}",
|
||||||
"insert": "Incapaz de cargar el archivo. {{message}}",
|
"insert": "Incapaz de cargar el archivo. {{message}}",
|
||||||
"nodocuments": "No hay documentos"
|
"nodocuments": "No hay documentos",
|
||||||
|
"updating": ""
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"confirmdelete": "",
|
"confirmdelete": "",
|
||||||
|
|||||||
@@ -683,7 +683,8 @@
|
|||||||
"deleting_cloudinary": "",
|
"deleting_cloudinary": "",
|
||||||
"getpresignurl": "Erreur lors de l'obtention de l'URL présignée pour le document. {{message}}",
|
"getpresignurl": "Erreur lors de l'obtention de l'URL présignée pour le document. {{message}}",
|
||||||
"insert": "Incapable de télécharger le fichier. {{message}}",
|
"insert": "Incapable de télécharger le fichier. {{message}}",
|
||||||
"nodocuments": "Il n'y a pas de documents."
|
"nodocuments": "Il n'y a pas de documents.",
|
||||||
|
"updating": ""
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"confirmdelete": "",
|
"confirmdelete": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user