Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a2e5a82
Update create process modal for generative ai
agustinbusso Jun 15, 2023
ebdfdb9
HIde upload file for generative ai
agustinbusso Jun 15, 2023
7360253
Add inflight modeler endpoint for generative ai
agustinbusso Jun 15, 2023
a1b6c0c
Add modeler inflight route
agustinbusso Jun 16, 2023
e8754d1
Add ai button and redesign blank button
agustinbusso Jun 20, 2023
1f57da8
Implement infligthProcessAi endpoint
agustinbusso Jun 20, 2023
447cac6
Move route to package
agustinbusso Jun 20, 2023
be92cd5
Improve New process buttons UI design
agustinbusso Jun 20, 2023
b7382d1
Fix left arrow for button helper card
agustinbusso Jun 20, 2023
a3ace0a
Improve paddings and heights of cards
agustinbusso Jun 20, 2023
8edf37c
Fix card width and margins
agustinbusso Jun 20, 2023
a1e6d6e
Add mock data and use Http laravel helper to call microservice
agustinbusso Jun 21, 2023
2f86eef
Remove hardcoded bpmn. Add call to endpoint
agustinbusso Jun 22, 2023
b1e5e5e
Add micro service host env variable
agustinbusso Jun 22, 2023
f9e7a5f
Add package-ai to composer
agustinbusso Jun 22, 2023
980ebf2
Merge branch 'develop' into feature/nl-to-process-IT1
agustinbusso Jun 22, 2023
eff8ba3
Fix format
agustinbusso Jun 22, 2023
c476c59
Update composer lock
agustinbusso Jun 22, 2023
c2c92e8
Update AI package version
ryancooley Jun 23, 2023
f384179
Merge branch 'develop' into feature/nl-to-process-IT1
agustinbusso Jun 23, 2023
1f6582e
Fix format
agustinbusso Jun 23, 2023
a1dc0e4
Merge branch 'feature/nl-to-process-IT1' of https://github.com/Proces…
agustinbusso Jun 23, 2023
99fb7a7
Check if BPMN version exists
agustinbusso Jun 23, 2023
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: 1 addition & 1 deletion ProcessMaker/Contracts/SecurityLogEventInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ public function getData(): array;
public function getChanges(): array;

public function getEventName(): string;
}
}
11 changes: 6 additions & 5 deletions ProcessMaker/Events/AuthClientCreated.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class AuthClientCreated implements SecurityLogEventInterface
use Dispatchable;

private array $data;

private array $changes;

/**
Expand All @@ -27,21 +28,21 @@ public function __construct(array $created_values)
'provider' => $created_values['provider'],
'redirect' => $created_values['redirect'],
'password_client' => $created_values['password_client'],
'personal_access_client' => $created_values['personal_access_client']
'personal_access_client' => $created_values['personal_access_client'],
];
$this->changes = $created_values;
}

/**
* Return event data
* Return event data
*/
public function getData(): array
{
return $this->data;
}

/**
* Return event changes
* Return event changes
*/
public function getChanges(): array
{
Expand Down
9 changes: 5 additions & 4 deletions ProcessMaker/Events/AuthClientDeleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class AuthClientDeleted implements SecurityLogEventInterface
use Dispatchable;

private array $data;

private array $changes;

/**
Expand All @@ -22,17 +23,17 @@ public function __construct(array $deleted_values)
$this->data = ['auth_client_id' => $deleted_values['id']];
$this->changes = $deleted_values;
}

/**
* Return event data
* Return event data
*/
public function getData(): array
{
return $this->data;
}

/**
* Return event changes
* Return event changes
*/
public function getChanges(): array
{
Expand Down
16 changes: 10 additions & 6 deletions ProcessMaker/Events/AuthClientUpdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ class AuthClientUpdated implements SecurityLogEventInterface
use Dispatchable, FormatSecurityLogChanges;

private array $original;

private array $data;

private array $changes;

private string $clientId;

/**
Expand All @@ -31,22 +34,23 @@ public function __construct(string $clientId, array $original_values, array $cha
/**
* Building the data
*/
public function buildData() {
public function buildData()
{
$this->data = array_merge([
'auth_client_id' => $this->clientId
'auth_client_id' => $this->clientId,
], $this->formatChanges($this->changes, $this->original));
}

/**
* Return event data
* Return event data
*/
public function getData(): array
{
return $this->data;
}

/**
* Return event changes
* Return event changes
*/
public function getChanges(): array
{
Expand Down
3 changes: 2 additions & 1 deletion ProcessMaker/Events/CategoryCreated.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class CategoryCreated implements SecurityLogEventInterface
use FormatSecurityLogChanges;

private ProcessCategory $category;

private array $variable = [];

/**
Expand Down Expand Up @@ -51,7 +52,7 @@ public function getData(): array
public function getChanges(): array
{
return [
$this->category
$this->category,
];
}

Expand Down
7 changes: 3 additions & 4 deletions ProcessMaker/Events/CategoryDeleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CategoryDeleted implements SecurityLogEventInterface
*/
public function __construct(ProcessCategory $data)
{
$this->processCategory = $data;
$this->processCategory = $data;
}

/**
Expand All @@ -32,7 +32,7 @@ public function getData(): array
{
return [
'category_name' => $this->processCategory->getAttribute('name'),
'deleted_at' => Carbon::now()
'deleted_at' => Carbon::now(),
];
}

Expand All @@ -41,13 +41,12 @@ public function getData(): array
*
* @return array
*/

public function getChanges(): array
{
return [
'id' => $this->processCategory->getAttribute('id'),
'name' => $this->processCategory->getAttribute('name'),
'status' => $this->processCategory->getAttribute('status')
'status' => $this->processCategory->getAttribute('status'),
];
}

Expand Down
1 change: 1 addition & 0 deletions ProcessMaker/Events/CategoryUpdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class CategoryUpdated implements SecurityLogEventInterface
private ProcessCategory $category;

private array $changes;

private array $original;

/**
Expand Down
18 changes: 10 additions & 8 deletions ProcessMaker/Events/CustomizeUiUpdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class CustomizeUiUpdated implements SecurityLogEventInterface
use Dispatchable, FormatSecurityLogChanges;

private array $data;

private array $changes;

private array $original;

/**
Expand All @@ -35,36 +37,36 @@ public function __construct(array $original, array $changes, string $updatedAt)
/**
* Building the data
*/
public function buildData()
public function buildData()
{
if (isset($this->changes['variables'])) {
$variables_changes = [];
$variables_original = [];
foreach ((array)json_decode($this->changes['variables'], true) as $variable) {
foreach ((array) json_decode($this->changes['variables'], true) as $variable) {
$variables_changes[$variable['title']] = $variable['value'];
}
foreach ((array)json_decode($this->original['variables'], true) as $variable) {
foreach ((array) json_decode($this->original['variables'], true) as $variable) {
$variables_original[$variable['title']] = $variable['value'];
}
$variables_changes = array_diff($variables_changes, $variables_original);
$variables_original = array_intersect_key($variables_original, $variables_changes);

$this->changes['variables'] = $variables_changes;
$this->original['variables'] = $variables_original;
}
$this->data = $this->formatChanges($this->changes, $this->original);
}

/**
* Return event data
* Return event data
*/
public function getData(): array
{
return $this->data;
}

/**
* Return event changes
* Return event changes
*/
public function getChanges(): array
{
Expand Down
1 change: 1 addition & 0 deletions ProcessMaker/Events/EnvironmentVariablesCreated.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class EnvironmentVariablesCreated implements SecurityLogEventInterface
use FormatSecurityLogChanges;

private EnvironmentVariable $enVariable;

private $variable = [];

/**
Expand Down
2 changes: 1 addition & 1 deletion ProcessMaker/Events/EnvironmentVariablesDeleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function getData(): array
return [
'name' => $this->enVariable->getAttribute('name'),
'description' => $this->enVariable->getAttribute('description'),
'deleted_at' => Carbon::now()
'deleted_at' => Carbon::now(),
];
}

Expand Down
1 change: 1 addition & 0 deletions ProcessMaker/Events/EnvironmentVariablesUpdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class EnvironmentVariablesUpdated implements SecurityLogEventInterface
private EnvironmentVariable $enVariable;

private array $changes;

private array $original;

/**
Expand Down
1 change: 1 addition & 0 deletions ProcessMaker/Events/GroupCreated.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class GroupCreated implements SecurityLogEventInterface
use FormatSecurityLogChanges;

private Group $group;

/**
* Create a new event instance.
*
Expand Down
10 changes: 7 additions & 3 deletions ProcessMaker/Events/GroupDeleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ class GroupDeleted implements SecurityLogEventInterface
use FormatSecurityLogChanges;

private Group $group;

private array $userIds;

private array $userMembers;

private array $groupIds;

private array $groupMembers;

/**
Expand Down Expand Up @@ -61,7 +65,7 @@ public function getData(): array
'name' => $this->group->getAttribute('name'),
'user_members' => $this->userMembers,
'group_members' => $this->groupMembers,
'deleted_at' => Carbon::now()
'deleted_at' => Carbon::now(),
];
}

Expand All @@ -74,10 +78,10 @@ public function getChanges(): array
{
return [
'group_name' => [
$this->group
$this->group,
],
'user_members' => $this->userMembers,
'group_members' => $this->groupMembers
'group_members' => $this->groupMembers,
];
}

Expand Down
41 changes: 24 additions & 17 deletions ProcessMaker/Events/GroupUsersUpdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@ class GroupUsersUpdated implements SecurityLogEventInterface
use Dispatchable;

const ADDED = 'added';

const DELETED = 'deleted';

private array $data;

private int $groupUpdated;

private User|Group $member;

private string $action;

private array $changes;

private string $memberType;

/**
Expand All @@ -37,16 +43,17 @@ public function __construct(int $groupUpdated, int $memberId, string $action, st
'memberType' => $memberType,
'memberId' => $memberId,
'group' => $groupUpdated,
'action' => $action
'action' => $action,
];
}

/**
* Building the data
*/
public function buildData() {
public function buildData()
{
$group = Group::findOrFail($this->groupUpdated);

if ($this->memberType === User::class) {
$type = 'user';
$link = 'users.edit';
Expand All @@ -55,46 +62,46 @@ public function buildData() {
$type = 'group';
$link = 'groups.edit';
$label = $this->member->name;
}
}

switch ($this->action) {
case GroupUsersUpdated::ADDED:
case self::ADDED:
$this->data = [
'group' => [
'link' => route('groups.edit', $group),
'label' => $group->name
'label' => $group->name,
],
'+ ' . $type => [
'link' => route($link, $this->member),
'label' => $label
]
'label' => $label,
],
];
break;
case GroupUsersUpdated::DELETED:
case self::DELETED:
$this->data = [
'group' => [
'link' => route('groups.edit', $group),
'label' => $group->name
'label' => $group->name,
],
'- ' . $type => [
'link' => route( $link, $this->member),
'label' => $label
]
'link' => route($link, $this->member),
'label' => $label,
],
];
break;
}
}

/**
* Return event data
* Return event data
*/
public function getData(): array
{
return $this->data;
}

/**
* Return event changes
* Return event changes
*/
public function getChanges(): array
{
Expand Down
Loading