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

🧹 Rooms: Get rid of locked/unlocked/internal Rooms in favor of public/internal #1183

Merged
merged 2 commits into from
Mar 4, 2023

Conversation

zspencer
Copy link
Member

@zspencer zspencer commented Mar 4, 2023

It's not really serving us, and is a hold-over from when Convene was
more video-forward.

Instead, we may want to create a Furniture that can "bounce" people
from a Room unless they know the secret code / are Members of the
Space or in an appropriate Group.

@zspencer zspencer marked this pull request as draft March 4, 2023 00:41
@zspencer zspencer force-pushed the rooms/delete-wating-rooms branch from d3f6248 to 7d4613f Compare March 4, 2023 00:46
@zspencer zspencer added the 🧹 refactor Includes non-behavioral changes label Mar 4, 2023
@zspencer zspencer force-pushed the rooms/delete-wating-rooms branch 3 times, most recently from f3ee93c to 96492d2 Compare March 4, 2023 00:55
@zspencer zspencer marked this pull request as ready for review March 4, 2023 00:58
@zspencer zspencer requested review from anaulin, KellyAH and a team March 4, 2023 00:59
@zspencer zspencer force-pushed the rooms/delete-wating-rooms branch from 96492d2 to 5d49843 Compare March 4, 2023 01:00
- #1155
- #1151

It's not really serving us, and is a hold-over from when Convene was
more video-forward.

Instead, we may want to create a `Furniture` that can "bounce" people
from a `Room` unless they know the secret code / are `Member`s of the
`Space` or in an appropriate `Group`.
@zspencer zspencer force-pushed the rooms/delete-wating-rooms branch from 5d49843 to c819266 Compare March 4, 2023 01:02
Copy link
Member

@anaulin anaulin left a comment

Choose a reason for hiding this comment

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

Yay, great simplification!

access_level&.to_sym == :unlocked
end
# `internal` only Members may access the Room
attribute :access_level, :string, default: :public
Copy link
Member

Choose a reason for hiding this comment

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

Not from this PR, and not blocking, but I'm surprised this is not an enum. It would save us from defining the internal? and public? methods, and also help make sure we don't accidentally set it to something that is not in the enum (like, say, during a refactor...).

enum :access_level, {
  internal: "internal",
  public: "public"
}, default: :public

Then our one use of Room::ACCESS_LEVELS.map(&:to_s) becomes instead Room.access_levels.values.

Copy link
Member Author

Choose a reason for hiding this comment

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

I considered piling that into this PR, but dissuaded myself because of the weirdness I ran into with the ENUMs on Heroku last time.

@@ -55,16 +42,14 @@
it "includes all the rooms" do
space = create(:space)
internal_room = create(:room, :internal, space: space)
locked_room = create(:room, :locked, space: space)
unlocked_room = create(:room, :unlocked, space: space)
public_rom = create(:room, :public, space: space)
Copy link
Member

Choose a reason for hiding this comment

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

public_roOm, here and on line 52

@@ -101,38 +101,27 @@ def space_attributes
{
name: "Listed Room 1",
publicity_level: :listed,
access_level: :unlocked,
access_code: nil,
access_level: :public,
furniture_placements: {
markdown_text_block: {content: "# Welcome!"}
}
},
{
name: "Listed Room 2",
Copy link
Member

Choose a reason for hiding this comment

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

Should we rename all of these to "Public", instead of "Listed"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oo, I remember why I didn't!!! If I had, it would have broken feature tests which have those names hardcoded... And technically they are listed they're just also public, since listed indicates whether or not they are enumerated in the navigation menu.

@zspencer zspencer merged commit 36705bf into main Mar 4, 2023
@zspencer zspencer deleted the rooms/delete-wating-rooms branch March 4, 2023 22:47
@zspencer zspencer added this to the 1.0 - Andromeda milestone May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧹 refactor Includes non-behavioral changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants