diff --git a/app/Events/Jobs/NewJobSearched.php b/app/Events/Jobs/NewJobSearched.php new file mode 100644 index 00000000..16bfdd68 --- /dev/null +++ b/app/Events/Jobs/NewJobSearched.php @@ -0,0 +1,41 @@ +mysgs_job = $mysgs_job; + } + + /** + * Get the channels the event should broadcast on. + * + * @return \Illuminate\Broadcasting\Channel|array + */ + public function broadcastOn() + { + return new PrivateChannel('channel-name'); + } +} diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php new file mode 100644 index 00000000..1f4e6447 --- /dev/null +++ b/app/Http/Controllers/HomeController.php @@ -0,0 +1,24 @@ +render($request, 'Dashboard', [ + 'team' => $request->user()->currentTeam, + ]); + } +} diff --git a/app/Http/Controllers/OPs/JobController.php b/app/Http/Controllers/OPs/JobController.php index 79281bb8..4897a054 100644 --- a/app/Http/Controllers/OPs/JobController.php +++ b/app/Http/Controllers/OPs/JobController.php @@ -3,56 +3,60 @@ namespace App\Http\Controllers\OPs; use App\Http\Controllers\Controller; +use App\Repositories\JobRepository; use App\Services\Job\JobApiHandler; use App\Services\Rule\RuleFilter; +use Illuminate\Contracts\Foundation\Application; +use Illuminate\Http\JsonResponse; +use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; +use Illuminate\Routing\Redirector; use Laravel\Jetstream\Jetstream; class JobController extends Controller { /** - * Display a listing of the resource. + * Display rules relevant for a job. * - * @param Request $request - * @param null $jobNumber - * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Inertia\Response + * @param Request $request + * @param null $jobNumber + * @return JsonResponse|\Inertia\Response */ - public function show(Request $request, $jobNumber = null) + public function show(Request $request, $jobNumber) { $rules = []; - $job = null; - if($jobNumber){ - $job = JobApiHandler::handle($jobNumber, 'basicDetails'); - if ($job) { - $rules = RuleFilter::handle($job); - } + //$job = JobApiHandler::handle($jobNumber, 'basicDetails'); + + $job = JobRepository::findByJobNumber($jobNumber); + + if (!$job->metadata->processing_mysgs) { + logger('already loaded mysgs data'); + $rules = RuleFilter::handle($job); } - return Jetstream::inertia()->render($request, ($job ? 'OP/JobRules' : 'Dashboard'), [ - 'team' => $request->user()->currentTeam, - 'jobNumber' => $jobNumber, - 'job' => $job, - 'rules' => $rules - ]); + + + + return $request->wantsJson() ? + new JsonResponse(['rules' => $rules, 'job' => $job], 200) + : Jetstream::inertia()->render($request, 'OP/JobRules', [ + 'team' => $request->user()->currentTeam, + 'jobNumber' => $jobNumber, + 'job' => $job, + 'rules' => $rules + ]); } /** - * Display a listing of the resource. + * Helper to redirect to show. * - * @param Request $request - * @param null $jobNumber - * @return \Illuminate\Http\JsonResponse + * @param Request $request + * @param null $jobNumber + * @return RedirectResponse */ public function search(Request $request, $jobNumber) { - $rules = []; - if($jobNumber) { - $job = JobApiHandler::handle($jobNumber, 'basicDetails'); - if ($job) { - $rules = RuleFilter::handle($job); - } - } - return response()->json($rules); + return \Redirect::route('job.rules', [$jobNumber]); } } diff --git a/app/Listeners/Jobs/LoadMySgsData.php b/app/Listeners/Jobs/LoadMySgsData.php new file mode 100644 index 00000000..f7ccbacf --- /dev/null +++ b/app/Listeners/Jobs/LoadMySgsData.php @@ -0,0 +1,75 @@ +mysgs_job = $event->mysgs_job; + + logger('handling job '.$this->mysgs_job->job_number); + + DataLoader::handle($this->mysgs_job); + } + + /** + * The unique ID of the job. + * + * @return string + */ + public function uniqueId() + { + return $this->mysgs_job->id; + } + + /** + * @param $event + * @param \Exception|null $exception + */ + public function failed($event, $exception) + { + \Log::error('loading mysgs data failed'); + \Log::error($exception->getMessage()); + \Log::error($exception->getTraceAsString()); + $job_metadata = $event->mysgs_job->metadata; + $job_metadata->error_mysgs = true; + $event->mysgs_job->metadata = $job_metadata; + + $event->mysgs_job->save(); + } +} diff --git a/app/Models/ClientAccount.php b/app/Models/ClientAccount.php index 3484639b..38cc76de 100644 --- a/app/Models/ClientAccount.php +++ b/app/Models/ClientAccount.php @@ -31,6 +31,10 @@ * @method static \Illuminate\Database\Eloquent\Builder|ClientAccount whereLegacyId($value) * @method static \Illuminate\Database\Eloquent\Builder|ClientAccount whereUpdatedAt($value) * @mixin \Eloquent + * @property string|null $legacy_id + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Rule[] $rules + * @property-read int|null $rules_count + * @property-read \App\Models\Team|null $team */ class ClientAccount extends Model { diff --git a/app/Models/FieldMapping.php b/app/Models/FieldMapping.php index 7b07fb51..cba209fb 100644 --- a/app/Models/FieldMapping.php +++ b/app/Models/FieldMapping.php @@ -7,8 +7,31 @@ /** * Class FieldMapping + * * @package App\Models * @mixin \Eloquent + * @property int $id + * @property string $api_name + * @property string|null $api_version + * @property string $api_action + * @property string $field_path + * @property string|null $resolver_name + * @property int $taxonomy_id + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property-read \App\Models\Taxonomy $taxonomy + * @method static \Illuminate\Database\Eloquent\Builder|FieldMapping newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|FieldMapping newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|FieldMapping query() + * @method static \Illuminate\Database\Eloquent\Builder|FieldMapping whereApiAction($value) + * @method static \Illuminate\Database\Eloquent\Builder|FieldMapping whereApiName($value) + * @method static \Illuminate\Database\Eloquent\Builder|FieldMapping whereApiVersion($value) + * @method static \Illuminate\Database\Eloquent\Builder|FieldMapping whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|FieldMapping whereFieldPath($value) + * @method static \Illuminate\Database\Eloquent\Builder|FieldMapping whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|FieldMapping whereResolverName($value) + * @method static \Illuminate\Database\Eloquent\Builder|FieldMapping whereTaxonomyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|FieldMapping whereUpdatedAt($value) */ class FieldMapping extends Model { diff --git a/app/Models/Job.php b/app/Models/Job.php index e6285d28..f9097db7 100644 --- a/app/Models/Job.php +++ b/app/Models/Job.php @@ -5,6 +5,28 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +/** + * App\Models\Job + * + * @property int $id + * @property string $job_number + * @property string|null $designation + * @property object|null $metadata + * @property string|null $deleted_at + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @method static \Illuminate\Database\Eloquent\Builder|Job newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Job newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|Job query() + * @method static \Illuminate\Database\Eloquent\Builder|Job whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Job whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|Job whereDesignation($value) + * @method static \Illuminate\Database\Eloquent\Builder|Job whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|Job whereJobNumber($value) + * @method static \Illuminate\Database\Eloquent\Builder|Job whereMetadata($value) + * @method static \Illuminate\Database\Eloquent\Builder|Job whereUpdatedAt($value) + * @mixin \Eloquent + */ class Job extends Model { use HasFactory; diff --git a/app/Models/MysgsClientAccount.php b/app/Models/MysgsClientAccount.php index d6b9450a..291edd68 100644 --- a/app/Models/MysgsClientAccount.php +++ b/app/Models/MysgsClientAccount.php @@ -5,6 +5,24 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +/** + * App\Models\MysgsClientAccount + * + * @property int $id + * @property string $name + * @property string|null $alias + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @method static \Illuminate\Database\Eloquent\Builder|MysgsClientAccount newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|MysgsClientAccount newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|MysgsClientAccount query() + * @method static \Illuminate\Database\Eloquent\Builder|MysgsClientAccount whereAlias($value) + * @method static \Illuminate\Database\Eloquent\Builder|MysgsClientAccount whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|MysgsClientAccount whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|MysgsClientAccount whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|MysgsClientAccount whereUpdatedAt($value) + * @mixin \Eloquent + */ class MysgsClientAccount extends Model { use HasFactory; diff --git a/app/Models/Rule.php b/app/Models/Rule.php index 28706b87..842eae08 100644 --- a/app/Models/Rule.php +++ b/app/Models/Rule.php @@ -38,6 +38,8 @@ * @method static \Illuminate\Database\Query\Builder|Rule withTrashed() * @method static \Illuminate\Database\Query\Builder|Rule withoutTrashed() * @mixin \Eloquent + * @property-read \Illuminate\Database\Eloquent\Collection|\OwenIt\Auditing\Models\Audit[] $audits + * @property-read int|null $audits_count */ class Rule extends Model implements Auditable { diff --git a/app/Models/Taxonomy.php b/app/Models/Taxonomy.php index 0f2feb34..8f78e0a2 100644 --- a/app/Models/Taxonomy.php +++ b/app/Models/Taxonomy.php @@ -38,6 +38,8 @@ * @method static \Illuminate\Database\Query\Builder|Taxonomy withTrashed() * @method static \Illuminate\Database\Query\Builder|Taxonomy withoutTrashed() * @mixin \Eloquent + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ClientAccount[] $client_accounts + * @property-read \App\Models\FieldMapping|null $mapping */ class Taxonomy extends Model { @@ -63,6 +65,8 @@ class Taxonomy extends Model protected $with = ['parent']; + protected $appends = ['requiresMapping']; + /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo @@ -103,4 +107,9 @@ public function mapping() { return $this->hasOne(FieldMapping::class); } + + public function getRequiresMappingAttribute() + { + return $this->parent && $this->parent->name == 'Account Structure'; + } } diff --git a/app/Models/Term.php b/app/Models/Term.php index 320288ca..f6f3afe8 100644 --- a/app/Models/Term.php +++ b/app/Models/Term.php @@ -28,6 +28,10 @@ * @method static \Illuminate\Database\Eloquent\Builder|Term whereTaxonomyId($value) * @method static \Illuminate\Database\Eloquent\Builder|Term whereUpdatedAt($value) * @mixin \Eloquent + * @property \Illuminate\Support\Carbon|null $deleted_at + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Rule[] $rules + * @property-read int|null $rules_count + * @method static \Illuminate\Database\Eloquent\Builder|Term whereDeletedAt($value) */ class Term extends Model { diff --git a/app/Models/User.php b/app/Models/User.php index 084ab542..f7bc2027 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -54,6 +54,13 @@ * @method static \Illuminate\Database\Eloquent\Builder|User whereTwoFactorSecret($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereUpdatedAt($value) * @mixin \Eloquent + * @property string|null $azure_id + * @property-read \Illuminate\Database\Eloquent\Collection|\OwenIt\Auditing\Models\Audit[] $audits + * @property-read int|null $audits_count + * @property-read \Illuminate\Database\Eloquent\Collection|\Silvanite\Brandenburg\Role[] $roles + * @property-read int|null $roles_count + * @method static \Illuminate\Database\Eloquent\Builder|User whereAzureId($value) + * @method static \Illuminate\Database\Eloquent\Builder|User withRoles() */ class User extends Authenticatable implements Auditable { diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 78b6f953..47895ceb 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -31,6 +31,10 @@ class EventServiceProvider extends ServiceProvider 'App\\Events\\Rules\\Unflagged' => [ 'App\\Listeners\\Rules\\RebuildRuleCache', + ], + + 'App\\Events\\Jobs\\NewJobSearched' => [ + 'App\\Listeners\\Jobs\\LoadMySgsData', ] // Audited::class => [ // AuditedListener::class diff --git a/app/Repositories/JobRepository.php b/app/Repositories/JobRepository.php new file mode 100644 index 00000000..446826f2 --- /dev/null +++ b/app/Repositories/JobRepository.php @@ -0,0 +1,44 @@ + $job_number, + 'metadata' => [ + 'rules' => null, + 'processing_mysgs' => true, + 'error_mysgs' => false, + 'client_found' => false, + ], + ]); + } + + public static function findByJobNumber($job_number) + { + $job = Job::whereJobNumber($job_number)->first(); + + if (!$job) { + $job = static::createFromJobNumber($job_number); + + event(new NewJobSearched($job)); + } elseif ($job->metadata->processing_mysgs) { + logger($job_number . ' still processing, adding to queue, if running it will not re-trigger'); + event(new NewJobSearched($job)); + } + + return $job; + + + } +} diff --git a/app/Services/ClientAccounts/BuildTaxonomyWithUsage.php b/app/Services/ClientAccounts/BuildTaxonomyWithUsage.php index 93a2030e..62c3eec7 100644 --- a/app/Services/ClientAccounts/BuildTaxonomyWithUsage.php +++ b/app/Services/ClientAccounts/BuildTaxonomyWithUsage.php @@ -31,7 +31,8 @@ public function handle() foreach ($top_taxonomy->taxonomies() ->whereHas('client_accounts', function ($query) use ($client_account) { return $query->whereIn('id', [$client_account->id]); - })->get() as $taxonomy) { + })->with('mapping') + ->get() as $taxonomy) { $this->taxonomy_hierarchy[$top_taxonomy->name]['children'][] = static::processTaxonomy($taxonomy); } diff --git a/app/Services/Job/JobApiHandler.php b/app/Services/Job/JobApiHandler.php index cf31389d..8f8bc6fd 100644 --- a/app/Services/Job/JobApiHandler.php +++ b/app/Services/Job/JobApiHandler.php @@ -7,32 +7,74 @@ use App\Broadcast\RulesFiltered; use App\Jobs\JobApiRequest; use App\Models\Job; +use App\Repositories\JobRepository; use App\Services\MySgs\Api\JobApi; class JobApiHandler { /** - * @param $jobNumber - * @param $apiName - * @return Job + * @var Job */ - public static function handle($jobNumber, $apiName){ + public $job; - $job = Job::whereJobNumber($jobNumber)->first(); + public $response; - if($job){ - JobApiRequest::dispatch($jobNumber, $apiName); - return $job; + /** + * JobApiHandler constructor. + * @param Job $job + */ + public function __construct($job) + { + if (is_string($job)) { + $job = JobRepository::createFromJobNumber($job); } - $jobDetails = JobApi::$apiName($jobNumber); + $this->job = $job; + } + + + /** + * @param $apiName + * @return JobApiHandler + */ + public function handle($apiName) + { + logger('handling api call ' . $apiName . ' on job ' . $this->job->id); + - $job = Job::create([ - 'job_number' => $jobNumber, - 'metadata' => [ $apiName => $jobDetails ] - ]); + $this->response = JobApi::$apiName($this->getApiParam($apiName)); + + $job_metadata = $this->job->metadata; + + $job_metadata->$apiName = $this->response; + + $this->job->metadata = $job_metadata; + $this->job->save(); + + return $this; + } + + + protected function getApiParam($apiName) { + /* + * Build the appropriate Api object + */ + $apiclass = 'App\Services\MySgs\Api\JobApi'; + $api = new $apiclass; + $function = $apiName; + + /* + * Check which parameter is expected from the api function + */ + $signature = get_func_argNames($function, $api); + + if (array_keys($signature)[0] == 'jobVersionId') { + $param = $this->job->metadata->basicInfo->jobVersionId; + } else { + $param = $this->job->job_number; + } - return $job; + return $param; } } diff --git a/app/Services/MySgs/Api/JobApi.php b/app/Services/MySgs/Api/JobApi.php index e99a13e1..01b191bf 100644 --- a/app/Services/MySgs/Api/JobApi.php +++ b/app/Services/MySgs/Api/JobApi.php @@ -13,16 +13,19 @@ public static function jobSearch($query, $params = []) public static function basicInfo($formattedJobNumber, $params = [], $array_mode = false) { + logger('basic info api'); return static::get('Job/basicInfo/formattedJobNumber/', $formattedJobNumber, $params, $array_mode); } public static function basicDetails($jobVersionId, $params = []) { + logger('basic details api'); return static::get('JobVersion/basicDetails/', $jobVersionId, $params); } public static function extraDetails($jobVersionId, $params = []) { + logger('extra details api'); return static::get('JobVersion/extraDetails/', $jobVersionId, $params); } } diff --git a/app/Services/MySgs/DataLoader.php b/app/Services/MySgs/DataLoader.php new file mode 100644 index 00000000..bae1a747 --- /dev/null +++ b/app/Services/MySgs/DataLoader.php @@ -0,0 +1,50 @@ +handle('basicInfo'); + $basicDetails = (new JobApiHandler($job))->handle('basicDetails'); + $extraDetails = (new JobApiHandler($job))->handle('extraDetails'); + + $job->designation = $basicInfo->response->jobDescription; + $job_metadata = $job->metadata; + $job_metadata->processing_mysgs = false; + + try { + $customer_name = $job->metadata->basicDetails->retailer->customerName; + + $client = ClientAccount::where('name', 'LIKE', '%'.$customer_name.'%') + ->orWhereRaw('LOWER(alias) LIKE "%'.Str::lower($job->metadata->basicDetails->retailer->customerName).'%"') + ->first(); + + if($client) { + $job_metadata->client = $client->only(['id', 'name', 'slug', 'image']); + $job_metadata->client_found = true; + } else { + $job_metadata->client_found = false; + $job_metadata->client = ['name' => $customer_name]; + } + + } catch (\Exception $e) { + \Log::error('could not deduce client'); + $job_metadata->client = ['name' => $customer_name]; + $job_metadata->client_found = false; + } + + $job->metadata = $job_metadata; + $job->save(); + } +} diff --git a/app/Services/MySgs/Mapping/Mapper.php b/app/Services/MySgs/Mapping/Mapper.php index 0de1e1f2..41741e9d 100644 --- a/app/Services/MySgs/Mapping/Mapper.php +++ b/app/Services/MySgs/Mapping/Mapper.php @@ -12,8 +12,8 @@ class Mapper { /** - * @param Job $job - * @param FieldMapping $mapping + * @param Job $job + * @param FieldMapping $mapping * @return array|\ArrayAccess|mixed|void */ public static function getMetaValue(Job $job, FieldMapping $mapping) @@ -22,25 +22,29 @@ public static function getMetaValue(Job $job, FieldMapping $mapping) /* * Build the appropriate Api object */ - $apiClass = 'App\Services\MySgs\Api\\' . $mapping->api_name; + $apiClass = 'App\Services\MySgs\Api\\'.$mapping->api_name; $api = new $apiClass; $function = $mapping->api_action; /* * Check which parameter is expected from the api function */ - // $signature = get_func_argNames($function, $api); - // - // if (array_keys($signature)[0] == 'jobVersionId') { - // if (!is_array($job)) { - // $job = json_decode($job); - // } - // $param = $job['jobVersionId']; - // } else { - // $param = $job['job_number']; - // } - - $response = $api::$function($job->job_number); + $signature = get_func_argNames($function, $api); + + if (array_keys($signature)[0] == 'jobVersionId') { + if (!is_array($job)) { + $job = json_decode($job); + } + $param = $job->metadata->basicInfo->jobVersionId; + } else { + $param = $job->job_number; + } + + if (isset($job->metadata->{$mapping->api_action})) { + $response = $job->metadata->{$mapping->api_action}; + } else { + $response = $api::$function($param); + } return static::parseMapping($mapping, $response); } @@ -53,8 +57,8 @@ protected static function parseMapping($mapping, $data) $dataToResolve = static::parseFieldPathSection($field_path_sections, $data); // send the response to resolver to make some changes according to your need to tag - if($mapping->resolver_name !== null){ - $resolverClass = 'App\Services\Resolvers\\' . $mapping->resolver_name; + if ($mapping->resolver_name !== null) { + $resolverClass = 'App\Services\Resolvers\\'.$mapping->resolver_name; $resolver = new $resolverClass; $dataToResolve = $resolver::handle($dataToResolve); } @@ -72,7 +76,7 @@ protected static function parseFieldPathSection($field_path_sections, $data) } if (is_int($section) || $section === "0") { - if(!isset($data[$section])){ + if (!isset($data[$section])) { return null; } return static::parseFieldPathSection($field_path_sections, $data[$section]); diff --git a/app/Services/Rule/RuleFilter.php b/app/Services/Rule/RuleFilter.php index 15ad9fc5..603a0289 100644 --- a/app/Services/Rule/RuleFilter.php +++ b/app/Services/Rule/RuleFilter.php @@ -14,6 +14,28 @@ class RuleFilter { + public static function findClient($job) + { + $customer_name = $job->metadata->basicDetails->retailer->customerName; + + $client = ClientAccount::where('name', 'LIKE', '%'.$customer_name.'%') + ->orWhereRaw('LOWER(alias) LIKE "%'.Str::lower($job->metadata->basicDetails->retailer->customerName).'%"') + ->first(); + + $job_metadata = $job->metadata; + + if($client) { + $job_metadata->client = $client->only(['id', 'name', 'slug', 'image']); + $job_metadata->client_found = true; + } else { + $job_metadata->client_found = false; + $job_metadata->client = ['name' => $customer_name]; + } + + $job->metadata = $job_metadata; + $job->save(); + } + /** * @param Job $job * @return array @@ -23,11 +45,16 @@ public static function handle(Job $job): array $clientRules = []; - if ($job->metadata->basicDetails) { - $client = ClientAccount::with('rules.terms.taxonomy')->whereRaw('LOWER(alias) LIKE "%'.Str::lower($job->metadata->basicDetails->retailer->customerName).'%"')->first(); + if (!$job->metadata->client_found) { + static::findClient($job); + } + + if ($job->metadata->client_found) { + + $client = ClientAccount::find($job->metadata->client->id); + logger('loaded client '.$client->name); $metadata = $job->metadata; - $metadata->client = $client->only(['id', 'name', 'slug']); $job_taxonomy_terms_matches = []; $job_taxonomy_terms = []; diff --git a/resources/js/Components/Loader.vue b/resources/js/Components/Loader.vue new file mode 100644 index 00000000..482e5f4a --- /dev/null +++ b/resources/js/Components/Loader.vue @@ -0,0 +1,43 @@ + + + + + diff --git a/resources/js/Components/OP/JobIdentification.vue b/resources/js/Components/OP/JobIdentification.vue new file mode 100644 index 00000000..f345fe82 --- /dev/null +++ b/resources/js/Components/OP/JobIdentification.vue @@ -0,0 +1,53 @@ + + + + + diff --git a/resources/js/Components/OP/JobSearchForm.vue b/resources/js/Components/OP/JobSearchForm.vue index 6f9353bd..f7d0d517 100644 --- a/resources/js/Components/OP/JobSearchForm.vue +++ b/resources/js/Components/OP/JobSearchForm.vue @@ -47,11 +47,8 @@ export default { methods: { findJob() { - this.form.post(route('home', this.jobNumber), { - preserveScroll: true - }).then(() => { - this.$emit('loaded') - }); + this.$emit('searching') + this.form.post(route('job.rules', this.jobNumber)); } }, } diff --git a/resources/js/Components/PM/ClientAccount/TaxonomyDefinition.vue b/resources/js/Components/PM/ClientAccount/TaxonomyDefinition.vue index c1315fdc..e91cacbf 100644 --- a/resources/js/Components/PM/ClientAccount/TaxonomyDefinition.vue +++ b/resources/js/Components/PM/ClientAccount/TaxonomyDefinition.vue @@ -14,12 +14,20 @@ diff --git a/resources/js/Pages/OP/JobRules.vue b/resources/js/Pages/OP/JobRules.vue index 4dc6c173..2cd0be2a 100644 --- a/resources/js/Pages/OP/JobRules.vue +++ b/resources/js/Pages/OP/JobRules.vue @@ -4,13 +4,13 @@
-

- Rules for job {{ job.job_number }} +

+ Rules for job {{ currentJob.job_number }}

- @@ -18,97 +18,87 @@
-
-
-
-
-

Client Account: - {{ job.metadata.client.name }} -

-
- -
-
-
-
-
-
{{ item }}
-
-
-
- -
{{ value }} -
- -
- {{ terms }}
-
-
- -
-
-
-
-
+
+
- -
-
- - - - - Hello! Rules list updated. Do you want to check? - - +
+ +
+
+
+

"{{ currentJob.metadata.client.name }}" was not matched with any client + account.

- -
- -
- - +
+
+ There was an error loading data for the job "{{ currentJob.metadata.client.name }}". +
Please try again later. +
+
+ + +
+
+ + + + + Hello! Rules list updated. Do you want to check? + -
- - -
- +
+ +
+ + + +
- + + +
+ +
+
+ +
@@ -152,7 +142,7 @@