-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Hide power role for v3 apps #14813
Merged
Merged
Hide power role for v3 apps #14813
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8b9bb78
Initial appMetadata sdk usage
adrinr ab517bf
Persist created version
adrinr 8cdc5be
Store proper version even on local
adrinr 15bb730
Remove power role for apps created at >= 3.0.0
adrinr 1155be4
Fix
adrinr 8008d2c
Fix all references
adrinr 7bb69d7
Add tests
adrinr c1128ff
Fix test
adrinr 32b9d22
Merge branch 'master' into budi-8755-hide-power-role-for-v3-apps
adrinr ca974cf
Renames
adrinr 4c688b9
Add more tests
adrinr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { context, DocumentType } from "@budibase/backend-core" | ||
import { App } from "@budibase/types" | ||
|
||
/** | ||
* @deprecated the plan is to get everything using `tryGet` instead, then rename | ||
* `tryGet` to `get`. | ||
*/ | ||
export async function get() { | ||
const db = context.getAppDB() | ||
const application = await db.get<App>(DocumentType.APP_METADATA) | ||
return application | ||
} | ||
|
||
export async function tryGet() { | ||
const db = context.getAppDB() | ||
const application = await db.tryGet<App>(DocumentType.APP_METADATA) | ||
return application | ||
} |
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be tempted to actually put this on the root
Document
type and call it_creationVersion
, anticipating that we will likely introduce this idea onto other documents going forward.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, then in
DatabaseImpl.post
we know when a doc is new because it has no ID, we could slap_creationVersion
onto it there. Though it is a wide-reaching change that likely has risk.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure about this - I don't think we need this on every document, since every DB will have an
app_metadata
(it won't load without this/is corrupt) - in theory noting it here is enough since its a static document that is always easy to retrieve.