diff --git a/app/Constants/Enums.php b/app/Constants/Enums.php index a2794cf5f..fb7494b69 100644 --- a/app/Constants/Enums.php +++ b/app/Constants/Enums.php @@ -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'; } diff --git a/app/Http/Controllers/Admin/Setting/SettingController.php b/app/Http/Controllers/Admin/Setting/SettingController.php index 5e9a8b94e..104a8c07b 100644 --- a/app/Http/Controllers/Admin/Setting/SettingController.php +++ b/app/Http/Controllers/Admin/Setting/SettingController.php @@ -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; @@ -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; } } diff --git a/app/IATI/Services/Organization/OrganizationOnboardingService.php b/app/IATI/Services/Organization/OrganizationOnboardingService.php index 8992ecc2d..71c8e3f68 100644 --- a/app/IATI/Services/Organization/OrganizationOnboardingService.php +++ b/app/IATI/Services/Organization/OrganizationOnboardingService.php @@ -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; @@ -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; @@ -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); } /** diff --git a/resources/assets/sass/component/_input.scss b/resources/assets/sass/component/_input.scss index e2c936663..0eef68c73 100644 --- a/resources/assets/sass/component/_input.scss +++ b/resources/assets/sass/component/_input.scss @@ -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; }