mirror of
https://github.com/strapi/strapi.git
synced 2025-12-30 00:37:24 +00:00
remove front form for restricted access
This commit is contained in:
parent
72a128af83
commit
62299883f1
@ -19,13 +19,13 @@ module.exports = {
|
||||
try {
|
||||
const docService = strapi.plugin('documentation').service('documentation');
|
||||
const docVersions = docService.getDocumentationVersions();
|
||||
const form = await docService.getFrontendForm();
|
||||
const documentationAccess = await docService.getDocumentationAccess();
|
||||
|
||||
ctx.send({
|
||||
docVersions,
|
||||
currentVersion: docService.getDocumentationVersion(),
|
||||
prefix: strapi.plugin('documentation').config('x-strapi-config').path,
|
||||
form,
|
||||
documentationAccess,
|
||||
});
|
||||
} catch (err) {
|
||||
ctx.badRequest(null, err.message);
|
||||
|
||||
@ -6,7 +6,6 @@ const moment = require('moment');
|
||||
|
||||
const { builApiEndpointPath } = require('../utils/builders');
|
||||
const defaultConfig = require('../config/default-config');
|
||||
const form = require('./utils/forms');
|
||||
|
||||
module.exports = () => {
|
||||
const docPlugin = strapi.plugin('documentation');
|
||||
@ -57,7 +56,7 @@ module.exports = () => {
|
||||
.filter(x => x);
|
||||
},
|
||||
|
||||
async getFrontendForm() {
|
||||
async getDocumentationAccess() {
|
||||
const config = await strapi
|
||||
.store({
|
||||
environment: '',
|
||||
@ -67,12 +66,7 @@ module.exports = () => {
|
||||
})
|
||||
.get();
|
||||
|
||||
const forms = JSON.parse(JSON.stringify(form));
|
||||
|
||||
_.set(forms, [0, 0, 'value'], config.restrictedAccess);
|
||||
_.set(forms, [0, 1, 'value'], config.password || '');
|
||||
|
||||
return forms;
|
||||
return { restrictedAccess: config.restrictedAccess, password: config.password || '' };
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@ -1,29 +0,0 @@
|
||||
[
|
||||
[
|
||||
{
|
||||
"name": "restrictedAccess",
|
||||
"label": {
|
||||
"id": "documentation.containers.HomePage.form.restrictedAccess"
|
||||
},
|
||||
"type": "toggle",
|
||||
"inputDescription": {
|
||||
"id": "documentation.containers.HomePage.form.restrictedAccess.inputDescription"
|
||||
},
|
||||
"inputDescriptionStyle": { "marginBottom": "2px"},
|
||||
"value": false
|
||||
},
|
||||
{
|
||||
"name": "password",
|
||||
"label": {
|
||||
"id": "documentation.containers.HomePage.form.password"
|
||||
},
|
||||
"customBootstrapClass": "col-md-4",
|
||||
"type": "password",
|
||||
"inputDescription": {
|
||||
"id": "documentation.containers.HomePage.form.password.inputDescription"
|
||||
},
|
||||
"validations": { "required": true },
|
||||
"value": ""
|
||||
}
|
||||
]
|
||||
]
|
||||
Loading…
x
Reference in New Issue
Block a user