Merged in feature/2020-06-04 (pull request #94)

Feature/2020 06 04
This commit is contained in:
Patrick Fic
2021-06-02 23:10:45 +00:00
8 changed files with 47 additions and 11 deletions

View File

@@ -24030,6 +24030,27 @@
</translation> </translation>
</translations> </translations>
</concept_node> </concept_node>
<concept_node>
<name>help</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>
<concept_node> <concept_node>
<name>home</name> <name>home</name>
<definition_loaded>false</definition_loaded> <definition_loaded>false</definition_loaded>

View File

@@ -23,7 +23,10 @@ export const handleUpload = (ev, context) => {
const fileName = ev.file.name || ev.filename; const fileName = ev.file.name || ev.filename;
let key = `${bodyshop.id}/${jobId}/${fileName.replace(/\.[^/.]+$/, "")}`; let key = `${bodyshop.id}/${jobId}/${fileName.replace(
/\.[^/.]+$/,
""
)}-${new Date().getTime()}`;
let extension = fileName.split(".").pop(); let extension = fileName.split(".").pop();
uploadToCloudinary( uploadToCloudinary(
key, key,

View File

@@ -20,6 +20,7 @@ import Icon, {
ToolFilled, ToolFilled,
UnorderedListOutlined, UnorderedListOutlined,
UserOutlined, UserOutlined,
QuestionCircleFilled,
} from "@ant-design/icons"; } from "@ant-design/icons";
import { Layout, Menu } from "antd"; import { Layout, Menu } from "antd";
import React from "react"; import React from "react";
@@ -284,6 +285,15 @@ function Header({
<Link to="/manage/shop/csi">{t("menus.header.shop_csi")}</Link> <Link to="/manage/shop/csi">{t("menus.header.shop_csi")}</Link>
</Menu.Item> </Menu.Item>
</Menu.SubMenu> </Menu.SubMenu>
<Menu.Item
key="shop"
onClick={() => {
window.open("https://help.imex.online/", "_blank");
}}
icon={<Icon component={QuestionCircleFilled} />}
>
{t("menus.header.help")}
</Menu.Item>
<Menu.SubMenu <Menu.SubMenu
style={{ float: "right" }} style={{ float: "right" }}
title={ title={

View File

@@ -14,11 +14,11 @@ export default function JobsDocumentsDownloadButton({
const [download, setDownload] = useState(null); const [download, setDownload] = useState(null);
const imagesToDownload = [ const imagesToDownload = [
...galleryImages.images.filter((image) => image.isSelected), ...galleryImages.images.filter((image) => image.isSelected),
...galleryImages.other.filter((image) => image.isSelected), // ...galleryImages.other.filter((image) => image.isSelected),
]; ];
const handleDownload = () => { const handleDownload = () => {
logImEXEvent("jobs_documents_download"); logImEXEvent("jobs_documents_download");
axios axios
.post("/media/download", { .post("/media/download", {
ids: imagesToDownload.map((_) => _.key), ids: imagesToDownload.map((_) => _.key),
@@ -27,12 +27,8 @@ export default function JobsDocumentsDownloadButton({
// window.open(r.data); // window.open(r.data);
downloadAs( downloadAs(
r.data, r.data,
`${identifier || "images"}.zip`, `${identifier || "documents"}.zip`,
(progressEvent) => { (progressEvent) => {
const percentage = Math.round(
(progressEvent.loaded * 100) / progressEvent.total
);
console.log(progressEvent, percentage);
setDownload((currentDownloadState) => { setDownload((currentDownloadState) => {
return { return {
downloaded: progressEvent.loaded || 0, downloaded: progressEvent.loaded || 0,

View File

@@ -56,6 +56,7 @@ function JobsDocumentsComponent({
isSelected: false, isSelected: false,
key: value.key, key: value.key,
extension: value.extension, extension: value.extension,
id: value.id, id: value.id,
type: value.type, type: value.type,
size: value.size, size: value.size,
@@ -74,7 +75,8 @@ function JobsDocumentsComponent({
const fileName = value.key.split("/").pop(); const fileName = value.key.split("/").pop();
acc.other.push({ acc.other.push({
src: GenerateSrcUrl(value), source: GenerateSrcUrl(value),
src: "",
thumbnail: thumb, thumbnail: thumb,
tags: [ tags: [
{ {
@@ -100,6 +102,7 @@ function JobsDocumentsComponent({
thumbnailHeight: 225, thumbnailHeight: 225,
thumbnailWidth: 225, thumbnailWidth: 225,
isSelected: false, isSelected: false,
extension: value.extension, extension: value.extension,
key: value.key, key: value.key,
id: value.id, id: value.id,
@@ -211,7 +214,7 @@ function JobsDocumentsComponent({
}} }}
onClickThumbnail={(index) => { onClickThumbnail={(index) => {
window.open( window.open(
galleryImages.other[index].src, galleryImages.other[index].source,
"_blank", "_blank",
"toolbar=0,location=0,menubar=0" "toolbar=0,location=0,menubar=0"
); );

View File

@@ -677,7 +677,7 @@
"documents": { "documents": {
"actions": { "actions": {
"delete": "Delete Selected Documents", "delete": "Delete Selected Documents",
"download": "Download Selected Documents", "download": "Download Selected Images",
"reassign": "Reassign to another Job", "reassign": "Reassign to another Job",
"selectallimages": "Select All Images", "selectallimages": "Select All Images",
"selectallotherdocuments": "Select All Other Documents" "selectallotherdocuments": "Select All Other Documents"
@@ -1420,6 +1420,7 @@
"entertimeticket": "Enter Time Tickets", "entertimeticket": "Enter Time Tickets",
"export": "Export", "export": "Export",
"export-logs": "Export Logs", "export-logs": "Export Logs",
"help": "Help",
"home": "Home", "home": "Home",
"jobs": "Jobs", "jobs": "Jobs",
"owners": "Owners", "owners": "Owners",

View File

@@ -1420,6 +1420,7 @@
"entertimeticket": "", "entertimeticket": "",
"export": "", "export": "",
"export-logs": "", "export-logs": "",
"help": "",
"home": "Casa", "home": "Casa",
"jobs": "Trabajos", "jobs": "Trabajos",
"owners": "propietarios", "owners": "propietarios",

View File

@@ -1420,6 +1420,7 @@
"entertimeticket": "", "entertimeticket": "",
"export": "", "export": "",
"export-logs": "", "export-logs": "",
"help": "",
"home": "Accueil", "home": "Accueil",
"jobs": "Emplois", "jobs": "Emplois",
"owners": "Propriétaires", "owners": "Propriétaires",