Fixing issue that refactoring file caused (some strings renamed to ts rather than js).
This commit is contained in:
parent
67d9495481
commit
429a89159c
|
@ -15,7 +15,7 @@ A package that handles all common components across the Budibase organisation. Y
|
|||
1. Create a file: `Headline.svelte`
|
||||
2. Create a Svench file: `Headline.svench`
|
||||
3. Build component and add variants to the Svench file.
|
||||
4. Once done, re-export the file in `src/index.ts`.
|
||||
4. Once done, re-export the file in `src/index.js`.
|
||||
5. Publish, update the package in the main project and profit.
|
||||
|
||||
## Guidelines
|
||||
|
|
|
@ -6,7 +6,7 @@ import { terser } from "rollup-plugin-terser"
|
|||
import postcss from "rollup-plugin-postcss"
|
||||
|
||||
export default {
|
||||
input: "src/index.ts",
|
||||
input: "src/index.js",
|
||||
output: {
|
||||
sourcemap: true,
|
||||
format: "esm",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference types="cypress" />
|
||||
// ***********************************************************
|
||||
// This example plugins/index.ts can be used to load plugins
|
||||
// This example plugins/index.js can be used to load plugins
|
||||
//
|
||||
// You can change the location of this file or turn off loading
|
||||
// the plugins file with the 'pluginsFile' configuration option.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// ***********************************************************
|
||||
// This example support/index.ts is processed and
|
||||
// This example support/index.js is processed and
|
||||
// loaded automatically before your test files.
|
||||
//
|
||||
// This is a great place to put global configuration and
|
||||
|
|
|
@ -8,7 +8,7 @@ their settings, and know how to correctly interact with them.
|
|||
|
||||
### Component Definitions
|
||||
|
||||
The object key is the name of the component, as exported by `index.ts`.
|
||||
The object key is the name of the component, as exported by `index.js`.
|
||||
|
||||
- **name** - the name displayed in the builder
|
||||
- **description** - not currently used
|
||||
|
|
|
@ -19,7 +19,7 @@ const ignoredWarnings = [
|
|||
]
|
||||
|
||||
export default {
|
||||
input: "src/index.ts",
|
||||
input: "src/index.js",
|
||||
output: [
|
||||
{
|
||||
sourcemap: false,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script>
|
||||
import { Layout, Select, Body } from "@budibase/bbui"
|
||||
import { componentStore } from "stores/index.ts"
|
||||
import { componentStore } from "stores/index.js"
|
||||
import DevToolsStat from "./DevToolsStat.svelte"
|
||||
|
||||
const ReadableBindingMap = {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script>
|
||||
import { Layout, Toggle } from "@budibase/bbui"
|
||||
import DevToolsStat from "./DevToolsStat.svelte"
|
||||
import { componentStore } from "stores/index.ts"
|
||||
import { componentStore } from "stores/index.js"
|
||||
import { getSettingsDefinition } from "utils/componentProps.js"
|
||||
|
||||
let showEnrichedSettings = true
|
||||
|
|
|
@ -2,6 +2,9 @@ import { outputProcessing } from "../../utilities/rowProcessor"
|
|||
import { InternalTables } from "../../db/utils"
|
||||
import { getFullUser } from "../../utilities/users"
|
||||
import { roles, context } from "@budibase/backend-core"
|
||||
import { groups } from "@budibase/pro"
|
||||
|
||||
const PUBLIC_ROLE = roles.BUILTIN_ROLE_IDS.PUBLIC
|
||||
|
||||
/**
|
||||
* Add the attributes that are session based to the current user.
|
||||
|
@ -26,8 +29,14 @@ export async function fetchSelf(ctx: any) {
|
|||
// forward the csrf token from the session
|
||||
user.csrfToken = ctx.user.csrfToken
|
||||
|
||||
if (context.getAppId()) {
|
||||
const appId = context.getAppId()
|
||||
if (appId) {
|
||||
const db = context.getAppDB()
|
||||
// check for group permissions
|
||||
if (!user.roleId || user.roleId === PUBLIC_ROLE) {
|
||||
const groupRoleId = await groups.getGroupRoleId(user, appId)
|
||||
user.roleId = groupRoleId || user.roleId
|
||||
}
|
||||
// remove the full roles structure
|
||||
delete user.roles
|
||||
try {
|
||||
|
@ -43,7 +52,7 @@ export async function fetchSelf(ctx: any) {
|
|||
} catch (err: any) {
|
||||
let response
|
||||
// user didn't exist in app, don't pretend they do
|
||||
if (user.roleId === roles.BUILTIN_ROLE_IDS.PUBLIC) {
|
||||
if (user.roleId === PUBLIC_ROLE) {
|
||||
response = {}
|
||||
}
|
||||
// user has a role of some sort, return them
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module.exports = {
|
||||
apps: [
|
||||
{
|
||||
script: "./dist/index.ts",
|
||||
script: "./dist/index.js",
|
||||
instances: "max",
|
||||
exec_mode: "cluster",
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue