Skip to content

Commit

Permalink
Remove row/columns
Browse files Browse the repository at this point in the history
  • Loading branch information
colinhowe committed Apr 26, 2022
1 parent cff01f3 commit 581adaa
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 84 deletions.
23 changes: 0 additions & 23 deletions functions/src/venue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ interface VenueData2Payload {

showGrid?: boolean;

columns: number;

template?: string;

parentId?: string;
Expand Down Expand Up @@ -157,7 +155,6 @@ interface CreateVenueData2 {

showGrid: boolean;

columns?: number;
isHidden: boolean;
boothsEnabled: boolean;
maxBooths: number;
Expand All @@ -182,7 +179,6 @@ const createVenueData_v2 = (data: VenueData2Payload, context: Object) => {
// @ts-ignore
owners: [context.auth.token.user_id],
showGrid: data.showGrid || false,
...(data.showGrid && { columns: data.columns }),
template: data.template || VenueTemplate.partymap,
rooms: [],
createdAt: Date.now(),
Expand Down Expand Up @@ -240,7 +236,6 @@ interface Venue {
start_utc_seconds?: number;
end_utc_seconds?: number;
showGrid?: boolean;
columns?: number;
showRadio?: boolean;
radioStations: string[];
entrance?: string;
Expand All @@ -258,8 +253,6 @@ interface Venue {
updatedAt: number;
zoomUrl?: string;
iframeUrl?: string;
auditoriumColumns?: number;
auditoriumRows?: number;
showRangers?: boolean;
isReactionsMuted?: boolean;
boothsEnabled?: boolean;
Expand Down Expand Up @@ -687,9 +680,6 @@ export const updateVenue_v2 = functions.https.onCall(async (data, context) => {
// @debt aside from the data.columns part, this is exactly the same as in updateVenue
if (typeof data.showGrid === "boolean") {
updated.showGrid = data.showGrid;

// @debt the logic here differs from updateVenue, as data.columns is always set when present there
updated.columns = data.columns;
}

// @debt aside from the data.radioStations part, this is exactly the same as in updateVenue
Expand Down Expand Up @@ -829,14 +819,6 @@ export const updateVenueNG = functions.https.onCall(async (data, context) => {
updated.roomVisibility = data.roomVisibility;
}

if (data.auditoriumColumns) {
updated.auditoriumColumns = data.auditoriumColumns;
}

if (data.auditoriumRows) {
updated.auditoriumRows = data.auditoriumRows;
}

if (typeof data.showRangers === "boolean") {
updated.showRangers = data.showRangers;
}
Expand Down Expand Up @@ -896,10 +878,6 @@ export const updateVenueNG = functions.https.onCall(async (data, context) => {
updated.showGrid = data.showGrid;
}

if (typeof data.columns === "number") {
updated.columns = data.columns;
}

if (typeof data.showRadio === "boolean") {
updated.showRadio = data.showRadio;
}
Expand Down Expand Up @@ -1300,7 +1278,6 @@ export const createBooth = functions.https.onCall(async (data, context) => {
subtitle: templateSpace.config.landingPageConfig.subtitle,
description: templateSpace.config.landingPageConfig.description,
logoImageUrl: templateSpace.host.icon,
columns: 0,
template: "meetingroom",
parentId: options.parentSpaceId,
worldId: templateSpace.worldId,
Expand Down
1 change: 0 additions & 1 deletion src/api/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ type RoomImageUrls = Partial<Record<RoomImageUrlKeys, string>>;

// @debt remove this old interface, most/all of these fields were moved to the world
interface VenueAdvancedConfig {
columns?: number;
radioStations?: string | string[]; // single string on form, array in DB
roomVisibility?: RoomVisibility;
showGrid?: boolean;
Expand Down
35 changes: 0 additions & 35 deletions src/components/admin/SpaceEditForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ const HANDLED_ERRORS = [
"mapBackgroundImage",
"iframeUrl",
"zoomUrl",
"auditoriumColumns",
"auditoriumRows",
"columns",
];

export interface SpaceEditFormProps {
Expand All @@ -101,7 +98,6 @@ export const SpaceEditForm: React.FC<SpaceEditFormProps> = ({
showGrid: space.showGrid ?? false,
showReactions: space.showReactions ?? DEFAULT_SHOW_REACTIONS,
showShoutouts: space.showShoutouts ?? DEFAULT_SHOW_SHOUTOUTS,
columns: space.columns ?? 0,
autoPlay: space.autoPlay ?? DEFAULT_VENUE_AUTOPLAY,
isReactionsMuted: space.isReactionsMuted ?? DEFAULT_REACTIONS_MUTED,
// @debt should use SpaceId type here, resolve error with form typing
Expand All @@ -128,7 +124,6 @@ export const SpaceEditForm: React.FC<SpaceEditFormProps> = ({
space.showGrid,
space.showReactions,
space.showShoutouts,
space.columns,
space.autoPlay,
space.isReactionsMuted,
space.parentId,
Expand Down Expand Up @@ -492,36 +487,6 @@ export const SpaceEditForm: React.FC<SpaceEditFormProps> = ({
}
</TesterRestricted>

{!DISABLED_DUE_TO_1253 &&
HAS_GRID_TEMPLATES.includes(space.template as VenueTemplate) &&
values.showGrid && (
<>
<div className="input-container">
<h4 className="italic input-header">Number of columns</h4>
<input
defaultValue={1}
type="number"
{...register("columns")}
className="align-left"
placeholder={`Number of grid columns`}
/>
{errors?.columns ? (
<span className="input-error">
{errors?.columns.message}
</span>
) : null}
</div>
<div className="input-container">
<h4 className="italic input-header">Number of rows</h4>
<div>
Not editable. The number of rows is derived from the number
of specified columns and the width:height ratio of the party
map, to keep the two aligned.
</div>
</div>
</>
)}

<div className="mb-10"></div>

{space.template === VenueTemplate.auditorium && (
Expand Down
15 changes: 0 additions & 15 deletions src/forms/spaceEditSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,6 @@ export const spaceEditSchema = Yup.object().shape({
(template: VenueTemplate, schema: Yup.StringSchema) =>
IFRAME_TEMPLATES.includes(template) ? validUrlSchema : schema
),
// @debt de-dupe this
auditoriumColumns: Yup.number().when(
"$template",
(template: VenueTemplate, schema: Yup.StringSchema) =>
template === VenueTemplate.auditorium
? schema.required()
: schema.notRequired()
),
auditoriumRows: Yup.number().when(
"$template",
(template: VenueTemplate, schema: Yup.StringSchema) =>
template === VenueTemplate.auditorium
? schema.required()
: schema.notRequired()
),
template: Yup.mixed<VenueTemplate>().oneOf(Object.values(VenueTemplate)),
boothsEnabled: Yup.boolean().when(
"$template",
Expand Down
6 changes: 0 additions & 6 deletions src/settings/disableSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@

// Please add proper description and links as references

/**
*
* @see https://github.com/sparkletown/internal-sparkle-issues/issues/1253
*/
export const DISABLED_DUE_TO_1253 = true;

/**
* Since navbar has one, disables a redundant "Log in" button
* @see https://github.com/sparkletown/internal-sparkle-issues/issues/1324
Expand Down
2 changes: 0 additions & 2 deletions src/settings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ export const MARKDOWN_LINK_TAGS = ["a"];
export const MARKDOWN_LIST_TAGS = ["ol", "ul", "li"];
export const MARKDOWN_PRE_CODE_TAGS = ["pre", "code"];

export const DEFAULT_TABLE_ROWS = 2;
export const DEFAULT_TABLE_COLUMNS = 3;
export const ALLOWED_EMPTY_TABLES_NUMBER = 4;
export const DEFAULT_JAZZBAR_TABLES_NUMBER = 12;
export const DEFAULT_CONVERSATION_SPACE_TABLES_NUMBER = 10;
Expand Down
2 changes: 0 additions & 2 deletions src/types/venues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ export interface BaseVenue {
radioTitle?: string;
banner?: Banner;
samlAuthProviderId?: string;
columns?: number;
rows?: number;
showGrid?: boolean;
roomVisibility?: RoomVisibility;
rooms?: Room[];
Expand Down

0 comments on commit 581adaa

Please sign in to comment.