From bfa128f0b9719c93a873c7951f035766ff3320f8 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 19 Feb 2017 23:38:00 +0100 Subject: [PATCH] Client id fixed --- .../Contents/Visitors/FindExtensions.cs | 4 +- src/Squidex/Pipeline/AppFilterAttribute.cs | 2 +- .../pages/schemas/schema-form.component.html | 2 +- .../pages/clients/client.component.scss | 3 +- .../app/shared/components/component-base.ts | 4 +- .../shared/components/history.component.html | 2 +- .../shared/components/history.component.ts | 18 +--- src/Squidex/app/theme/_common.scss | 2 +- src/Squidex/wwwroot/images/client.png | Bin 0 -> 454 bytes src/Squidex/wwwroot/images/client.svg | 95 ++++++++++++++++++ 10 files changed, 109 insertions(+), 23 deletions(-) create mode 100644 src/Squidex/wwwroot/images/client.png create mode 100644 src/Squidex/wwwroot/images/client.svg diff --git a/src/Squidex.Read.MongoDb/Contents/Visitors/FindExtensions.cs b/src/Squidex.Read.MongoDb/Contents/Visitors/FindExtensions.cs index 49427da42..7322f0c01 100644 --- a/src/Squidex.Read.MongoDb/Contents/Visitors/FindExtensions.cs +++ b/src/Squidex.Read.MongoDb/Contents/Visitors/FindExtensions.cs @@ -12,6 +12,8 @@ using MongoDB.Bson; using MongoDB.Driver; using Squidex.Core.Schemas; +// ReSharper disable RedundantIfElseBlock + namespace Squidex.Read.MongoDb.Contents.Visitors { public static class FindExtensions @@ -60,7 +62,7 @@ namespace Squidex.Read.MongoDb.Contents.Visitors if (!nonPublished) { - filters.Add(Filter.Eq(x => x.IsPublished, false)); + filters.Add(Filter.Eq(x => x.IsPublished, true)); } var filter = FilterBuilder.Build(query, schema); diff --git a/src/Squidex/Pipeline/AppFilterAttribute.cs b/src/Squidex/Pipeline/AppFilterAttribute.cs index 141c62248..4c426b520 100644 --- a/src/Squidex/Pipeline/AppFilterAttribute.cs +++ b/src/Squidex/Pipeline/AppFilterAttribute.cs @@ -88,7 +88,7 @@ namespace Squidex.Pipeline return null; } - clientId = clientId.Split(':')[0]; + clientId = clientId.Split(':')[1]; var contributor = app.Clients.FirstOrDefault(x => string.Equals(x.Id, clientId, StringComparison.OrdinalIgnoreCase)); diff --git a/src/Squidex/app/features/schemas/pages/schemas/schema-form.component.html b/src/Squidex/app/features/schemas/pages/schemas/schema-form.component.html index 040ca3175..8ff470085 100644 --- a/src/Squidex/app/features/schemas/pages/schemas/schema-form.component.html +++ b/src/Squidex/app/features/schemas/pages/schemas/schema-form.component.html @@ -10,7 +10,7 @@ - + The schema name becomes part of the api url,
e.g https://{{appName}}.squidex.io/{{schemaName | async}}/. diff --git a/src/Squidex/app/features/settings/pages/clients/client.component.scss b/src/Squidex/app/features/settings/pages/clients/client.component.scss index 446dcce82..b97356f97 100644 --- a/src/Squidex/app/features/settings/pages/clients/client.component.scss +++ b/src/Squidex/app/features/settings/pages/clients/client.component.scss @@ -68,6 +68,7 @@ $color-editor: #eceeef; .access-token { height: 18rem; - font-size: .8rem; + font-size: 1rem; font-weight: normal; + font-family: monospace; } \ No newline at end of file diff --git a/src/Squidex/app/shared/components/component-base.ts b/src/Squidex/app/shared/components/component-base.ts index afba4eefa..371480a71 100644 --- a/src/Squidex/app/shared/components/component-base.ts +++ b/src/Squidex/app/shared/components/component-base.ts @@ -42,7 +42,7 @@ export abstract class ComponentBase { if (parts[0] === 'subject') { return this.users.getUser(parts[1]).map(u => u.pictureUrl); } else { - return null; + return Observable.of('/images/client.png'); } } else { return this.users.getUser(userId).map(u => u.pictureUrl); @@ -56,7 +56,7 @@ export abstract class ComponentBase { if (parts[0] === 'subject') { return this.users.getUser(parts[1], placeholder).map(u => u.displayName); } else { - return Observable.of(parts[1]); + return Observable.of(`Client '${parts[1]}'`); } } else { return this.users.getUser(userId, placeholder).map(u => u.displayName); diff --git a/src/Squidex/app/shared/components/history.component.html b/src/Squidex/app/shared/components/history.component.html index 43edc2d46..1f08cfa59 100644 --- a/src/Squidex/app/shared/components/history.component.html +++ b/src/Squidex/app/shared/components/history.component.html @@ -13,7 +13,7 @@
- +
diff --git a/src/Squidex/app/shared/components/history.component.ts b/src/Squidex/app/shared/components/history.component.ts index c1f1db7a8..b998b5ed6 100644 --- a/src/Squidex/app/shared/components/history.component.ts +++ b/src/Squidex/app/shared/components/history.component.ts @@ -55,23 +55,11 @@ export class HistoryComponent extends AppComponentBase { } public actorName(actor: string): Observable { - const parts = actor.split(':'); - - if (parts[0] === 'subject') { - return this.userName(parts[1], false, 'I'); - } - - return Observable.of(parts[1]); + return this.userName(actor, true, 'I'); } - public actorProfile(actor: string): Observable { - const parts = actor.split(':'); - - if (parts[0] === 'subject') { - return this.userPicture(parts[1]); - } - - return Observable.of(''); + public actorPicture(actor: string): Observable { + return this.userPicture(actor, true); } public format(message: string): Observable { diff --git a/src/Squidex/app/theme/_common.scss b/src/Squidex/app/theme/_common.scss index d381eeb0b..3e7aa1301 100644 --- a/src/Squidex/app/theme/_common.scss +++ b/src/Squidex/app/theme/_common.scss @@ -21,7 +21,7 @@ h1 { .user-picture { & { - @include circle(2.2rem); + @include circle(2rem); } &:not([src]) { diff --git a/src/Squidex/wwwroot/images/client.png b/src/Squidex/wwwroot/images/client.png new file mode 100644 index 0000000000000000000000000000000000000000..d234bb53c569495335474ebd658d564339a74f83 GIT binary patch literal 454 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=EX7WqAsj$Z!;#Vf4nJ zNUsNB#yF{oGC)De64!{5;QX|b^2DN4hVt@qz0ADq;^f4FRK5J7^x5xhq!<_&ojqL~ zLn`LHopHPOu!4YVd&d6QMs5SufX3a0h9%804b}zhc@1o4`vaHUJ;8i&&p%!{FZcGg zd3t$4USVE^UwQAbPfV1EVcyprwR-jZYSt}$ce<~2UXXO)u1Mc-{nYDSOkSF1zLSqi zk0++3J+`>D@BRO6|3jaj*^&O+ezEa_^o?^i>z+{n#%WgRFSoLOh;I1TcR}(()Pt<~N765HW#~G*PyEYmvIyuZDOLwu4*#O` y + + + + + image/svg+xml + + + + + + + + + + + + + +