Skip to content
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

FOUR-14286: Add a variable to hide AI for Fall and Winter #6316

Merged
merged 1 commit into from
Mar 7, 2024
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
8 changes: 6 additions & 2 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@

// Option Fractal, Serializer
// TODO Does the ProcessMakerSerializer class exist, if so, we need to fix its namespace :)
'serialize_fractal' => env('SERIALIZE_FRACTAL', \ProcessMaker\Transformers\ProcessMakerSerializer::class),
'serialize_fractal' => env('SERIALIZE_FRACTAL', ProcessMaker\Transformers\ProcessMakerSerializer::class),

//Option Fractal, paginator
'paginate_fractal' => env('PAGINATE_FRACTAL', \League\Fractal\Pagination\IlluminatePaginatorAdapter::class),
'paginate_fractal' => env('PAGINATE_FRACTAL', League\Fractal\Pagination\IlluminatePaginatorAdapter::class),

// The processmaker identifier of the web client application
'web_client_application_id' => env('PM_CLIENT_ID', 'x-pm-local-client'),
Expand Down Expand Up @@ -109,6 +109,10 @@
// Allows to detect if OpenAI is enabled or not
'open_ai_nlq_to_pmql' => env('OPEN_AI_NLQ_TO_PMQL_ENABLED', false) && env('OPEN_AI_SECRET', false),

// Allows to detect if OpenAI is enabled or not
'open_ai_process_translations' => env('OPEN_AI_PROCESS_TRANSLATIONS_ENABLED', false) &&
env('OPEN_AI_SECRET', false),

// Microservice AI Host
'ai_microservice_host' => env('AI_MICROSERVICE_HOST'),

Expand Down
144 changes: 74 additions & 70 deletions resources/views/processes/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
<a class="nav-item nav-link active" id="nav-home-tab" data-toggle="tab" href="#nav-config"
role="tab"
aria-controls="nav-config" aria-selected="true" @click="activateTab">{{__('Configuration')}}</a>
@can('view-process-translations')
<a class="nav-item nav-link" id="nav-groups-tab" data-toggle="tab" href="#nav-translations"
role="tab"
data-test="translation-tab"
aria-controls="nav-translations" aria-selected="true" @click="activateTab">{{__('Translations')}}</a>
@endcan
@if (config('app.open_ai_process_translations'))
@can('view-process-translations')
<a class="nav-item nav-link" id="nav-groups-tab" data-toggle="tab" href="#nav-translations"
role="tab"
data-test="translation-tab"
aria-controls="nav-translations" aria-selected="true" @click="activateTab">{{__('Translations')}}</a>
@endcan
@endif
<a class="nav-item nav-link" id="nav-groups-tab" data-toggle="tab" href="#nav-notifications"
role="tab"
aria-controls="nav-notifications" aria-selected="true" @click="activateTab">{{__('Notifications')}}</a>
Expand Down Expand Up @@ -198,79 +200,81 @@
</div>

{{-- Translations --}}
@can('view-process-translations')
<div class="tab-pane fade show" :class="{'active': activeTab === 'nav-translations'}" id="nav-translations" ref="nav-translations" role="tabpanel"
aria-labelledby="nav-translations-tab">

<div class="page-content mb-0" id="processTranslationIndex">
<div id="search-bar" class="search mb-3" vcloak>
<div class="d-flex flex-column flex-md-row">
<div class="flex-grow-1">
<div id="search" class="mb-3 mb-md-0">
<div class="input-group w-100">
<input id="search-box" v-model="filterTranslations" class="form-control" placeholder="{{__('Search')}}" aria-label="{{__('Search')}}">
<div class="input-group-append">
<button type="button" class="btn btn-primary" aria-label="{{__('Search')}}">
<i class="fas fa-search"></i>
</button>
@if (config('app.open_ai_process_translations'))
@can('view-process-translations')
<div class="tab-pane fade show" :class="{'active': activeTab === 'nav-translations'}" id="nav-translations" ref="nav-translations" role="tabpanel"
aria-labelledby="nav-translations-tab">

<div class="page-content mb-0" id="processTranslationIndex">
<div id="search-bar" class="search mb-3" vcloak>
<div class="d-flex flex-column flex-md-row">
<div class="flex-grow-1">
<div id="search" class="mb-3 mb-md-0">
<div class="input-group w-100">
<input id="search-box" v-model="filterTranslations" class="form-control" placeholder="{{__('Search')}}" aria-label="{{__('Search')}}">
<div class="input-group-append">
<button type="button" class="btn btn-primary" aria-label="{{__('Search')}}">
<i class="fas fa-search"></i>
</button>
</div>
</div>
</div>
</div>
@canany(['import-process-translations', 'create-process-translations'])
<div class="d-flex ml-md-0 flex-column flex-md-row">
@can('import-process-translations')
<div class="mb-3 mb-md-0 ml-md-2">
<a href="#" aria-label="{{ __('Import Translation') }}" id="import_translation" class="btn btn-outline-secondary w-100" @click="importTranslation" data-test="translation-import">
<i class="fas fa-file-import"></i> {{__('Import')}}
</a>
</div>
@endcan
@can('create-process-translations')
<div class="mb-3 mb-md-0 ml-md-2">
<a href="#"
aria-label="{{ __('New Translation') }}"
id="new_translation"
class="btn btn-primary w-100"
@click="newTranslation"
data-test="translation-create-button">
{{__('+ Translation')}}
</a>
</div>
@endcan
</div>
@endcan
</div>
@canany(['import-process-translations', 'create-process-translations'])
<div class="d-flex ml-md-0 flex-column flex-md-row">
@can('import-process-translations')
<div class="mb-3 mb-md-0 ml-md-2">
<a href="#" aria-label="{{ __('Import Translation') }}" id="import_translation" class="btn btn-outline-secondary w-100" @click="importTranslation" data-test="translation-import">
<i class="fas fa-file-import"></i> {{__('Import')}}
</a>
</div>
@endcan
@can('create-process-translations')
<div class="mb-3 mb-md-0 ml-md-2">
<a href="#"
aria-label="{{ __('New Translation') }}"
id="new_translation"
class="btn btn-primary w-100"
@click="newTranslation"
data-test="translation-create-button">
{{__('+ Translation')}}
</a>
</div>
@endcan
</div>
@endcan
</div>

<div class="container-fluid">
<process-translation-listing
ref="translationsListing"
:filter="filterTranslations"
:permission="{{ \Auth::user()->hasPermissionsFor('process-translations') }}"
@translated-languages-changed="onTranslatedLanguagesChanged"
@edit-translation="onEditTranslation"
:process-id="{{ $process->id }}"
></process-translation-listing>
</div>
</div>

<div class="container-fluid">
<process-translation-listing
ref="translationsListing"
:filter="filterTranslations"
:permission="{{ \Auth::user()->hasPermissionsFor('process-translations') }}"
@translated-languages-changed="onTranslatedLanguagesChanged"
@edit-translation="onEditTranslation"
:process-id="{{ $process->id }}"
></process-translation-listing>

<div class="d-flex justify-content-end mt-2">
{!! Form::button(__('Cancel'), ['class'=>'btn btn-outline-secondary', '@click' => 'onClose']) !!}
{!! Form::button(__('Save'), ['class'=>'btn btn-secondary ml-2', '@click' => 'onUpdate']) !!}
</div>
</div>

<div class="d-flex justify-content-end mt-2">
{!! Form::button(__('Cancel'), ['class'=>'btn btn-outline-secondary', '@click' => 'onClose']) !!}
{!! Form::button(__('Save'), ['class'=>'btn btn-secondary ml-2', '@click' => 'onUpdate']) !!}
<create-process-translation-modal
ref="createProcessTranslationModal"
:process-id="{{ $process->id }}"
:permission="{{ \Auth::user()->hasPermissionsFor('process-translations') }}"
process-name="{{ $process->name }}"
:edit-translation="editTranslation"
@create-process-translation-closed="onCreateProcessTranslationClosed"
@translating-language="onTranslatingLanguage"
@language-saved="onLanguageSaved"/>
</div>

<create-process-translation-modal
ref="createProcessTranslationModal"
:process-id="{{ $process->id }}"
:permission="{{ \Auth::user()->hasPermissionsFor('process-translations') }}"
process-name="{{ $process->name }}"
:edit-translation="editTranslation"
@create-process-translation-closed="onCreateProcessTranslationClosed"
@translating-language="onTranslatingLanguage"
@language-saved="onLanguageSaved"/>
</div>
@endcan
@endcan
@endif

{{-- Notifications --}}
<div class="tab-pane fade show p-3" id="nav-notifications" role="tabpanel"
Expand Down
Loading