diff --git a/ProcessMaker/Http/Controllers/Api/DevLinkController.php b/ProcessMaker/Http/Controllers/Api/DevLinkController.php index 399323ea0c..8994184d1a 100644 --- a/ProcessMaker/Http/Controllers/Api/DevLinkController.php +++ b/ProcessMaker/Http/Controllers/Api/DevLinkController.php @@ -355,12 +355,14 @@ public function removeSharedAsset($id) public function installRemoteAsset(Request $request, DevLink $devLink) { + $updateType = $request->input('updateType', DevLinkInstall::MODE_UPDATE); + DevLinkInstall::dispatch( $request->user()->id, $devLink->id, $request->input('class'), $request->input('id'), - DevLinkInstall::MODE_UPDATE, + $updateType, DevLinkInstall::TYPE_IMPORT_ASSET ); diff --git a/ProcessMaker/Jobs/DevLinkInstall.php b/ProcessMaker/Jobs/DevLinkInstall.php index 25c347fbf3..c30519e201 100644 --- a/ProcessMaker/Jobs/DevLinkInstall.php +++ b/ProcessMaker/Jobs/DevLinkInstall.php @@ -67,7 +67,7 @@ public function handle(): void $bundle->reinstall($this->importMode, $logger); break; case self::TYPE_IMPORT_ASSET: - $devLink->installRemoteAsset($this->class, $this->id, $logger); + $devLink->installRemoteAsset($this->class, $this->id, $this->importMode, $logger); break; default: break; diff --git a/ProcessMaker/Models/DevLink.php b/ProcessMaker/Models/DevLink.php index a157d7f8fd..e7ad53939d 100644 --- a/ProcessMaker/Models/DevLink.php +++ b/ProcessMaker/Models/DevLink.php @@ -191,14 +191,14 @@ public function installRemoteBundle($remoteBundleId, $updateType) $this->logger->setStatus('done'); } - public function installRemoteAsset(string $class, int $id, Logger $logger) : ProcessMakerModel + public function installRemoteAsset(string $class, int $id, string $updateType, Logger $logger) : ProcessMakerModel { $payload = $this->client()->get( route('api.devlink.export-local-asset', ['class' => $class, 'id' => $id], false) )->json(); $options = new Options([ - 'mode' => 'update', + 'mode' => $updateType, ]); $logger->setSteps([$payload]); diff --git a/resources/js/admin/devlink/components/AssetListing.vue b/resources/js/admin/devlink/components/AssetListing.vue index af9d61781c..a5716181d3 100644 --- a/resources/js/admin/devlink/components/AssetListing.vue +++ b/resources/js/admin/devlink/components/AssetListing.vue @@ -1,6 +1,6 @@