mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-29 01:13:59 +00:00
Admin Workflow - Fix Reported Issues - More filtering user controls for admin to find issues
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class IsAdminFilter implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->where('is_admin_filter', $value);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class QuestionGroupIn implements Filter
|
||||
{
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereHas('question', function ($query) use ($value) {
|
||||
$query->whereIn('group', $value);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class QuestionIn implements Filter
|
||||
{
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereHas('question', function ($query) use ($value) {
|
||||
$query->whereIn('question_number', $value);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ class ListQuestionsAnswersLogic extends AbstractControllerLogic
|
||||
private $listsQuestionUserAnswerSelected;
|
||||
|
||||
/**
|
||||
* ListQuestionsAnswersQALogic constructor.
|
||||
* ListQuestionsAnswersLogic constructor.
|
||||
* @param CanListQuestions $canListQuestions
|
||||
* @param ListsQuestionUserAnswerSelected $listsQuestionUserAnswerSelected
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Questionnaires\ControllersLogic;
|
||||
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Questionnaires\Services\ListsQuestions;
|
||||
use App\Classes\Modules\Questionnaires\Standards\Rules\CanListQuestions;
|
||||
use App\Http\Resources\QuestionResource;
|
||||
use App\Models\QAQuestionnaireSet;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ListQuestionsLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Retrieved Questions',
|
||||
'message' => 'You have successfully retrieved a list of questions'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var CanListQuestions */
|
||||
private $canListQuestions;
|
||||
|
||||
/** @var ListsQuestions */
|
||||
private $listsQuestions;
|
||||
|
||||
/**
|
||||
* ListQuestionsLogic constructor.
|
||||
* @param CanListQuestions $canListQuestions
|
||||
* @param ListsQuestions $listsQuestions
|
||||
*/
|
||||
public function __construct(CanListQuestions $canListQuestions, ListsQuestions $listsQuestions)
|
||||
{
|
||||
$this->canListQuestions = $canListQuestions;
|
||||
$this->listsQuestions = $listsQuestions;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws \App\Classes\Exceptions\AccessForbiddenException
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
* @throws \App\Classes\Exceptions\RequestValidationException
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
$this->canListQuestions->passes();
|
||||
$setId = 0;
|
||||
if ($request->route('set_id')) {
|
||||
$setId = $request->route('set_id');
|
||||
}
|
||||
|
||||
if($setId === 0){
|
||||
$set = QAQuestionnaireSet::where('group', '1688,approve_po,fill_po')->latest('id')->first();
|
||||
$setId = $set->id;
|
||||
}
|
||||
|
||||
$query = $this->listsQuestions->execute(array_merge($this->listsQuestions->deserializeFilters($request->input('filters')), ['questionnaire_set_id' => $setId]));
|
||||
|
||||
return $this->collectionResponse(QuestionResource::collection($query));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Questionnaires;
|
||||
|
||||
|
||||
use App\Classes\Modules\Questionnaires\ControllersLogic\ListQuestionsLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ListQuestionsController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param ListQuestiosLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function list(Request $request, ListQuestionsLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -25,7 +25,7 @@ class AddGroupToQaQuestionsTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('questionnaire_set_id', function (Blueprint $table) {
|
||||
Schema::table('qa_questions', function (Blueprint $table) {
|
||||
$table->dropColumn('group');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddIsAdminFilterToQaQuestionsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('qa_questions', function (Blueprint $table) {
|
||||
$table->boolean('is_admin_filter')->after('url')->default(false);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('qa_questions', function (Blueprint $table) {
|
||||
$table->dropColumn('is_admin_filter');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -78,12 +78,13 @@ class QAWorkFlowSeeder extends Seeder
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
'answer_options' => [
|
||||
['display_text' => 'Need TAC', 'value' => 'Need Tac', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'Wrong login details', 'value' => 'Wrong Login Details', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'Need TAC', 'value' => '1688_login_issue_need_tac', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'Wrong login details', 'value' => '1688_login_issue_wrong_login_details', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'Others', 'value' => '1688_login_issue_others', 'next_question_number' => '1688_login_issue_others'],
|
||||
['display_text' => 'Order Cancelled', 'value' => '1688_refund_request', 'next_question_number' => '1688_refund_request'],
|
||||
['display_text' => 'Order Cancelled', 'value' => '1688_login_issue_refund_request', 'next_question_number' => '1688_login_issue_refund_request'],
|
||||
],
|
||||
'group' => '1688',
|
||||
'is_admin_filter' => true
|
||||
],
|
||||
[
|
||||
'question_number' => '1688_login_successful',
|
||||
@@ -105,13 +106,14 @@ class QAWorkFlowSeeder extends Seeder
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
'answer_options' => [
|
||||
['display_text' => 'Amount not found', 'value' => 'Amount not found', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'Plus Member', 'value' => 'Plus Member', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'Amount not found', 'value' => '1688_login_successful_cannot_verify_amount_not_found', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'Plus Member', 'value' => '1688_login_successful_cannot_verify_plus_member', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'Others', 'value' => '1688_login_successful_cannot_verify_others', 'next_question_number' => '1688_login_successful_cannot_verify_others'],
|
||||
['display_text' => 'Customer did not verify 1688 account', 'value' => 'Customer did not verify 1688 account', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'WorldFirst account linked another account', 'value' => 'WorldFirst account linked another account', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'Customer did not verify 1688 account', 'value' => '1688_login_successful_cannot_verify_customer_did_not_verify_account', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'WorldFirst account linked another account', 'value' => '1688_login_successful_cannot_verify_worldfirst_account_linked_another_account', 'next_question_number' => '1688_issue_submit'],
|
||||
],
|
||||
'group' => '1688',
|
||||
'is_admin_filter' => true
|
||||
],
|
||||
[
|
||||
'question_number' => '1688_login_successful_cannot_verify_others',
|
||||
@@ -121,6 +123,7 @@ class QAWorkFlowSeeder extends Seeder
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
'group' => '1688',
|
||||
'is_admin_filter' => true
|
||||
],
|
||||
[
|
||||
'question_number' => '1688_order_verify',
|
||||
@@ -168,13 +171,14 @@ class QAWorkFlowSeeder extends Seeder
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
'answer_options' => [
|
||||
['display_text' => 'Wrong Pin Number', 'value' => 'Wrong Pin Number', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'Not Enough Stock', 'value' => 'Not Enough Stock', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'Others', 'value' => 'Others', 'next_question_number' => '1688_proceed_order_issue_others'],
|
||||
['display_text' => 'No CrossBoarder', 'value' => 'No CrossBoarder', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'AngPau', 'value' => 'AngPau', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'Wrong Pin Number', 'value' => '1688_proceed_order_issue_wrong_pin_number', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'Not Enough Stock', 'value' => '1688_proceed_order_issue_not_enough_stock', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'Others', 'value' => '1688_proceed_order_issue_others', 'next_question_number' => '1688_proceed_order_issue_others'],
|
||||
['display_text' => 'No CrossBoarder', 'value' => '1688_proceed_order_issue_no_crossborder', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'AngPau', 'value' => '1688_proceed_order_issue_angpau', 'next_question_number' => '1688_issue_submit'],
|
||||
],
|
||||
'group' => '1688',
|
||||
'is_admin_filter' => true
|
||||
],
|
||||
[
|
||||
'question_number' => '1688_proceed_order_issue_others',
|
||||
@@ -184,6 +188,7 @@ class QAWorkFlowSeeder extends Seeder
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
'group' => '1688',
|
||||
'is_admin_filter' => true
|
||||
],
|
||||
[
|
||||
'question_number' => '1688_login_issue_others',
|
||||
@@ -193,6 +198,7 @@ class QAWorkFlowSeeder extends Seeder
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
'group' => '1688',
|
||||
'is_admin_filter' => true
|
||||
],
|
||||
[
|
||||
'question_number' => '1688_submit',
|
||||
@@ -216,7 +222,7 @@ class QAWorkFlowSeeder extends Seeder
|
||||
'group' => '1688',
|
||||
],
|
||||
[
|
||||
'question_number' => '1688_refund_request',
|
||||
'question_number' => '1688_login_issue_refund_request',
|
||||
'question_title' => 'Refund Request sent',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
@@ -227,6 +233,52 @@ class QAWorkFlowSeeder extends Seeder
|
||||
],
|
||||
'group' => '1688',
|
||||
],
|
||||
[
|
||||
'question_number' => '1688_insufficient_order',
|
||||
'question_title' => 'Are You Sure this is the correct amount?',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
'answer_options' => [
|
||||
['display_text' => 'Underpaid Order', 'value' => 'underpaid_order_1', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'Underpaid Order', 'value' => 'underpaid_order_2', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'Overpaid Order', 'value' => 'underpaid_order_2', 'next_question_number' => '1688_issue_submit'],
|
||||
],
|
||||
'group' => '1688',
|
||||
],
|
||||
[
|
||||
'question_number' => '1688_underpaid_order_1',
|
||||
'question_title' => 'This order is underpaid 1',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
'answer_options' => [
|
||||
['display_text' => 'Done', 'value' => '1688_issue_submit', 'next_question_number' => '1688_issue_submit'],
|
||||
],
|
||||
'group' => '1688',
|
||||
],
|
||||
[
|
||||
'question_number' => '1688_underpaid_order_2',
|
||||
'question_title' => 'This order is underpaid 2',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
'answer_options' => [
|
||||
['display_text' => 'Done', 'value' => '1688_issue_submit', 'next_question_number' => '1688_issue_submit'],
|
||||
],
|
||||
'group' => '1688',
|
||||
],
|
||||
[
|
||||
'question_number' => '1688_overpaid_order',
|
||||
'question_title' => 'This order is overpaid',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
'answer_options' => [
|
||||
['display_text' => 'Done', 'value' => '1688_issue_submit', 'next_question_number' => '1688_issue_submit'],
|
||||
],
|
||||
'group' => '1688',
|
||||
],
|
||||
[
|
||||
'question_number' => 'approve_po',
|
||||
'question_title' => 'approve_po',
|
||||
@@ -305,6 +357,7 @@ class QAWorkFlowSeeder extends Seeder
|
||||
// ['display_text' => 'Next Order', 'value' => 'approve_po', 'next_question_number' => 'approve_po'],
|
||||
],
|
||||
'group' => 'approve_po',
|
||||
'is_admin_filter' => true
|
||||
],
|
||||
[
|
||||
'question_number' => 'approve_po_reject_others',
|
||||
@@ -314,6 +367,7 @@ class QAWorkFlowSeeder extends Seeder
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
'group' => 'approve_po',
|
||||
'is_admin_filter' => true
|
||||
],
|
||||
[
|
||||
'question_number' => 'approve_po_reject_others_complete',
|
||||
@@ -335,8 +389,45 @@ class QAWorkFlowSeeder extends Seeder
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
'answer_options' => [
|
||||
['display_text' => 'Sensitive Goods', 'value' => 'Sensitive Goods', 'next_question_number' => 'fill_po_issue_submit'],
|
||||
['display_text' => 'Others', 'value' => 'fill_po_issue_others', 'next_question_number' => 'fill_po_issue_others'],
|
||||
['display_text' => 'Sensitive Goods', 'value' => 'Sensitive Goods', 'next_question_number' => 'approve_po_edit_po_issue_submit'],
|
||||
['display_text' => 'Others', 'value' => 'approve_po_edit_po_issue_others', 'next_question_number' => 'approve_po_edit_po_issue_others'],
|
||||
],
|
||||
'group' => 'approve_po',
|
||||
'is_admin_filter' => true
|
||||
],
|
||||
[
|
||||
'question_number' => 'approve_po_edit_po_issue_submit',
|
||||
'question_title' => 'Issue has been submitted',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => true,
|
||||
'answer_options' => [
|
||||
['display_text' => 'Stop Working', 'value' => 'stop_working', 'next_question_number' => 'stop_working'],
|
||||
['display_text' => 'Next PO (Fill)', 'value' => 'fill_po', 'next_question_number' => 'fill_po'],
|
||||
['display_text' => 'Next PO (Approve)', 'value' => 'approve_po', 'next_question_number' => 'approve_po'],
|
||||
],
|
||||
'group' => 'approve_po',
|
||||
],
|
||||
[
|
||||
'question_number' => 'approve_po_edit_po_issue_others',
|
||||
'question_title' => 'What other issues did you encounter? Upload documents if needed',
|
||||
'question_type' => QAType::REMARKS_WITH_DOCUMENT_UPLOAD,
|
||||
'next_nested_question' => 'approve_po_edit_po_issue_submit',
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
'group' => 'approve_po',
|
||||
'is_admin_filter' => true
|
||||
],
|
||||
[
|
||||
'question_number' => 'approve_po_edit_po_issue_submit',
|
||||
'question_title' => 'Issue has been submitted',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => true,
|
||||
'answer_options' => [
|
||||
['display_text' => 'Stop Working', 'value' => 'stop_working', 'next_question_number' => 'stop_working'],
|
||||
['display_text' => 'Next PO (Fill)', 'value' => 'fill_po', 'next_question_number' => 'fill_po'],
|
||||
['display_text' => 'Next PO (Approve)', 'value' => 'approve_po', 'next_question_number' => 'approve_po'],
|
||||
],
|
||||
'group' => 'approve_po',
|
||||
],
|
||||
@@ -348,6 +439,7 @@ class QAWorkFlowSeeder extends Seeder
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
'group' => 'fill_po',
|
||||
'is_admin_filter' => true
|
||||
],
|
||||
[
|
||||
'question_number' => 'fill_po_issue_submit',
|
||||
@@ -362,60 +454,6 @@ class QAWorkFlowSeeder extends Seeder
|
||||
],
|
||||
'group' => 'fill_po',
|
||||
],
|
||||
[
|
||||
'question_number' => 'stop_working',
|
||||
'question_title' => 'Thank you. Reload page to restart.',
|
||||
'question_type' => QAType::DEFAULT,
|
||||
'is_start' => false,
|
||||
'is_end' => true,
|
||||
'group' => '',
|
||||
],
|
||||
[
|
||||
'question_number' => '1688_insufficient_order',
|
||||
'question_title' => 'Are You Sure this is the correct amount?',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
'answer_options' => [
|
||||
['display_text' => 'Underpaid Order', 'value' => 'underpaid_order_1', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'Underpaid Order', 'value' => 'underpaid_order_2', 'next_question_number' => '1688_issue_submit'],
|
||||
['display_text' => 'Overpaid Order', 'value' => 'underpaid_order_2', 'next_question_number' => '1688_issue_submit'],
|
||||
],
|
||||
'group' => '1688',
|
||||
],
|
||||
[
|
||||
'question_number' => '1688_underpaid_order_1',
|
||||
'question_title' => 'This order is underpaid 1',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
'answer_options' => [
|
||||
['display_text' => 'Done', 'value' => '1688_issue_submit', 'next_question_number' => '1688_issue_submit'],
|
||||
],
|
||||
'group' => '1688',
|
||||
],
|
||||
[
|
||||
'question_number' => '1688_underpaid_order_2',
|
||||
'question_title' => 'This order is underpaid 2',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
'answer_options' => [
|
||||
['display_text' => 'Done', 'value' => '1688_issue_submit', 'next_question_number' => '1688_issue_submit'],
|
||||
],
|
||||
'group' => '1688',
|
||||
],
|
||||
[
|
||||
'question_number' => '1688_overpaid_order',
|
||||
'question_title' => 'This order is overpaid',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
'answer_options' => [
|
||||
['display_text' => 'Done', 'value' => '1688_issue_submit', 'next_question_number' => '1688_issue_submit'],
|
||||
],
|
||||
'group' => '1688',
|
||||
],
|
||||
[
|
||||
'question_number' => 'fill_po_edit',
|
||||
'question_title' => 'fill_po_edit',
|
||||
@@ -440,6 +478,7 @@ class QAWorkFlowSeeder extends Seeder
|
||||
['display_text' => 'Others', 'value' => 'fill_po_issue_others', 'next_question_number' => 'fill_po_issue_others'],
|
||||
],
|
||||
'group' => 'fill_po',
|
||||
'is_admin_filter' => true
|
||||
],
|
||||
[
|
||||
'question_number' => 'fill_po_edit_filled',
|
||||
@@ -454,6 +493,14 @@ class QAWorkFlowSeeder extends Seeder
|
||||
],
|
||||
'group' => 'fill_po',
|
||||
],
|
||||
[
|
||||
'question_number' => 'stop_working',
|
||||
'question_title' => 'Thank you. Reload page to restart.',
|
||||
'question_type' => QAType::DEFAULT,
|
||||
'is_start' => false,
|
||||
'is_end' => true,
|
||||
'group' => '',
|
||||
],
|
||||
]
|
||||
],
|
||||
];
|
||||
@@ -495,6 +542,10 @@ class QAWorkFlowSeeder extends Seeder
|
||||
$question->url = $questionData['url'];
|
||||
}
|
||||
|
||||
if (isset($questionData['is_admin_filter'])) {
|
||||
$question->is_admin_filter = $questionData['is_admin_filter'];
|
||||
}
|
||||
|
||||
$question->order = $key + 1;
|
||||
$question->save();
|
||||
|
||||
|
||||
+4
-2
@@ -54,7 +54,8 @@
|
||||
<i class="fa fa-download" :class="[{'fa-angle-up': expanded}, {'fa-angle-down': !expanded}]"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto no-padding" v-if="loading && item.question_groups.includes(item.answer_value)">
|
||||
<!-- <div class="col-auto no-padding" v-if="loading && item.question_groups.includes(item.answer_value)"> -->
|
||||
<div class="col-auto no-padding" v-if="loading">
|
||||
<div class="btn btn-sm btn-default b-rad-none no-border">
|
||||
<span class="spinner"></span>
|
||||
</div>
|
||||
@@ -62,7 +63,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-10" v-show="expanded" v-if="item.question_groups.includes(item.answer_value)">
|
||||
<!-- <div class="row m-b-10" v-show="expanded" v-if="item.question_groups.includes(item.answer_value)"> -->
|
||||
<div class="row m-b-10" v-show="expanded">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
||||
+47
-7
@@ -12,15 +12,16 @@
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<validation-wrapper-component selectable :validator="$v.filterUserId">
|
||||
<label>Users</label>
|
||||
<selectable-component :endpoint="route('api.account.user.list') + '?filters=' + JSON.stringify(userListOptions)" :section="section + 'UserList'" valueColumn="id" :labelColumn="['name', 'email']" v-model="filterUserId"></selectable-component>
|
||||
<validation-wrapper-component selectable :validator="$v.filterQuestionGroup">
|
||||
<label>Question Groups</label>
|
||||
<select-component :options="questionGroups" v-model="filterQuestionGroup"></select-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<validation-wrapper-component :validator="$v.filterAnswerText">
|
||||
<label class="all-caps">Answer Text</label>
|
||||
<input type="text" class="form-control" v-model.lazy="filterAnswerText">
|
||||
<validation-wrapper-component selectable :validator="$v.filterQuestion">
|
||||
<label class="all-caps">Question</label>
|
||||
<!-- <select-component :options="['1688_login_issue', '1688_login_issue_others', '1688_proceed_order_issue', '1688_proceed_order_issue_others', '1688_login_successful_cannot_verify', '1688_login_successful_cannot_verify_others', 'approve_po_reject', 'approve_po_reject_others', 'approve_po_edit_po_issue', 'approve_po_edit_po_issue_others', 'fill_po_edit_issue', 'fill_po_issue_others']" v-model="filterQuestion"></select-component> -->
|
||||
<selectable-component :endpoint="route('api.questionnaires.q.list', 0) + '?filters=' + JSON.stringify({'is_admin_filter': true, order_by: {column: 'question_number', DESC: false}})" :section="section + 'QuestionsFiltering'" valueColumn="question_number" :labelColumn="['question_number']" v-model="filterQuestion"></selectable-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
@@ -37,8 +38,23 @@
|
||||
<date-picker-component v-model.lazy="filterEndDate"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<validation-wrapper-component :validator="$v.filterAnswerText">
|
||||
<label class="all-caps">Answer Text</label>
|
||||
<input type="text" class="form-control" v-model.lazy="filterAnswerText">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-end m-t-10">
|
||||
<div class="row m-t-10">
|
||||
<div class="col-md-4">
|
||||
<validation-wrapper-component selectable :validator="$v.filterUserId">
|
||||
<label>Users</label>
|
||||
<selectable-component :endpoint="route('api.account.user.list') + '?filters=' + JSON.stringify(userListOptions)" :section="section + 'UserList'" valueColumn="id" :labelColumn="['name', 'email']" v-model="filterUserId"></selectable-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
<loading-component style="height: 200px; top: 0;" color="success" v-show="questionGroups.length === 0"></loading-component>
|
||||
<div class="row justify-content-end m-t-10" v-show="!$store.getters.isLoading(section + 'ListQuestions')">
|
||||
<div class="col-auto p-l-0">
|
||||
<open-link-in-new-tab-component custom-class="btn btn-sm b-rad-none fs-14" :url="route('api.questionnaires.qa.export.without.groups') + '?filters=' + JSON.stringify(this.options)" :is-url-protected="true" :onClick="exportAction">
|
||||
<i class="fa fa-download lh-40"></i> Download
|
||||
@@ -88,6 +104,8 @@
|
||||
data(){
|
||||
return {
|
||||
filterUserId: "",
|
||||
filterQuestion: "",
|
||||
filterQuestionGroup: "",
|
||||
filterQuestionnaireSet: "",
|
||||
filterStartDate: "",
|
||||
filterEndDate: "",
|
||||
@@ -100,16 +118,29 @@
|
||||
'order_by': {column: 'created_at', DESC: true},
|
||||
},
|
||||
currentKey: 1,
|
||||
questionGroups: [],
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.fetchQuestionnaireSets();
|
||||
},
|
||||
validations: {
|
||||
filterUserId: {},
|
||||
filterQuestion: {},
|
||||
filterQuestionGroup: {},
|
||||
filterQuestionnaireSet: {},
|
||||
filterStartDate: {},
|
||||
filterEndDate: {},
|
||||
filterAnswerText: {},
|
||||
},
|
||||
methods: {
|
||||
fetchQuestionnaireSets(){
|
||||
this.submit(route('api.questionnaires.list') +'?filters=' + JSON.stringify({ 'per_page': 10, order_by: {column: 'id', DESC: true} }), 'get', this.section, false, false)
|
||||
},
|
||||
successHandler(response){
|
||||
this.questionGroups = response.payload.data[0].group;
|
||||
this.options['question_group_in'] = this.questionGroups;
|
||||
},
|
||||
onSelected(userId){
|
||||
this.updateOptions();
|
||||
this.currentKey+=1;
|
||||
@@ -118,6 +149,12 @@
|
||||
// if(this.filterUserId){
|
||||
// this.options['user_id'] = this.filterUserId;
|
||||
// }
|
||||
if(this.filterQuestion){
|
||||
this.options['question_in'] = [this.filterQuestion];
|
||||
}
|
||||
if(this.filterQuestionGroup){
|
||||
this.options['question_group_in'] = [this.filterQuestionGroup];
|
||||
}
|
||||
if(this.filterQuestionnaireSet){
|
||||
this.options['has_questionnaire'] = this.filterQuestionnaireSet;
|
||||
}
|
||||
@@ -137,16 +174,19 @@
|
||||
},
|
||||
resetSarch() {
|
||||
this.filterUserId = "",
|
||||
this.filterQuestion = "",
|
||||
this.filterQuestionGroup = "",
|
||||
this.filterQuestionnaireSet = "",
|
||||
this.filterStartDate = "",
|
||||
this.filterEndDate = "",
|
||||
this.filterAnswerText = "",
|
||||
// delete this.options['user_id'];
|
||||
delete this.options['question_in'];
|
||||
delete this.options['has_questionnaire'];
|
||||
delete this.options['start_date'];
|
||||
delete this.options['end_date'];
|
||||
delete this.options['answer_like_with_user_id'];
|
||||
this.options['question_group_in'] = this.questionGroups;
|
||||
this.currentKey+=1;
|
||||
},
|
||||
},
|
||||
|
||||
+2
-2
@@ -39,7 +39,8 @@
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-end m-t-10">
|
||||
<loading-component style="height: 200px; top: 0;" color="success" v-show="questionGroups.length === 0"></loading-component>
|
||||
<div class="row justify-content-end m-t-10" v-show="questionGroups.length > 0 && !$store.getters.isLoading(section + 'ListQuestionGroups')">
|
||||
<div class="col-auto p-l-0">
|
||||
<open-link-in-new-tab-component custom-class="btn btn-sm b-rad-none fs-14" :url="route('api.questionnaires.qa.export.with.groups') + '?filters=' + JSON.stringify(this.options)" :is-url-protected="true" :onClick="exportAction">
|
||||
<i class="fa fa-download lh-40"></i> Download
|
||||
@@ -67,7 +68,6 @@
|
||||
<div class="col-1">Created Date</div>
|
||||
</div>
|
||||
</div>
|
||||
<loading-component style="height: 200px; top: 0;" color="success" v-show="questionGroups.length === 0"></loading-component>
|
||||
<list-component style="min-height: 600px;" :key="currentKey" :section="section + 'ListQuestionGroups'" :endpoint="route('api.questionnaires.qa.list')" :options="options" v-if="questionGroups.length > 0">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<question-answer-component :key="data.id" :data="data"></question-answer-component>
|
||||
|
||||
@@ -13,18 +13,7 @@
|
||||
<div class="row m-l-0 m-r-0 d-flex">
|
||||
<div class="col m-r-5">
|
||||
<div class="row fs-12 text-center">
|
||||
<div class="col p-t-20 p-b-20 bg-master-lighter active tabButton" tab-name="questionGroups">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="fs-12 m-t-5 all-caps">Question Groups</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col m-r-5">
|
||||
<div class="row fs-12 text-center">
|
||||
<div class="col p-t-20 p-b-20 bg-master-lighter tabButton" tab-name="questions">
|
||||
<div class="col p-t-20 p-b-20 bg-master-lighter active tabButton" tab-name="questions">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="fs-12 m-t-5 all-caps">Questions</div>
|
||||
@@ -33,19 +22,30 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col m-r-5">
|
||||
<div class="row fs-12 text-center">
|
||||
<div class="col p-t-20 p-b-20 bg-master-lighter tabButton" tab-name="questionGroups">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="fs-12 m-t-5 all-caps">Groups</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row no-margin">
|
||||
<div class="col bg-white padding-25">
|
||||
<div class="row tabsContainer tabContent" tab-name="questionGroups" style="margin: 15px;">
|
||||
<div class="col">
|
||||
<question-answer-section-component section="qaQuestionGroupsSection"></question-answer-section-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row tabsContainer hide tabContent" tab-name="questions" style="margin: 15px;">
|
||||
<div class="row tabsContainer tabContent" tab-name="questions" style="margin: 15px;">
|
||||
<div class="col">
|
||||
<question-answer-section-2-component section="qaQuestionsWithoutGroupSection"></question-answer-section-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row tabsContainer hide tabContent" tab-name="questionGroups" style="margin: 15px;">
|
||||
<div class="col">
|
||||
<question-answer-section-component section="qaQuestionGroupsSection"></question-answer-section-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -12,4 +12,8 @@ Route::group(['prefix' => 'questionnaires', 'as' => 'questionnaires.', 'namespac
|
||||
Route::get('/export1', '\\App\\Http\\Controllers\\Exports\\ExportQuestionsAnswersController@exportWithGroups')->name('export.with.groups');
|
||||
Route::get('/export2', '\\App\\Http\\Controllers\\Exports\\ExportQuestionsAnswersController@exportWithoutGroups')->name('export.without.groups');
|
||||
});
|
||||
|
||||
Route::group(['prefix' => 'q', 'as' => 'q.'], function () {
|
||||
Route::get('/list/{set_id}', 'ListQuestionsController@list')->name('list');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user