diff --git a/codegen.yml b/codegen.yml index 6266518..dfbd037 100644 --- a/codegen.yml +++ b/codegen.yml @@ -1,6 +1,6 @@ overwrite: true schema: "http://localhost:4000/graphql" -documents: "src/app/graphqlOperations/**/*" +documents: "src/app/graphqlOperations/**/*.graphql" generates: src/generated/graphql.ts: plugins: diff --git a/src/app/components/tableComponents/string-cell/string-cell.component.ts b/src/app/components/tableComponents/string-cell/string-cell.component.ts index 6cab8a0..1e1948f 100644 --- a/src/app/components/tableComponents/string-cell/string-cell.component.ts +++ b/src/app/components/tableComponents/string-cell/string-cell.component.ts @@ -1,4 +1,5 @@ import { Component, Input, Output, EventEmitter } from '@angular/core'; +import { catchError } from 'rxjs/operators'; @Component({ selector: 'app-string-cell', @@ -15,7 +16,7 @@ export class StringCellComponent { inputType = 'text'; change(newValue) { - this.value = newValue; - this.valueChange.emit(newValue); + this.value = this.inputType === 'number' ? +newValue : newValue; + this.valueChange.emit(this.value); } } diff --git a/src/app/graphql.module.ts b/src/app/graphql.module.ts index badafbb..eaee8ab 100644 --- a/src/app/graphql.module.ts +++ b/src/app/graphql.module.ts @@ -11,15 +11,8 @@ import { environment } from '../environments/environment'; const uri = environment.apiUrl + '/graphql'; // <-- add the URL of the GraphQL server here -const cleanTypeName = new ApolloLink((operation, forward) => { - if (operation.variables) { - const omitTypename = (key: string, value: any) => - key === '__typename' ? undefined : value; - operation.variables = JSON.parse( - JSON.stringify(operation.variables), - omitTypename - ); - } +const authMiddleware = new ApolloLink((operation, forward) => { + //Add token here <------------------------------------------------------- return forward(operation).map((data) => { return data; }); @@ -27,7 +20,7 @@ const cleanTypeName = new ApolloLink((operation, forward) => { export function createApollo(httpLink: HttpLink): ApolloClientOptions { return { - link: concat(cleanTypeName, httpLink.create({ uri })), + link: concat(authMiddleware, httpLink.create({ uri })), cache: new InMemoryCache({}), }; } diff --git a/src/app/pages/tables/bikes/bikes.component.html b/src/app/pages/tables/bikes/bikes.component.html index 136ceb7..f14e5b5 100644 --- a/src/app/pages/tables/bikes/bikes.component.html +++ b/src/app/pages/tables/bikes/bikes.component.html @@ -1,7 +1,6 @@
- - +
edit @@ -96,7 +96,8 @@ *ngIf=" !element.isGettingEdited && !element.waitingForEditPermissions && - !element.locked + !element.locked && + !element.saving " > delete @@ -104,7 +105,7 @@