1
0
Fork 0
mirror of synced 2024-06-14 08:24:48 +12:00

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`
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

View file

@ -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",

View file

@ -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.

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.
//
// 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
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

View file

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

View file

@ -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 = {

View file

@ -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

View file

@ -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

View file

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