BOD-24 Removed URL/Thumb URL to have them dynamically created.
This commit is contained in:
@@ -68,7 +68,7 @@ export function DocumentsUploadContainer({
|
||||
let timestamp = Math.floor(Date.now() / 1000);
|
||||
let public_id = fileName;
|
||||
let tags = `${bodyshop.textid},${
|
||||
tagsArray ? tagsArray.map((tag) => `{tag},`) : ""
|
||||
tagsArray ? tagsArray.map((tag) => `${tag},`) : ""
|
||||
}`;
|
||||
let eager = "w_200,h_200,c_thumb";
|
||||
axios
|
||||
@@ -110,8 +110,6 @@ export function DocumentsUploadContainer({
|
||||
{
|
||||
jobid: jobId,
|
||||
uploaded_by: currentUser.email,
|
||||
url: "c",
|
||||
thumb_url: "c",
|
||||
key: fileName,
|
||||
invoiceid: invoiceId,
|
||||
type: fileType,
|
||||
@@ -121,10 +119,8 @@ export function DocumentsUploadContainer({
|
||||
}).then((r) => {
|
||||
onSuccess({
|
||||
uid: r.data.insert_documents.returning[0].id,
|
||||
url: r.data.insert_documents.returning[0].thumb_url,
|
||||
name: r.data.insert_documents.returning[0].name,
|
||||
status: "done",
|
||||
full_url: r.data.insert_documents.returning[0].url,
|
||||
key: r.data.insert_documents.returning[0].key,
|
||||
});
|
||||
notification["success"]({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Button, notification } from "antd";
|
||||
import { Button } from "antd";
|
||||
import axios from "axios";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import axios from "axios";
|
||||
|
||||
export default function JobsDocumentsDownloadButton({ galleryImages }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -11,13 +11,11 @@ function JobsDocumentsComponent({ data, jobId, refetch }) {
|
||||
setgalleryImages(
|
||||
data.reduce((acc, value) => {
|
||||
acc.push({
|
||||
src: value.url,
|
||||
thumbnail: `${
|
||||
process.env.REACT_APP_CLOUDINARY_IMAGE_ENDPOINT
|
||||
}/h_200,w_200,c_thumb/${value.key}${
|
||||
value.type.includes("pdf") ? ".jpg" : ""
|
||||
}`,
|
||||
tags: value.type.includes("pdf") ? [{ value: "PDF" }] : [],
|
||||
src: `${process.env.REACT_APP_CLOUDINARY_IMAGE_ENDPOINT}/${value.key}.jpg`,
|
||||
thumbnail: `${process.env.REACT_APP_CLOUDINARY_IMAGE_ENDPOINT}/h_200,w_200,c_thumb/${value.key}.jpg`,
|
||||
tags: value.type.includes("pdf")
|
||||
? [{ value: "PDF", title: "PDF" }]
|
||||
: [],
|
||||
thumbnailHeight: 200,
|
||||
thumbnailWidth: 200,
|
||||
isSelected: false,
|
||||
@@ -31,7 +29,11 @@ function JobsDocumentsComponent({ data, jobId, refetch }) {
|
||||
|
||||
return (
|
||||
<div className="clearfix">
|
||||
<DocumentsUploadContainer jobId={jobId} callbackAfterUpload={refetch} />
|
||||
<DocumentsUploadContainer
|
||||
jobId={jobId}
|
||||
callbackAfterUpload={refetch}
|
||||
tagsArray={["test"]}
|
||||
/>
|
||||
|
||||
<JobsDocumentsDownloadButton galleryImages={galleryImages} />
|
||||
<JobsDocumentsDeleteButton
|
||||
|
||||
Reference in New Issue
Block a user