Skip to content

Commit

Permalink
Updated publisher id verify api and activity complete status
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanilblank committed Sep 26, 2024
1 parent 5d4036c commit 0b867a4
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 21 deletions.
8 changes: 8 additions & 0 deletions app/Constants/Enums.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,12 @@ abstract class Enums
public const MERGED_XML_BASE_PATH = 'xml/mergedActivityXml';

public const ORG_XML_BASE_PATH = 'organizationXmlFiles';

public const TOKEN_PENDING = 'Pending';

public const TOKEN_CORRECT = 'Correct';

public const TOKEN_INCORRECT = 'Incorrect';

public const EXISTING_ORG = 'existing_org';
}
7 changes: 4 additions & 3 deletions app/Http/Controllers/Admin/Setting/SettingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Http\Controllers\Admin\Setting;

use App\Constants\Enums;
use App\Exceptions\PublisherIdChangeByIatiAdminException;
use App\Http\Controllers\Controller;
use App\Http\Requests\Setting\DefaultFormRequest;
Expand Down Expand Up @@ -340,15 +341,15 @@ public function getSettingStatus(): JsonResponse
private function getTokenStatusAndMessage(array $verifyPublisherInfo, array $verifyApiInfo): array
{
$message = 'API token incorrect. Please enter valid API token.';
$tokenStatus = 'Incorrect';
$tokenStatus = Enums::TOKEN_INCORRECT;

if ($verifyPublisherInfo['success'] && $verifyPublisherInfo['validation']) {
if ($verifyApiInfo['success'] && $verifyApiInfo['validation']) {
$message = 'API token verified successfully.';
$tokenStatus = 'Correct';
$tokenStatus = Enums::TOKEN_CORRECT;
} elseif ($verifyPublisherInfo['state'] === 'approval_needed') {
$message = 'Your account is pending approval by the IATI team - someone should be in touch within two working days.';
$tokenStatus = 'Pending';
$tokenStatus = Enums::TOKEN_PENDING;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\IATI\Services\Organization;

use App\Constants\Enums;
use App\IATI\Models\Organization\Organization;
use App\IATI\Models\Organization\OrganizationOnboarding;
use App\IATI\Repositories\Organization\OrganizationOnboardingRepository;
Expand Down Expand Up @@ -86,7 +87,7 @@ public function getOrganizationOnboardingStepsStatus($organization): array
$array[] = [
'step' => 4,
'title' => OrganizationOnboarding::ACTIVITY,
'complete' => false,
'complete' => $organization->registration_type === Enums::EXISTING_ORG,
];

return $array;
Expand All @@ -109,7 +110,7 @@ public function checkPublishingSettingsComplete($publishingInfo): bool
Arr::get($publishingInfo, 'api_token') &&
Arr::get($publishingInfo, 'publisher_verification', false) &&
Arr::get($publishingInfo, 'token_verification', false) &&
Arr::get($publishingInfo, 'token_status') === 'Correct';
in_array(Arr::get($publishingInfo, 'token_status'), [Enums::TOKEN_CORRECT, Enums::TOKEN_PENDING], true);
}

/**
Expand Down
32 changes: 16 additions & 16 deletions resources/assets/sass/component/_input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -256,41 +256,41 @@ label {
}

select.select2.default-value-indicator
+ .select2
.selection
.select2-selection:not(:focus) {
+ .select2
.selection
.select2-selection:not(:focus) {
border: 2px solid #3f9a7c;
background-color: #3f9a7c15;
}

select.select2.default-value-indicator
+ .select2
.selection
.select2-selection:not(:focus) {
+ .select2
.selection
.select2-selection:not(:focus) {
border: 2px solid #3f9a7c;
background-color: #3f9a7c15;
}

select.select2.default-value-indicator
+ .select2
.selection
.select2-selection
.select2-selection__placeholder {
+ .select2
.selection
.select2-selection
.select2-selection__placeholder {
color: var(--bluecoral-50);
}

select.select2.default-value-indicator
+ .select2.select2-container--open
.selection
.select2-selection {
+ .select2.select2-container--open
.selection
.select2-selection {
border: 1px solid #a6b5ba;
background-color: transparent;
}

select.select2.default-value-indicator
+ .select2
.selection
.select2-selection.select2-selection--clearable {
+ .select2
.selection
.select2-selection.select2-selection--clearable {
border: 1px solid #a6b5ba;
background-color: transparent;
}
Expand Down

0 comments on commit 0b867a4

Please sign in to comment.