Skip to content
Open
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
26 changes: 23 additions & 3 deletions src/Form/AdminConfig/AesirxAnalyticsAdminConfigForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,34 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#type' => 'textfield',
'#title' => $this->t('Client ID'),
'#default_value' => $settings['client_id'],
'#required' => TRUE,
'#states' => [
'visible' => [
':input[name="first_party_server"]' => ['value' => AesirxAnalyticsInterface::EXTERNAL],
],
'required' => [
':input[name="first_party_server"]' => ['value' => AesirxAnalyticsInterface::EXTERNAL],
],
],
'#element_validate' => [[get_class($this), 'validateInternalIsRequired']],
];

$form['client_secret'] = [
'#type' => 'textfield',
'#title' => $this->t('Client Secret'),
'#default_value' => $settings['client_secret'],
'#required' => TRUE,
'#states' => [
'visible' => [
':input[name="first_party_server"]' => ['value' => AesirxAnalyticsInterface::EXTERNAL],
],
'required' => [
':input[name="first_party_server"]' => ['value' => AesirxAnalyticsInterface::EXTERNAL],
],
],
'#element_validate' => [[get_class($this), 'validateInternalIsRequired']],
'#description' => $this->t(
"<p class= 'description'>
Register to AesirX and get your Client ID and Client Secret here: <a target='_blank' href='https://dapp.shield.aesirx.io/licenses'>https://dapp.shield.aesirx.io/licenses</a>.</p>"
),
];
$form['license'] = [
'#type' => 'textfield',
Expand All @@ -219,7 +239,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#element_validate' => [[get_class($this), 'validateInternalIsRequired']],
'#description' => $this->t(
"<p class= 'description'>
Register to AesirX and get your client id, client secret and license here: <a target='_blank' href='https://web3id.aesirx.io'>https://web3id.aesirx.io</a>.</p>"
Register to AesirX and get your license here: <a target='_blank' href='https://dapp.shield.aesirx.io/licenses'>https://dapp.shield.aesirx.io/licenses/</a>.</p>"
),
];

Expand Down