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

🥔✨ Space: Display domain on Space#edit #1600

Merged
merged 6 commits into from
Jun 29, 2023
Merged

Conversation

KellyAH
Copy link
Contributor

@KellyAH KellyAH commented Jun 25, 2023

TODO

  • display the branded domain for a Space on the configuration screen (if there is a branded domain).
  • unit test when space.branded_domain=nil (redirect issue prevents us from creating unit test for when domain is set 🥔✨ Space: Member may set Domain #1595)

Domain exists
domain exists

Domain is nil
nil domain

@KellyAH KellyAH self-assigned this Jun 25, 2023
@KellyAH KellyAH mentioned this pull request Jun 25, 2023
3 tasks
Copy link
Member

@zspencer zspencer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! to test this you will probably want to add an expectation to the SpacesController#show tests in spec/requests/spaces_controller_request_spec

or

You could make a Space::WebsiteSettingsComponent which would be testable outside the request/response cycle (and therefore slightly easier)

@@ -4,6 +4,13 @@
<p class="text-sm italic"><%= t('website_settings.help_text') %></p>
</header>

<h4 class="text-base"> Domain </h4>
<% if space.branded_domain.present? %>
<p class="text-sm"><%= space.branded_domain %></p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could put the if inside the p to reduce divergence between the branches. Also, space.branded_domain.presence || "No Domain" will evaluate to "No Domain" when space.branded_domain is nil or #empty? and the value held in space.branded_domain otherwise.

Which means you could do this!

<p class="text-sm"><%= space.branded_domain.presence || "No Domain"%></p>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed c5b6ce0

@zspencer zspencer changed the title Space config displays branded domain Space config displays branded domain Jun 26, 2023
@KellyAH
Copy link
Contributor Author

KellyAH commented Jun 26, 2023

gah I still need to add 1 test. I'll do it tomorrow Tues/Wed (hands hurt form lotta typing and RSI and my local PG is messed up). it's getting late and #1602 ate the rest of my 🧠 ⚡ .

@KellyAH KellyAH marked this pull request as ready for review June 29, 2023 01:16
<% if space.branded_domain.present? %>
<p class="text-sm"><%= space.branded_domain.presence || "No Domain" %></p>
<% else %>
<p class="text-sm"> No domain </p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the if/else anymore?

@KellyAH KellyAH merged commit 76418be into main Jun 29, 2023
@KellyAH KellyAH deleted the 1513-only-show-spaces-domain branch June 29, 2023 01:26
@zspencer zspencer changed the title Space config displays branded domain Space: Display domain on Space#edit Jul 11, 2023
@zspencer zspencer changed the title Space: Display domain on Space#edit 🥔✨ Space: Display domain on Space#edit Jul 11, 2023
@zspencer zspencer added ✨ feature Reduces Client's Burden or Grants them Benefits 🥔 Satisfices It's good enough to use, but not particularly great labels Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature Reduces Client's Burden or Grants them Benefits 🥔 Satisfices It's good enough to use, but not particularly great
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants