Skip to content

Epic/FOUR-11380: AI Search V2 #5690

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ProcessMaker/Events/CommentsUpdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class CommentsUpdated implements ShouldBroadcastNow
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;

public $users;

/**
Expand All @@ -34,6 +35,7 @@ public function broadcastOn()
foreach ($this->users as $user) {
$channels[] = new PrivateChannel("ProcessMaker.Models.User.{$user->id}");
}

return $channels;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public function availableLanguages()
{
$languages = [];
foreach (Script::scriptFormats() as $key => $config) {
if (!array_key_exists( 'system', $config) || (array_key_exists( 'system', $config) && !$config['system'])) {
if (!array_key_exists('system', $config) || (array_key_exists('system', $config) && !$config['system'])) {
$languages[] = [
'value' => $key,
'text' => $config['name'],
Expand Down
1 change: 1 addition & 0 deletions ProcessMaker/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public function index(Request $request)

return redirect($homePage);
}

// Redirect to the default view
return redirect('/requests');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@ public function index(Request $request)
{
return view('processes-catalogue.index');
}

/**
* @param Process $process
* @param string $id
*
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function open(Process $process, $id)
{
return view('processes-catalogue.open', [
'process' => $process,
'processId' => $id
'processId' => $id,
]);
}
}
1 change: 1 addition & 0 deletions ProcessMaker/ImportExport/Exporters/TemplateExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function import() : bool
}
$this->model->setProcessCategoryIdAttribute($this->model->process_category_id);
$this->model->save();

return true;
}
}
1 change: 1 addition & 0 deletions ProcessMaker/LicensedPackageManifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class LicensedPackageManifest extends PackageManifest
const DISCOVER_PACKAGES_LOCK_KEY = 'discover_package_lock_key';

const DISCOVER_PACKAGES = 'package:discover';

const LAST_PACKAGE_DISCOVERY = 0;

protected function packagesToIgnore()
Expand Down
5 changes: 3 additions & 2 deletions ProcessMaker/Models/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ public function groups()

/**
* This retrieves the users who have permissions in a list of groups.
*
*
* @param array $groups
* @return Collection
*/
public static function getUsersByGroup(array $groups)
public static function getUsersByGroup(array $groups)
{
$users = DB::table('assignables')
->join('permissions', function ($join) use ($groups) {
Expand All @@ -126,6 +126,7 @@ public static function getUsersByGroup(array $groups)
->union(\ProcessMaker\Models\User::where('is_administrator', '=', true))
->groupBy('users.id')
->get();

return $users;
}
}
1 change: 1 addition & 0 deletions ProcessMaker/Nayra/Managers/WorkflowManagerRabbitMq.php
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ private function getEnvironmentVariables()
$accessToken = Cache::remember('script-runner-' . $user->id, $expires, function () use ($user) {
$user->removeOldRunScriptTokens();
$token = new GenerateAccessToken($user);

return $token->getToken();
});
$environmentVariables['API_TOKEN'] = $accessToken;
Expand Down
3 changes: 2 additions & 1 deletion ProcessMaker/Notifications/ProcessTranslationReady.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ public function toArray($notifiable)
{
$data = [
'humanLanguage' => $this->targetLanguage['humanLanguage'],
'processName' => $this->process->name
'processName' => $this->process->name,
];
$message = __('Process translation to :humanLanguage completed for process: :processName', $data);

return [
'message' => $message,
'code' => $this->code,
Expand Down
2 changes: 1 addition & 1 deletion ProcessMaker/Policies/ProcessPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private function isPmBlockImportedLocked(Process $process): bool

/**
* This determine if user can view processes.
*
*
* @param User $user
* @param Process $process
* @return bool
Expand Down
7 changes: 7 additions & 0 deletions resources/js/app-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ window.ProcessMaker.navbar = new Vue({
MessageModal,
NavbarProfile,
newRequestModal,
GlobalSearch: (resolve) => {
if (window.ProcessMaker.globalSearchComponent) {
resolve(window.ProcessMaker.globalSearchComponent);
} else {
window.ProcessMaker.globalSearchComponentResolve = resolve;
}
},
},
data() {
return {
Expand Down
2 changes: 0 additions & 2 deletions resources/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import RequestChannel from "./tasks/components/ProcessRequestChannel";
import Modal from "./components/shared/Modal";
import AccessibilityMixin from "./components/common/mixins/accessibility";
import PmqlInput from "./components/shared/PmqlInput.vue";
import GlobalSearch from "../../vendor/processmaker/package-ai/resources/js/ai/search/components/GlobalSearch.vue";
import DataTreeToggle from "./components/common/data-tree-toggle.vue";
import TreeView from "./components/TreeView.vue";

Expand Down Expand Up @@ -86,7 +85,6 @@ window.Vue.component("monaco-editor", MonacoEditor);
window.Vue.component("screen-select", ScreenSelect);
window.Vue.component("pm-modal", Modal);
window.Vue.component("pmql-input", PmqlInput);
window.Vue.component("global-search", GlobalSearch);
window.Vue.component("data-tree-toggle", DataTreeToggle);
window.Vue.component("tree-view", TreeView);
let translationsLoaded = false;
Expand Down
4 changes: 3 additions & 1 deletion resources/views/layouts/navbar.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
</div>

<div class="d-flex d-lg-none w-100">
<global-search v-if="isMobile" class="w-100 small-screen"></global-search>
@if(hasPackage('package-ai'))
<global-search v-if="isMobile" class="w-100 small-screen"></global-search>
@endif
</div>

<b-collapse is-nav id="nav-collapse">
Expand Down