Browse Source

Info endpoint finished.

pull/386/head
Sebastian Stehle 7 years ago
parent
commit
20cb694077
  1. 4
      src/Squidex/Areas/Api/Controllers/UI/MyUIOptions.cs
  2. 9
      src/Squidex/Areas/Frontend/Middlewares/IndexExtensions.cs
  3. 2
      src/Squidex/WebStartup.cs
  4. 2
      src/Squidex/app/features/apps/pages/apps-page.component.html
  5. 7
      src/Squidex/app/features/apps/pages/apps-page.component.scss
  6. 5
      src/Squidex/app/features/apps/pages/apps-page.component.ts
  7. 8
      src/Squidex/appsettings.json

4
src/Squidex/Areas/Api/Controllers/UI/MyUIOptions.cs

@ -13,8 +13,12 @@ namespace Squidex.Areas.Api.Controllers.UI
{
public Dictionary<string, string> RegexSuggestions { get; set; }
public Dictionary<string, string> More { get; set; } = new Dictionary<string, string>();
public MapOptions Map { get; set; }
public bool ShowInfo { get; set; }
public bool HideNews { get; set; }
public bool HideOnboarding { get; set; }

9
src/Squidex/Areas/Frontend/Middlewares/IndexExtensions.cs

@ -9,9 +9,9 @@ using System;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using Squidex.Areas.Api.Controllers.UI;
using Squidex.Infrastructure.Json;
using Squidex.Web;
namespace Squidex.Areas.Frontend.Middlewares
{
@ -45,6 +45,13 @@ namespace Squidex.Areas.Frontend.Middlewares
if (uiOptions != null)
{
var values = httpContext.RequestServices.GetService<ExposedValues>();
if (values != null)
{
uiOptions.More["info"] = values.ToString();
}
var jsonSerializer = httpContext.RequestServices.GetRequiredService<IJsonSerializer>();
var jsonOptions = jsonSerializer.Serialize(uiOptions, false);

2
src/Squidex/WebStartup.cs

@ -94,6 +94,8 @@ namespace Squidex
config.GetSection("usage"));
services.Configure<RebuildOptions>(
config.GetSection("rebuild"));
services.Configure<ExposedConfiguration>(
config.GetSection("exposedConfiguration"));
services.Configure<MyContentsControllerOptions>(
config.GetSection("contentsController"));

2
src/Squidex/app/features/apps/pages/apps-page.component.html

@ -100,6 +100,8 @@
</div>
</div>
<div *ngIf="info" class="info">{{info}}</div>
<ng-container *sqxModalView="addAppDialog;onRoot:true">
<sqx-app-form [template]="addAppTemplate"
(complete)="addAppDialog.hide()">

7
src/Squidex/app/features/apps/pages/apps-page.component.scss

@ -90,3 +90,10 @@
display: none;
}
}
.info {
color: $color-border-dark;
padding: 2rem;
padding-left: $size-sidebar-width + .25rem;
font-size: .8rem;
}

5
src/Squidex/app/features/apps/pages/apps-page.component.ts

@ -35,6 +35,8 @@ export class AppsPageComponent implements OnInit {
public newsFeatures: FeatureDto[];
public newsDialog = new DialogModel();
public info: string;
constructor(
public readonly appsState: AppsState,
public readonly authState: AuthService,
@ -44,6 +46,9 @@ export class AppsPageComponent implements OnInit {
private readonly onboardingService: OnboardingService,
private readonly uiOptions: UIOptions
) {
if (uiOptions.get('showInfo')) {
this.info = uiOptions.get('more.info');
}
}
public ngOnInit() {

8
src/Squidex/appsettings.json

@ -78,7 +78,11 @@
/*
* Hide all onboarding tooltips and dialogs.
*/
"hideOnboarding": false
"hideOnboarding": false,
/*
* Show the exposed values as information on the apps overview page.
*/
"showInfo": false
},
"email": {
@ -485,7 +489,7 @@
"indexes": false
},
/*
/*"
* A list of configuration valeus that should be exposed from the info endpoint and in the UI.
*/
"exposedConfiguration": {

Loading…
Cancel
Save