Browse Source

Client id fixed

pull/1/head
Sebastian 9 years ago
parent
commit
bfa128f0b9
  1. 4
      src/Squidex.Read.MongoDb/Contents/Visitors/FindExtensions.cs
  2. 2
      src/Squidex/Pipeline/AppFilterAttribute.cs
  3. 2
      src/Squidex/app/features/schemas/pages/schemas/schema-form.component.html
  4. 3
      src/Squidex/app/features/settings/pages/clients/client.component.scss
  5. 4
      src/Squidex/app/shared/components/component-base.ts
  6. 2
      src/Squidex/app/shared/components/history.component.html
  7. 18
      src/Squidex/app/shared/components/history.component.ts
  8. 2
      src/Squidex/app/theme/_common.scss
  9. BIN
      src/Squidex/wwwroot/images/client.png
  10. 95
      src/Squidex/wwwroot/images/client.svg

4
src/Squidex.Read.MongoDb/Contents/Visitors/FindExtensions.cs

@ -12,6 +12,8 @@ using MongoDB.Bson;
using MongoDB.Driver; using MongoDB.Driver;
using Squidex.Core.Schemas; using Squidex.Core.Schemas;
// ReSharper disable RedundantIfElseBlock
namespace Squidex.Read.MongoDb.Contents.Visitors namespace Squidex.Read.MongoDb.Contents.Visitors
{ {
public static class FindExtensions public static class FindExtensions
@ -60,7 +62,7 @@ namespace Squidex.Read.MongoDb.Contents.Visitors
if (!nonPublished) if (!nonPublished)
{ {
filters.Add(Filter.Eq(x => x.IsPublished, false)); filters.Add(Filter.Eq(x => x.IsPublished, true));
} }
var filter = FilterBuilder.Build(query, schema); var filter = FilterBuilder.Build(query, schema);

2
src/Squidex/Pipeline/AppFilterAttribute.cs

@ -88,7 +88,7 @@ namespace Squidex.Pipeline
return null; return null;
} }
clientId = clientId.Split(':')[0]; clientId = clientId.Split(':')[1];
var contributor = app.Clients.FirstOrDefault(x => string.Equals(x.Id, clientId, StringComparison.OrdinalIgnoreCase)); var contributor = app.Clients.FirstOrDefault(x => string.Equals(x.Id, clientId, StringComparison.OrdinalIgnoreCase));

2
src/Squidex/app/features/schemas/pages/schemas/schema-form.component.html

@ -10,7 +10,7 @@
<sqx-control-errors for="name" [submitted]="createFormSubmitted"></sqx-control-errors> <sqx-control-errors for="name" [submitted]="createFormSubmitted"></sqx-control-errors>
<input type="text" class="form-control" id="schema-name" formControlName="name" /> <input type="text" class="form-control" id="schema-name" formControlName="name" sqxFocusOnInit />
<span class="form-hint"> <span class="form-hint">
The schema name becomes part of the api url,<br /> e.g https://{{appName}}.squidex.io/<b>{{schemaName | async}}</b>/. The schema name becomes part of the api url,<br /> e.g https://{{appName}}.squidex.io/<b>{{schemaName | async}}</b>/.

3
src/Squidex/app/features/settings/pages/clients/client.component.scss

@ -68,6 +68,7 @@ $color-editor: #eceeef;
.access-token { .access-token {
height: 18rem; height: 18rem;
font-size: .8rem; font-size: 1rem;
font-weight: normal; font-weight: normal;
font-family: monospace;
} }

4
src/Squidex/app/shared/components/component-base.ts

@ -42,7 +42,7 @@ export abstract class ComponentBase {
if (parts[0] === 'subject') { if (parts[0] === 'subject') {
return this.users.getUser(parts[1]).map(u => u.pictureUrl); return this.users.getUser(parts[1]).map(u => u.pictureUrl);
} else { } else {
return null; return Observable.of('/images/client.png');
} }
} else { } else {
return this.users.getUser(userId).map(u => u.pictureUrl); return this.users.getUser(userId).map(u => u.pictureUrl);
@ -56,7 +56,7 @@ export abstract class ComponentBase {
if (parts[0] === 'subject') { if (parts[0] === 'subject') {
return this.users.getUser(parts[1], placeholder).map(u => u.displayName); return this.users.getUser(parts[1], placeholder).map(u => u.displayName);
} else { } else {
return Observable.of(parts[1]); return Observable.of(`Client '${parts[1]}'`);
} }
} else { } else {
return this.users.getUser(userId, placeholder).map(u => u.displayName); return this.users.getUser(userId, placeholder).map(u => u.displayName);

2
src/Squidex/app/shared/components/history.component.html

@ -13,7 +13,7 @@
<div class="panel-content panel-content-blank"> <div class="panel-content panel-content-blank">
<div *ngFor="let event of events | async" class="event"> <div *ngFor="let event of events | async" class="event">
<div class="event-left"> <div class="event-left">
<img class="user-picture"[attr.title]="actorName(event.actor) | async" [attr.src]="actorProfile(event.actor) | async" /> <img class="user-picture" [attr.title]="actorName(event.actor) | async" [attr.src]="actorPicture(event.actor) | async" />
</div> </div>
<div class="event-main"> <div class="event-main">
<div class="event-message"> <div class="event-message">

18
src/Squidex/app/shared/components/history.component.ts

@ -55,23 +55,11 @@ export class HistoryComponent extends AppComponentBase {
} }
public actorName(actor: string): Observable<string> { public actorName(actor: string): Observable<string> {
const parts = actor.split(':'); return this.userName(actor, true, 'I');
if (parts[0] === 'subject') {
return this.userName(parts[1], false, 'I');
}
return Observable.of(parts[1]);
}
public actorProfile(actor: string): Observable<string> {
const parts = actor.split(':');
if (parts[0] === 'subject') {
return this.userPicture(parts[1]);
} }
return Observable.of(''); public actorPicture(actor: string): Observable<string> {
return this.userPicture(actor, true);
} }
public format(message: string): Observable<string> { public format(message: string): Observable<string> {

2
src/Squidex/app/theme/_common.scss

@ -21,7 +21,7 @@ h1 {
.user-picture { .user-picture {
& { & {
@include circle(2.2rem); @include circle(2rem);
} }
&:not([src]) { &:not([src]) {

BIN
src/Squidex/wwwroot/images/client.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

95
src/Squidex/wwwroot/images/client.svg

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 32 32"
width="32"
height="32"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="client.svg"
inkscape:export-filename="C:\Users\mail2\Downloads\client.png"
inkscape:export-xdpi="180"
inkscape:export-ydpi="180">
<metadata
id="metadata10">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs8" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0.12941176"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1017"
id="namedview6"
showgrid="true"
inkscape:zoom="32"
inkscape:cx="20.671165"
inkscape:cy="20.571089"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg2"
showguides="false" />
<rect
style="fill:#f2f2f2;fill-opacity:1;stroke:none;stroke-opacity:1"
id="rect4138"
width="32"
height="32"
x="0"
y="0" />
<rect
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4140"
width="17"
height="15"
x="7.5"
y="8.5" />
<rect
style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4142"
width="18"
height="1"
x="7"
y="14" />
<rect
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4144"
width="6"
height="2"
x="16.5"
y="10.5" />
<circle
style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path4146"
cx="10.5"
cy="11.5"
r="1" />
<circle
style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path4146-1"
cx="13.5"
cy="11.5"
r="1" />
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

Loading…
Cancel
Save