Compare commits

...

9 Commits

Author SHA1 Message Date
Hargata Softworks
b42527f15d
Merge pull request #1132 from hargata/Hargata/ins.label.bug
add translation key
2025-11-07 13:54:02 -07:00
DESKTOP-T0O5CDB\DESK-555BD
cb432d92a6 add translation key 2025-11-07 13:27:29 -07:00
Hargata Softworks
300edd8c4e
Merge pull request #1131 from hargata/Hargata/ins.label.bug
fix template selector modal not hiding after creating inspection temp…
2025-11-07 12:53:10 -07:00
DESKTOP-T0O5CDB\DESK-555BD
cb77d6675e fix template selector modal not hiding after creating inspection template 2025-11-07 12:52:44 -07:00
Hargata Softworks
d29b20b16b
Merge pull request #1130 from hargata/Hargata/ins.label.bug
Fix label bug
2025-11-07 12:13:54 -07:00
DESKTOP-T0O5CDB\DESK-555BD
f3999650bd Fix label bug 2025-11-07 12:13:32 -07:00
Hargata Softworks
bd47ef41f0
Merge pull request #1129 from hargata/Hargata/copy.attachment.link
Allow users to copy link to attachments
2025-11-07 10:24:51 -07:00
DESKTOP-T0O5CDB\DESK-555BD
0c4ccea9ec clean up 2025-11-07 10:24:38 -07:00
DESKTOP-T0O5CDB\DESK-555BD
18243ec779 Allow users to copy link to attachments 2025-11-07 10:21:34 -07:00
5 changed files with 25 additions and 4 deletions

View File

@ -742,6 +742,10 @@ namespace CarCareTracker.Helper
{
return (!fileLocation.StartsWith("/documents") && !fileLocation.StartsWith("documents") && !fileLocation.StartsWith("/temp") && !fileLocation.StartsWith("temp"));
}
public static bool GetAttachmentIsInTemp(string fileLocation)
{
return (fileLocation.StartsWith("/temp") || fileLocation.StartsWith("temp"));
}
public static string GetAttachmentOriginalName(string fileLocation, string originalName)
{
var fileExt = Path.GetExtension(fileLocation);

View File

@ -25,7 +25,13 @@
<span class="link-body-emphasis"><i class="bi bi-download"></i></span>
</a>
}
@if (StaticHelper.GetAttachmentIsInTemp(Model.Location))
{
<h5 class="modal-title" id="updateAccountModalLabel">@Model.Name</h5>
} else
{
<h5 class="modal-title" id="updateAccountModalLabel" data-link="@Model.Location" onclick="handleAttachmentCopyLink(this)" style="cursor:pointer;">@Model.Name</h5>
}
<a style="cursor:pointer;" onclick="closeAttachmentPreview()"><span class="link-body-emphasis"><i class="bi bi-x-lg"></i></span></a>
</div>
<div class="modal-body">
@ -38,8 +44,9 @@
}
else if (StaticHelper.GetAttachmentIsLink(Model.Location))
{
<div class="align-self-center">
<div class="d-flex align-self-center flex-column">
<a href="@Model.Location" target="_blank" onclick="noPropagation()" class="btn btn-primary"><span class="me-2">@translator.Translate(userLanguage, "Open Link in New Tab")</span><span><i class="bi bi-box-arrow-up-right"></i></span></a>
<a data-link="@Model.Location" href="#" onclick="handleAttachmentCopyLink(this)" class="mt-2 btn btn-secondary"><span class="me-2">@translator.Translate(userLanguage, "Copy Link Address")</span><span><i class="bi bi-link-45deg"></i></span></a>
</div>
}
else if (StaticHelper.GetAttachmentIsImage(Model.Location))
@ -51,6 +58,10 @@
<div class="d-flex align-self-center flex-column">
<a href="@Model.Location" download="@StaticHelper.GetAttachmentOriginalName(Model.Location, Model.Name)" onclick="noPropagation()" class="btn btn-primary"><span class="me-2">@translator.Translate(userLanguage, "Download File")</span><span><i class="bi bi-download"></i></span></a>
<a href="@Model.Location" target="_blank" onclick="noPropagation()" class="mt-2 btn btn-secondary"><span class="me-2">@translator.Translate(userLanguage, "Open Link in New Tab")</span><span><i class="bi bi-box-arrow-up-right"></i></span></a>
@if (!StaticHelper.GetAttachmentIsInTemp(Model.Location))
{
<a data-link="@Model.Location" href="#" onclick="handleAttachmentCopyLink(this)" class="mt-2 btn btn-secondary"><span class="me-2">@translator.Translate(userLanguage, "Copy Link Address")</span><span><i class="bi bi-link-45deg"></i></span></a>
}
</div>
}
</div>

File diff suppressed because one or more lines are too long

View File

@ -184,7 +184,6 @@ function saveInspectionRecordTemplateToVehicle(isEdit) {
if (data) {
successToast(isEdit ? "Inspection Record Template Updated" : "Inspection Record Template Added.");
hideInspectionRecordTemplateModal();
getVehicleCollisionRecords(formValues.vehicleId);
} else {
errorToast(genericErrorMessage());
}

View File

@ -1806,3 +1806,10 @@ function clearModalContentOnHide(modalElem) {
modalElem.find('.modal-content').html('');
});
}
function handleAttachmentCopyLink(e) {
event.stopPropagation();
event.preventDefault();
let textToCopy = $(e).attr('data-link');
navigator.clipboard.writeText(textToCopy);
successToast("Copied Link to Clipboard");
}