|
|
@ -113,17 +113,6 @@ export class SchemaDto { |
|
|
public readonly version: Version |
|
|
public readonly version: Version |
|
|
) { |
|
|
) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public publish(user: string, version: Version, now?: DateTime): SchemaDto { |
|
|
|
|
|
return new SchemaDto( |
|
|
|
|
|
this.id, |
|
|
|
|
|
this.name, |
|
|
|
|
|
this.properties, |
|
|
|
|
|
true, |
|
|
|
|
|
this.createdBy, user, |
|
|
|
|
|
this.created, now || DateTime.now(), |
|
|
|
|
|
version); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export class SchemaDetailsDto extends SchemaDto { |
|
|
export class SchemaDetailsDto extends SchemaDto { |
|
|
@ -146,7 +135,7 @@ export class SchemaDetailsDto extends SchemaDto { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (this.listFields.length === 0) { |
|
|
if (this.listFields.length === 0) { |
|
|
this.listFields = [<any>{}]; |
|
|
this.listFields = [<any>{ properties: {} }]; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -659,255 +648,255 @@ export class SchemasService { |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas`); |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas`); |
|
|
|
|
|
|
|
|
return HTTP.getVersioned<any>(this.http, url) |
|
|
return HTTP.getVersioned<any>(this.http, url) |
|
|
.map(response => { |
|
|
.map(response => { |
|
|
const body = response.payload.body; |
|
|
const body = response.payload.body; |
|
|
|
|
|
|
|
|
const items: any[] = body; |
|
|
const items: any[] = body; |
|
|
|
|
|
|
|
|
return items.map(item => { |
|
|
return items.map(item => { |
|
|
const properties = new SchemaPropertiesDto(item.properties.label, item.properties.hints); |
|
|
const properties = new SchemaPropertiesDto(item.properties.label, item.properties.hints); |
|
|
|
|
|
|
|
|
return new SchemaDto( |
|
|
return new SchemaDto( |
|
|
item.id, |
|
|
item.id, |
|
|
item.name, properties, |
|
|
item.name, properties, |
|
|
item.isPublished, |
|
|
item.isPublished, |
|
|
item.createdBy, |
|
|
item.createdBy, |
|
|
item.lastModifiedBy, |
|
|
item.lastModifiedBy, |
|
|
DateTime.parseISO_UTC(item.created), |
|
|
DateTime.parseISO_UTC(item.created), |
|
|
DateTime.parseISO_UTC(item.lastModified), |
|
|
DateTime.parseISO_UTC(item.lastModified), |
|
|
new Version(item.version.toString())); |
|
|
new Version(item.version.toString())); |
|
|
}); |
|
|
}); |
|
|
}) |
|
|
}) |
|
|
.pretifyError('Failed to load schemas. Please reload.'); |
|
|
.pretifyError('Failed to load schemas. Please reload.'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public getSchema(appName: string, id: string): Observable<SchemaDetailsDto> { |
|
|
public getSchema(appName: string, id: string): Observable<SchemaDetailsDto> { |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${id}`); |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${id}`); |
|
|
|
|
|
|
|
|
return HTTP.getVersioned<any>(this.http, url) |
|
|
return HTTP.getVersioned<any>(this.http, url) |
|
|
.map(response => { |
|
|
.map(response => { |
|
|
const body = response.payload.body; |
|
|
const body = response.payload.body; |
|
|
|
|
|
|
|
|
const fields = body.fields.map((item: any) => { |
|
|
const fields = body.fields.map((item: any) => { |
|
|
const propertiesDto = |
|
|
const propertiesDto = |
|
|
createProperties( |
|
|
createProperties( |
|
|
item.properties.fieldType, |
|
|
item.properties.fieldType, |
|
|
item.properties); |
|
|
item.properties); |
|
|
|
|
|
|
|
|
return new FieldDto( |
|
|
return new FieldDto( |
|
|
item.fieldId, |
|
|
item.fieldId, |
|
|
item.name, |
|
|
item.name, |
|
|
item.isLocked, |
|
|
item.isLocked, |
|
|
item.isHidden, |
|
|
item.isHidden, |
|
|
item.isDisabled, |
|
|
item.isDisabled, |
|
|
item.partitioning, |
|
|
item.partitioning, |
|
|
propertiesDto); |
|
|
propertiesDto); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
const properties = new SchemaPropertiesDto(body.properties.label, body.properties.hints); |
|
|
const properties = new SchemaPropertiesDto(body.properties.label, body.properties.hints); |
|
|
|
|
|
|
|
|
return new SchemaDetailsDto( |
|
|
return new SchemaDetailsDto( |
|
|
body.id, |
|
|
body.id, |
|
|
body.name, properties, |
|
|
body.name, properties, |
|
|
body.isPublished, |
|
|
body.isPublished, |
|
|
body.createdBy, |
|
|
body.createdBy, |
|
|
body.lastModifiedBy, |
|
|
body.lastModifiedBy, |
|
|
DateTime.parseISO_UTC(body.created), |
|
|
DateTime.parseISO_UTC(body.created), |
|
|
DateTime.parseISO_UTC(body.lastModified), |
|
|
DateTime.parseISO_UTC(body.lastModified), |
|
|
response.version, |
|
|
response.version, |
|
|
fields, |
|
|
fields, |
|
|
body.scriptQuery, |
|
|
body.scriptQuery, |
|
|
body.scriptCreate, |
|
|
body.scriptCreate, |
|
|
body.scriptUpdate, |
|
|
body.scriptUpdate, |
|
|
body.scriptDelete, |
|
|
body.scriptDelete, |
|
|
body.scriptChange); |
|
|
body.scriptChange); |
|
|
}) |
|
|
}) |
|
|
.pretifyError('Failed to load schema. Please reload.'); |
|
|
.pretifyError('Failed to load schema. Please reload.'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public postSchema(appName: string, dto: CreateSchemaDto, user: string, now: DateTime): Observable<SchemaDetailsDto> { |
|
|
public postSchema(appName: string, dto: CreateSchemaDto, user: string, now: DateTime): Observable<SchemaDetailsDto> { |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas`); |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas`); |
|
|
|
|
|
|
|
|
return HTTP.postVersioned<any>(this.http, url, dto) |
|
|
return HTTP.postVersioned<any>(this.http, url, dto) |
|
|
.map(response => { |
|
|
.map(response => { |
|
|
const body = response.payload.body; |
|
|
const body = response.payload.body; |
|
|
|
|
|
|
|
|
now = now || DateTime.now(); |
|
|
now = now || DateTime.now(); |
|
|
|
|
|
|
|
|
return new SchemaDetailsDto( |
|
|
return new SchemaDetailsDto( |
|
|
body.id, |
|
|
body.id, |
|
|
dto.name, |
|
|
dto.name, |
|
|
dto.properties || new SchemaPropertiesDto(), |
|
|
dto.properties || new SchemaPropertiesDto(), |
|
|
false, |
|
|
false, |
|
|
user, |
|
|
user, |
|
|
user, |
|
|
user, |
|
|
now, |
|
|
now, |
|
|
now, |
|
|
now, |
|
|
response.version, |
|
|
response.version, |
|
|
dto.fields || [], |
|
|
dto.fields || [], |
|
|
body.scriptQuery, |
|
|
body.scriptQuery, |
|
|
body.scriptCreate, |
|
|
body.scriptCreate, |
|
|
body.scriptUpdate, |
|
|
body.scriptUpdate, |
|
|
body.scriptDelete, |
|
|
body.scriptDelete, |
|
|
body.scriptChange); |
|
|
body.scriptChange); |
|
|
}) |
|
|
}) |
|
|
.do(schema => { |
|
|
.do(schema => { |
|
|
this.analytics.trackEvent('Schema', 'Created', appName); |
|
|
this.analytics.trackEvent('Schema', 'Created', appName); |
|
|
}) |
|
|
}) |
|
|
.pretifyError('Failed to create schema. Please reload.'); |
|
|
.pretifyError('Failed to create schema. Please reload.'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public postField(appName: string, schemaName: string, dto: AddFieldDto, version: Version): Observable<Versioned<FieldDto>> { |
|
|
public postField(appName: string, schemaName: string, dto: AddFieldDto, version: Version): Observable<Versioned<FieldDto>> { |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/fields`); |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/fields`); |
|
|
|
|
|
|
|
|
return HTTP.postVersioned<any>(this.http, url, dto, version) |
|
|
return HTTP.postVersioned<any>(this.http, url, dto, version) |
|
|
.map(response => { |
|
|
.map(response => { |
|
|
const body = response.payload.body; |
|
|
const body = response.payload.body; |
|
|
|
|
|
|
|
|
const field = new FieldDto( |
|
|
const field = new FieldDto( |
|
|
body.id, |
|
|
body.id, |
|
|
dto.name, |
|
|
dto.name, |
|
|
false, |
|
|
false, |
|
|
false, |
|
|
false, |
|
|
false, |
|
|
false, |
|
|
dto.partitioning, |
|
|
dto.partitioning, |
|
|
dto.properties); |
|
|
dto.properties); |
|
|
|
|
|
|
|
|
return new Versioned(response.version, field); |
|
|
return new Versioned(response.version, field); |
|
|
}) |
|
|
}) |
|
|
.do(() => { |
|
|
.do(() => { |
|
|
this.analytics.trackEvent('Schema', 'FieldCreated', appName); |
|
|
this.analytics.trackEvent('Schema', 'FieldCreated', appName); |
|
|
}) |
|
|
}) |
|
|
.pretifyError('Failed to add field. Please reload.'); |
|
|
.pretifyError('Failed to add field. Please reload.'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public deleteSchema(appName: string, schemaName: string, version: Version): Observable<Versioned<any>> { |
|
|
public deleteSchema(appName: string, schemaName: string, version: Version): Observable<Versioned<any>> { |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}`); |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}`); |
|
|
|
|
|
|
|
|
return HTTP.deleteVersioned(this.http, url, version) |
|
|
return HTTP.deleteVersioned(this.http, url, version) |
|
|
.do(() => { |
|
|
.do(() => { |
|
|
this.analytics.trackEvent('Schema', 'Deleted', appName); |
|
|
this.analytics.trackEvent('Schema', 'Deleted', appName); |
|
|
}) |
|
|
}) |
|
|
.pretifyError('Failed to delete schema. Please reload.'); |
|
|
.pretifyError('Failed to delete schema. Please reload.'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public putSchemaScripts(appName: string, schemaName: string, dto: UpdateSchemaScriptsDto, version: Version): Observable<Versioned<any>> { |
|
|
public putSchemaScripts(appName: string, schemaName: string, dto: UpdateSchemaScriptsDto, version: Version): Observable<Versioned<any>> { |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/scripts`); |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/scripts`); |
|
|
|
|
|
|
|
|
return HTTP.putVersioned(this.http, url, dto, version) |
|
|
return HTTP.putVersioned(this.http, url, dto, version) |
|
|
.do(() => { |
|
|
.do(() => { |
|
|
this.analytics.trackEvent('Schema', 'ScriptsConfigured', appName); |
|
|
this.analytics.trackEvent('Schema', 'ScriptsConfigured', appName); |
|
|
}) |
|
|
}) |
|
|
.pretifyError('Failed to update schema scripts. Please reload.'); |
|
|
.pretifyError('Failed to update schema scripts. Please reload.'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public putSchema(appName: string, schemaName: string, dto: UpdateSchemaDto, version: Version): Observable<Versioned<any>> { |
|
|
public putSchema(appName: string, schemaName: string, dto: UpdateSchemaDto, version: Version): Observable<Versioned<any>> { |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}`); |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}`); |
|
|
|
|
|
|
|
|
return HTTP.putVersioned(this.http, url, dto, version) |
|
|
return HTTP.putVersioned(this.http, url, dto, version) |
|
|
.do(() => { |
|
|
.do(() => { |
|
|
this.analytics.trackEvent('Schema', 'Updated', appName); |
|
|
this.analytics.trackEvent('Schema', 'Updated', appName); |
|
|
}) |
|
|
}) |
|
|
.pretifyError('Failed to update schema. Please reload.'); |
|
|
.pretifyError('Failed to update schema. Please reload.'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public putFieldOrdering(appName: string, schemaName: string, dto: number[], version: Version): Observable<Versioned<any>> { |
|
|
public putFieldOrdering(appName: string, schemaName: string, dto: number[], version: Version): Observable<Versioned<any>> { |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/fields/ordering`); |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/fields/ordering`); |
|
|
|
|
|
|
|
|
return HTTP.putVersioned(this.http, url, { fieldIds: dto }, version) |
|
|
return HTTP.putVersioned(this.http, url, { fieldIds: dto }, version) |
|
|
.do(() => { |
|
|
.do(() => { |
|
|
this.analytics.trackEvent('Schema', 'FieldsReordered', appName); |
|
|
this.analytics.trackEvent('Schema', 'FieldsReordered', appName); |
|
|
}) |
|
|
}) |
|
|
.pretifyError('Failed to reorder fields. Please reload.'); |
|
|
.pretifyError('Failed to reorder fields. Please reload.'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public publishSchema(appName: string, schemaName: string, version: Version): Observable<Versioned<any>> { |
|
|
public publishSchema(appName: string, schemaName: string, version: Version): Observable<Versioned<any>> { |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/publish`); |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/publish`); |
|
|
|
|
|
|
|
|
return HTTP.putVersioned(this.http, url, {}, version) |
|
|
return HTTP.putVersioned(this.http, url, {}, version) |
|
|
.do(() => { |
|
|
.do(() => { |
|
|
this.analytics.trackEvent('Schema', 'Published', appName); |
|
|
this.analytics.trackEvent('Schema', 'Published', appName); |
|
|
}) |
|
|
}) |
|
|
.pretifyError('Failed to publish schema. Please reload.'); |
|
|
.pretifyError('Failed to publish schema. Please reload.'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public unpublishSchema(appName: string, schemaName: string, version: Version): Observable<Versioned<any>> { |
|
|
public unpublishSchema(appName: string, schemaName: string, version: Version): Observable<Versioned<any>> { |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/unpublish`); |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/unpublish`); |
|
|
|
|
|
|
|
|
return HTTP.putVersioned(this.http, url, {}, version) |
|
|
return HTTP.putVersioned(this.http, url, {}, version) |
|
|
.do(() => { |
|
|
.do(() => { |
|
|
this.analytics.trackEvent('Schema', 'Unpublished', appName); |
|
|
this.analytics.trackEvent('Schema', 'Unpublished', appName); |
|
|
}) |
|
|
}) |
|
|
.pretifyError('Failed to unpublish schema. Please reload.'); |
|
|
.pretifyError('Failed to unpublish schema. Please reload.'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public putField(appName: string, schemaName: string, fieldId: number, dto: UpdateFieldDto, version: Version): Observable<Versioned<any>> { |
|
|
public putField(appName: string, schemaName: string, fieldId: number, dto: UpdateFieldDto, version: Version): Observable<Versioned<any>> { |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/fields/${fieldId}`); |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/fields/${fieldId}`); |
|
|
|
|
|
|
|
|
return HTTP.putVersioned(this.http, url, dto, version) |
|
|
return HTTP.putVersioned(this.http, url, dto, version) |
|
|
.do(() => { |
|
|
.do(() => { |
|
|
this.analytics.trackEvent('Schema', 'FieldUpdated', appName); |
|
|
this.analytics.trackEvent('Schema', 'FieldUpdated', appName); |
|
|
}) |
|
|
}) |
|
|
.pretifyError('Failed to update field. Please reload.'); |
|
|
.pretifyError('Failed to update field. Please reload.'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public enableField(appName: string, schemaName: string, fieldId: number, version: Version): Observable<Versioned<any>> { |
|
|
public enableField(appName: string, schemaName: string, fieldId: number, version: Version): Observable<Versioned<any>> { |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/fields/${fieldId}/enable`); |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/fields/${fieldId}/enable`); |
|
|
|
|
|
|
|
|
return HTTP.putVersioned(this.http, url, {}, version) |
|
|
return HTTP.putVersioned(this.http, url, {}, version) |
|
|
.do(() => { |
|
|
.do(() => { |
|
|
this.analytics.trackEvent('Schema', 'FieldEnabled', appName); |
|
|
this.analytics.trackEvent('Schema', 'FieldEnabled', appName); |
|
|
}) |
|
|
}) |
|
|
.pretifyError('Failed to enable field. Please reload.'); |
|
|
.pretifyError('Failed to enable field. Please reload.'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public disableField(appName: string, schemaName: string, fieldId: number, version: Version): Observable<Versioned<any>> { |
|
|
public disableField(appName: string, schemaName: string, fieldId: number, version: Version): Observable<Versioned<any>> { |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/fields/${fieldId}/disable`); |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/fields/${fieldId}/disable`); |
|
|
|
|
|
|
|
|
return HTTP.putVersioned(this.http, url, {}, version) |
|
|
return HTTP.putVersioned(this.http, url, {}, version) |
|
|
.do(() => { |
|
|
.do(() => { |
|
|
this.analytics.trackEvent('Schema', 'FieldDisabled', appName); |
|
|
this.analytics.trackEvent('Schema', 'FieldDisabled', appName); |
|
|
}) |
|
|
}) |
|
|
.pretifyError('Failed to disable field. Please reload.'); |
|
|
.pretifyError('Failed to disable field. Please reload.'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public lockField(appName: string, schemaName: string, fieldId: number, version: Version): Observable<Versioned<any>> { |
|
|
public lockField(appName: string, schemaName: string, fieldId: number, version: Version): Observable<Versioned<any>> { |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/fields/${fieldId}/lock`); |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/fields/${fieldId}/lock`); |
|
|
|
|
|
|
|
|
return HTTP.putVersioned(this.http, url, {}, version) |
|
|
return HTTP.putVersioned(this.http, url, {}, version) |
|
|
.do(() => { |
|
|
.do(() => { |
|
|
this.analytics.trackEvent('Schema', 'FieldLocked', appName); |
|
|
this.analytics.trackEvent('Schema', 'FieldLocked', appName); |
|
|
}) |
|
|
}) |
|
|
.pretifyError('Failed to lock field. Please reload.'); |
|
|
.pretifyError('Failed to lock field. Please reload.'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public showField(appName: string, schemaName: string, fieldId: number, version: Version): Observable<Versioned<any>> { |
|
|
public showField(appName: string, schemaName: string, fieldId: number, version: Version): Observable<Versioned<any>> { |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/fields/${fieldId}/show`); |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/fields/${fieldId}/show`); |
|
|
|
|
|
|
|
|
return HTTP.putVersioned(this.http, url, {}, version) |
|
|
return HTTP.putVersioned(this.http, url, {}, version) |
|
|
.do(() => { |
|
|
.do(() => { |
|
|
this.analytics.trackEvent('Schema', 'FieldShown', appName); |
|
|
this.analytics.trackEvent('Schema', 'FieldShown', appName); |
|
|
}) |
|
|
}) |
|
|
.pretifyError('Failed to show field. Please reload.'); |
|
|
.pretifyError('Failed to show field. Please reload.'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public hideField(appName: string, schemaName: string, fieldId: number, version: Version): Observable<Versioned<any>> { |
|
|
public hideField(appName: string, schemaName: string, fieldId: number, version: Version): Observable<Versioned<any>> { |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/fields/${fieldId}/hide`); |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/fields/${fieldId}/hide`); |
|
|
|
|
|
|
|
|
return HTTP.putVersioned(this.http, url, {}, version) |
|
|
return HTTP.putVersioned(this.http, url, {}, version) |
|
|
.do(() => { |
|
|
.do(() => { |
|
|
this.analytics.trackEvent('Schema', 'FieldHidden', appName); |
|
|
this.analytics.trackEvent('Schema', 'FieldHidden', appName); |
|
|
}) |
|
|
}) |
|
|
.pretifyError('Failed to hide field. Please reload.'); |
|
|
.pretifyError('Failed to hide field. Please reload.'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public deleteField(appName: string, schemaName: string, fieldId: number, version: Version): Observable<Versioned<any>> { |
|
|
public deleteField(appName: string, schemaName: string, fieldId: number, version: Version): Observable<Versioned<any>> { |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/fields/${fieldId}`); |
|
|
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/fields/${fieldId}`); |
|
|
|
|
|
|
|
|
return HTTP.deleteVersioned(this.http, url, version) |
|
|
return HTTP.deleteVersioned(this.http, url, version) |
|
|
.do(() => { |
|
|
.do(() => { |
|
|
this.analytics.trackEvent('Schema', 'FieldDeleted', appName); |
|
|
this.analytics.trackEvent('Schema', 'FieldDeleted', appName); |
|
|
}) |
|
|
}) |
|
|
.pretifyError('Failed to delete field. Please reload.'); |
|
|
.pretifyError('Failed to delete field. Please reload.'); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |