This commit is contained in:
Martin McKeaveney 2021-05-06 10:57:24 +01:00
parent efacbe861a
commit 2fe2d521cf
6 changed files with 18 additions and 13 deletions

View File

@ -41,7 +41,8 @@
<Input <Input
label="password" label="password"
type="password" type="password"
bind:value={adminUser.password} /> bind:value={adminUser.password}
/>
<Button cta on:click={save}>Create super admin user</Button> <Button cta on:click={save}>Create super admin user</Button>
</Layout> </Layout>
</div> </div>

View File

@ -32,13 +32,15 @@
<Item <Item
external external
href="https://github.com/Budibase/budibase/discussions" href="https://github.com/Budibase/budibase/discussions"
icon="PeopleGroup"> icon="PeopleGroup"
>
Community Community
</Item> </Item>
<Item <Item
external external
href="https://github.com/Budibase/budibase/issues/new/choose" href="https://github.com/Budibase/budibase/issues/new/choose"
icon="Bug"> icon="Bug"
>
Raise an issue Raise an issue
</Item> </Item>
</Navigation> </Navigation>

View File

@ -11,15 +11,18 @@ export function createAdminStore() {
const onboardingSteps = Object.keys(json) const onboardingSteps = Object.keys(json)
const stepsComplete = onboardingSteps.reduce((score, step) => score + Number(!!json[step]), 0) const stepsComplete = onboardingSteps.reduce(
(score, step) => score + Number(!!json[step]),
0
)
set({ set({
checklist: json, checklist: json,
onboardingProgress: stepsComplete / onboardingSteps.length * 100 onboardingProgress: (stepsComplete / onboardingSteps.length) * 100,
}) })
} catch (err) { } catch (err) {
set({ set({
checklist: null checklist: null,
}) })
} }
} }

View File

@ -104,13 +104,14 @@ exports.destroy = async function (ctx) {
} }
} }
exports.configChecklist = async function(ctx) { exports.configChecklist = async function (ctx) {
const db = new CouchDB(GLOBAL_DB) const db = new CouchDB(GLOBAL_DB)
try { try {
// TODO: Watch get started video // TODO: Watch get started video
// Apps exist // Apps exist
let allDbs
if (env.COUCH_DB_URL) { if (env.COUCH_DB_URL) {
allDbs = await (await fetch(`${env.COUCH_DB_URL}/_all_dbs`)).json() allDbs = await (await fetch(`${env.COUCH_DB_URL}/_all_dbs`)).json()
} else { } else {
@ -120,7 +121,7 @@ exports.configChecklist = async function(ctx) {
// They have set up SMTP // They have set up SMTP
const smtpConfig = await determineScopedConfig(db, { const smtpConfig = await determineScopedConfig(db, {
type: Configs.SMTP type: Configs.SMTP,
}) })
// They have set up an admin user // They have set up an admin user
@ -131,10 +132,10 @@ exports.configChecklist = async function(ctx) {
) )
const adminUser = users.rows.some(row => row.doc.admin) const adminUser = users.rows.some(row => row.doc.admin)
ctx.body = { ctx.body = {
apps: appDbNames.length, apps: appDbNames.length,
smtp: !!smtpConfig, smtp: !!smtpConfig,
adminUser adminUser,
} }
} catch (err) { } catch (err) {
ctx.throw(err.status, err) ctx.throw(err.status, err)

View File

@ -7,8 +7,6 @@ const {
const { hash, getGlobalUserByEmail } = require("@budibase/auth").utils const { hash, getGlobalUserByEmail } = require("@budibase/auth").utils
const { UserStatus } = require("../../../constants") const { UserStatus } = require("../../../constants")
const FIRST_USER_EMAIL = "test@test.com"
const FIRST_USER_PASSWORD = "test"
const GLOBAL_DB = StaticDatabases.GLOBAL.name const GLOBAL_DB = StaticDatabases.GLOBAL.name
exports.save = async ctx => { exports.save = async ctx => {

View File

@ -162,7 +162,7 @@ class TestConfiguration {
await this._req( await this._req(
{ {
email: "testuser@test.com", email: "testuser@test.com",
password: "test@test.com" password: "test@test.com",
}, },
null, null,
controllers.users.adminUser controllers.users.adminUser