Browse Source

Finally fixed the news check.

pull/347/head
Sebastian Stehle 7 years ago
parent
commit
9d02f85dfa
  1. 6
      src/Squidex/Areas/Api/Controllers/News/NewsController.cs
  2. 2
      src/Squidex/Areas/Api/Views/Shared/Docs.cshtml
  3. 30
      src/Squidex/app/features/apps/pages/apps-page.component.ts

6
src/Squidex/Areas/Api/Controllers/News/NewsController.cs

@ -17,10 +17,10 @@ namespace Squidex.Areas.Api.Controllers.News
/// <summary> /// <summary>
/// Readonly API for news items. /// Readonly API for news items.
/// </summary> /// </summary>
[ApiExplorerSettings(GroupName = nameof(Languages))] [ApiExplorerSettings(GroupName = nameof(News))]
public sealed class NewsController : ApiController public sealed class NewsController : ApiController
{ {
private FeaturesService featuresService; private readonly FeaturesService featuresService;
public NewsController(ICommandBus commandBus, FeaturesService featuresService) public NewsController(ICommandBus commandBus, FeaturesService featuresService)
: base(commandBus) : base(commandBus)
@ -29,7 +29,7 @@ namespace Squidex.Areas.Api.Controllers.News
} }
/// <summary> /// <summary>
/// Get all features since latest version. /// Get features since version.
/// </summary> /// </summary>
/// <param name="version">The latest received version.</param> /// <param name="version">The latest received version.</param>
/// <returns> /// <returns>

2
src/Squidex/Areas/Api/Views/Shared/Docs.cshtml

@ -19,6 +19,6 @@
<body> <body>
<redoc spec-url="@Url.Content(Model.Specification)"></redoc> <redoc spec-url="@Url.Content(Model.Specification)"></redoc>
<script src="https://cdn.jsdelivr.net/npm/redoc@2.0.0-alpha.37/bundles/redoc.standalone.js"></script> <script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"></script>
</body> </body>
</html> </html>

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

@ -49,24 +49,22 @@ export class AppsPageComponent implements OnInit {
if (shouldShowOnboarding && apps.length === 0) { if (shouldShowOnboarding && apps.length === 0) {
this.onboardingService.disable('dialog'); this.onboardingService.disable('dialog');
this.onboardingDialog.show(); this.onboardingDialog.show();
} } else {
}); const newsVersion = this.localStore.getInt('squidex.news.version');
if (!shouldShowOnboarding) {
const newsVersion = this.localStore.getInt('squidex.news.version');
this.newsService.getFeatures(newsVersion) this.newsService.getFeatures(newsVersion)
.subscribe(result => { .subscribe(result => {
if (result.version !== newsVersion) { if (result.version !== newsVersion) {
if (result.features.length > 0) { if (result.features.length > 0) {
this.newsFeatures = result.features; this.newsFeatures = result.features;
this.newsDialog.show(); this.newsDialog.show();
} }
this.localStore.setInt('squidex.news.version', result.version); this.localStore.setInt('squidex.news.version', result.version);
} }
}); });
} }
});
} }
public createNewApp(template: string) { public createNewApp(template: string) {

Loading…
Cancel
Save