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

Project Configurable Env Settings #5409

Merged
merged 28 commits into from
Mar 14, 2022
Merged

Project Configurable Env Settings #5409

merged 28 commits into from
Mar 14, 2022

Conversation

zulqarnainhanif
Copy link
Contributor

@zulqarnainhanif zulqarnainhanif commented Mar 4, 2022

Summary

Add project settings seeded from xrengine.config.ts of each project and allow updating from Admin Panel Settings

This PR will add a column to Project Table named settings which can store and array of objects ({key: "", value: ""}). The key is the name of the setting and value can consist of any any string value you want stored against it.
The Admin Panel will have a Project Tab in /settings route now which will show settings config loaded from xrengine.config.ts , which then can be updated and stored in the database against each project.
By default the Settings column of Project Table will be hidden from project service but can be accessed through project-settings service like its used in the admin panel routes. Only admins currently have access to these api but later scopes can be used to allow fetching them according to the scehma available with each project.

Checklist

  • Pre-push checks pass npm run check
    • Linter passing via npm run lint
    • Unit & Integration tests passing via npm run test:packages
    • Docker build process passing via npm run build-client
  • If this PR is still a WIP, convert to a draft
  • When this PR is ready, mark it as "Ready for review"
  • Changes have been manually QA'd
  • Changes reviewed by at least 2 approved reviewers

References

#5183

QA Steps

  1. git checkout pr_branch_name
  2. npm install
  3. npm run dev-reinit
  4. npm run dev

List any additional steps required to QA the changes of this PR, as well as any supplemental images or videos.

Reviewers

Reviewers for this PR

@zulqarnainhanif zulqarnainhanif marked this pull request as ready for review March 10, 2022 17:42
@HexaField HexaField requested review from speigg and barankyle and removed request for speigg March 12, 2022 22:43
Copy link
Member

@speigg speigg left a comment

Choose a reason for hiding this comment

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

Looks great, nice job!

}

export const state = createState({
projectSetting: [] as Array<ProjectSettingValue>
Copy link
Member

Choose a reason for hiding this comment

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

this state can just be an array, e.g.,

createState([] as Array<ProjectSettingValue>)

export interface ProjectSettingSchema {
key: string
type: string
scopes: Array<string>
Copy link
Member

@speigg speigg Mar 14, 2022

Choose a reason for hiding this comment

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

type/scopes properties not being used anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this will be used when we start adding code to check whether a person has access to any project setting or not

@zulqarnainhanif zulqarnainhanif merged commit cda1a04 into dev Mar 14, 2022
@zulqarnainhanif zulqarnainhanif deleted the ProjectConfigurableEnv branch March 14, 2022 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants