This repository has been archived by the owner on Aug 21, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IR-3329: Added Visibility column in project table (#10722)
* feat: Add project visibility toggle functionality * feat: Add project visibility column to admin table * feat: Remove unnecessary verify-project-owner hook and replace with verify-project-permission * refactor: Update project-permission.hooks.ts to set project id in query * Fixed order * refactor: Set project ID in query for project-permission.hooks.ts * Fixed string enum * chore: Update ProjectTable component and ProjectService * Removed ProjectVisibility enum --------- Co-authored-by: hanzlamateen <[email protected]> Co-authored-by: Josh Field <[email protected]>
- Loading branch information
1 parent
9b7a105
commit ed90277
Showing
11 changed files
with
141 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
packages/server-core/src/projects/project/migrations/20240724071204_visibility_column.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
CPAL-1.0 License | ||
The contents of this file are subject to the Common Public Attribution License | ||
Version 1.0. (the "License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE. | ||
The License is based on the Mozilla Public License Version 1.1, but Sections 14 | ||
and 15 have been added to cover use of software over a computer network and | ||
provide for limited attribution for the Original Developer. In addition, | ||
Exhibit A has been modified to be consistent with Exhibit B. | ||
Software distributed under the License is distributed on an "AS IS" basis, | ||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the | ||
specific language governing rights and limitations under the License. | ||
The Original Code is Ethereal Engine. | ||
The Original Developer is the Initial Developer. The Initial Developer of the | ||
Original Code is the Ethereal Engine team. | ||
All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023 | ||
Ethereal Engine. All Rights Reserved. | ||
*/ | ||
|
||
import type { Knex } from 'knex' | ||
|
||
import { projectPath } from '@etherealengine/common/src/schema.type.module' | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
export async function up(knex: Knex): Promise<void> { | ||
const visibilityColumnExists = await knex.schema.hasColumn(projectPath, 'visibility') | ||
if (!visibilityColumnExists) { | ||
await knex.schema.alterTable(projectPath, async (table) => { | ||
table.string('visibility', 255).defaultTo('private') | ||
}) | ||
} | ||
} | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
export async function down(knex: Knex): Promise<void> { | ||
const visibilityColumnExists = await knex.schema.hasColumn(projectPath, 'visibility') | ||
|
||
if (visibilityColumnExists) { | ||
await knex.schema.alterTable(projectPath, async (table) => { | ||
table.dropColumn('visibility') | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters