Fix tag actions
This commit is contained in:
parent
643fa5b715
commit
263defc7ba
6 changed files with 19 additions and 74 deletions
|
@ -5,9 +5,8 @@ import { map } from 'rxjs/operators'
|
||||||
|
|
||||||
// import { Apollo, gql } from 'apollo-angular'
|
// import { Apollo, gql } from 'apollo-angular'
|
||||||
|
|
||||||
import { Tag } from '../info/info-tags/tags.service'
|
import { ApiService, ActionsStore, ActionsResults,
|
||||||
import { TaggedLayer, TaggedFeature, FormFieldInput } from '../info/info-data.service'
|
FormFieldInput, TaggedLayer } from '../openapi'
|
||||||
import { ApiService, ActionsStore, ActionResults } from '../openapi'
|
|
||||||
|
|
||||||
export class ActionParam {
|
export class ActionParam {
|
||||||
constructor(
|
constructor(
|
||||||
|
@ -25,13 +24,6 @@ export class Action {
|
||||||
) {}
|
) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// export class ActionsStore {
|
|
||||||
// constructor(
|
|
||||||
// public store: string,
|
|
||||||
// public actions: Action[],
|
|
||||||
// ) {}
|
|
||||||
// }
|
|
||||||
|
|
||||||
export class ActionResult {
|
export class ActionResult {
|
||||||
constructor(
|
constructor(
|
||||||
public name: string,
|
public name: string,
|
||||||
|
@ -48,13 +40,6 @@ export class ActionResult {
|
||||||
// ) {}
|
// ) {}
|
||||||
// }
|
// }
|
||||||
|
|
||||||
export class ActionsResults {
|
|
||||||
constructor(
|
|
||||||
public message: string,
|
|
||||||
public actionResults: ActionResults[],
|
|
||||||
) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ActionAction {
|
export class ActionAction {
|
||||||
constructor(
|
constructor(
|
||||||
public plugin: string,
|
public plugin: string,
|
||||||
|
@ -183,50 +168,13 @@ export class ActionsService {
|
||||||
actionNames: string[],
|
actionNames: string[],
|
||||||
params: ActionParam[],
|
params: ActionParam[],
|
||||||
formFields?: FormFieldInput[]
|
formFields?: FormFieldInput[]
|
||||||
): Observable<ActionResults> {
|
): Observable<ActionsResults> {
|
||||||
return this.apiService.executeTagActionApiExecTagActionActionPost({
|
return this.apiService.executeTagActionApiExecTagActionsPost({
|
||||||
"stores": stores,
|
"stores": stores,
|
||||||
"ids": ids,
|
"ids": ids,
|
||||||
"actionNames": actionNames,
|
"actionNames": actionNames,
|
||||||
"params": params,
|
"params": params,
|
||||||
"formFields": formFields
|
"formFields": formFields
|
||||||
})
|
})
|
||||||
// }).pipe(map(
|
|
||||||
// result => result['data']['executeAction']['result'].map(
|
|
||||||
// res => new ActionsResults(
|
|
||||||
// res['message'],
|
|
||||||
// res['actionResults'].map(
|
|
||||||
// r => new ActionResults(
|
|
||||||
// r['name'],
|
|
||||||
// r['message'],
|
|
||||||
// r['actionResults'] && r['actionResults'].map(
|
|
||||||
// actionResults => new ActionResult(
|
|
||||||
// actionResults['name'],
|
|
||||||
// actionResults['message'],
|
|
||||||
// (actionResults['taggedLayers'] || []).map(
|
|
||||||
// taggedLayer => new TaggedLayer(
|
|
||||||
// taggedLayer['store'],
|
|
||||||
// taggedLayer['taggedFeatures'].map(
|
|
||||||
// taggedFeature => new TaggedFeature(
|
|
||||||
// taggedFeature['id'],
|
|
||||||
// taggedFeature['lon'],
|
|
||||||
// taggedFeature['lat'],
|
|
||||||
// taggedFeature['tags'].map(
|
|
||||||
// tag => new Tag(
|
|
||||||
// tag['key'],
|
|
||||||
// tag['value']
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
// ))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,8 +80,8 @@ export class AppComponent implements OnInit {
|
||||||
width: '21em'
|
width: '21em'
|
||||||
})
|
})
|
||||||
|
|
||||||
dialogRef.afterClosed().subscribe(result => {
|
// dialogRef.afterClosed().subscribe(
|
||||||
console.log('The dialog was closed')
|
// result => {}
|
||||||
})
|
// )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,16 +84,13 @@ export class ActionFormComponent implements OnInit {
|
||||||
).subscribe(
|
).subscribe(
|
||||||
results => {
|
results => {
|
||||||
// Update the tags in the info source
|
// Update the tags in the info source
|
||||||
let result = results[0].actionResults[0]
|
let messages: string[] = []
|
||||||
let messages = []
|
if (results.message) {
|
||||||
if (result.message) {
|
messages.push(results.message)
|
||||||
messages.push(result.message)
|
|
||||||
}
|
}
|
||||||
if (result.actionResults) {
|
results.actionResults[0].actionResults?.forEach(
|
||||||
result.actionResults.forEach(
|
element => messages.push(element.message)
|
||||||
(element: ActionResult) => messages.push(element.message)
|
|
||||||
)
|
)
|
||||||
}
|
|
||||||
this.snackBar.open(messages.join(', '), 'Close', {duration: 3000})
|
this.snackBar.open(messages.join(', '), 'Close', {duration: 3000})
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
@ -19,7 +19,7 @@ export type { BaseMapWithStores } from './models/BaseMapWithStores';
|
||||||
export type { BaseStyle } from './models/BaseStyle';
|
export type { BaseStyle } from './models/BaseStyle';
|
||||||
export type { BasketDefault } from './models/BasketDefault';
|
export type { BasketDefault } from './models/BasketDefault';
|
||||||
export type { BasketNameOnly } from './models/BasketNameOnly';
|
export type { BasketNameOnly } from './models/BasketNameOnly';
|
||||||
export type { Body_execute_tag_action_api_execTagAction__action__post } from './models/Body_execute_tag_action_api_execTagAction__action__post';
|
export type { Body_execute_tag_action_api_execTagActions_post } from './models/Body_execute_tag_action_api_execTagActions_post';
|
||||||
export type { Body_login_for_access_token_api_token_post } from './models/Body_login_for_access_token_api_token_post';
|
export type { Body_login_for_access_token_api_token_post } from './models/Body_login_for_access_token_api_token_post';
|
||||||
export type { BootstrapData } from './models/BootstrapData';
|
export type { BootstrapData } from './models/BootstrapData';
|
||||||
export type { CategoryGroup } from './models/CategoryGroup';
|
export type { CategoryGroup } from './models/CategoryGroup';
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import type { ActionParam } from './ActionParam';
|
import type { ActionParam } from './ActionParam';
|
||||||
import type { FormFieldInput } from './FormFieldInput';
|
import type { FormFieldInput } from './FormFieldInput';
|
||||||
export type Body_execute_tag_action_api_execTagAction__action__post = {
|
export type Body_execute_tag_action_api_execTagActions_post = {
|
||||||
stores: Array<string>;
|
stores: Array<string>;
|
||||||
ids: Array<Array<string>>;
|
ids: Array<Array<string>>;
|
||||||
actionNames: Array<string>;
|
actionNames: Array<string>;
|
|
@ -7,7 +7,7 @@ import { HttpClient } from '@angular/common/http';
|
||||||
import type { Observable } from 'rxjs';
|
import type { Observable } from 'rxjs';
|
||||||
import type { ActionsResults } from '../models/ActionsResults';
|
import type { ActionsResults } from '../models/ActionsResults';
|
||||||
import type { ActionsStore } from '../models/ActionsStore';
|
import type { ActionsStore } from '../models/ActionsStore';
|
||||||
import type { Body_execute_tag_action_api_execTagAction__action__post } from '../models/Body_execute_tag_action_api_execTagAction__action__post';
|
import type { Body_execute_tag_action_api_execTagActions_post } from '../models/Body_execute_tag_action_api_execTagActions_post';
|
||||||
import type { Body_login_for_access_token_api_token_post } from '../models/Body_login_for_access_token_api_token_post';
|
import type { Body_login_for_access_token_api_token_post } from '../models/Body_login_for_access_token_api_token_post';
|
||||||
import type { BootstrapData } from '../models/BootstrapData';
|
import type { BootstrapData } from '../models/BootstrapData';
|
||||||
import type { CategoryRead } from '../models/CategoryRead';
|
import type { CategoryRead } from '../models/CategoryRead';
|
||||||
|
@ -358,12 +358,12 @@ export class ApiService {
|
||||||
* @returns ActionsResults Successful Response
|
* @returns ActionsResults Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public executeTagActionApiExecTagActionActionPost(
|
public executeTagActionApiExecTagActionsPost(
|
||||||
requestBody: Body_execute_tag_action_api_execTagAction__action__post,
|
requestBody: Body_execute_tag_action_api_execTagActions_post,
|
||||||
): Observable<ActionsResults> {
|
): Observable<ActionsResults> {
|
||||||
return __request(OpenAPI, this.http, {
|
return __request(OpenAPI, this.http, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: '/api/execTagAction/{action}',
|
url: '/api/execTagActions',
|
||||||
body: requestBody,
|
body: requestBody,
|
||||||
mediaType: 'application/json',
|
mediaType: 'application/json',
|
||||||
errors: {
|
errors: {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue