mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
remove alert and change tracer
This commit is contained in:
@@ -116,7 +116,7 @@ export class AgendaDataRepositoryService {
|
||||
return ok(result)
|
||||
} catch (e) {
|
||||
if(isHttpError(e)) {
|
||||
alert(e.status)
|
||||
console.log(e.status)
|
||||
tracing?.setAttribute('status.code', e.status.toString())
|
||||
if (e.status == 400) {
|
||||
tracing?.bugFlag()
|
||||
|
||||
@@ -39,13 +39,13 @@ const OrganizerSchema = z.object({
|
||||
});
|
||||
|
||||
const EventRecurrenceSchema = z.object({
|
||||
Type: z.number(),
|
||||
Day: null,
|
||||
DayOfWeek: null,
|
||||
Month: null,
|
||||
LastOccurrence: null,
|
||||
frequency: z.number(),
|
||||
until: z.string()
|
||||
Type: z.number().optional(),
|
||||
Day: z.any().optional(),
|
||||
DayOfWeek: z.any(),
|
||||
Month: z.any(),
|
||||
LastOccurrence: z.any().optional(),
|
||||
frequency: z.number().optional(),
|
||||
until: z.string().optional()
|
||||
}).nullable()
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ export class BackgroundService {
|
||||
private themeservice: ThemeService,
|
||||
private storageservice: StorageService,
|
||||
private http: HttpClient,
|
||||
) {
|
||||
) {
|
||||
|
||||
window.addEventListener('focus', (event) => {
|
||||
if(this.status == 'offline') {
|
||||
@@ -35,7 +35,7 @@ export class BackgroundService {
|
||||
return false
|
||||
}
|
||||
this.status = 'online'
|
||||
|
||||
|
||||
this.paint()
|
||||
this.callBacks.forEach((e) => {
|
||||
if (e.type == 'Online') {
|
||||
@@ -104,14 +104,14 @@ export class BackgroundService {
|
||||
}
|
||||
|
||||
try {
|
||||
await this.http.post(environment.apiURL + "UserAuthentication/Login", '', opts).toPromise();
|
||||
|
||||
await this.http.get("assets/images/theme/gov/governoangola_A.png").toPromise();
|
||||
|
||||
return true
|
||||
} catch (error) {
|
||||
|
||||
if(error.status === 0) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ export function APIReturn(schema: z.ZodTypeAny, path: string) {
|
||||
} catch (error) {
|
||||
if (error instanceof ZodError) {
|
||||
// If validation fails, throw an error with the details
|
||||
//
|
||||
console.error('unexpected data structure', path)
|
||||
// Capture the Zod validation error with additional context
|
||||
console.error('Validation failed:', error.errors);
|
||||
|
||||
@@ -31,4 +31,5 @@ function createProvider(serviceName) {
|
||||
export const OpentelemetryChatProvider = createProvider('FO-chat-service');
|
||||
export const OpentelemetryAgendaProvider = createProvider('FO-agenda-service');
|
||||
export const OpentelemetryNotificationProvider = createProvider('FO-notification');
|
||||
export const OpentelemetryInterceptorProvider = createProvider('FO-interceptor');
|
||||
export const OpentelemetryPublicationProvider = createProvider('FO-publication-service');
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { SemanticAttributes } from '@opentelemetry/semantic-conventions';
|
||||
import { Tracer, Span } from '@opentelemetry/sdk-trace-base';
|
||||
import { OpentelemetryAgendaProvider, OpentelemetryNotificationProvider } from './opentelemetry';
|
||||
import { OpentelemetryAgendaProvider, OpentelemetryInterceptorProvider, OpentelemetryNotificationProvider } from './opentelemetry';
|
||||
import { Device, DeviceInfo } from '@capacitor/device';
|
||||
|
||||
|
||||
const tracerInstance = OpentelemetryAgendaProvider.getTracer('example-tracer-hole', '111', {})
|
||||
const tracerNotificationInstance = OpentelemetryNotificationProvider.getTracer('example-tracer-hole', '111', {})
|
||||
|
||||
// const logger: ILoggerAdapter = new ColoredLoggerService()
|
||||
|
||||
let device: DeviceInfo;
|
||||
@@ -59,7 +58,10 @@ const createTracingInstance = ({bugPrint, name, module, autoFinish}): TracingTyp
|
||||
span.setAttribute(key, value);
|
||||
},
|
||||
finish: () => {
|
||||
span.end();
|
||||
if(!window.location.origin.includes('https')) {
|
||||
span.end();
|
||||
}
|
||||
|
||||
if(bugPrint && hasBug) {
|
||||
console.error(name, data)
|
||||
}
|
||||
@@ -73,7 +75,7 @@ const createTracingInstance = ({bugPrint, name, module, autoFinish}): TracingTyp
|
||||
}
|
||||
}
|
||||
|
||||
export function XTracerAsync({ name, log, bugPrint, module = null, autoFinish = true }) {
|
||||
export function XTracerAsync({ name, bugPrint, module = null, autoFinish = true }) {
|
||||
return (
|
||||
target: unknown,
|
||||
propertyKey: string,
|
||||
@@ -114,7 +116,7 @@ export function XTracerAsync({ name, log, bugPrint, module = null, autoFinish =
|
||||
}
|
||||
|
||||
|
||||
export function XTracer({ name, log, bugPrint, module, autoFinish = true }: any) {
|
||||
export function XTracer({ name, bugPrint, module, autoFinish = true }) {
|
||||
return (
|
||||
target: unknown,
|
||||
propertyKey: string,
|
||||
|
||||
@@ -99,7 +99,7 @@ export class NotificationsService {
|
||||
}
|
||||
}
|
||||
|
||||
@XTracerAsync({name:'Notification/getAndpostToken', log: false, bugPrint: true, module:'notification', autoFinish: false})
|
||||
@XTracerAsync({name:'Notification/getAndpostToken', bugPrint: true, module:'notification', autoFinish: false})
|
||||
private getAndpostToken(username, tracing?: TracingType) {
|
||||
const geturl = environment.apiURL + 'notifications/token';
|
||||
|
||||
|
||||
@@ -313,7 +313,7 @@ export class TaskService {
|
||||
}
|
||||
|
||||
|
||||
@XTracerAsync({name:'taskService/loadEventosParaAprovacao', log: false, bugPrint: true})
|
||||
@XTracerAsync({name:'taskService/loadEventosParaAprovacao', bugPrint: true})
|
||||
async loadEventosParaAprovacao(tracing?: TracingType) {
|
||||
this.showLoaderNum++
|
||||
console.log('PR')
|
||||
|
||||
Reference in New Issue
Block a user