Browse Source

Bugfixes for IE

pull/1/head
Sebastian 9 years ago
parent
commit
b48c975b28
  1. 4
      src/Squidex/Controllers/Api/Apps/AppController.cs
  2. 2
      src/Squidex/Properties/launchSettings.json
  3. 5
      src/Squidex/app/app.routes.ts
  4. 1
      src/Squidex/app/shell/declarations.ts
  5. 2
      src/Squidex/app/shell/module.ts
  6. 2
      src/Squidex/app/shell/pages/home/home-page.component.html
  7. 22
      src/Squidex/app/shell/pages/home/home-page.component.ts
  8. 34
      src/Squidex/app/shell/pages/login/login-page.component.ts
  9. 2
      src/Squidex/app/shell/pages/logout/logout-page.component.ts
  10. 1
      src/Squidex/app/theme/_panels.scss
  11. 29
      src/Squidex/wwwroot/index.html

4
src/Squidex/Controllers/Api/Apps/AppController.cs

@ -55,9 +55,9 @@ namespace Squidex.Controllers.Api.Apps
{
var subject = HttpContext.User.OpenIdSubject();
var schemas = await appRepository.QueryAllAsync(subject);
var apps = await appRepository.QueryAllAsync(subject);
var response = schemas.Select(s =>
var response = apps.Select(s =>
{
var dto = SimpleMapper.Map(s, new AppDto());

2
src/Squidex/Properties/launchSettings.json

@ -16,10 +16,8 @@
},
"Squidex": {
"commandName": "Project",
"commandLineArgs": "replay",
"launchUrl": "http://localhost:5000",
"environmentVariables": {
"SQUIDEX__EVENTBUS__TYPE": "Memory",
"ASPNETCORE_ENVIRONMENT": "Development"
}
}

5
src/Squidex/app/app.routes.ts

@ -12,6 +12,7 @@ import {
AppAreaComponent,
HomePageComponent,
InternalAreaComponent,
LoginPageComponent,
LogoutPageComponent,
NotFoundPageComponent
} from './shell';
@ -61,6 +62,10 @@ export const routes: Routes = [
path: 'logout',
component: LogoutPageComponent
},
{
path: 'login',
component: LoginPageComponent
},
{
path: '**',
component: NotFoundPageComponent

1
src/Squidex/app/shell/declarations.ts

@ -14,6 +14,7 @@ export * from './pages/internal/apps-menu.component';
export * from './pages/internal/internal-area.component';
export * from './pages/internal/profile-menu.component';
export * from './pages/login/login-page.component';
export * from './pages/logout/logout-page.component';
export * from './pages/not-found/not-found-page.component';

2
src/Squidex/app/shell/module.ts

@ -15,6 +15,7 @@ import {
HomePageComponent,
InternalAreaComponent,
LeftMenuComponent,
LoginPageComponent,
LogoutPageComponent,
NotFoundPageComponent,
ProfileMenuComponent
@ -37,6 +38,7 @@ import {
HomePageComponent,
InternalAreaComponent,
LeftMenuComponent,
LoginPageComponent,
LogoutPageComponent,
NotFoundPageComponent,
ProfileMenuComponent

2
src/Squidex/app/shell/pages/home/home-page.component.html

@ -3,7 +3,7 @@
<button class="btn btn-primary btn-lg login-button" (click)="login()">Login to Squidex</button>
<p class="login-hint">
<p class="login-hint" *ngIf="!isIE()">
The login button will open a new popup. Once you are logged in successfull we will redirect you to the squidex management portal.
</p>

22
src/Squidex/app/shell/pages/home/home-page.component.ts

@ -25,11 +25,21 @@ export class HomePageComponent {
}
public login() {
this.auth.loginPopup()
.subscribe(() => {
this.router.navigate(['/app']);
}, ex => {
this.showLoginError = true;
});
if (this.isIE()) {
this.auth.loginRedirect();
} else {
this.auth.loginPopup()
.subscribe(() => {
this.router.navigate(['/app']);
}, ex => {
this.showLoginError = true;
});
}
}
public isIE() {
const isIE = !!navigator.userAgent.match(/Trident/g) || !!navigator.userAgent.match(/MSIE/g);
return isIE;
}
}

34
src/Squidex/app/shell/pages/login/login-page.component.ts

@ -0,0 +1,34 @@
/*
* Squidex Headless CMS
*
* @license
* Copyright (c) Sebastian Stehle. All rights reserved
*/
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { AuthService } from 'shared';
@Component({
selector: 'sqx-login',
template: ''
})
export class LoginPageComponent implements OnInit {
constructor(
private readonly auth: AuthService,
private readonly router: Router
) {
}
public ngOnInit() {
this.auth.loginRedirectComplete().subscribe(
() => {
this.router.navigate(['/app'], { replaceUrl: true });
},
() => {
this.router.navigate(['/'], { replaceUrl: true });
}
);
}
}

2
src/Squidex/app/shell/pages/logout/logout-page.component.ts

@ -11,7 +11,7 @@ import { Router } from '@angular/router';
import { AuthService } from 'shared';
@Component({
selector: 'logout',
selector: 'sqx-logout',
template: ''
})
export class LogoutPageComponent implements OnInit {

1
src/Squidex/app/theme/_panels.scss

@ -56,6 +56,7 @@
@include flex-box;
@include flex-flow(row);
@include flex-grow(1);
overflow: hidden;
}
&-content {

29
src/Squidex/wwwroot/index.html

@ -7,7 +7,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
background: #F4F8F9;
@ -21,7 +21,7 @@
}
.loading {
text-align: center; margin-top: 200px;
text-align: center;
}
.loading img {
@ -33,9 +33,34 @@
font-size: 30px;
font-weight: lighter;
}
.loading, noscript {
margin-top: 200px;
}
noscript {
display: block;
text-align: center;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
font-size: 30px;
font-weight: lighter;
color: red;
}
</style>
<noscript>
<style>
.loading {
display: none;
}
</style>
</noscript>
</head>
<body>
<noscript>
You must enable Javascript to use the Squidex Portal
</noscript>
<sqx-app>
<div class="loading">
<img src="/images/loader.gif" />

Loading…
Cancel
Save