Feat: Workspace Templates#4869
Open
17ColinMiPerry wants to merge 9 commits intoMintplex-Labs:masterfrom
Open
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Type
Relevant Issues
resolves #4769
What is in this change?
Basic workspace templates were implemented. Templates can either be made by copying settings from an existing workspace, or an empty template can be made and edited from the WorkspaceTemplate general settings page. When users create a new workspace, they will be given the option to select either a template they have made in the past, or default. Any unedited template settings will use system defaults.
Frontend Changes
frontend/src/components/Modals/NewWorkspace.jsx- include the dropdown to allow users to select from their saved templates.frontend/src/components/SettingsSidebar/index.jsx- include the workspace setting in the sidebarfrontend/src/main.jsx- added the new route to the workspace template settings pagefrontend/src/models/workspaceTemplate.js- created the frontend workspace template modelfrontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplatePreviewModal/CustomSelect/index.jsx- this was necessary to allow for a dropdown in the right style with the AnythingLLM vertical scrollbarfrontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplatePreviewModal/ModelSelect/index.jsx- the specific dropdown logic for model selectionfrontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplatePreviewModal/ProviderSelect/index.jsx- the specific dropdown logic for providersfrontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplatePreviewModal/index.jsx- the template preview modal for displaying and editing template datafrontend/src/pages/GeneralSettings/WorkspaceTemplates/TemplateRow/index.jsx- this is the subcomponent for rows in the workspace template settings page tablefrontend/src/pages/GeneralSettings/WorkspaceTemplates/index.jsx- this is the general settings page for workspace templatesfrontend/src/pages/WorkspaceSettings/AgentConfig/AgentLLMSelection/index.jsx- exported theENABLED_PROVIDERSto be used in the template provider dropdownfrontend/src/pages/WorkspaceSettings/GeneralAppearance/SaveAsTemplate/index.jsx- created the SaveAsTemplate componentfrontend/src/pages/WorkspaceSettings/GeneralAppearance/index.jsx- implemented the SaveAsTemplate component into the workspace settings pagefrontend/src/utils/paths.js- registered the workspae template pathServer Changes
server/endpoints/workspaceTemplates.js- defined the workspace template endpointsserver/endpoints/workspaces.js- updated workspace endpoints to allow for creation from templateserver/index.js- registered the workspace template endpointsserver/models/workspace.js- updated workspace backend modelsserver/models/workspaceTemplate.js- created workspace template backend modelPrisma Schema Change
A table was added to the DB (which stores workspace template information). This change necessitates a migration for template features to work.
Additional Information
Additional Notes
This change does not implement including embedded files in templates. This change does not allow for overwriting existing workspaces with a template. Most strings are hardcoded in English.
Developer Validations
yarn lintfrom the root of the repo & committed changes