Fixing issue that refactoring file caused (some strings renamed to ts rather than js).

This commit is contained in:
mike12345567 2022-09-22 15:18:10 +01:00
parent a461c25cef
commit 7a732b8155
10 changed files with 20 additions and 11 deletions

View File

@ -15,7 +15,7 @@ A package that handles all common components across the Budibase organisation. Y
1. Create a file: `Headline.svelte` 1. Create a file: `Headline.svelte`
2. Create a Svench file: `Headline.svench` 2. Create a Svench file: `Headline.svench`
3. Build component and add variants to the Svench file. 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. 5. Publish, update the package in the main project and profit.
## Guidelines ## Guidelines

View File

@ -6,7 +6,7 @@ import { terser } from "rollup-plugin-terser"
import postcss from "rollup-plugin-postcss" import postcss from "rollup-plugin-postcss"
export default { export default {
input: "src/index.ts", input: "src/index.js",
output: { output: {
sourcemap: true, sourcemap: true,
format: "esm", format: "esm",

View File

@ -1,6 +1,6 @@
/// <reference types="cypress" /> /// <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 // You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option. // the plugins file with the 'pluginsFile' configuration option.

View File

@ -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. // loaded automatically before your test files.
// //
// This is a great place to put global configuration and // This is a great place to put global configuration and

View File

@ -8,7 +8,7 @@ their settings, and know how to correctly interact with them.
### Component Definitions ### 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 - **name** - the name displayed in the builder
- **description** - not currently used - **description** - not currently used

View File

@ -19,7 +19,7 @@ const ignoredWarnings = [
] ]
export default { export default {
input: "src/index.ts", input: "src/index.js",
output: [ output: [
{ {
sourcemap: false, sourcemap: false,

View File

@ -1,6 +1,6 @@
<script> <script>
import { Layout, Select, Body } from "@budibase/bbui" import { Layout, Select, Body } from "@budibase/bbui"
import { componentStore } from "stores/index.ts" import { componentStore } from "stores/index.js"
import DevToolsStat from "./DevToolsStat.svelte" import DevToolsStat from "./DevToolsStat.svelte"
const ReadableBindingMap = { const ReadableBindingMap = {

View File

@ -1,7 +1,7 @@
<script> <script>
import { Layout, Toggle } from "@budibase/bbui" import { Layout, Toggle } from "@budibase/bbui"
import DevToolsStat from "./DevToolsStat.svelte" import DevToolsStat from "./DevToolsStat.svelte"
import { componentStore } from "stores/index.ts" import { componentStore } from "stores/index.js"
import { getSettingsDefinition } from "utils/componentProps.js" import { getSettingsDefinition } from "utils/componentProps.js"
let showEnrichedSettings = true let showEnrichedSettings = true

View File

@ -2,6 +2,9 @@ import { outputProcessing } from "../../utilities/rowProcessor"
import { InternalTables } from "../../db/utils" import { InternalTables } from "../../db/utils"
import { getFullUser } from "../../utilities/users" import { getFullUser } from "../../utilities/users"
import { roles, context } from "@budibase/backend-core" 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. * 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 // forward the csrf token from the session
user.csrfToken = ctx.user.csrfToken user.csrfToken = ctx.user.csrfToken
if (context.getAppId()) { const appId = context.getAppId()
if (appId) {
const db = context.getAppDB() 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 // remove the full roles structure
delete user.roles delete user.roles
try { try {
@ -43,7 +52,7 @@ export async function fetchSelf(ctx: any) {
} catch (err: any) { } catch (err: any) {
let response let response
// user didn't exist in app, don't pretend they do // 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 = {} response = {}
} }
// user has a role of some sort, return them // user has a role of some sort, return them

View File

@ -1,7 +1,7 @@
module.exports = { module.exports = {
apps: [ apps: [
{ {
script: "./dist/index.ts", script: "./dist/index.js",
instances: "max", instances: "max",
exec_mode: "cluster", exec_mode: "cluster",
}, },