From 531174f8540420df3c81468793aff32768c7e782 Mon Sep 17 00:00:00 2001 From: "smarcet@gmail.com" Date: Mon, 7 Jul 2025 15:59:47 -0300 Subject: [PATCH 1/4] feat: individual membership foundation Signed-off-by: smarcet@gmail.com --- .../code/infrastructure/active_records/FoundationMember.php | 5 +++++ .../code/infrastructure/active_records/MemberDeleted.php | 2 +- .../code/infrastructure/active_records/OpenStackMember.php | 2 +- registration/code/model/IOpenStackMember.php | 2 ++ registration/code/model/MemberManager.php | 3 +++ start_local_server.sh | 1 + 6 files changed, 13 insertions(+), 2 deletions(-) diff --git a/elections/code/infrastructure/active_records/FoundationMember.php b/elections/code/infrastructure/active_records/FoundationMember.php index 121928391a..4500b8118f 100644 --- a/elections/code/infrastructure/active_records/FoundationMember.php +++ b/elections/code/infrastructure/active_records/FoundationMember.php @@ -130,6 +130,11 @@ public function isCommunityMember() return $group || $this->isSpeaker() || $is_foundation_member; } + public function isIndividualMember():bool + { + return $this->owner->MembershipType = IOpenStackMember::MembershipTypeIndividual; + } + /** * @return bool */ diff --git a/registration/code/infrastructure/active_records/MemberDeleted.php b/registration/code/infrastructure/active_records/MemberDeleted.php index 5d52fc4f38..e9d6ab5dac 100644 --- a/registration/code/infrastructure/active_records/MemberDeleted.php +++ b/registration/code/infrastructure/active_records/MemberDeleted.php @@ -19,6 +19,6 @@ class MemberDeleted extends DataObject 'Email' => 'Varchar(254)', 'OriginalID' => 'Int', 'FromUrl' => 'Text', - 'MembershipType' => "Enum('Foundation,Community,None', 'None')", + 'MembershipType' => "Enum('Foundation,Community,None,Individual', 'None')", ]; } \ No newline at end of file diff --git a/registration/code/infrastructure/active_records/OpenStackMember.php b/registration/code/infrastructure/active_records/OpenStackMember.php index 8c1a295c41..4caa51e97c 100644 --- a/registration/code/infrastructure/active_records/OpenStackMember.php +++ b/registration/code/infrastructure/active_records/OpenStackMember.php @@ -21,7 +21,7 @@ class OpenStackMember 'ThirdEmail' => 'Varchar(254)', // See RFC 5321, Section 4.5.3.1.3. (256 minus the < and > character) 'HasBeenEmailed' => 'Boolean', 'ShirtSize' => "Enum('Extra Small, Small, Medium, Large, XL, XXL')", - 'MembershipType' => "Enum('Foundation,Community,None', 'None')", + 'MembershipType' => "Enum('Foundation,Community,None,Individual', 'None')", 'StatementOfInterest' => 'Text', 'Bio' => 'HTMLText', 'FoodPreference' => 'Text', diff --git a/registration/code/model/IOpenStackMember.php b/registration/code/model/IOpenStackMember.php index 607dcddead..9a551304e9 100644 --- a/registration/code/model/IOpenStackMember.php +++ b/registration/code/model/IOpenStackMember.php @@ -21,6 +21,8 @@ interface IOpenStackMember const MembershipTypeCommunity = 'Community'; + const MembershipTypeIndividual = 'Individual'; + const MembershipTypeNone = 'None'; /** * @return string diff --git a/registration/code/model/MemberManager.php b/registration/code/model/MemberManager.php index ec38410070..feac87a6d0 100644 --- a/registration/code/model/MemberManager.php +++ b/registration/code/model/MemberManager.php @@ -235,6 +235,9 @@ public function registerByClaims($claims): Member if($member->isFoundationMember()){ $membershipType = IOpenStackMember::MembershipTypeFoundation; } + else if($member->isIndividualMember()){ + $membershipType = IOpenStackMember::MembershipTypeIndividual; + } else if($member->isCommunityMember()){ $membershipType = IOpenStackMember::MembershipTypeCommunity; } diff --git a/start_local_server.sh b/start_local_server.sh index 5c68cb472a..da11348caa 100755 --- a/start_local_server.sh +++ b/start_local_server.sh @@ -1,6 +1,7 @@ #!/bin/bash set -e export DOCKER_SCAN_SUGGEST=false +export BUILDX_NO_DEFAULT_ATTESTATIONS=0 docker compose run --rm app composer install docker compose run --rm app ./framework/sake installsake; docker compose run --rm app yarn install From 7c5f36a23b249b5b9ab1533ada970e6832423ebc Mon Sep 17 00:00:00 2001 From: smarcet Date: Mon, 7 Jul 2025 16:31:58 -0300 Subject: [PATCH 2/4] feat: change profile page --- docker-compose.yml | 6 ++--- .../active_records/FoundationMember.php | 3 +++ .../Layout/EditProfilePage_election.ss | 2 +- registration/code/ui/EditProfilePage.php | 5 +++++ .../templates/Layout/EditProfilePage.ss | 2 +- .../Layout/EditProfilePage_Training.ss | 2 +- .../EditProfilePage_TrainingAddCourse.ss | 2 +- .../Layout/EditProfilePage_agreements.ss | 2 +- ...tProfilePage_marketplace_administration.ss | 2 +- .../Layout/EditProfilePage_speaker.ss | 3 +-- .../Layout/Includes/CurrentUserInfoBox.ss | 22 ++++++++++++------- .../templates/Layout/Includes/ProfileNav.ss | 1 - 12 files changed, 32 insertions(+), 20 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 204dac7690..800e5cc2f6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -47,11 +47,11 @@ services: SERVICE_TAGS: dev SERVICE_NAME: mysql healthcheck: - test: mysql -u ${SS_DB_USERNAME} --password=${SS_DB_PASSWORD} ${SS_DATABASE} -e 'SHOW TABLES;' | [ $(wc -l) -gt 885 ] + test: mysql -u ${SS_DB_USERNAME} --password=${SS_DB_PASSWORD} ${SS_DATABASE} -e 'SHOW TABLES;' | [ $(wc -l) -gt 300 ] interval: 60s - timeout: 10s + timeout: 60s retries: 60 - start_period: 60s + start_period: 10s volumes: - ./docker-compose/mysql/model:/docker-entrypoint-initdb.d - /tmp/mysql/www-openstack/model:/var/lib/mysql diff --git a/elections/code/infrastructure/active_records/FoundationMember.php b/elections/code/infrastructure/active_records/FoundationMember.php index 4500b8118f..5dcbcff59a 100644 --- a/elections/code/infrastructure/active_records/FoundationMember.php +++ b/elections/code/infrastructure/active_records/FoundationMember.php @@ -24,6 +24,7 @@ final class FoundationMember ( 'ShowDupesOnProfile' => "Boolean", 'ResignDate' => 'SS_Datetime', + 'IndividualMemberJoinDate' => 'SS_Datetime', ); private static $has_many = array @@ -66,6 +67,7 @@ public function resign() } $this->owner->MembershipType = IOpenStackMember::MembershipTypeCommunity; $this->owner->ResignDate = CustomMySQLDatabase::nowRfc2822(); + $this->owner->IndividualMemberJoinDate = null; } public function onBeforeDelete() @@ -97,6 +99,7 @@ public function upgradeToFoundationMember() $legalAgreement->write(); $this->owner->MembershipType = IOpenStackMember::MembershipTypeFoundation; $this->owner->ResignDate = null; + $this->owner->IndividualMemberJoinDate = null; $this->owner->write(); return true; } diff --git a/elections/templates/Layout/EditProfilePage_election.ss b/elections/templates/Layout/EditProfilePage_election.ss index 92c406cc2b..74b8986e3d 100644 --- a/elections/templates/Layout/EditProfilePage_election.ss +++ b/elections/templates/Layout/EditProfilePage_election.ss @@ -3,7 +3,7 @@ <% require themedCSS(profile-section) %>

$Title

<% if CurrentMember.isFoundationMember %> - <% include CurrentUserInfoBox LogOutLink=$Top.LogoutUrl, ResignLink=$Top.ResignUrl %> + <% include CurrentUserInfoBox LogOutLink=$Top.LogoutUrl, ResignLink=$Top.ResignUrl, RenewLink=$Top.RenewMembershipUrl %> <% include ProfileNav %> diff --git a/registration/code/ui/EditProfilePage.php b/registration/code/ui/EditProfilePage.php index 916ab83138..9fbedc1460 100755 --- a/registration/code/ui/EditProfilePage.php +++ b/registration/code/ui/EditProfilePage.php @@ -550,6 +550,11 @@ public function ResignUrl() return $this->Link('resign'); } + public function RenewMembershipUrl() + { + return 'https://deploy-preview-669--openinfra-dev.netlify.app/a/renew-membership'; + } + public function downgrade2communitymember() { $CurrentMember = Member::currentUser(); diff --git a/registration/templates/Layout/EditProfilePage.ss b/registration/templates/Layout/EditProfilePage.ss index 3f852e27b8..1481cfe61f 100644 --- a/registration/templates/Layout/EditProfilePage.ss +++ b/registration/templates/Layout/EditProfilePage.ss @@ -34,7 +34,7 @@ $SetCurrentTab(1) <% end_if %> $getRenderUITopExtensions - <% include CurrentUserInfoBox LogOutLink=$Top.LogoutUrl, ResignLink=$Top.ResignUrl %> + <% include CurrentUserInfoBox LogOutLink=$Top.LogoutUrl, ResignLink=$Top.ResignUrl, RenewLink=$Top.RenewMembershipUrl %> <% include ProfileNav %>
See how your public profile appears.
$EditProfileForm diff --git a/registration/templates/Layout/EditProfilePage_Training.ss b/registration/templates/Layout/EditProfilePage_Training.ss index 03bebe5ba0..7df2d89ccd 100644 --- a/registration/templates/Layout/EditProfilePage_Training.ss +++ b/registration/templates/Layout/EditProfilePage_Training.ss @@ -3,7 +3,7 @@ <% require themedCSS(profile-section) %>

$Title

<% if CurrentMember %> - <% include CurrentUserInfoBox LogOutLink=$Top.LogoutUrl, ResignLink=$Top.ResignUrl %> + <% include CurrentUserInfoBox LogOutLink=$Top.LogoutUrl, ResignLink=$Top.ResignUrl, RenewLink=$Top.RenewMembershipUrl %> <% include ProfileNav %> <% if CurrentMember.isTrainingAdmin %>
diff --git a/registration/templates/Layout/EditProfilePage_TrainingAddCourse.ss b/registration/templates/Layout/EditProfilePage_TrainingAddCourse.ss index 0a22bda9dc..4fff66db9c 100644 --- a/registration/templates/Layout/EditProfilePage_TrainingAddCourse.ss +++ b/registration/templates/Layout/EditProfilePage_TrainingAddCourse.ss @@ -3,7 +3,7 @@ <% require themedCSS(profile-section) %>

$Title

<% if CurrentMember %> - <% include CurrentUserInfoBox LogOutLink=$Top.LogoutUrl, ResignLink=$Top.ResignUrl %> + <% include CurrentUserInfoBox LogOutLink=$Top.LogoutUrl, ResignLink=$Top.ResignUrl, RenewLink=$Top.RenewMembershipUrl %> <% include ProfileNav %> <% if CurrentMember.isTrainingAdmin %> $AddTrainingCourseForm diff --git a/registration/templates/Layout/EditProfilePage_agreements.ss b/registration/templates/Layout/EditProfilePage_agreements.ss index 8b4c468785..81409e743a 100644 --- a/registration/templates/Layout/EditProfilePage_agreements.ss +++ b/registration/templates/Layout/EditProfilePage_agreements.ss @@ -16,7 +16,7 @@ <% end_if %> - <% include CurrentUserInfoBox LogOutLink=$Top.LogoutUrl, ResignLink=$Top.ResignUrl %> + <% include CurrentUserInfoBox LogOutLink=$Top.LogoutUrl, ResignLink=$Top.ResignUrl, RenewLink=$Top.RenewMembershipUrl %> <% include ProfileNav %>
diff --git a/registration/templates/Layout/EditProfilePage_marketplace_administration.ss b/registration/templates/Layout/EditProfilePage_marketplace_administration.ss index d328cbaf1d..ea56d0dc07 100644 --- a/registration/templates/Layout/EditProfilePage_marketplace_administration.ss +++ b/registration/templates/Layout/EditProfilePage_marketplace_administration.ss @@ -3,7 +3,7 @@ <% require themedCSS(profile-section) %>

$Title

<% if CurrentMember %> - <% include CurrentUserInfoBox LogOutLink=$Top.LogoutUrl, ResignLink=$Top.ResignUrl %> + <% include CurrentUserInfoBox LogOutLink=$Top.LogoutUrl, ResignLink=$Top.ResignUrl, RenewLink=$Top.RenewMembershipUrl %> <% include ProfileNav %> <% if CurrentMember.isMarketPlaceAdmin %>
diff --git a/registration/templates/Layout/EditProfilePage_speaker.ss b/registration/templates/Layout/EditProfilePage_speaker.ss index 28edbc1558..2089dc7d15 100644 --- a/registration/templates/Layout/EditProfilePage_speaker.ss +++ b/registration/templates/Layout/EditProfilePage_speaker.ss @@ -7,12 +7,11 @@

$Title

<% if CurrentMember %> <% if Saved %> -

Your Profile has been saved!

<% end_if %> - <% include CurrentUserInfoBox LogOutLink=$Top.LogoutUrl, ResignLink=$Top.ResignUrl %> + <% include CurrentUserInfoBox LogOutLink=$Top.LogoutUrl, ResignLink=$Top.ResignUrl, RenewLink=$Top.RenewMembershipUrl %> <% include ProfileNav %> $EditSpeakerProfileForm <% else %> diff --git a/registration/templates/Layout/Includes/CurrentUserInfoBox.ss b/registration/templates/Layout/Includes/CurrentUserInfoBox.ss index 37de9a619b..439741058c 100644 --- a/registration/templates/Layout/Includes/CurrentUserInfoBox.ss +++ b/registration/templates/Layout/Includes/CurrentUserInfoBox.ss @@ -1,27 +1,33 @@
+
You are logged in as: $CurrentMember.Name
- Resign Membership - <% if $CurrentMember.isFoundationMember %> + <% if $CurrentMember.isFoundationMember || $CurrentMember.isCommunityMember %> + Renew Membership + <% end_if %> + <% if $CurrentMember.isIndividualMember %> Change to Community Member - <% else %> - Make me a Foundation Member <% end_if %> + Resign Membership
<% if $CurrentMember.isFoundationMember %>
- Current Member Level: Foundation Member + Current Member Level: Foundation Member (Renew your Membership)
<% else_if $CurrentMember.isSpeaker %> -
+
Current Member Level: Speaker
<% else_if $CurrentMember.isCommunityMember %> -
- Current Member Level: Community Member +
+ Current Member Level: Community Member (Renew your Membership) +
+ <% else_if $CurrentMember.isIndividualMember %> +
+ Current Member Level: OIF Individual Member
<% end_if %>
diff --git a/registration/templates/Layout/Includes/ProfileNav.ss b/registration/templates/Layout/Includes/ProfileNav.ss index d22c632ff9..ef989c0c44 100644 --- a/registration/templates/Layout/Includes/ProfileNav.ss +++ b/registration/templates/Layout/Includes/ProfileNav.ss @@ -1,7 +1,6 @@ $NavMessageExtensions

class="active"<% end_if %> >Your Details -class="active"<% end_if %> >Legal Agreements <% if CurrentMember.isTrainingAdmin %> class="active"<% end_if %> >Training <% end_if %> From fb88cebc73d8e6d46cd28639c28613fa4e332389 Mon Sep 17 00:00:00 2001 From: smarcet Date: Mon, 7 Jul 2025 17:06:26 -0300 Subject: [PATCH 3/4] fix: individual membership test --- .../infrastructure/active_records/FoundationMember.php | 2 +- .../templates/Layout/Includes/CurrentUserInfoBox.ss | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/elections/code/infrastructure/active_records/FoundationMember.php b/elections/code/infrastructure/active_records/FoundationMember.php index 5dcbcff59a..9f82f6b4e2 100644 --- a/elections/code/infrastructure/active_records/FoundationMember.php +++ b/elections/code/infrastructure/active_records/FoundationMember.php @@ -135,7 +135,7 @@ public function isCommunityMember() public function isIndividualMember():bool { - return $this->owner->MembershipType = IOpenStackMember::MembershipTypeIndividual; + return $this->owner->MembershipType == IOpenStackMember::MembershipTypeIndividual; } /** diff --git a/registration/templates/Layout/Includes/CurrentUserInfoBox.ss b/registration/templates/Layout/Includes/CurrentUserInfoBox.ss index 439741058c..9042f83280 100644 --- a/registration/templates/Layout/Includes/CurrentUserInfoBox.ss +++ b/registration/templates/Layout/Includes/CurrentUserInfoBox.ss @@ -3,7 +3,7 @@
You are logged in as: $CurrentMember.Name
- <% if $CurrentMember.isFoundationMember || $CurrentMember.isCommunityMember %> + <% if not $CurrentMember.isIndividualMember %> Renew Membership <% end_if %> <% if $CurrentMember.isIndividualMember %> @@ -13,7 +13,11 @@

- <% if $CurrentMember.isFoundationMember %> + <% if $CurrentMember.isIndividualMember %> +
+ Current Member Level: OIF Individual Member +
+ <% else_if $CurrentMember.isFoundationMember %>
Current Member Level: Foundation Member (Renew your Membership)
From 005f1b2cb0ab10dd2cc8374161d8efdb7e5cda3d Mon Sep 17 00:00:00 2001 From: "smarcet@gmail.com" Date: Mon, 7 Jul 2025 17:42:35 -0300 Subject: [PATCH 4/4] chore: change downgrade wording Signed-off-by: smarcet@gmail.com --- .../Layout/EditProfilePage_downgrade2communitymember.ss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registration/templates/Layout/EditProfilePage_downgrade2communitymember.ss b/registration/templates/Layout/EditProfilePage_downgrade2communitymember.ss index b217fe0558..00a3c5bad0 100644 --- a/registration/templates/Layout/EditProfilePage_downgrade2communitymember.ss +++ b/registration/templates/Layout/EditProfilePage_downgrade2communitymember.ss @@ -3,7 +3,7 @@

Downgrade To Community Member

<% if CurrentMember %> -

If you select this option, you will be revoking your right to vote in elections and to commit code to OpenStack via Gerrit. Additionally, any administrative rights to the Marketplace Admin or Company Admin will be revoked.

+

If you select this option, you will be revoking your right to vote and run in elections.

Yes, Agree   Cancel