Skip to content

Commit

Permalink
Merge pull request #376 from AcclaroInc/fix-category-draft-issue-and-…
Browse files Browse the repository at this point in the history
…refactor

Fix category draft issue and refactor
  • Loading branch information
shnsumit authored Aug 1, 2022
2 parents bf7ff90 + b14473b commit 305db1d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/assetbundles/src/js/OrderEntries.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
var hasOrderId = $("input[type=hidden][name=id]").val() != '';
var isInProgress = $("#order-attr").data("status") === "in progress";
var hasCompleteFiles = $("#order-attr").data("has-completed-file");
var isTmAligned = $("#order-attr").data("is-tm-aligned");

/**
* Order entries class
Expand Down Expand Up @@ -473,6 +474,7 @@

$downloadTmAction = $('<a>', {
'href': '#',
'class': isTmAligned ? 'link-disabled' : '',
'text': $label,
});
$downloadTmLi.append($downloadTmAction);
Expand Down
10 changes: 6 additions & 4 deletions src/elements/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -683,16 +683,18 @@ public function hasDefaultTranslator()

public function shouldTrackSourceContent()
{
if ($this->trackChanges === NULL) return Translations::getInstance()->settings->trackSourceChanges;
if (!$this->id) {
return Translations::getInstance()->settings->trackSourceChanges;
}

return (bool) $this->trackChanges;
return $this->trackChanges;
}

public function shouldTrackTargetContent()
{
if ($this->trackTargetChanges === NULL) return Translations::getInstance()->settings->trackTargetChanges;
if (! $this->id) return Translations::getInstance()->settings->trackTargetChanges;

return (bool) $this->trackTargetChanges;
return $this->trackTargetChanges;
}

public function isExportImportAllowed()
Expand Down
2 changes: 1 addition & 1 deletion src/services/repository/OrderRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ public function getIsTargetChanged($order): ?array
$originalIds = [];

foreach ($order->getFiles() as $file) {
if ($file->isPublished() || $file->isNew()) continue;
if ($file->isPublished() || $file->isNew() || $file->isModified()) continue;

if ($file->hasTmMisalignments()) array_push($originalIds, $file->elementId);
}
Expand Down
1 change: 1 addition & 0 deletions src/templates/orders/_detail.twig
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<input type="hidden" id="order-attr" data-status="{{ orderRecentStatus|default('pending') }}" data-isUpdateable="{{ isUpdateable|default('') }}"
data-submitted="{{ isSubmitted }}" data-changed="{{ isChanged }}"
data-has-completed-file="{{ order.hasCompletedFiles }}"
data-is-tm-aligned = "{{ isTargetChanged is empty }}"
data-translator="{{ order.translator.service|default('export_import') }}"/>
<div id="new-order-button-group" class="btngroup submit"></div>
</div>
Expand Down

0 comments on commit 305db1d

Please sign in to comment.