diff --git a/.gitignore b/.gitignore index 34e76d797..5048f8506 100644 --- a/.gitignore +++ b/.gitignore @@ -98,3 +98,7 @@ src/app/domain _src/ -src plugin copy +pm2.yaml + +# Sentry Config File +.sentryclirc diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100644 index 000000000..2a1952310 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +node version/git-version.js diff --git a/.husky/pre-commit b/.husky/pre-commit index 1577fd5b5..7e311aa7e 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,8 @@ #!/usr/bin/env sh -# . "$(dirname -- "$0")/_/husky.sh" +. "$(dirname -- "$0")/_/husky.sh" -#npm run build:version && git add version/git-version.ts +# Run the node script +node version/git-version.js + +# Add the changes made by the script +git add . diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 96d5670a8..8e8816e52 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ - + diff --git a/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml index c7bd21dbd..ddb26ad77 100644 --- a/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ b/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -1,34 +1,34 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/android/app/src/main/res/drawable/ic_launcher_background.xml b/android/app/src/main/res/drawable/ic_launcher_background.xml index d5fccc538..3a37cf6d0 100644 --- a/android/app/src/main/res/drawable/ic_launcher_background.xml +++ b/android/app/src/main/res/drawable/ic_launcher_background.xml @@ -1,170 +1,170 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index 036d09bc5..67820c56d 100644 --- a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -1,5 +1,5 @@ - - - - + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml index 036d09bc5..67820c56d 100644 --- a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -1,5 +1,5 @@ - - - - + + + + \ No newline at end of file diff --git a/angular.json b/angular.json index 0c755a853..cd7b53a72 100644 --- a/angular.json +++ b/angular.json @@ -68,7 +68,7 @@ ], "optimization": true, "outputHashing": "all", - "sourceMap": false, + "sourceMap": true, "namedChunks": false, "aot": true, "extractLicenses": true, @@ -82,6 +82,22 @@ } ] }, + "oapr": { + "fileReplacements": [ + { + "replace": "src/environments/suport/oapr.ts", + "with": "src/environments/suport/oapr.ts" + } + ] + }, + "div": { + "fileReplacements": [ + { + "replace": "src/environments/suport/dev.ts", + "with": "src/environments/suport/dev.ts" + } + ] + }, "ci": { "progress": false } diff --git a/cypress/enum.ts b/cypress/enum.ts new file mode 100644 index 000000000..309926265 --- /dev/null +++ b/cypress/enum.ts @@ -0,0 +1,30 @@ +export const Cy = { + p: { + login: { + b: { + enter: 'loginbutton' + } + }, + gabinete: { + aside: { + despacho: 'cypress-despacho-item' + }, + }, + search: { + input: { + subject: 'cy-subject-input' + }, + b: { + search:'cy-search-button' + } + } + }, + header: { + b: { + search: 'cy-search-button' + } + }, + footer: { + gabinete: 'cypress-gabinete-tab', + } +} diff --git a/doc/TypeDoc/classes/infra_camera_camera_service.CameraService.html b/doc/TypeDoc/classes/infra_camera_camera_service.CameraService.html new file mode 100644 index 000000000..b5c9bbfb6 --- /dev/null +++ b/doc/TypeDoc/classes/infra_camera_camera_service.CameraService.html @@ -0,0 +1,9 @@ +CameraService | gabinete-digital

Service for handling camera functionality. +This service provides methods to interact with the device's camera.

+

Constructors

Methods

Constructors

Methods

  • Takes a picture using the device's camera.

    +

    Parameters

    Returns Promise<Ok<Photo, never> | Err<never, any>>

    A promise that resolves with an ok result containing the file or an err result containing the error.

    +
diff --git a/doc/TypeDoc/classes/infra_file_picker_file_picker_service.FilePickerService.html b/doc/TypeDoc/classes/infra_file_picker_file_picker_service.FilePickerService.html new file mode 100644 index 000000000..43fd75ca3 --- /dev/null +++ b/doc/TypeDoc/classes/infra_file_picker_file_picker_service.FilePickerService.html @@ -0,0 +1,9 @@ +FilePickerService | gabinete-digital

Service for handling file picking functionality. +This service provides methods to pick a picture from the device's photo library.

+

Constructors

Methods

Constructors

  • Creates an instance of FilePickerService.

    +

    Returns FilePickerService

Methods

  • Picks a picture from the device's photo library.

    +

    Parameters

    • params: PickPictureParams

      The parameters for picking the picture.

      +

    Returns Promise<Ok<Photo, never> | Err<never, any>>

    A promise that resolves with an ok result containing the file or an err result containing the error.

    +
diff --git a/doc/TypeDoc/classes/infra_file_picker_mobile_file_picker_mobile_service.FilePickerMobileService.html b/doc/TypeDoc/classes/infra_file_picker_mobile_file_picker_mobile_service.FilePickerMobileService.html new file mode 100644 index 000000000..6d69a8fd9 --- /dev/null +++ b/doc/TypeDoc/classes/infra_file_picker_mobile_file_picker_mobile_service.FilePickerMobileService.html @@ -0,0 +1,3 @@ +FilePickerMobileService | gabinete-digital

Constructors

Methods

Constructors

Methods

  • Parameters

    • __namedParameters: {
          multiple: any;
          readData: any;
          types: any;
      }
      • multiple: any
      • readData: any
      • types: any

    Returns Promise<Result<PickFilesResult, any>>

diff --git a/doc/TypeDoc/classes/infra_file_picker_web_file_picker_web_service.FilePickerWebService.html b/doc/TypeDoc/classes/infra_file_picker_web_file_picker_web_service.FilePickerWebService.html new file mode 100644 index 000000000..2976e7759 --- /dev/null +++ b/doc/TypeDoc/classes/infra_file_picker_web_file_picker_web_service.FilePickerWebService.html @@ -0,0 +1,3 @@ +FilePickerWebService | gabinete-digital

Constructors

Methods

Constructors

Methods

  • Parameters

    • types: (
          | "image/apng"
          | "image/bmp"
          | "image/gif"
          | "image/jpeg"
          | "image/pjpeg"
          | "image/png"
          | "image/svg+xml"
          | "image/tiff"
          | "image/webp"
          | "image/x-icon"
          | ".doc"
          | ".docx"
          | ".pdf")[]

    Returns Promise<Result<File, any>>

diff --git a/doc/TypeDoc/classes/infra_repository_dexie_dexie_repository_service.DexieRepository.html b/doc/TypeDoc/classes/infra_repository_dexie_dexie_repository_service.DexieRepository.html new file mode 100644 index 000000000..820b3dd1a --- /dev/null +++ b/doc/TypeDoc/classes/infra_repository_dexie_dexie_repository_service.DexieRepository.html @@ -0,0 +1,11 @@ +DexieRepository | gabinete-digital

Type Parameters

  • T

Hierarchy (view full)

Constructors

Methods

diff --git a/doc/TypeDoc/classes/infra_speaker_speaker_service.SpeakerService.html b/doc/TypeDoc/classes/infra_speaker_speaker_service.SpeakerService.html new file mode 100644 index 000000000..495095cdc --- /dev/null +++ b/doc/TypeDoc/classes/infra_speaker_speaker_service.SpeakerService.html @@ -0,0 +1,10 @@ +SpeakerService | gabinete-digital

Constructors

Properties

Methods

Constructors

Properties

recording: boolean = false

Methods

diff --git a/doc/TypeDoc/classes/module_chat_chat_module.ChatModule.html b/doc/TypeDoc/classes/module_chat_chat_module.ChatModule.html new file mode 100644 index 000000000..db33b39ae --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_chat_module.ChatModule.html @@ -0,0 +1,3 @@ +ChatModule | gabinete-digital

Constructors

Methods

diff --git a/doc/TypeDoc/classes/module_chat_chat_service_service.ChatServiceService.html b/doc/TypeDoc/classes/module_chat_chat_service_service.ChatServiceService.html new file mode 100644 index 000000000..a875e73f4 --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_chat_service_service.ChatServiceService.html @@ -0,0 +1,2 @@ +ChatServiceService | gabinete-digital

Constructors

Constructors

diff --git a/doc/TypeDoc/classes/module_chat_data_async_repository_message_repository_aync_service.MessageRepositoryAyncService.html b/doc/TypeDoc/classes/module_chat_data_async_repository_message_repository_aync_service.MessageRepositoryAyncService.html new file mode 100644 index 000000000..182f42c77 --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_data_async_repository_message_repository_aync_service.MessageRepositoryAyncService.html @@ -0,0 +1,2 @@ +MessageRepositoryAyncService | gabinete-digital
diff --git a/doc/TypeDoc/classes/module_chat_data_async_socket_user_typing_async_service.UserTypingAsyncService.html b/doc/TypeDoc/classes/module_chat_data_async_socket_user_typing_async_service.UserTypingAsyncService.html new file mode 100644 index 000000000..60487df28 --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_data_async_socket_user_typing_async_service.UserTypingAsyncService.html @@ -0,0 +1,3 @@ +UserTypingAsyncService | gabinete-digital

Constructors

Properties

Constructors

Properties

typingCallback: {
    [key: string]: Subject<any>;
} = {}
diff --git a/doc/TypeDoc/classes/module_chat_data_data_source_member_list_member_list_local_data_source_service.MemberListLocalDataSourceService.html b/doc/TypeDoc/classes/module_chat_data_data_source_member_list_member_list_local_data_source_service.MemberListLocalDataSourceService.html new file mode 100644 index 000000000..887995127 --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_data_data_source_member_list_member_list_local_data_source_service.MemberListLocalDataSourceService.html @@ -0,0 +1,11 @@ +MemberListLocalDataSourceService | gabinete-digital

Hierarchy (view full)

Constructors

Methods

  • Returns Promise<RepositoryResult<{
        $roomIdUserId?: string;
        id?: string;
        joinAt?: string;
        roomId?: string;
        status?: string;
        user?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
    }[]>>

  • Parameters

    • filter: Object

    Returns Promise<RepositoryResult<{
        $roomIdUserId?: string;
        id?: string;
        joinAt?: string;
        roomId?: string;
        status?: string;
        user?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
    }>>

  • Parameters

    • document: {
          $roomIdUserId?: string;
          id?: string;
          joinAt?: string;
          roomId?: string;
          status?: string;
          user?: {
              userPhoto?: string;
              wxFullName?: string;
              wxUserId?: number;
              wxeMail?: string;
          };
      }
      • Optional$roomIdUserId?: string
      • Optionalid?: string
      • OptionaljoinAt?: string
      • OptionalroomId?: string
      • Optionalstatus?: string
      • Optionaluser?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        }
        • OptionaluserPhoto?: string
        • OptionalwxFullName?: string
        • OptionalwxUserId?: number
        • OptionalwxeMail?: string

    Returns Promise<RepositoryResult<number>>

  • Parameters

    • documents: {
          $roomIdUserId?: string;
          id?: string;
          joinAt?: string;
          roomId?: string;
          status?: string;
          user?: {
              userPhoto?: string;
              wxFullName?: string;
              wxUserId?: number;
              wxeMail?: string;
          };
      }[]

    Returns Promise<RepositoryResult<number[]>>

  • Parameters

    • id: any
    • updatedDocument: Partial<{
          $roomIdUserId?: string;
          id?: string;
          joinAt?: string;
          roomId?: string;
          status?: string;
          user?: {
              userPhoto?: string;
              wxFullName?: string;
              wxUserId?: number;
              wxeMail?: string;
          };
      }>

    Returns Promise<Ok<number, never> | Err<never, Error>>

diff --git a/doc/TypeDoc/classes/module_chat_data_data_source_member_list_member_list_remote_data_source_service.MemberListRemoteDataSourceService.html b/doc/TypeDoc/classes/module_chat_data_data_source_member_list_member_list_remote_data_source_service.MemberListRemoteDataSourceService.html new file mode 100644 index 000000000..851cb935f --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_data_data_source_member_list_member_list_remote_data_source_service.MemberListRemoteDataSourceService.html @@ -0,0 +1,4 @@ +MemberListRemoteDataSourceService | gabinete-digital

Constructors

Methods

diff --git a/doc/TypeDoc/classes/module_chat_data_data_source_message_message_live_data_source_service.MessageLiveDataSourceService.html b/doc/TypeDoc/classes/module_chat_data_data_source_message_message_live_data_source_service.MessageLiveDataSourceService.html new file mode 100644 index 000000000..ffbb315fe --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_data_data_source_message_message_live_data_source_service.MessageLiveDataSourceService.html @@ -0,0 +1,2 @@ +MessageLiveDataSourceService | gabinete-digital
diff --git a/doc/TypeDoc/classes/module_chat_data_data_source_message_message_live_signalr_data_source_service.MessageLiveDataSourceService.html b/doc/TypeDoc/classes/module_chat_data_data_source_message_message_live_signalr_data_source_service.MessageLiveDataSourceService.html new file mode 100644 index 000000000..2d537b94b --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_data_data_source_message_message_live_signalr_data_source_service.MessageLiveDataSourceService.html @@ -0,0 +1,3 @@ +MessageLiveDataSourceService | gabinete-digital

Constructors

Methods

Constructors

Methods

diff --git a/doc/TypeDoc/classes/module_chat_data_data_source_message_message_local_data_source_service.MessageLocalDataSourceService.html b/doc/TypeDoc/classes/module_chat_data_data_source_message_message_local_data_source_service.MessageLocalDataSourceService.html new file mode 100644 index 000000000..b75632d6e --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_data_data_source_message_message_local_data_source_service.MessageLocalDataSourceService.html @@ -0,0 +1,26 @@ +MessageLocalDataSourceService | gabinete-digital

Hierarchy (view full)

Constructors

Properties

messageSubject: Subject<unknown> = ...

Methods

  • Parameters

    • data: {
          attachments?: {
              applicationId?: string;
              docId?: string;
              file?: string;
              fileName?: string;
              fileType?: MessageAttachmentFileType;
              source?: MessageAttachmentSource;
          }[];
          canEdit?: boolean;
          message?: string;
          messageType?: number;
          oneShot?: boolean;
          requestId?: string;
          requireUnlock?: boolean;
          roomId?: string;
          senderId?: number;
      }[]

    Returns Promise<Err<never, boolean> | Ok<number, never>>

  • Parameters

    • data: {
          attachments?: {
              applicationId?: string;
              docId?: string;
              file?: string;
              fileName?: string;
              fileType?: MessageAttachmentFileType;
              source?: MessageAttachmentSource;
          }[];
          canEdit?: boolean;
          message?: string;
          messageType?: number;
          oneShot?: boolean;
          requestId?: string;
          requireUnlock?: boolean;
          roomId?: string;
          senderId?: number;
      }
      • Optionalattachments?: {
            applicationId?: string;
            docId?: string;
            file?: string;
            fileName?: string;
            fileType?: MessageAttachmentFileType;
            source?: MessageAttachmentSource;
        }[]
      • OptionalcanEdit?: boolean
      • Optionalmessage?: string
      • OptionalmessageType?: number
      • OptionaloneShot?: boolean
      • OptionalrequestId?: string
      • OptionalrequireUnlock?: boolean
      • OptionalroomId?: string
      • OptionalsenderId?: number

    Returns Promise<Err<never, boolean> | Ok<number, never>>

  • Parameters

    • id: string

    Returns Promise<Result<{
        $id?: number;
        attachments?: {}[];
        canEdit?: boolean;
        id?: string;
        info?: {}[];
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        reactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[];
        requireUnlock?: boolean;
        roomId?: string;
        sender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        sending?: boolean;
        sentAt?: string;
    }, any>>

  • Returns Promise<RepositoryResult<{
        $id?: number;
        attachments?: {}[];
        canEdit?: boolean;
        id?: string;
        info?: {}[];
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        reactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[];
        requireUnlock?: boolean;
        roomId?: string;
        sender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        sending?: boolean;
        sentAt?: string;
    }[]>>

  • Parameters

    • id: string

    Returns Promise<Err<never, string> | Ok<{
        $id?: number;
        attachments?: {}[];
        canEdit?: boolean;
        id?: string;
        info?: {}[];
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        reactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[];
        requireUnlock?: boolean;
        roomId?: string;
        sender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        sending?: boolean;
        sentAt?: string;
    }, never>>

  • Parameters

    • filter: Object

    Returns Promise<RepositoryResult<{
        $id?: number;
        attachments?: {}[];
        canEdit?: boolean;
        id?: string;
        info?: {}[];
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        reactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[];
        requireUnlock?: boolean;
        roomId?: string;
        sender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        sending?: boolean;
        sentAt?: string;
    }>>

  • Parameters

    • data: {
          $id?: number;
          attachments?: {}[];
          canEdit?: boolean;
          id?: string;
          info?: {}[];
          message?: string;
          messageType?: number;
          oneShot?: boolean;
          reactions?: {
              id?: string;
              reactedAt?: string;
              reaction?: string;
              sender?: {};
          }[];
          requireUnlock?: boolean;
          roomId?: string;
          sender?: {
              userPhoto?: string;
              wxFullName?: string;
              wxUserId?: number;
              wxeMail?: string;
          };
          sending?: boolean;
          sentAt?: string;
      }
      • Optional$id?: number
      • Optionalattachments?: {}[]
      • OptionalcanEdit?: boolean
      • Optionalid?: string
      • Optionalinfo?: {}[]
      • Optionalmessage?: string
      • OptionalmessageType?: number
      • OptionaloneShot?: boolean
      • Optionalreactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[]
      • OptionalrequireUnlock?: boolean
      • OptionalroomId?: string
      • Optionalsender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        }
        • OptionaluserPhoto?: string
        • OptionalwxFullName?: string
        • OptionalwxUserId?: number
        • OptionalwxeMail?: string
      • Optionalsending?: boolean
      • OptionalsentAt?: string

    Returns Promise<Err<never, boolean> | Ok<number, never> | Err<never, Error>>

  • Parameters

    • roomId: string

    Returns PromiseExtended<{
        $id?: number;
        attachments?: {}[];
        canEdit?: boolean;
        id?: string;
        info?: {}[];
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        reactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[];
        requireUnlock?: boolean;
        roomId?: string;
        sender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        sending?: boolean;
        sentAt?: string;
    }[]>

  • Parameters

    • roomId: string

    Returns Observable<{
        $id?: number;
        attachments?: {}[];
        canEdit?: boolean;
        id?: string;
        info?: {}[];
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        reactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[];
        requireUnlock?: boolean;
        roomId?: string;
        sender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        sending?: boolean;
        sentAt?: string;
    }[]>

  • Parameters

    • roomId: string

    Returns Promise<Result<{
        $id?: number;
        attachments?: {}[];
        canEdit?: boolean;
        id?: string;
        info?: {}[];
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        reactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[];
        requireUnlock?: boolean;
        roomId?: string;
        sender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        sending?: boolean;
        sentAt?: string;
    }, any>>

  • Parameters

    • document: {
          $id?: number;
          attachments?: {}[];
          canEdit?: boolean;
          id?: string;
          info?: {}[];
          message?: string;
          messageType?: number;
          oneShot?: boolean;
          reactions?: {
              id?: string;
              reactedAt?: string;
              reaction?: string;
              sender?: {};
          }[];
          requireUnlock?: boolean;
          roomId?: string;
          sender?: {
              userPhoto?: string;
              wxFullName?: string;
              wxUserId?: number;
              wxeMail?: string;
          };
          sending?: boolean;
          sentAt?: string;
      }
      • Optional$id?: number
      • Optionalattachments?: {}[]
      • OptionalcanEdit?: boolean
      • Optionalid?: string
      • Optionalinfo?: {}[]
      • Optionalmessage?: string
      • OptionalmessageType?: number
      • OptionaloneShot?: boolean
      • Optionalreactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[]
      • OptionalrequireUnlock?: boolean
      • OptionalroomId?: string
      • Optionalsender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        }
        • OptionaluserPhoto?: string
        • OptionalwxFullName?: string
        • OptionalwxUserId?: number
        • OptionalwxeMail?: string
      • Optionalsending?: boolean
      • OptionalsentAt?: string

    Returns Promise<RepositoryResult<number>>

  • Parameters

    • documents: {
          $id?: number;
          attachments?: {}[];
          canEdit?: boolean;
          id?: string;
          info?: {}[];
          message?: string;
          messageType?: number;
          oneShot?: boolean;
          reactions?: {
              id?: string;
              reactedAt?: string;
              reaction?: string;
              sender?: {};
          }[];
          requireUnlock?: boolean;
          roomId?: string;
          sender?: {
              userPhoto?: string;
              wxFullName?: string;
              wxUserId?: number;
              wxeMail?: string;
          };
          sending?: boolean;
          sentAt?: string;
      }[]

    Returns Promise<RepositoryResult<number[]>>

  • Parameters

    • __namedParameters: {
          id: any;
      }
      • id: any

    Returns Promise<Err<never, boolean> | Ok<{
        $id?: number;
        attachments?: {}[];
        canEdit?: boolean;
        id?: string;
        info?: {}[];
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        reactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[];
        requireUnlock?: boolean;
        roomId?: string;
        sender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        sending?: boolean;
        sentAt?: string;
    }, never>>

  • Parameters

    • data: {
          attachments?: {
              applicationId?: string;
              docId?: string;
              file?: string;
              fileName?: string;
              fileType?: MessageAttachmentFileType;
              source?: MessageAttachmentSource;
          }[];
          canEdit?: boolean;
          message?: string;
          messageType?: number;
          oneShot?: boolean;
          requestId?: string;
          requireUnlock?: boolean;
          roomId?: string;
          senderId?: number;
      }
      • Optionalattachments?: {
            applicationId?: string;
            docId?: string;
            file?: string;
            fileName?: string;
            fileType?: MessageAttachmentFileType;
            source?: MessageAttachmentSource;
        }[]
      • OptionalcanEdit?: boolean
      • Optionalmessage?: string
      • OptionalmessageType?: number
      • OptionaloneShot?: boolean
      • OptionalrequestId?: string
      • OptionalrequireUnlock?: boolean
      • OptionalroomId?: string
      • OptionalsenderId?: number

    Returns Promise<Err<never, boolean> | Ok<number, never>>

  • Parameters

    • roomId: string

    Returns Observable<{
        $id?: number;
        attachments?: {}[];
        canEdit?: boolean;
        id?: string;
        info?: {}[];
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        reactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[];
        requireUnlock?: boolean;
        roomId?: string;
        sender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        sending?: boolean;
        sentAt?: string;
    }>

  • Parameters

    • id: any
    • updatedDocument: Partial<{
          $id?: number;
          attachments?: {}[];
          canEdit?: boolean;
          id?: string;
          info?: {}[];
          message?: string;
          messageType?: number;
          oneShot?: boolean;
          reactions?: {
              id?: string;
              reactedAt?: string;
              reaction?: string;
              sender?: {};
          }[];
          requireUnlock?: boolean;
          roomId?: string;
          sender?: {
              userPhoto?: string;
              wxFullName?: string;
              wxUserId?: number;
              wxeMail?: string;
          };
          sending?: boolean;
          sentAt?: string;
      }>

    Returns Promise<Ok<number, never> | Err<never, Error>>

  • Parameters

    • data: {
          $id?: number;
          attachments?: {}[];
          canEdit?: boolean;
          id?: string;
          info?: {}[];
          message?: string;
          messageType?: number;
          oneShot?: boolean;
          reactions?: {
              id?: string;
              reactedAt?: string;
              reaction?: string;
              sender?: {};
          }[];
          requireUnlock?: boolean;
          roomId?: string;
          sender?: {
              userPhoto?: string;
              wxFullName?: string;
              wxUserId?: number;
              wxeMail?: string;
          };
          sending?: boolean;
          sentAt?: string;
      }
      • Optional$id?: number
      • Optionalattachments?: {}[]
      • OptionalcanEdit?: boolean
      • Optionalid?: string
      • Optionalinfo?: {}[]
      • Optionalmessage?: string
      • OptionalmessageType?: number
      • OptionaloneShot?: boolean
      • Optionalreactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[]
      • OptionalrequireUnlock?: boolean
      • OptionalroomId?: string
      • Optionalsender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        }
        • OptionaluserPhoto?: string
        • OptionalwxFullName?: string
        • OptionalwxUserId?: number
        • OptionalwxeMail?: string
      • Optionalsending?: boolean
      • OptionalsentAt?: string

    Returns Promise<Err<never, boolean> | Ok<number, never>>

diff --git a/doc/TypeDoc/classes/module_chat_data_data_source_message_message_remote_data_source_service.MessageRemoteDataSourceService.html b/doc/TypeDoc/classes/module_chat_data_data_source_message_message_remote_data_source_service.MessageRemoteDataSourceService.html new file mode 100644 index 000000000..8d76350a8 --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_data_data_source_message_message_remote_data_source_service.MessageRemoteDataSourceService.html @@ -0,0 +1,5 @@ +MessageRemoteDataSourceService | gabinete-digital

Constructors

Methods

  • Parameters

    • id: string

    Returns DataSourceReturn<{
        data?: {
            attachments?: {
                applicationId?: string;
                docId?: string;
                file?: string;
                fileName?: string;
                fileType?: MessageAttachmentFileType;
                source?: MessageAttachmentSource;
            }[];
            canEdit?: boolean;
            deliverAt?: string;
            id?: string;
            info?: {}[];
            message?: string;
            messageType?: number;
            oneShot?: boolean;
            reactions?: {
                id?: string;
                reactedAt?: string;
                reaction?: string;
                sender?: {};
            }[];
            requestId?: string;
            requireUnlock?: boolean;
            roomId?: string;
            sender?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
            sentAt?: string;
        }[];
        message?: string;
        success?: boolean;
    }>

  • Parameters

    • data: {
          attachments?: {
              applicationId?: string;
              docId?: string;
              file?: string;
              fileName?: string;
              fileType?: MessageAttachmentFileType;
              source?: MessageAttachmentSource;
          }[];
          canEdit?: boolean;
          message?: string;
          messageType?: number;
          oneShot?: boolean;
          requestId?: string;
          requireUnlock?: boolean;
          roomId?: string;
          senderId?: number;
      }
      • Optionalattachments?: {
            applicationId?: string;
            docId?: string;
            file?: string;
            fileName?: string;
            fileType?: MessageAttachmentFileType;
            source?: MessageAttachmentSource;
        }[]
      • OptionalcanEdit?: boolean
      • Optionalmessage?: string
      • OptionalmessageType?: number
      • OptionaloneShot?: boolean
      • OptionalrequestId?: string
      • OptionalrequireUnlock?: boolean
      • OptionalroomId?: string
      • OptionalsenderId?: number

    Returns Promise<Result<{
        data?: {
            attachments?: {
                applicationId?: string;
                docId?: string;
                file?: string;
                fileName?: string;
                fileType?: MessageAttachmentFileType;
                source?: MessageAttachmentSource;
            }[];
            canEdit?: boolean;
            deliverAt?: string;
            id?: string;
            info?: {}[];
            message?: string;
            messageType?: number;
            oneShot?: boolean;
            reactions?: {
                id?: string;
                reactedAt?: string;
                reaction?: string;
                sender?: {};
            }[];
            requestId?: string;
            requireUnlock?: boolean;
            roomId?: string;
            sender?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
            sentAt?: string;
        }[];
        message?: string;
        success?: boolean;
    }, HttpErrorResponse>>

diff --git a/doc/TypeDoc/classes/module_chat_data_data_source_room_room_live_data_source_service.RoomLiveDataSourceService.html b/doc/TypeDoc/classes/module_chat_data_data_source_room_room_live_data_source_service.RoomLiveDataSourceService.html new file mode 100644 index 000000000..e42a3b6e2 --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_data_data_source_room_room_live_data_source_service.RoomLiveDataSourceService.html @@ -0,0 +1,3 @@ +RoomLiveDataSourceService | gabinete-digital

Constructors

Methods

Constructors

Methods

diff --git a/doc/TypeDoc/classes/module_chat_data_data_source_room_room_remote_data_source_service.RoomRemoteDataSourceService.html b/doc/TypeDoc/classes/module_chat_data_data_source_room_room_remote_data_source_service.RoomRemoteDataSourceService.html new file mode 100644 index 000000000..e58636777 --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_data_data_source_room_room_remote_data_source_service.RoomRemoteDataSourceService.html @@ -0,0 +1,10 @@ +RoomRemoteDataSourceService | gabinete-digital

Constructors

Methods

  • Parameters

    • data: {
          createdBy?: number;
          expirationDate?: string;
          members?: number[];
          roomName?: string;
          roomType?: number;
      }
      • OptionalcreatedBy?: number
      • OptionalexpirationDate?: string
      • Optionalmembers?: number[]
      • OptionalroomName?: string
      • OptionalroomType?: number

    Returns DataSourceReturn<{
        data?: {
            createdAt?: string;
            createdBy?: any;
            expirationDate?: string;
            id?: string;
            roomName?: string;
            roomType?: any;
        };
        message?: string;
        success?: boolean;
    }>

  • Parameters

    • id: string

    Returns DataSourceReturn<{
        data?: {
            createdAt?: string;
            createdBy?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
            expirationDate?: string;
            id?: string;
            members?: {
                id?: string;
                isAdmin?: boolean;
                joinAt?: string;
                user?: {
                    userPhoto?: string;
                    wxFullName?: string;
                    wxUserId?: number;
                    wxeMail?: string;
                };
            }[];
            roomName?: string;
            roomType?: number;
        };
        message?: string;
        success?: boolean;
    }>

  • Returns Promise<DataSourceReturn<{
        data?: {
            chatRoom?: {
                createdAt?: string;
                createdBy?: {
                    userPhoto?: string;
                    wxFullName?: string;
                    wxUserId?: number;
                    wxeMail?: string;
                };
                expirationDate?: string;
                id?: string;
                roomName?: string;
                roomType?: number;
            };
            joinAt?: string;
        }[];
        message?: string;
        success?: boolean;
    }>>

  • Parameters

    • data: {
          roomId?: string;
          roomName?: string;
          roomType?: number;
      }
      • OptionalroomId?: string
      • OptionalroomName?: string
      • OptionalroomType?: number

    Returns Promise<DataSourceReturn<{
        data?: {
            createdAt?: string;
            createdBy?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
            expirationDate?: string;
            id?: string;
            members?: {
                id?: string;
                joinAt?: string;
                user?: {
                    userPhoto?: string;
                    wxFullName?: string;
                    wxUserId?: number;
                    wxeMail?: string;
                };
            }[];
            roomName?: string;
            roomType?: number;
        };
        message?: string;
        success?: boolean;
    }>>

diff --git a/doc/TypeDoc/classes/module_chat_data_data_source_room_rooom_local_data_source_service.RoomLocalDataSourceService.html b/doc/TypeDoc/classes/module_chat_data_data_source_room_rooom_local_data_source_service.RoomLocalDataSourceService.html new file mode 100644 index 000000000..2911a6a33 --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_data_data_source_room_rooom_local_data_source_service.RoomLocalDataSourceService.html @@ -0,0 +1,21 @@ +RoomLocalDataSourceService | gabinete-digital

Constructors

Methods

  • Parameters

    • data: {
          $roomIdUserId?: string;
          id?: string;
          isAdmin?: boolean;
          joinAt?: string;
          roomId?: string;
          status?: string;
          userPhoto?: string;
          wxFullName?: string;
          wxUserId?: number;
          wxeMail?: string;
      }
      • Optional$roomIdUserId?: string
      • Optionalid?: string
      • OptionalisAdmin?: boolean
      • OptionaljoinAt?: string
      • OptionalroomId?: string
      • Optionalstatus?: string
      • OptionaluserPhoto?: string
      • OptionalwxFullName?: string
      • OptionalwxUserId?: number
      • OptionalwxeMail?: string

    Returns Promise<Err<never, boolean> | Ok<string, never>>

  • Parameters

    • data: {
          createdAt?: any;
          createdBy?: {
              userPhoto?: string;
              wxFullName?: string;
              wxUserId?: number;
              wxeMail?: string;
          };
          expirationDate?: any;
          id?: string;
          roomName?: string;
      }
      • OptionalcreatedAt?: any
      • OptionalcreatedBy?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        }
        • OptionaluserPhoto?: string
        • OptionalwxFullName?: string
        • OptionalwxUserId?: number
        • OptionalwxeMail?: string
      • OptionalexpirationDate?: any
      • Optionalid?: string
      • OptionalroomName?: string

    Returns Promise<Err<never, boolean> | Ok<number, never> | Ok<string, never>>

  • Parameters

    • data: {
          createdAt?: any;
          createdBy?: {
              userPhoto?: string;
              wxFullName?: string;
              wxUserId?: number;
              wxeMail?: string;
          };
          expirationDate?: any;
          id?: string;
          roomName?: string;
      }
      • OptionalcreatedAt?: any
      • OptionalcreatedBy?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        }
        • OptionaluserPhoto?: string
        • OptionalwxFullName?: string
        • OptionalwxUserId?: number
        • OptionalwxeMail?: string
      • OptionalexpirationDate?: any
      • Optionalid?: string
      • OptionalroomName?: string

    Returns Promise<Err<never, boolean> | Ok<string, never>>

  • Returns Observable<{
        data?: {
            chatRoom?: {
                createdAt?: string;
                createdBy?: {
                    userPhoto?: string;
                    wxFullName?: string;
                    wxUserId?: number;
                    wxeMail?: string;
                };
                expirationDate?: string;
                id?: string;
                roomName?: string;
                roomType?: number;
            };
            joinAt?: string;
        }[];
        message?: string;
        success?: boolean;
    }[]>

  • Parameters

    • id: any

    Returns Promise<Err<never, boolean> | Ok<{
        createdAt?: any;
        createdBy?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        expirationDate?: any;
        id?: string;
        roomName?: string;
    }, never>>

  • Parameters

    • id: any

    Returns Observable<{
        chatRoom?: {
            createdAt?: string;
            createdBy?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
            expirationDate?: string;
            id?: string;
            roomName?: string;
            roomType?: number;
        };
        joinAt?: string;
    }>

  • Returns Promise<{
        createdAt?: any;
        createdBy?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        expirationDate?: any;
        id?: string;
        roomName?: string;
    }[]>

  • Parameters

    • roomId: any

    Returns Promise<{
        $roomIdUserId?: string;
        id?: string;
        isAdmin?: boolean;
        joinAt?: string;
        roomId?: string;
        status?: string;
        userPhoto?: string;
        wxFullName?: string;
        wxUserId?: number;
        wxeMail?: string;
    }[]>

  • Parameters

    • roomId: any

    Returns Observable<{
        $roomIdUserId?: string;
        id?: string;
        isAdmin?: boolean;
        joinAt?: string;
        roomId?: string;
        status?: string;
        userPhoto?: string;
        wxFullName?: string;
        wxUserId?: number;
        wxeMail?: string;
    }[]>

  • Parameters

    • roomId: any

    Returns Observable<{
        $roomIdUserId?: string;
        id?: string;
        isAdmin?: boolean;
        joinAt?: string;
        roomId?: string;
        status?: string;
        userPhoto?: string;
        wxFullName?: string;
        wxUserId?: number;
        wxeMail?: string;
    }[]>

  • Parameters

    • data: {
          $roomIdUserId?: string;
          id?: string;
          isAdmin?: boolean;
          joinAt?: string;
          roomId?: string;
          status?: string;
          userPhoto?: string;
          wxFullName?: string;
          wxUserId?: number;
          wxeMail?: string;
      }
      • Optional$roomIdUserId?: string
      • Optionalid?: string
      • OptionalisAdmin?: boolean
      • OptionaljoinAt?: string
      • OptionalroomId?: string
      • Optionalstatus?: string
      • OptionaluserPhoto?: string
      • OptionalwxFullName?: string
      • OptionalwxUserId?: number
      • OptionalwxeMail?: string

    Returns Promise<Err<never, boolean> | Ok<number, never>>

  • Parameters

    • data: {
          createdAt?: any;
          createdBy?: {
              userPhoto?: string;
              wxFullName?: string;
              wxUserId?: number;
              wxeMail?: string;
          };
          expirationDate?: any;
          id?: string;
          roomName?: string;
      }
      • OptionalcreatedAt?: any
      • OptionalcreatedBy?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        }
        • OptionaluserPhoto?: string
        • OptionalwxFullName?: string
        • OptionalwxUserId?: number
        • OptionalwxeMail?: string
      • OptionalexpirationDate?: any
      • Optionalid?: string
      • OptionalroomName?: string

    Returns Promise<Err<never, boolean> | Ok<number, never>>

diff --git a/doc/TypeDoc/classes/module_chat_data_data_source_userTyping_user_typing_live_data_source_service.UserTypingLiveDataSourceService.html b/doc/TypeDoc/classes/module_chat_data_data_source_userTyping_user_typing_live_data_source_service.UserTypingLiveDataSourceService.html new file mode 100644 index 000000000..886752d1f --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_data_data_source_userTyping_user_typing_live_data_source_service.UserTypingLiveDataSourceService.html @@ -0,0 +1,3 @@ +UserTypingLiveDataSourceService | gabinete-digital

Constructors

Methods

Constructors

Methods

diff --git a/doc/TypeDoc/classes/module_chat_data_data_source_userTyping_user_typing_local_data_source_service.UserTypingLocalDataSourceService.html b/doc/TypeDoc/classes/module_chat_data_data_source_userTyping_user_typing_local_data_source_service.UserTypingLocalDataSourceService.html new file mode 100644 index 000000000..88b95ed36 --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_data_data_source_userTyping_user_typing_local_data_source_service.UserTypingLocalDataSourceService.html @@ -0,0 +1,5 @@ +UserTypingLocalDataSourceService | gabinete-digital

Constructors

Methods

  • Parameters

    • data: {
          chatRoomId?: string;
          entryDate?: string;
          id?: string;
          userId?: string;
          userName?: string;
      }
      • OptionalchatRoomId?: string
      • OptionalentryDate?: string
      • Optionalid?: string
      • OptionaluserId?: string
      • OptionaluserName?: string

    Returns Promise<Err<never, boolean> | Ok<string, never>>

  • Parameters

    • data: {
          chatRoomId?: string;
          entryDate?: string;
          id?: string;
          userId?: string;
          userName?: string;
      }
      • OptionalchatRoomId?: string
      • OptionalentryDate?: string
      • Optionalid?: string
      • OptionaluserId?: string
      • OptionaluserName?: string

    Returns Promise<Err<never, boolean> | Ok<void, never>>

diff --git a/doc/TypeDoc/classes/module_chat_data_repository_message_respository_service.MessageRepositoryService.html b/doc/TypeDoc/classes/module_chat_data_repository_message_respository_service.MessageRepositoryService.html new file mode 100644 index 000000000..ca84d3d5b --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_data_repository_message_respository_service.MessageRepositoryService.html @@ -0,0 +1,12 @@ +MessageRepositoryService | gabinete-digital

Constructors

Methods

  • Parameters

    • roomId: string

    Returns Observable<{
        $id?: number;
        attachments?: {}[];
        canEdit?: boolean;
        id?: string;
        info?: {}[];
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        reactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[];
        requireUnlock?: boolean;
        roomId?: string;
        sender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        sending?: boolean;
        sentAt?: string;
    }[]>

  • Parameters

    • id: string

    Returns Promise<Result<{
        data?: {
            attachments?: {
                applicationId?: string;
                docId?: string;
                file?: string;
                fileName?: string;
                fileType?: MessageAttachmentFileType;
                source?: MessageAttachmentSource;
            }[];
            canEdit?: boolean;
            deliverAt?: string;
            id?: string;
            info?: {}[];
            message?: string;
            messageType?: number;
            oneShot?: boolean;
            reactions?: {
                id?: string;
                reactedAt?: string;
                reaction?: string;
                sender?: {};
            }[];
            requestId?: string;
            requireUnlock?: boolean;
            roomId?: string;
            sender?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
            sentAt?: string;
        }[];
        message?: string;
        success?: boolean;
    }, HttpErrorResponse | ZodError<any>>>

  • Parameters

    • data: {
          messageId?: string;
          requestId?: string;
          roomId?: string;
          senderId?: number;
      }
      • OptionalmessageId?: string
      • OptionalrequestId?: string
      • OptionalroomId?: string
      • OptionalsenderId?: number

    Returns Promise<unknown>

  • Parameters

    • roomId: any

    Returns Observable<{
        $id?: number;
        attachments?: {}[];
        canEdit?: boolean;
        id?: string;
        info?: {}[];
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        reactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[];
        requireUnlock?: boolean;
        roomId?: string;
        sender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        sending?: boolean;
        sentAt?: string;
    }>

  • Parameters

    • input: {
          memberId?: number;
          message?: string;
          messageId?: string;
          requestId?: string;
          roomId?: string;
      }
      • OptionalmemberId?: number
      • Optionalmessage?: string
      • OptionalmessageId?: string
      • OptionalrequestId?: string
      • OptionalroomId?: string

    Returns void

diff --git a/doc/TypeDoc/classes/module_chat_data_repository_room_repository_service.RoomRepositoryService.html b/doc/TypeDoc/classes/module_chat_data_repository_room_repository_service.RoomRepositoryService.html new file mode 100644 index 000000000..86656864a --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_data_repository_room_repository_service.RoomRepositoryService.html @@ -0,0 +1,18 @@ +RoomRepositoryService | gabinete-digital

Constructors

Methods

  • Parameters

    • data: {
          createdBy?: number;
          expirationDate?: string;
          members?: number[];
          roomName?: string;
          roomType?: number;
      }
      • OptionalcreatedBy?: number
      • OptionalexpirationDate?: string
      • Optionalmembers?: number[]
      • OptionalroomName?: string
      • OptionalroomType?: number

    Returns Promise<Err<{
        data?: {
            createdAt?: string;
            createdBy?: any;
            expirationDate?: string;
            id?: string;
            roomName?: string;
            roomType?: any;
        };
        message?: string;
        success?: boolean;
    }, HttpErrorResponse | ZodError<any>> | Ok<{
        data?: {
            createdAt?: string;
            createdBy?: any;
            expirationDate?: string;
            id?: string;
            roomName?: string;
            roomType?: any;
        };
        message?: string;
        success?: boolean;
    }, boolean> | Err<{
        data?: {
            createdAt?: string;
            createdBy?: any;
            expirationDate?: string;
            id?: string;
            roomName?: string;
            roomType?: any;
        };
        message?: string;
        success?: boolean;
    }, boolean>>

  • Parameters

    • id: any

    Returns Observable<{
        chatRoom?: {
            createdAt?: string;
            createdBy?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
            expirationDate?: string;
            id?: string;
            roomName?: string;
            roomType?: number;
        };
        joinAt?: string;
    }>

  • Returns Observable<{
        data?: {
            chatRoom?: {
                createdAt?: string;
                createdBy?: {
                    userPhoto?: string;
                    wxFullName?: string;
                    wxUserId?: number;
                    wxeMail?: string;
                };
                expirationDate?: string;
                id?: string;
                roomName?: string;
                roomType?: number;
            };
            joinAt?: string;
        }[];
        message?: string;
        success?: boolean;
    }[]>

  • Parameters

    • id: string

    Returns Promise<Result<{
        data?: {
            createdAt?: string;
            createdBy?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
            expirationDate?: string;
            id?: string;
            members?: {
                id?: string;
                isAdmin?: boolean;
                joinAt?: string;
                user?: {
                    userPhoto?: string;
                    wxFullName?: string;
                    wxUserId?: number;
                    wxeMail?: string;
                };
            }[];
            roomName?: string;
            roomType?: number;
        };
        message?: string;
        success?: boolean;
    }, HttpErrorResponse | ZodError<any>>>

  • Parameters

    • roomId: any

    Returns Promise<{
        $roomIdUserId?: string;
        id?: string;
        isAdmin?: boolean;
        joinAt?: string;
        roomId?: string;
        status?: string;
        userPhoto?: string;
        wxFullName?: string;
        wxUserId?: number;
        wxeMail?: string;
    }[]>

  • Parameters

    • roomId: any

    Returns Observable<{
        $roomIdUserId?: string;
        id?: string;
        isAdmin?: boolean;
        joinAt?: string;
        roomId?: string;
        status?: string;
        userPhoto?: string;
        wxFullName?: string;
        wxUserId?: number;
        wxeMail?: string;
    }[]>

  • Parameters

    • roomId: any

    Returns Observable<{
        $roomIdUserId?: string;
        id?: string;
        isAdmin?: boolean;
        joinAt?: string;
        roomId?: string;
        status?: string;
        userPhoto?: string;
        wxFullName?: string;
        wxUserId?: number;
        wxeMail?: string;
    }[]>

  • Returns Promise<Result<{
        data?: {
            chatRoom?: {
                createdAt?: string;
                createdBy?: {
                    userPhoto?: string;
                    wxFullName?: string;
                    wxUserId?: number;
                    wxeMail?: string;
                };
                expirationDate?: string;
                id?: string;
                roomName?: string;
                roomType?: number;
            };
            joinAt?: string;
        }[];
        message?: string;
        success?: boolean;
    }, HttpErrorResponse | ZodError<any>>>

  • Parameters

    • data: {
          key?: string;
          value?: {
              userId?: number;
              userName?: string;
          };
      }[]

    Returns Promise<Ok<boolean, never> | Err<never, any>>

  • Parameters

    • data: {
          roomId?: string;
          roomName?: string;
          roomType?: number;
      }
      • OptionalroomId?: string
      • OptionalroomName?: string
      • OptionalroomType?: number

    Returns Promise<Result<{
        data?: {
            createdAt?: string;
            createdBy?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
            expirationDate?: string;
            id?: string;
            members?: {
                id?: string;
                joinAt?: string;
                user?: {
                    userPhoto?: string;
                    wxFullName?: string;
                    wxUserId?: number;
                    wxeMail?: string;
                };
            }[];
            roomName?: string;
            roomType?: number;
        };
        message?: string;
        success?: boolean;
    }, HttpErrorResponse | ZodError<any>>>

diff --git a/doc/TypeDoc/classes/module_chat_data_repository_user_typing_repository_service.UserTypingServiceRepository.html b/doc/TypeDoc/classes/module_chat_data_repository_user_typing_repository_service.UserTypingServiceRepository.html new file mode 100644 index 000000000..88be8063f --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_data_repository_user_typing_repository_service.UserTypingServiceRepository.html @@ -0,0 +1,5 @@ +UserTypingServiceRepository | gabinete-digital

Constructors

Methods

  • Returns Observable<{
        chatRoomId?: string;
        entryDate?: string;
        id?: string;
        userId?: string;
        userName?: string;
    }[]>

  • Parameters

    • data: {
          chatRoomId?: string;
          entryDate?: string;
          id?: string;
          userId?: string;
          userName?: string;
      }
      • OptionalchatRoomId?: string
      • OptionalentryDate?: string
      • Optionalid?: string
      • OptionaluserId?: string
      • OptionaluserName?: string

    Returns Promise<Err<never, boolean> | Ok<void, never>>

diff --git a/doc/TypeDoc/classes/module_chat_data_service_sync_repository_sync_message_repository_service.SyncMessageRepositoryService.html b/doc/TypeDoc/classes/module_chat_data_service_sync_repository_sync_message_repository_service.SyncMessageRepositoryService.html new file mode 100644 index 000000000..d418d69b3 --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_data_service_sync_repository_sync_message_repository_service.SyncMessageRepositoryService.html @@ -0,0 +1,3 @@ +SyncMessageRepositoryService | gabinete-digital

Constructors

Methods

Constructors

Methods

diff --git a/doc/TypeDoc/classes/module_chat_domain_chat_service_service.ChatServiceService.html b/doc/TypeDoc/classes/module_chat_domain_chat_service_service.ChatServiceService.html new file mode 100644 index 000000000..78946a77c --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_domain_chat_service_service.ChatServiceService.html @@ -0,0 +1,7 @@ +ChatServiceService | gabinete-digital

Constructors

Methods

  • Parameters

    • input: {
          memberId?: number;
          messageId?: string;
          reaction?: string;
          requestId?: string;
          roomId?: string;
      }
      • OptionalmemberId?: number
      • OptionalmessageId?: string
      • Optionalreaction?: string
      • OptionalrequestId?: string
      • OptionalroomId?: string

    Returns void

  • Parameters

    • input: {
          memberId?: number;
          message?: string;
          messageId?: string;
          requestId?: string;
          roomId?: string;
      }
      • OptionalmemberId?: number
      • Optionalmessage?: string
      • OptionalmessageId?: string
      • OptionalrequestId?: string
      • OptionalroomId?: string

    Returns void

diff --git a/doc/TypeDoc/classes/module_chat_domain_entity_message.MessageEntity.html b/doc/TypeDoc/classes/module_chat_domain_entity_message.MessageEntity.html new file mode 100644 index 000000000..a1842493f --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_domain_entity_message.MessageEntity.html @@ -0,0 +1,16 @@ +MessageEntity | gabinete-digital

Implements

  • Message

Constructors

Properties

$id: number
attachments: {
    applicationId?: string;
    docId?: string;
    file?: string;
    fileName: string;
    fileType: MessageAttachmentFileType;
    source: MessageAttachmentSource;
}[]
canEdit: boolean = false
id: string
message: string
messageType: number = 0
oneShot: boolean = false
requireUnlock: boolean = false
roomId: string
sendAttemp: number = 0
sender: {
    userPhoto: string;
    wxFullName: string;
    wxUserId: number;
    wxeMail: string;
}
sending: boolean = false
sentAt: string

Accessors

diff --git a/doc/TypeDoc/classes/module_chat_domain_mapper_messageMapper.MessageMapper.html b/doc/TypeDoc/classes/module_chat_domain_mapper_messageMapper.MessageMapper.html new file mode 100644 index 000000000..e6dcd40af --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_domain_mapper_messageMapper.MessageMapper.html @@ -0,0 +1,4 @@ +MessageMapper | gabinete-digital

Constructors

Methods

Constructors

Methods

  • Parameters

    Returns {
        attachments?: {
            applicationId?: string;
            docId?: string;
            file?: string;
            fileName?: string;
            fileType?: MessageAttachmentFileType;
            source?: MessageAttachmentSource;
        }[];
        canEdit?: boolean;
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        requestId?: string;
        requireUnlock?: boolean;
        roomId?: string;
        senderId?: number;
    }

    • Optionalattachments?: {
          applicationId?: string;
          docId?: string;
          file?: string;
          fileName?: string;
          fileType?: MessageAttachmentFileType;
          source?: MessageAttachmentSource;
      }[]
    • OptionalcanEdit?: boolean
    • Optionalmessage?: string
    • OptionalmessageType?: number
    • OptionaloneShot?: boolean
    • OptionalrequestId?: string
    • OptionalrequireUnlock?: boolean
    • OptionalroomId?: string
    • OptionalsenderId?: number
  • Parameters

    • DTO: {
          attachments?: {
              applicationId?: string;
              docId?: string;
              file?: string;
              fileName?: string;
              fileType?: MessageAttachmentFileType;
              source?: MessageAttachmentSource;
          }[];
          canEdit?: boolean;
          deliverAt?: string;
          id?: string;
          info?: {}[];
          message?: string;
          messageType?: number;
          oneShot?: boolean;
          reactions?: {
              id?: string;
              reactedAt?: string;
              reaction?: string;
              sender?: {};
          }[];
          requestId?: string;
          requireUnlock?: boolean;
          roomId?: string;
          sender?: {
              userPhoto?: string;
              wxFullName?: string;
              wxUserId?: number;
              wxeMail?: string;
          };
          sentAt?: string;
      }
      • Optionalattachments?: {
            applicationId?: string;
            docId?: string;
            file?: string;
            fileName?: string;
            fileType?: MessageAttachmentFileType;
            source?: MessageAttachmentSource;
        }[]
      • OptionalcanEdit?: boolean
      • OptionaldeliverAt?: string
      • Optionalid?: string
      • Optionalinfo?: {}[]
      • Optionalmessage?: string
      • OptionalmessageType?: number
      • OptionaloneShot?: boolean
      • Optionalreactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[]
      • OptionalrequestId?: string
      • OptionalrequireUnlock?: boolean
      • OptionalroomId?: string
      • Optionalsender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        }
        • OptionaluserPhoto?: string
        • OptionalwxFullName?: string
        • OptionalwxUserId?: number
        • OptionalwxeMail?: string
      • OptionalsentAt?: string

    Returns MessageEntity

diff --git a/doc/TypeDoc/classes/module_chat_domain_use_case_member_admin_use_case_service.MemberAdminUseCaseService.html b/doc/TypeDoc/classes/module_chat_domain_use_case_member_admin_use_case_service.MemberAdminUseCaseService.html new file mode 100644 index 000000000..4e8886da7 --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_domain_use_case_member_admin_use_case_service.MemberAdminUseCaseService.html @@ -0,0 +1,4 @@ +MemberAdminUseCaseService | gabinete-digital

Constructors

Properties

Methods

Constructors

Properties

Methods

diff --git a/doc/TypeDoc/classes/module_chat_domain_use_case_message_create_use_case_service.MessageCreateUseCaseService.html b/doc/TypeDoc/classes/module_chat_domain_use_case_message_create_use_case_service.MessageCreateUseCaseService.html new file mode 100644 index 000000000..e54506865 --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_domain_use_case_message_create_use_case_service.MessageCreateUseCaseService.html @@ -0,0 +1,3 @@ +MessageCreateUseCaseService | gabinete-digital

Constructors

Methods

Constructors

Methods

diff --git a/doc/TypeDoc/classes/module_chat_domain_use_case_message_delete_live_use_case_service.MessageDeleteLiveUseCaseService.html b/doc/TypeDoc/classes/module_chat_domain_use_case_message_delete_live_use_case_service.MessageDeleteLiveUseCaseService.html new file mode 100644 index 000000000..8d02b5bea --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_domain_use_case_message_delete_live_use_case_service.MessageDeleteLiveUseCaseService.html @@ -0,0 +1,4 @@ +MessageDeleteLiveUseCaseService | gabinete-digital

Constructors

Properties

Methods

Constructors

Properties

Methods

diff --git a/doc/TypeDoc/classes/module_chat_domain_use_case_message_reaction_use_case_service.MessageReactionUseCaseService.html b/doc/TypeDoc/classes/module_chat_domain_use_case_message_reaction_use_case_service.MessageReactionUseCaseService.html new file mode 100644 index 000000000..12a19ccd7 --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_domain_use_case_message_reaction_use_case_service.MessageReactionUseCaseService.html @@ -0,0 +1,4 @@ +MessageReactionUseCaseService | gabinete-digital

Constructors

Properties

Methods

Constructors

Properties

Methods

  • Parameters

    • input: {
          memberId?: number;
          messageId?: string;
          reaction?: string;
          requestId?: string;
          roomId?: string;
      }
      • OptionalmemberId?: number
      • OptionalmessageId?: string
      • Optionalreaction?: string
      • OptionalrequestId?: string
      • OptionalroomId?: string

    Returns void

diff --git a/doc/TypeDoc/classes/module_chat_domain_use_case_message_update_use_case_service.MessageUpdateUseCaseService.html b/doc/TypeDoc/classes/module_chat_domain_use_case_message_update_use_case_service.MessageUpdateUseCaseService.html new file mode 100644 index 000000000..3f02d6eec --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_domain_use_case_message_update_use_case_service.MessageUpdateUseCaseService.html @@ -0,0 +1,4 @@ +MessageUpdateUseCaseService | gabinete-digital

Constructors

Properties

Methods

Constructors

Properties

Methods

  • Parameters

    • input: {
          memberId?: number;
          message?: string;
          messageId?: string;
          requestId?: string;
          roomId?: string;
      }
      • OptionalmemberId?: number
      • Optionalmessage?: string
      • OptionalmessageId?: string
      • OptionalrequestId?: string
      • OptionalroomId?: string

    Returns void

diff --git a/doc/TypeDoc/classes/module_chat_domain_use_case_socket_member_list_update_status_use_case_service.MemberListUpdateStatusUseCaseService.html b/doc/TypeDoc/classes/module_chat_domain_use_case_socket_member_list_update_status_use_case_service.MemberListUpdateStatusUseCaseService.html new file mode 100644 index 000000000..c748000ce --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_domain_use_case_socket_member_list_update_status_use_case_service.MemberListUpdateStatusUseCaseService.html @@ -0,0 +1,3 @@ +MemberListUpdateStatusUseCaseService | gabinete-digital

Constructors

Methods

Constructors

Methods

diff --git a/doc/TypeDoc/classes/module_chat_domain_use_case_socket_socket_message_create_use_case_service.SocketMessageCreateUseCaseService.html b/doc/TypeDoc/classes/module_chat_domain_use_case_socket_socket_message_create_use_case_service.SocketMessageCreateUseCaseService.html new file mode 100644 index 000000000..2fefff065 --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_domain_use_case_socket_socket_message_create_use_case_service.SocketMessageCreateUseCaseService.html @@ -0,0 +1,3 @@ +SocketMessageCreateUseCaseService | gabinete-digital

Constructors

Methods

Constructors

Methods

diff --git a/doc/TypeDoc/classes/module_chat_domain_use_case_socket_socket_message_delete_use_case_service.SocketMessageDeleteUseCaseService.html b/doc/TypeDoc/classes/module_chat_domain_use_case_socket_socket_message_delete_use_case_service.SocketMessageDeleteUseCaseService.html new file mode 100644 index 000000000..6bbe2b777 --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_domain_use_case_socket_socket_message_delete_use_case_service.SocketMessageDeleteUseCaseService.html @@ -0,0 +1,3 @@ +SocketMessageDeleteUseCaseService | gabinete-digital

Constructors

Methods

Constructors

Methods

  • Parameters

    • input: {
          attachments?: {
              applicationId?: string;
              docId?: string;
              file?: string;
              fileName?: string;
              fileType?: MessageAttachmentFileType;
              source?: MessageAttachmentSource;
          }[];
          canEdit?: boolean;
          deliverAt?: string;
          id?: string;
          info?: {}[];
          message?: string;
          messageType?: number;
          oneShot?: boolean;
          reactions?: {
              id?: string;
              reactedAt?: string;
              reaction?: string;
              sender?: {};
          }[];
          requestId?: string;
          requireUnlock?: boolean;
          roomId?: string;
          sender?: {
              userPhoto?: string;
              wxFullName?: string;
              wxUserId?: number;
              wxeMail?: string;
          };
          sentAt?: string;
      }
      • Optionalattachments?: {
            applicationId?: string;
            docId?: string;
            file?: string;
            fileName?: string;
            fileType?: MessageAttachmentFileType;
            source?: MessageAttachmentSource;
        }[]
      • OptionalcanEdit?: boolean
      • OptionaldeliverAt?: string
      • Optionalid?: string
      • Optionalinfo?: {}[]
      • Optionalmessage?: string
      • OptionalmessageType?: number
      • OptionaloneShot?: boolean
      • Optionalreactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[]
      • OptionalrequestId?: string
      • OptionalrequireUnlock?: boolean
      • OptionalroomId?: string
      • Optionalsender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        }
        • OptionaluserPhoto?: string
        • OptionalwxFullName?: string
        • OptionalwxUserId?: number
        • OptionalwxeMail?: string
      • OptionalsentAt?: string

    Returns Promise<void>

diff --git a/doc/TypeDoc/classes/module_chat_domain_use_case_socket_socket_message_update_use_case_service.SocketMessageUpdateUseCaseService.html b/doc/TypeDoc/classes/module_chat_domain_use_case_socket_socket_message_update_use_case_service.SocketMessageUpdateUseCaseService.html new file mode 100644 index 000000000..2d12afeeb --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_domain_use_case_socket_socket_message_update_use_case_service.SocketMessageUpdateUseCaseService.html @@ -0,0 +1,3 @@ +SocketMessageUpdateUseCaseService | gabinete-digital

Constructors

Methods

Constructors

Methods

  • Parameters

    • data: {
          attachments?: {
              applicationId?: string;
              docId?: string;
              file?: string;
              fileName?: string;
              fileType?: MessageAttachmentFileType;
              source?: MessageAttachmentSource;
          }[];
          canEdit?: boolean;
          deliverAt?: string;
          id?: string;
          info?: {}[];
          message?: string;
          messageType?: number;
          oneShot?: boolean;
          reactions?: {
              id?: string;
              reactedAt?: string;
              reaction?: string;
              sender?: {};
          }[];
          requestId?: string;
          requireUnlock?: boolean;
          roomId?: string;
          sender?: {
              userPhoto?: string;
              wxFullName?: string;
              wxUserId?: number;
              wxeMail?: string;
          };
          sentAt?: string;
      }
      • Optionalattachments?: {
            applicationId?: string;
            docId?: string;
            file?: string;
            fileName?: string;
            fileType?: MessageAttachmentFileType;
            source?: MessageAttachmentSource;
        }[]
      • OptionalcanEdit?: boolean
      • OptionaldeliverAt?: string
      • Optionalid?: string
      • Optionalinfo?: {}[]
      • Optionalmessage?: string
      • OptionalmessageType?: number
      • OptionaloneShot?: boolean
      • Optionalreactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[]
      • OptionalrequestId?: string
      • OptionalrequireUnlock?: boolean
      • OptionalroomId?: string
      • Optionalsender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        }
        • OptionaluserPhoto?: string
        • OptionalwxFullName?: string
        • OptionalwxUserId?: number
        • OptionalwxeMail?: string
      • OptionalsentAt?: string
    • Optionaltracing: TracingType

    Returns Promise<Ok<number, never> | Err<never, Error>>

diff --git a/doc/TypeDoc/classes/module_chat_domain_use_case_sync_local_message_service.SyncLocalMessageService.html b/doc/TypeDoc/classes/module_chat_domain_use_case_sync_local_message_service.SyncLocalMessageService.html new file mode 100644 index 000000000..22537b638 --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_domain_use_case_sync_local_message_service.SyncLocalMessageService.html @@ -0,0 +1,3 @@ +SyncLocalMessageService | gabinete-digital

Constructors

Methods

Constructors

Methods

diff --git a/doc/TypeDoc/classes/module_chat_infra_socket_signalR.SignalRConnection.html b/doc/TypeDoc/classes/module_chat_infra_socket_signalR.SignalRConnection.html new file mode 100644 index 000000000..1b5cce669 --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_infra_socket_signalR.SignalRConnection.html @@ -0,0 +1,21 @@ +SignalRConnection | gabinete-digital

Constructors

Properties

url: string

Methods

  • Parameters

    • data: {
          messageId?: string;
          requestId?: string;
          roomId?: string;
          senderId?: number;
      }
      • OptionalmessageId?: string
      • OptionalrequestId?: string
      • OptionalroomId?: string
      • OptionalsenderId?: number

    Returns Promise<unknown>

  • Returns Observable<{
        attachments?: {
            applicationId?: string;
            docId?: string;
            file?: string;
            fileName?: string;
            fileType?: MessageAttachmentFileType;
            source?: MessageAttachmentSource;
        }[];
        canEdit?: boolean;
        deliverAt?: string;
        id?: string;
        info?: {}[];
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        reactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[];
        requestId?: string;
        requireUnlock?: boolean;
        roomId?: string;
        sender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        sentAt?: string;
    }>

  • Returns Observable<{
        attachments?: {
            applicationId?: string;
            docId?: string;
            file?: string;
            fileName?: string;
            fileType?: MessageAttachmentFileType;
            source?: MessageAttachmentSource;
        }[];
        canEdit?: boolean;
        deliverAt?: string;
        id?: string;
        info?: {}[];
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        reactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[];
        requestId?: string;
        requireUnlock?: boolean;
        roomId?: string;
        sender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        sentAt?: string;
    }>

  • Returns Observable<{
        attachments?: {
            applicationId?: string;
            docId?: string;
            file?: string;
            fileName?: string;
            fileType?: MessageAttachmentFileType;
            source?: MessageAttachmentSource;
        }[];
        canEdit?: boolean;
        deliverAt?: string;
        id?: string;
        info?: {}[];
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        reactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[];
        requestId?: string;
        requireUnlock?: boolean;
        roomId?: string;
        sender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        sentAt?: string;
    }>

  • Returns Observable<{
        requestId?: string;
        roomId?: string;
        userId?: string;
        userName?: string;
    }>

  • Parameters

    • input: {
          data?: objectOutputType<{
              requestId: ZodString;
          }, ZodUnknown, "strip">;
          method?: string;
      }
      • Optionaldata?: objectOutputType<{
            requestId: ZodString;
        }, ZodUnknown, "strip">
      • Optionalmethod?: string

    Returns Promise<unknown>

  • Parameters

    • data: {
          memberId?: number;
          messageId?: string;
          reaction?: string;
          requestId?: string;
          roomId?: string;
      }
      • OptionalmemberId?: number
      • OptionalmessageId?: string
      • Optionalreaction?: string
      • OptionalrequestId?: string
      • OptionalroomId?: string

    Returns Promise<Result<any, any>>

diff --git a/doc/TypeDoc/classes/module_chat_infra_socket_signal_r_service.SignalRService.html b/doc/TypeDoc/classes/module_chat_infra_socket_signal_r_service.SignalRService.html new file mode 100644 index 000000000..28c283ac3 --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_infra_socket_signal_r_service.SignalRService.html @@ -0,0 +1,15 @@ +SignalRService | gabinete-digital

Constructors

Methods

  • Returns Observable<{
        attachments?: {
            applicationId?: string;
            docId?: string;
            file?: string;
            fileName?: string;
            fileType?: MessageAttachmentFileType;
            source?: MessageAttachmentSource;
        }[];
        canEdit?: boolean;
        deliverAt?: string;
        id?: string;
        info?: {}[];
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        reactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[];
        requestId?: string;
        requireUnlock?: boolean;
        roomId?: string;
        sender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        sentAt?: string;
    }>

  • Returns Observable<{
        attachments?: {
            applicationId?: string;
            docId?: string;
            file?: string;
            fileName?: string;
            fileType?: MessageAttachmentFileType;
            source?: MessageAttachmentSource;
        }[];
        canEdit?: boolean;
        deliverAt?: string;
        id?: string;
        info?: {}[];
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        reactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[];
        requestId?: string;
        requireUnlock?: boolean;
        roomId?: string;
        sender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        sentAt?: string;
    }>

  • Returns Observable<{
        attachments?: {
            applicationId?: string;
            docId?: string;
            file?: string;
            fileName?: string;
            fileType?: MessageAttachmentFileType;
            source?: MessageAttachmentSource;
        }[];
        canEdit?: boolean;
        deliverAt?: string;
        id?: string;
        info?: {}[];
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        reactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[];
        requestId?: string;
        requireUnlock?: boolean;
        roomId?: string;
        sender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        sentAt?: string;
    }>

  • Returns Observable<{
        requestId?: string;
        roomId?: string;
        userId?: string;
        userName?: string;
    }>

  • Parameters

    • input: {
          data?: objectOutputType<{
              requestId: ZodString;
          }, ZodUnknown, "strip">;
          method?: string;
      }
      • Optionaldata?: objectOutputType<{
            requestId: ZodString;
        }, ZodUnknown, "strip">
      • Optionalmethod?: string

    Returns Promise<unknown>

  • Parameters

    • data: {
          messageId?: string;
          requestId?: string;
          roomId?: string;
          senderId?: number;
      }
      • OptionalmessageId?: string
      • OptionalrequestId?: string
      • OptionalroomId?: string
      • OptionalsenderId?: number

    Returns Promise<unknown>

  • Parameters

    • __namedParameters: {
          chatMessageId: any;
          memberId: any;
          roomId: any;
      }
      • chatMessageId: any
      • memberId: any
      • roomId: any

    Returns Promise<Result<any, any>>

  • Parameters

    • __namedParameters: {
          UserName: any;
          roomId: any;
          userId: any;
      }
      • UserName: any
      • roomId: any
      • userId: any

    Returns Promise<Result<any, any>>

diff --git a/doc/TypeDoc/classes/module_chat_infra_socket_socket.WebSocketService.html b/doc/TypeDoc/classes/module_chat_infra_socket_socket.WebSocketService.html new file mode 100644 index 000000000..f73f34609 --- /dev/null +++ b/doc/TypeDoc/classes/module_chat_infra_socket_socket.WebSocketService.html @@ -0,0 +1,7 @@ +WebSocketService | gabinete-digital

Constructors

Properties

Accessors

Methods

Constructors

Properties

callback: {
    [key: string]: Function;
} = {}

Accessors

Methods

diff --git a/doc/TypeDoc/enums/infra_speaker_speaker_service.StartRecordingResultError.html b/doc/TypeDoc/enums/infra_speaker_speaker_service.StartRecordingResultError.html new file mode 100644 index 000000000..3d39384bb --- /dev/null +++ b/doc/TypeDoc/enums/infra_speaker_speaker_service.StartRecordingResultError.html @@ -0,0 +1,4 @@ +StartRecordingResultError | gabinete-digital

Enumeration Members

NeedPermission: 1
NoSpeaker: 0
alreadyRecording: 2
diff --git a/doc/TypeDoc/enums/infra_speaker_speaker_service.StopRecordingResultError.html b/doc/TypeDoc/enums/infra_speaker_speaker_service.StopRecordingResultError.html new file mode 100644 index 000000000..522f7c8b8 --- /dev/null +++ b/doc/TypeDoc/enums/infra_speaker_speaker_service.StopRecordingResultError.html @@ -0,0 +1,4 @@ +StopRecordingResultError | gabinete-digital

Enumeration Members

Enumeration Members

NoValue: 1
UnknownError: 2
haventStartYet: 0
diff --git a/doc/TypeDoc/enums/infra_speaker_type.StartRecordingResultError.html b/doc/TypeDoc/enums/infra_speaker_type.StartRecordingResultError.html new file mode 100644 index 000000000..0d5cdcb46 --- /dev/null +++ b/doc/TypeDoc/enums/infra_speaker_type.StartRecordingResultError.html @@ -0,0 +1,4 @@ +StartRecordingResultError | gabinete-digital

Enumeration Members

NeedPermission: 1
NoSpeaker: 0
alreadyRecording: 2
diff --git a/doc/TypeDoc/enums/infra_speaker_type.StopRecordingResultError.html b/doc/TypeDoc/enums/infra_speaker_type.StopRecordingResultError.html new file mode 100644 index 000000000..1e5a50921 --- /dev/null +++ b/doc/TypeDoc/enums/infra_speaker_type.StopRecordingResultError.html @@ -0,0 +1,4 @@ +StopRecordingResultError | gabinete-digital

Enumeration Members

Enumeration Members

NoValue: 1
UnknownError: 2
haventStartYet: 0
diff --git a/doc/TypeDoc/enums/module_chat_data_dto_message_messageOutputDTO.MessageAttachmentFileType.html b/doc/TypeDoc/enums/module_chat_data_dto_message_messageOutputDTO.MessageAttachmentFileType.html new file mode 100644 index 000000000..d1bcd4aff --- /dev/null +++ b/doc/TypeDoc/enums/module_chat_data_dto_message_messageOutputDTO.MessageAttachmentFileType.html @@ -0,0 +1,5 @@ +MessageAttachmentFileType | gabinete-digital
diff --git a/doc/TypeDoc/enums/module_chat_data_dto_message_messageOutputDTO.MessageAttachmentSource.html b/doc/TypeDoc/enums/module_chat_data_dto_message_messageOutputDTO.MessageAttachmentSource.html new file mode 100644 index 000000000..6133c6100 --- /dev/null +++ b/doc/TypeDoc/enums/module_chat_data_dto_message_messageOutputDTO.MessageAttachmentSource.html @@ -0,0 +1,3 @@ +MessageAttachmentSource | gabinete-digital
diff --git a/doc/TypeDoc/functions/module_chat_data_async_list_rooms_messageListChangedetector.messageListDetermineChanges.html b/doc/TypeDoc/functions/module_chat_data_async_list_rooms_messageListChangedetector.messageListDetermineChanges.html new file mode 100644 index 000000000..f863f354f --- /dev/null +++ b/doc/TypeDoc/functions/module_chat_data_async_list_rooms_messageListChangedetector.messageListDetermineChanges.html @@ -0,0 +1 @@ +messageListDetermineChanges | gabinete-digital
  • Parameters

    • serverList: any[]
    • localList: any[]

    Returns {
        addedItems: any[];
        changedItems: any[];
        deletedItems: any[];
    }

    • addedItems: any[]
    • changedItems: any[]
    • deletedItems: any[]
diff --git a/doc/TypeDoc/functions/module_chat_data_async_list_rooms_roomListChangeDetector.roomListDetermineChanges.html b/doc/TypeDoc/functions/module_chat_data_async_list_rooms_roomListChangeDetector.roomListDetermineChanges.html new file mode 100644 index 000000000..f8676028f --- /dev/null +++ b/doc/TypeDoc/functions/module_chat_data_async_list_rooms_roomListChangeDetector.roomListDetermineChanges.html @@ -0,0 +1 @@ +roomListDetermineChanges | gabinete-digital
  • Parameters

    • serverRooms: {
          chatRoom?: {
              createdAt?: string;
              createdBy?: {
                  userPhoto?: string;
                  wxFullName?: string;
                  wxUserId?: number;
                  wxeMail?: string;
              };
              expirationDate?: string;
              id?: string;
              roomName?: string;
              roomType?: number;
          };
          joinAt?: string;
      }[]
    • localRooms: {
          createdAt?: any;
          createdBy?: {
              userPhoto?: string;
              wxFullName?: string;
              wxUserId?: number;
              wxeMail?: string;
          };
          expirationDate?: any;
          id?: string;
          roomName?: string;
      }[]

    Returns {
        roomsToDelete: {
            createdAt?: any;
            createdBy?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
            expirationDate?: any;
            id?: string;
            roomName?: string;
        }[];
        roomsToInsert: {
            chatRoom?: {
                createdAt?: string;
                createdBy?: {
                    userPhoto?: string;
                    wxFullName?: string;
                    wxUserId?: number;
                    wxeMail?: string;
                };
                expirationDate?: string;
                id?: string;
                roomName?: string;
                roomType?: number;
            };
            joinAt?: string;
        }[];
        roomsToUpdate: {
            chatRoom?: {
                createdAt?: string;
                createdBy?: {
                    userPhoto?: string;
                    wxFullName?: string;
                    wxUserId?: number;
                    wxeMail?: string;
                };
                expirationDate?: string;
                id?: string;
                roomName?: string;
                roomType?: number;
            };
            joinAt?: string;
        }[];
    }

    • roomsToDelete: {
          createdAt?: any;
          createdBy?: {
              userPhoto?: string;
              wxFullName?: string;
              wxUserId?: number;
              wxeMail?: string;
          };
          expirationDate?: any;
          id?: string;
          roomName?: string;
      }[]
    • roomsToInsert: {
          chatRoom?: {
              createdAt?: string;
              createdBy?: {
                  userPhoto?: string;
                  wxFullName?: string;
                  wxUserId?: number;
                  wxeMail?: string;
              };
              expirationDate?: string;
              id?: string;
              roomName?: string;
              roomType?: number;
          };
          joinAt?: string;
      }[]
    • roomsToUpdate: {
          chatRoom?: {
              createdAt?: string;
              createdBy?: {
                  userPhoto?: string;
                  wxFullName?: string;
                  wxUserId?: number;
                  wxeMail?: string;
              };
              expirationDate?: string;
              id?: string;
              roomName?: string;
              roomType?: number;
          };
          joinAt?: string;
      }[]
diff --git a/doc/TypeDoc/functions/module_chat_data_async_list_rooms_roomMembersChangeDetector.roomMemberListDetermineChanges.html b/doc/TypeDoc/functions/module_chat_data_async_list_rooms_roomMembersChangeDetector.roomMemberListDetermineChanges.html new file mode 100644 index 000000000..f36c88bb6 --- /dev/null +++ b/doc/TypeDoc/functions/module_chat_data_async_list_rooms_roomMembersChangeDetector.roomMemberListDetermineChanges.html @@ -0,0 +1 @@ +roomMemberListDetermineChanges | gabinete-digital
  • Parameters

    • ____serverRooms: {
          id?: string;
          isAdmin?: boolean;
          joinAt?: string;
          user?: {
              userPhoto?: string;
              wxFullName?: string;
              wxUserId?: number;
              wxeMail?: string;
          };
      }[]
    • localRooms: {
          $roomIdUserId?: string;
          id?: string;
          isAdmin?: boolean;
          joinAt?: string;
          roomId?: string;
          status?: string;
          userPhoto?: string;
          wxFullName?: string;
          wxUserId?: number;
          wxeMail?: string;
      }[]
    • roomId: string

    Returns {
        membersToDelete: {
            $roomIdUserId?: string;
            id?: string;
            isAdmin?: boolean;
            joinAt?: string;
            roomId?: string;
            status?: string;
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        }[];
        membersToInsert: ({
            id?: string;
            isAdmin?: boolean;
            joinAt?: string;
            user?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
        } & {
            $roomIdUserId: string;
        })[];
        membersToUpdate: ({
            id?: string;
            isAdmin?: boolean;
            joinAt?: string;
            user?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
        } & {
            $roomIdUserId: string;
        })[];
    }

    • membersToDelete: {
          $roomIdUserId?: string;
          id?: string;
          isAdmin?: boolean;
          joinAt?: string;
          roomId?: string;
          status?: string;
          userPhoto?: string;
          wxFullName?: string;
          wxUserId?: number;
          wxeMail?: string;
      }[]
    • membersToInsert: ({
          id?: string;
          isAdmin?: boolean;
          joinAt?: string;
          user?: {
              userPhoto?: string;
              wxFullName?: string;
              wxUserId?: number;
              wxeMail?: string;
          };
      } & {
          $roomIdUserId: string;
      })[]
    • membersToUpdate: ({
          id?: string;
          isAdmin?: boolean;
          joinAt?: string;
          user?: {
              userPhoto?: string;
              wxFullName?: string;
              wxUserId?: number;
              wxeMail?: string;
          };
      } & {
          $roomIdUserId: string;
      })[]
diff --git a/doc/TypeDoc/functions/module_chat_data_data_source_room_room_memory_data_source.addMessage.html b/doc/TypeDoc/functions/module_chat_data_data_source_room_room_memory_data_source.addMessage.html new file mode 100644 index 000000000..04c5ef747 --- /dev/null +++ b/doc/TypeDoc/functions/module_chat_data_data_source_room_room_memory_data_source.addMessage.html @@ -0,0 +1,2 @@ +addMessage | gabinete-digital
  • Parameters

    • props: {
          message: any;
          roomId: string;
      }
      • message: any
      • roomId: string

    Returns {
        message: any;
        roomId: string;
    } & TypedAction<"[Chat] Add Message">

Properties

Properties

type: "[Chat] Add Message"
diff --git a/doc/TypeDoc/functions/module_chat_data_data_source_room_room_memory_data_source.addRoom.html b/doc/TypeDoc/functions/module_chat_data_data_source_room_room_memory_data_source.addRoom.html new file mode 100644 index 000000000..f6b55c7c2 --- /dev/null +++ b/doc/TypeDoc/functions/module_chat_data_data_source_room_room_memory_data_source.addRoom.html @@ -0,0 +1,2 @@ +addRoom | gabinete-digital
  • Parameters

    • props: {
          data?: {
              createdAt?: string;
              createdBy?: any;
              expirationDate?: string;
              id?: string;
              roomName?: string;
              roomType?: any;
          };
          message?: string;
          success?: boolean;
      }
      • Optionaldata?: {
            createdAt?: string;
            createdBy?: any;
            expirationDate?: string;
            id?: string;
            roomName?: string;
            roomType?: any;
        }
        • OptionalcreatedAt?: string
        • OptionalcreatedBy?: any
        • OptionalexpirationDate?: string
        • Optionalid?: string
        • OptionalroomName?: string
        • OptionalroomType?: any
      • Optionalmessage?: string
      • Optionalsuccess?: boolean

    Returns {
        data?: {
            createdAt?: string;
            createdBy?: any;
            expirationDate?: string;
            id?: string;
            roomName?: string;
            roomType?: any;
        };
        message?: string;
        success?: boolean;
    } & TypedAction<"[Chat] Add Room">

Properties

Properties

type: "[Chat] Add Room"
diff --git a/doc/TypeDoc/functions/module_chat_data_data_source_room_room_memory_data_source.chatReducer.html b/doc/TypeDoc/functions/module_chat_data_data_source_room_room_memory_data_source.chatReducer.html new file mode 100644 index 000000000..602dfd4a4 --- /dev/null +++ b/doc/TypeDoc/functions/module_chat_data_data_source_room_room_memory_data_source.chatReducer.html @@ -0,0 +1 @@ +chatReducer | gabinete-digital
diff --git a/doc/TypeDoc/functions/module_chat_data_data_source_room_room_memory_data_source.selectAllRooms.html b/doc/TypeDoc/functions/module_chat_data_data_source_room_room_memory_data_source.selectAllRooms.html new file mode 100644 index 000000000..6ce97dbc6 --- /dev/null +++ b/doc/TypeDoc/functions/module_chat_data_data_source_room_room_memory_data_source.selectAllRooms.html @@ -0,0 +1,5 @@ +selectAllRooms | gabinete-digital

Properties

Methods

Properties

clearResult: (() => void)
projector: DefaultProjectorFn<string[]>
setResult: ((result?: string[]) => void)

Methods

  • Returns void

diff --git a/doc/TypeDoc/functions/module_chat_data_data_source_room_room_memory_data_source.selectChatState.html b/doc/TypeDoc/functions/module_chat_data_data_source_room_room_memory_data_source.selectChatState.html new file mode 100644 index 000000000..b2c3987e3 --- /dev/null +++ b/doc/TypeDoc/functions/module_chat_data_data_source_room_room_memory_data_source.selectChatState.html @@ -0,0 +1,5 @@ +selectChatState | gabinete-digital

Properties

Methods

Properties

clearResult: (() => void)
projector: DefaultProjectorFn<RoomRemoteDataSourceState>
setResult: ((result?: RoomRemoteDataSourceState) => void)

Methods

  • Returns void

diff --git a/doc/TypeDoc/functions/module_chat_data_data_source_room_room_memory_data_source.selectMessagesByRoom.html b/doc/TypeDoc/functions/module_chat_data_data_source_room_room_memory_data_source.selectMessagesByRoom.html new file mode 100644 index 000000000..1d9f7ec81 --- /dev/null +++ b/doc/TypeDoc/functions/module_chat_data_data_source_room_room_memory_data_source.selectMessagesByRoom.html @@ -0,0 +1 @@ +selectMessagesByRoom | gabinete-digital
  • Parameters

    • roomId: string

    Returns MemoizedSelector<object, {
        createdAt?: any;
        createdBy?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        expirationDate?: any;
        id?: string;
        roomName?: string;
    }[], DefaultProjectorFn<{
        createdAt?: any;
        createdBy?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        expirationDate?: any;
        id?: string;
        roomName?: string;
    }[]>>

diff --git a/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.addUserTyping.html b/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.addUserTyping.html new file mode 100644 index 000000000..a2fb280b0 --- /dev/null +++ b/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.addUserTyping.html @@ -0,0 +1,2 @@ +addUserTyping | gabinete-digital
  • Parameters

    • props: {
          data: {
              chatRoomId?: string;
              entryDate?: string;
              id?: string;
              userId?: string;
              userName?: string;
          };
      }
      • data: {
            chatRoomId?: string;
            entryDate?: string;
            id?: string;
            userId?: string;
            userName?: string;
        }
        • OptionalchatRoomId?: string
        • OptionalentryDate?: string
        • Optionalid?: string
        • OptionaluserId?: string
        • OptionaluserName?: string

    Returns {
        data: {
            chatRoomId?: string;
            entryDate?: string;
            id?: string;
            userId?: string;
            userName?: string;
        };
    } & TypedAction<"[Typing] Add User Typing">

Properties

Properties

type: "[Typing] Add User Typing"
diff --git a/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.loadUserTyping.html b/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.loadUserTyping.html new file mode 100644 index 000000000..584ebc29d --- /dev/null +++ b/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.loadUserTyping.html @@ -0,0 +1,2 @@ +loadUserTyping | gabinete-digital

Properties

Properties

type: "[Typing] Load User Typing"
diff --git a/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.loadUserTypingFailure.html b/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.loadUserTypingFailure.html new file mode 100644 index 000000000..12804f7f3 --- /dev/null +++ b/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.loadUserTypingFailure.html @@ -0,0 +1,2 @@ +loadUserTypingFailure | gabinete-digital

Properties

Properties

type: "[Typing] Load User Typing Failure"
diff --git a/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.loadUserTypingSuccess.html b/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.loadUserTypingSuccess.html new file mode 100644 index 000000000..0250724e7 --- /dev/null +++ b/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.loadUserTypingSuccess.html @@ -0,0 +1,2 @@ +loadUserTypingSuccess | gabinete-digital
  • Parameters

    • props: {
          data: {
              chatRoomId?: string;
              entryDate?: string;
              id?: string;
              userId?: string;
              userName?: string;
          }[];
      }
      • data: {
            chatRoomId?: string;
            entryDate?: string;
            id?: string;
            userId?: string;
            userName?: string;
        }[]

    Returns {
        data: {
            chatRoomId?: string;
            entryDate?: string;
            id?: string;
            userId?: string;
            userName?: string;
        }[];
    } & TypedAction<"[Typing] Load User Typing Success">

Properties

Properties

type: "[Typing] Load User Typing Success"
diff --git a/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.removeUserTyping.html b/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.removeUserTyping.html new file mode 100644 index 000000000..85987701c --- /dev/null +++ b/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.removeUserTyping.html @@ -0,0 +1,2 @@ +removeUserTyping | gabinete-digital
  • Parameters

    • props: {
          data: {
              chatRoomId?: string;
              entryDate?: string;
              id?: string;
              userId?: string;
              userName?: string;
          };
      }
      • data: {
            chatRoomId?: string;
            entryDate?: string;
            id?: string;
            userId?: string;
            userName?: string;
        }
        • OptionalchatRoomId?: string
        • OptionalentryDate?: string
        • Optionalid?: string
        • OptionaluserId?: string
        • OptionaluserName?: string

    Returns {
        data: {
            chatRoomId?: string;
            entryDate?: string;
            id?: string;
            userId?: string;
            userName?: string;
        };
    } & TypedAction<"[Typing] Remove User Typing">

Properties

Properties

type: "[Typing] Remove User Typing"
diff --git a/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.selectAllUserSource.html b/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.selectAllUserSource.html new file mode 100644 index 000000000..7945ef982 --- /dev/null +++ b/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.selectAllUserSource.html @@ -0,0 +1,5 @@ +selectAllUserSource | gabinete-digital

Properties

Methods

Properties

clearResult: (() => void)
projector: DefaultProjectorFn<{
    chatRoomId?: string;
    entryDate?: string;
    id?: string;
    userId?: string;
    userName?: string;
}[]>
setResult: ((result?: {
    chatRoomId?: string;
    entryDate?: string;
    id?: string;
    userId?: string;
    userName?: string;
}[]) => void)

Methods

  • Returns void

diff --git a/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.selectCalendarState.html b/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.selectCalendarState.html new file mode 100644 index 000000000..deba0ab8a --- /dev/null +++ b/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.selectCalendarState.html @@ -0,0 +1,5 @@ +selectCalendarState | gabinete-digital

Properties

Methods

Properties

clearResult: (() => void)
projector: DefaultProjectorFn<TypingState>
setResult: ((result?: TypingState) => void)

Methods

  • Returns void

diff --git a/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.selectUserTypingTable.html b/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.selectUserTypingTable.html new file mode 100644 index 000000000..e46c59791 --- /dev/null +++ b/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.selectUserTypingTable.html @@ -0,0 +1 @@ +selectUserTypingTable | gabinete-digital
  • Returns MemoizedSelector<object, {
        chatRoomId?: string;
        entryDate?: string;
        id?: string;
        userId?: string;
        userName?: string;
    }[], DefaultProjectorFn<{
        chatRoomId?: string;
        entryDate?: string;
        id?: string;
        userId?: string;
        userName?: string;
    }[]>>

diff --git a/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.typingReducer.html b/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.typingReducer.html new file mode 100644 index 000000000..10b975774 --- /dev/null +++ b/doc/TypeDoc/functions/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.typingReducer.html @@ -0,0 +1 @@ +typingReducer | gabinete-digital
diff --git a/doc/TypeDoc/functions/module_chat_domain_mapper_memberLIstMapper.MemberListMapper.html b/doc/TypeDoc/functions/module_chat_domain_mapper_memberLIstMapper.MemberListMapper.html new file mode 100644 index 000000000..200f4c724 --- /dev/null +++ b/doc/TypeDoc/functions/module_chat_domain_mapper_memberLIstMapper.MemberListMapper.html @@ -0,0 +1 @@ +MemberListMapper | gabinete-digital
  • Parameters

    • outputDto: {
          id?: string;
          isAdmin?: boolean;
          joinAt?: string;
          user?: {
              userPhoto?: string;
              wxFullName?: string;
              wxUserId?: number;
              wxeMail?: string;
          };
      }
      • Optionalid?: string
      • OptionalisAdmin?: boolean
      • OptionaljoinAt?: string
      • Optionaluser?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        }
        • OptionaluserPhoto?: string
        • OptionalwxFullName?: string
        • OptionalwxUserId?: number
        • OptionalwxeMail?: string
    • roomId: string

    Returns MemberTable

diff --git a/doc/TypeDoc/functions/utils_ToBase64.JSFileToBase64.html b/doc/TypeDoc/functions/utils_ToBase64.JSFileToBase64.html new file mode 100644 index 000000000..dd46d9b26 --- /dev/null +++ b/doc/TypeDoc/functions/utils_ToBase64.JSFileToBase64.html @@ -0,0 +1,4 @@ +JSFileToBase64 | gabinete-digital
  • Converts a File object to a Base64 encoded string.

    +

    Parameters

    • file: File

      The file to be converted.

      +

    Returns Promise<Result<string, any>>

    A promise that resolves with a Result object containing either the Base64 encoded string or an error.

    +
diff --git a/doc/TypeDoc/functions/utils_allowedDocExtension.allowedDocExtension.html b/doc/TypeDoc/functions/utils_allowedDocExtension.allowedDocExtension.html new file mode 100644 index 000000000..595205d0d --- /dev/null +++ b/doc/TypeDoc/functions/utils_allowedDocExtension.allowedDocExtension.html @@ -0,0 +1 @@ +allowedDocExtension | gabinete-digital
diff --git a/doc/TypeDoc/functions/utils_imageCompressore.compressImageBase64.html b/doc/TypeDoc/functions/utils_imageCompressore.compressImageBase64.html new file mode 100644 index 000000000..baf6a9eea --- /dev/null +++ b/doc/TypeDoc/functions/utils_imageCompressore.compressImageBase64.html @@ -0,0 +1,16 @@ +compressImageBase64 | gabinete-digital
  • Compresses an image represented as a Base64 string.

    +

    This function resizes the image to fit within the specified maximum width and height while maintaining the aspect ratio. +The image is then compressed to a JPEG format with the given quality level.

    +

    Parameters

    • base64String: string

      The Base64 string of the image to be compressed.

      +
    • maxWidth: number

      The maximum width of the compressed image. The aspect ratio is preserved.

      +
    • maxHeight: number

      The maximum height of the compressed image. The aspect ratio is preserved.

      +
    • quality: number

      The quality of the compressed image, ranging from 0 to 1, where 1 is the best quality.

      +

    Returns Promise<Result<string, any>>

    A Promise that resolves to a Result containing either:

    +
      +
    • ok with the compressed image as a Base64 string, or
    • +
    • err with an error if the image fails to load or compress.
    • +
    +
    compressImageBase64('data:image/png;base64,...', 800, 600, 0.8)
    .then(result => {
    if (result.isOk()) {
    console.log('Compressed image:', result.value);
    } else {
    console.error('Error compressing image:', result.error);
    }
    }); +
    + +
diff --git a/doc/TypeDoc/hierarchy.html b/doc/TypeDoc/hierarchy.html new file mode 100644 index 000000000..1de8fe2d4 --- /dev/null +++ b/doc/TypeDoc/hierarchy.html @@ -0,0 +1 @@ +gabinete-digital
diff --git a/doc/TypeDoc/interfaces/module_chat_data_data_source_room_room_memory_data_source.ChatRoom.html b/doc/TypeDoc/interfaces/module_chat_data_data_source_room_room_memory_data_source.ChatRoom.html new file mode 100644 index 000000000..4ff706240 --- /dev/null +++ b/doc/TypeDoc/interfaces/module_chat_data_data_source_room_room_memory_data_source.ChatRoom.html @@ -0,0 +1 @@ +ChatRoom | gabinete-digital
diff --git a/doc/TypeDoc/interfaces/module_chat_data_data_source_room_room_memory_data_source.RoomRemoteDataSourceState.html b/doc/TypeDoc/interfaces/module_chat_data_data_source_room_room_memory_data_source.RoomRemoteDataSourceState.html new file mode 100644 index 000000000..9d1accf0e --- /dev/null +++ b/doc/TypeDoc/interfaces/module_chat_data_data_source_room_room_memory_data_source.RoomRemoteDataSourceState.html @@ -0,0 +1,2 @@ +RoomRemoteDataSourceState | gabinete-digital
diff --git a/doc/TypeDoc/interfaces/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.TypingState.html b/doc/TypeDoc/interfaces/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.TypingState.html new file mode 100644 index 000000000..bb07f51a1 --- /dev/null +++ b/doc/TypeDoc/interfaces/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.TypingState.html @@ -0,0 +1,3 @@ +TypingState | gabinete-digital
interface TypingState {
    error: any;
    typingList: {
        chatRoomId?: string;
        entryDate?: string;
        id?: string;
        userId?: string;
        userName?: string;
    }[];
}

Properties

Properties

error: any
typingList: {
    chatRoomId?: string;
    entryDate?: string;
    id?: string;
    userId?: string;
    userName?: string;
}[]
diff --git a/doc/TypeDoc/interfaces/module_chat_infra_socket_socket.WebSocketMessage.html b/doc/TypeDoc/interfaces/module_chat_infra_socket_socket.WebSocketMessage.html new file mode 100644 index 000000000..603a4d7f9 --- /dev/null +++ b/doc/TypeDoc/interfaces/module_chat_infra_socket_socket.WebSocketMessage.html @@ -0,0 +1,4 @@ +WebSocketMessage | gabinete-digital
interface WebSocketMessage {
    payload: any;
    requestId?: string;
    type: string;
}

Properties

Properties

payload: any
requestId?: string
type: string
diff --git a/doc/TypeDoc/modules/infra_camera_camera_service-1.html b/doc/TypeDoc/modules/infra_camera_camera_service-1.html new file mode 100644 index 000000000..acf409cf2 --- /dev/null +++ b/doc/TypeDoc/modules/infra_camera_camera_service-1.html @@ -0,0 +1,3 @@ +infra/camera/camera.service | gabinete-digital

Module infra/camera/camera.service

References

Re-exports CameraService
Re-exports takePictureParams
diff --git a/doc/TypeDoc/modules/infra_camera_camera_service.html b/doc/TypeDoc/modules/infra_camera_camera_service.html new file mode 100644 index 000000000..fa6b8831e --- /dev/null +++ b/doc/TypeDoc/modules/infra_camera_camera_service.html @@ -0,0 +1,3 @@ +infra/camera/camera.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/infra_camera_camera_service_spec-1.html b/doc/TypeDoc/modules/infra_camera_camera_service_spec-1.html new file mode 100644 index 000000000..374ab11fd --- /dev/null +++ b/doc/TypeDoc/modules/infra_camera_camera_service_spec-1.html @@ -0,0 +1 @@ +infra/camera/camera.service.spec | gabinete-digital
diff --git a/doc/TypeDoc/modules/infra_camera_camera_service_spec.html b/doc/TypeDoc/modules/infra_camera_camera_service_spec.html new file mode 100644 index 000000000..ee2534a25 --- /dev/null +++ b/doc/TypeDoc/modules/infra_camera_camera_service_spec.html @@ -0,0 +1 @@ +infra/camera/camera.service.spec | gabinete-digital
diff --git a/doc/TypeDoc/modules/infra_file_picker_adapter.html b/doc/TypeDoc/modules/infra_file_picker_adapter.html new file mode 100644 index 000000000..17868003b --- /dev/null +++ b/doc/TypeDoc/modules/infra_file_picker_adapter.html @@ -0,0 +1 @@ +infra/file-picker/adapter | gabinete-digital

Module infra/file-picker/adapter

diff --git a/doc/TypeDoc/modules/infra_file_picker_file_picker_service.html b/doc/TypeDoc/modules/infra_file_picker_file_picker_service.html new file mode 100644 index 000000000..c29b21062 --- /dev/null +++ b/doc/TypeDoc/modules/infra_file_picker_file_picker_service.html @@ -0,0 +1,2 @@ +infra/file-picker/file-picker.service | gabinete-digital

Module infra/file-picker/file-picker.service

Index

Classes

diff --git a/doc/TypeDoc/modules/infra_file_picker_mobile_file_picker_mobile_service.html b/doc/TypeDoc/modules/infra_file_picker_mobile_file_picker_mobile_service.html new file mode 100644 index 000000000..8c091cac2 --- /dev/null +++ b/doc/TypeDoc/modules/infra_file_picker_mobile_file_picker_mobile_service.html @@ -0,0 +1,2 @@ +infra/file-picker/mobile/file-picker-mobile.service | gabinete-digital

Module infra/file-picker/mobile/file-picker-mobile.service

Index

Classes

diff --git a/doc/TypeDoc/modules/infra_file_picker_web_file_picker_web_service.html b/doc/TypeDoc/modules/infra_file_picker_web_file_picker_web_service.html new file mode 100644 index 000000000..1181696e5 --- /dev/null +++ b/doc/TypeDoc/modules/infra_file_picker_web_file_picker_web_service.html @@ -0,0 +1,2 @@ +infra/file-picker/web/file-picker-web.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/infra_repository_dexie_dexie_repository_service.html b/doc/TypeDoc/modules/infra_repository_dexie_dexie_repository_service.html new file mode 100644 index 000000000..7e43917a6 --- /dev/null +++ b/doc/TypeDoc/modules/infra_repository_dexie_dexie_repository_service.html @@ -0,0 +1,2 @@ +infra/repository/dexie/dexie-repository.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/infra_speaker_speaker_service.html b/doc/TypeDoc/modules/infra_speaker_speaker_service.html new file mode 100644 index 000000000..0dc3a5605 --- /dev/null +++ b/doc/TypeDoc/modules/infra_speaker_speaker_service.html @@ -0,0 +1,4 @@ +infra/speaker/speaker.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/infra_speaker_type.html b/doc/TypeDoc/modules/infra_speaker_type.html new file mode 100644 index 000000000..19b498b23 --- /dev/null +++ b/doc/TypeDoc/modules/infra_speaker_type.html @@ -0,0 +1,3 @@ +infra/speaker/type | gabinete-digital

Module infra/speaker/type

Index

Enumerations

diff --git a/doc/TypeDoc/modules/module_chat_chat_module.html b/doc/TypeDoc/modules/module_chat_chat_module.html new file mode 100644 index 000000000..dda5aba7c --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_chat_module.html @@ -0,0 +1,2 @@ +module/chat/chat.module | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_chat_service_service.html b/doc/TypeDoc/modules/module_chat_chat_service_service.html new file mode 100644 index 000000000..9ba5e6b13 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_chat_service_service.html @@ -0,0 +1,2 @@ +module/chat/chat-service.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_async_list_rooms_messageListChangedetector.html b/doc/TypeDoc/modules/module_chat_data_async_list_rooms_messageListChangedetector.html new file mode 100644 index 000000000..732c6add7 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_async_list_rooms_messageListChangedetector.html @@ -0,0 +1,2 @@ +module/chat/data/async/list/rooms/messageListChangedetector | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_async_list_rooms_roomListChangeDetector.html b/doc/TypeDoc/modules/module_chat_data_async_list_rooms_roomListChangeDetector.html new file mode 100644 index 000000000..93cfc2f6e --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_async_list_rooms_roomListChangeDetector.html @@ -0,0 +1,2 @@ +module/chat/data/async/list/rooms/roomListChangeDetector | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_async_list_rooms_roomMembersChangeDetector.html b/doc/TypeDoc/modules/module_chat_data_async_list_rooms_roomMembersChangeDetector.html new file mode 100644 index 000000000..c4e74a410 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_async_list_rooms_roomMembersChangeDetector.html @@ -0,0 +1,2 @@ +module/chat/data/async/list/rooms/roomMembersChangeDetector | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_async_repository_message_repository_aync_service.html b/doc/TypeDoc/modules/module_chat_data_async_repository_message_repository_aync_service.html new file mode 100644 index 000000000..7418d1177 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_async_repository_message_repository_aync_service.html @@ -0,0 +1,2 @@ +module/chat/data/async/repository/message-repository-aync.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_async_repository_message_repository_aync_service_spec.html b/doc/TypeDoc/modules/module_chat_data_async_repository_message_repository_aync_service_spec.html new file mode 100644 index 000000000..ba4fe3f59 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_async_repository_message_repository_aync_service_spec.html @@ -0,0 +1 @@ +module/chat/data/async/repository/message-repository-aync.service.spec | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_async_socket_user_typing_async_service.html b/doc/TypeDoc/modules/module_chat_data_async_socket_user_typing_async_service.html new file mode 100644 index 000000000..8598792cb --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_async_socket_user_typing_async_service.html @@ -0,0 +1,2 @@ +module/chat/data/async/socket/user-typing-async.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_data_source_member_list_member_list_local_data_source_service.html b/doc/TypeDoc/modules/module_chat_data_data_source_member_list_member_list_local_data_source_service.html new file mode 100644 index 000000000..e61c2f9d2 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_data_source_member_list_member_list_local_data_source_service.html @@ -0,0 +1,4 @@ +module/chat/data/data-source/member-list/member-list-local-data-source.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_data_source_member_list_member_list_remote_data_source_service.html b/doc/TypeDoc/modules/module_chat_data_data_source_member_list_member_list_remote_data_source_service.html new file mode 100644 index 000000000..c3dd9e8c0 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_data_source_member_list_member_list_remote_data_source_service.html @@ -0,0 +1,2 @@ +module/chat/data/data-source/member-list/member-list-remote-data-source.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_data_source_message_message_live_data_source_service.html b/doc/TypeDoc/modules/module_chat_data_data_source_message_message_live_data_source_service.html new file mode 100644 index 000000000..d44e7ee78 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_data_source_message_message_live_data_source_service.html @@ -0,0 +1,2 @@ +module/chat/data/data-source/message/message-live-data-source.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_data_source_message_message_live_signalr_data_source_service.html b/doc/TypeDoc/modules/module_chat_data_data_source_message_message_live_signalr_data_source_service.html new file mode 100644 index 000000000..c1ece232a --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_data_source_message_message_live_signalr_data_source_service.html @@ -0,0 +1,2 @@ +module/chat/data/data-source/message/message-live-signalr-data-source.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_data_source_message_message_local_data_source_service.html b/doc/TypeDoc/modules/module_chat_data_data_source_message_message_local_data_source_service.html new file mode 100644 index 000000000..e9b39e4a4 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_data_source_message_message_local_data_source_service.html @@ -0,0 +1,2 @@ +module/chat/data/data-source/message/message-local-data-source.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_data_source_message_message_remote_data_source_service.html b/doc/TypeDoc/modules/module_chat_data_data_source_message_message_remote_data_source_service.html new file mode 100644 index 000000000..7a15858c3 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_data_source_message_message_remote_data_source_service.html @@ -0,0 +1,2 @@ +module/chat/data/data-source/message/message-remote-data-source.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_data_source_room_room_live_data_source_service.html b/doc/TypeDoc/modules/module_chat_data_data_source_room_room_live_data_source_service.html new file mode 100644 index 000000000..2784093ec --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_data_source_room_room_live_data_source_service.html @@ -0,0 +1,2 @@ +module/chat/data/data-source/room/room-live-data-source.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_data_source_room_room_memory_data_source.html b/doc/TypeDoc/modules/module_chat_data_data_source_room_room_memory_data_source.html new file mode 100644 index 000000000..b628aad25 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_data_source_room_room_memory_data_source.html @@ -0,0 +1,10 @@ +module/chat/data/data-source/room/room-memory-data-source | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_data_source_room_room_remote_data_source_service.html b/doc/TypeDoc/modules/module_chat_data_data_source_room_room_remote_data_source_service.html new file mode 100644 index 000000000..3902bfae3 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_data_source_room_room_remote_data_source_service.html @@ -0,0 +1,2 @@ +module/chat/data/data-source/room/room-remote-data-source.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_data_source_room_rooom_local_data_source_service.html b/doc/TypeDoc/modules/module_chat_data_data_source_room_rooom_local_data_source_service.html new file mode 100644 index 000000000..827bbdc84 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_data_source_room_rooom_local_data_source_service.html @@ -0,0 +1,2 @@ +module/chat/data/data-source/room/rooom-local-data-source.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_data_source_userTyping_user_typing_live_data_source_service.html b/doc/TypeDoc/modules/module_chat_data_data_source_userTyping_user_typing_live_data_source_service.html new file mode 100644 index 000000000..950bc3c4a --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_data_source_userTyping_user_typing_live_data_source_service.html @@ -0,0 +1,2 @@ +module/chat/data/data-source/userTyping/user-typing-live-data-source.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_data_source_userTyping_user_typing_local_data_source_service.html b/doc/TypeDoc/modules/module_chat_data_data_source_userTyping_user_typing_local_data_source_service.html new file mode 100644 index 000000000..7e7f50ad8 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_data_source_userTyping_user_typing_local_data_source_service.html @@ -0,0 +1,2 @@ +module/chat/data/data-source/userTyping/user-typing-local-data-source.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.html b/doc/TypeDoc/modules/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.html new file mode 100644 index 000000000..441318c67 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.html @@ -0,0 +1,12 @@ +module/chat/data/data-source/userTyping/user-typing-memory-data-source.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_dto_message_messageDeleteInputDTO.html b/doc/TypeDoc/modules/module_chat_data_dto_message_messageDeleteInputDTO.html new file mode 100644 index 000000000..8f3dbf7f2 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_dto_message_messageDeleteInputDTO.html @@ -0,0 +1,3 @@ +module/chat/data/dto/message/messageDeleteInputDTO | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_dto_message_messageInputDtO.html b/doc/TypeDoc/modules/module_chat_data_dto_message_messageInputDtO.html new file mode 100644 index 000000000..614f25a1c --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_dto_message_messageInputDtO.html @@ -0,0 +1,3 @@ +module/chat/data/dto/message/messageInputDtO | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_dto_message_messageListInputDTO.html b/doc/TypeDoc/modules/module_chat_data_dto_message_messageListInputDTO.html new file mode 100644 index 000000000..b80369e85 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_dto_message_messageListInputDTO.html @@ -0,0 +1,2 @@ +module/chat/data/dto/message/messageListInputDTO | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_dto_message_messageOutputDTO.html b/doc/TypeDoc/modules/module_chat_data_dto_message_messageOutputDTO.html new file mode 100644 index 000000000..935e0fc77 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_dto_message_messageOutputDTO.html @@ -0,0 +1,7 @@ +module/chat/data/dto/message/messageOutputDTO | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_dto_room_addMemberToRoomInputDto.html b/doc/TypeDoc/modules/module_chat_data_dto_room_addMemberToRoomInputDto.html new file mode 100644 index 000000000..2e9c7b679 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_dto_room_addMemberToRoomInputDto.html @@ -0,0 +1,3 @@ +module/chat/data/dto/room/addMemberToRoomInputDto | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_dto_room_outPut.html b/doc/TypeDoc/modules/module_chat_data_dto_room_outPut.html new file mode 100644 index 000000000..cf1fa18ed --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_dto_room_outPut.html @@ -0,0 +1,2 @@ +module/chat/data/dto/room/outPut | gabinete-digital

Module module/chat/data/dto/room/outPut

Index

Type Aliases

diff --git a/doc/TypeDoc/modules/module_chat_data_dto_room_roomByIdInputDTO.html b/doc/TypeDoc/modules/module_chat_data_dto_room_roomByIdInputDTO.html new file mode 100644 index 000000000..326f3c27e --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_dto_room_roomByIdInputDTO.html @@ -0,0 +1,3 @@ +module/chat/data/dto/room/roomByIdInputDTO | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_dto_room_roomByIdOutputDTO.html b/doc/TypeDoc/modules/module_chat_data_dto_room_roomByIdOutputDTO.html new file mode 100644 index 000000000..c127ca7ac --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_dto_room_roomByIdOutputDTO.html @@ -0,0 +1,4 @@ +module/chat/data/dto/room/roomByIdOutputDTO | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_dto_room_roomInputDTO.html b/doc/TypeDoc/modules/module_chat_data_dto_room_roomInputDTO.html new file mode 100644 index 000000000..623cd8985 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_dto_room_roomInputDTO.html @@ -0,0 +1,3 @@ +module/chat/data/dto/room/roomInputDTO | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_dto_room_roomListOutputDTO.html b/doc/TypeDoc/modules/module_chat_data_dto_room_roomListOutputDTO.html new file mode 100644 index 000000000..83b9467aa --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_dto_room_roomListOutputDTO.html @@ -0,0 +1,4 @@ +module/chat/data/dto/room/roomListOutputDTO | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_dto_room_roomOutputDTO.html b/doc/TypeDoc/modules/module_chat_data_dto_room_roomOutputDTO.html new file mode 100644 index 000000000..6c9227e6e --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_dto_room_roomOutputDTO.html @@ -0,0 +1,3 @@ +module/chat/data/dto/room/roomOutputDTO | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_dto_room_roomUpdateInputDTO.html b/doc/TypeDoc/modules/module_chat_data_dto_room_roomUpdateInputDTO.html new file mode 100644 index 000000000..867f5cf10 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_dto_room_roomUpdateInputDTO.html @@ -0,0 +1,3 @@ +module/chat/data/dto/room/roomUpdateInputDTO | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_dto_room_roomUpdateOutputDTO.html b/doc/TypeDoc/modules/module_chat_data_dto_room_roomUpdateOutputDTO.html new file mode 100644 index 000000000..0d6c4837e --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_dto_room_roomUpdateOutputDTO.html @@ -0,0 +1,3 @@ +module/chat/data/dto/room/roomUpdateOutputDTO | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_dto_room_userRemoveListInputDTO.html b/doc/TypeDoc/modules/module_chat_data_dto_room_userRemoveListInputDTO.html new file mode 100644 index 000000000..4cd017822 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_dto_room_userRemoveListInputDTO.html @@ -0,0 +1,3 @@ +module/chat/data/dto/room/userRemoveListInputDTO | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_dto_typing_typingInputDTO.html b/doc/TypeDoc/modules/module_chat_data_dto_typing_typingInputDTO.html new file mode 100644 index 000000000..1e0c36f5a --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_dto_typing_typingInputDTO.html @@ -0,0 +1,3 @@ +module/chat/data/dto/typing/typingInputDTO | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_dto_typing_typingOutputDTO.html b/doc/TypeDoc/modules/module_chat_data_dto_typing_typingOutputDTO.html new file mode 100644 index 000000000..49a28a13b --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_dto_typing_typingOutputDTO.html @@ -0,0 +1 @@ +module/chat/data/dto/typing/typingOutputDTO | gabinete-digital

Module module/chat/data/dto/typing/typingOutputDTO

diff --git a/doc/TypeDoc/modules/module_chat_data_repository_message_respository_service.html b/doc/TypeDoc/modules/module_chat_data_repository_message_respository_service.html new file mode 100644 index 000000000..c3f54f5bf --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_repository_message_respository_service.html @@ -0,0 +1,2 @@ +module/chat/data/repository/message-respository.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_repository_room_repository_service.html b/doc/TypeDoc/modules/module_chat_data_repository_room_repository_service.html new file mode 100644 index 000000000..49c923628 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_repository_room_repository_service.html @@ -0,0 +1,2 @@ +module/chat/data/repository/room-repository.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_repository_user_typing_repository_service.html b/doc/TypeDoc/modules/module_chat_data_repository_user_typing_repository_service.html new file mode 100644 index 000000000..09b33f4bb --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_repository_user_typing_repository_service.html @@ -0,0 +1,2 @@ +module/chat/data/repository/user-typing-repository.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_data_service_sync_repository_sync_message_repository_service.html b/doc/TypeDoc/modules/module_chat_data_service_sync_repository_sync_message_repository_service.html new file mode 100644 index 000000000..ed100c251 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_data_service_sync_repository_sync_message_repository_service.html @@ -0,0 +1,2 @@ +module/chat/data/service/sync-repository/sync-message-repository.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_domain_chat_service_service.html b/doc/TypeDoc/modules/module_chat_domain_chat_service_service.html new file mode 100644 index 000000000..6c61aff2f --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_domain_chat_service_service.html @@ -0,0 +1,3 @@ +module/chat/domain/chat-service.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_domain_entity_message.html b/doc/TypeDoc/modules/module_chat_domain_entity_message.html new file mode 100644 index 000000000..bdf51b8da --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_domain_entity_message.html @@ -0,0 +1,2 @@ +module/chat/domain/entity/message | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_domain_mapper_memberLIstMapper.html b/doc/TypeDoc/modules/module_chat_domain_mapper_memberLIstMapper.html new file mode 100644 index 000000000..e05738881 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_domain_mapper_memberLIstMapper.html @@ -0,0 +1,2 @@ +module/chat/domain/mapper/memberLIstMapper | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_domain_mapper_messageMapper.html b/doc/TypeDoc/modules/module_chat_domain_mapper_messageMapper.html new file mode 100644 index 000000000..38cde72d3 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_domain_mapper_messageMapper.html @@ -0,0 +1,2 @@ +module/chat/domain/mapper/messageMapper | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_domain_use_case_member_admin_use_case_service.html b/doc/TypeDoc/modules/module_chat_domain_use_case_member_admin_use_case_service.html new file mode 100644 index 000000000..35839ff4a --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_domain_use_case_member_admin_use_case_service.html @@ -0,0 +1,3 @@ +module/chat/domain/use-case/member-admin-use-case.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_domain_use_case_message_create_use_case_service.html b/doc/TypeDoc/modules/module_chat_domain_use_case_message_create_use_case_service.html new file mode 100644 index 000000000..80cfe69aa --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_domain_use_case_message_create_use_case_service.html @@ -0,0 +1,3 @@ +module/chat/domain/use-case/message-create-use-case.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_domain_use_case_message_delete_live_use_case_service.html b/doc/TypeDoc/modules/module_chat_domain_use_case_message_delete_live_use_case_service.html new file mode 100644 index 000000000..74d938aef --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_domain_use_case_message_delete_live_use_case_service.html @@ -0,0 +1,4 @@ +module/chat/domain/use-case/message-delete-live-use-case.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_domain_use_case_message_reaction_use_case_service.html b/doc/TypeDoc/modules/module_chat_domain_use_case_message_reaction_use_case_service.html new file mode 100644 index 000000000..95ce9c4b3 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_domain_use_case_message_reaction_use_case_service.html @@ -0,0 +1,3 @@ +module/chat/domain/use-case/message-reaction-use-case.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_domain_use_case_message_update_use_case_service.html b/doc/TypeDoc/modules/module_chat_domain_use_case_message_update_use_case_service.html new file mode 100644 index 000000000..230c9f69d --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_domain_use_case_message_update_use_case_service.html @@ -0,0 +1,3 @@ +module/chat/domain/use-case/message-update-use-case.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_domain_use_case_socket_member_list_update_status_use_case_service.html b/doc/TypeDoc/modules/module_chat_domain_use_case_socket_member_list_update_status_use_case_service.html new file mode 100644 index 000000000..5e424f90a --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_domain_use_case_socket_member_list_update_status_use_case_service.html @@ -0,0 +1,4 @@ +module/chat/domain/use-case/socket/member-list-update-status-use-case.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_domain_use_case_socket_socket_message_create_use_case_service.html b/doc/TypeDoc/modules/module_chat_domain_use_case_socket_socket_message_create_use_case_service.html new file mode 100644 index 000000000..a68cfac05 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_domain_use_case_socket_socket_message_create_use_case_service.html @@ -0,0 +1,2 @@ +module/chat/domain/use-case/socket/socket-message-create-use-case.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_domain_use_case_socket_socket_message_delete_use_case_service.html b/doc/TypeDoc/modules/module_chat_domain_use_case_socket_socket_message_delete_use_case_service.html new file mode 100644 index 000000000..f3a3460e6 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_domain_use_case_socket_socket_message_delete_use_case_service.html @@ -0,0 +1,2 @@ +module/chat/domain/use-case/socket/socket-message-delete-use-case.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_domain_use_case_socket_socket_message_update_use_case_service.html b/doc/TypeDoc/modules/module_chat_domain_use_case_socket_socket_message_update_use_case_service.html new file mode 100644 index 000000000..8380e696b --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_domain_use_case_socket_socket_message_update_use_case_service.html @@ -0,0 +1,2 @@ +module/chat/domain/use-case/socket/socket-message-update-use-case.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_domain_use_case_sync_local_message_service.html b/doc/TypeDoc/modules/module_chat_domain_use_case_sync_local_message_service.html new file mode 100644 index 000000000..08e5b18b0 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_domain_use_case_sync_local_message_service.html @@ -0,0 +1,2 @@ +module/chat/domain/use-case/sync-local-message.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_infra_database_dexie_schema_members.html b/doc/TypeDoc/modules/module_chat_infra_database_dexie_schema_members.html new file mode 100644 index 000000000..c0af36e45 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_infra_database_dexie_schema_members.html @@ -0,0 +1,5 @@ +module/chat/infra/database/dexie/schema/members | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_infra_database_dexie_schema_message.html b/doc/TypeDoc/modules/module_chat_infra_database_dexie_schema_message.html new file mode 100644 index 000000000..7e3c2cd64 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_infra_database_dexie_schema_message.html @@ -0,0 +1,5 @@ +module/chat/infra/database/dexie/schema/message | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_infra_database_dexie_schema_room.html b/doc/TypeDoc/modules/module_chat_infra_database_dexie_schema_room.html new file mode 100644 index 000000000..84be7e553 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_infra_database_dexie_schema_room.html @@ -0,0 +1,5 @@ +module/chat/infra/database/dexie/schema/room | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_infra_database_dexie_schema_typing.html b/doc/TypeDoc/modules/module_chat_infra_database_dexie_schema_typing.html new file mode 100644 index 000000000..64779cf03 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_infra_database_dexie_schema_typing.html @@ -0,0 +1,5 @@ +module/chat/infra/database/dexie/schema/typing | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_infra_database_dexie_service.html b/doc/TypeDoc/modules/module_chat_infra_database_dexie_service.html new file mode 100644 index 000000000..08e148d8b --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_infra_database_dexie_service.html @@ -0,0 +1,2 @@ +module/chat/infra/database/dexie/service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_infra_socket_signalR.html b/doc/TypeDoc/modules/module_chat_infra_socket_signalR.html new file mode 100644 index 000000000..d069ed04a --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_infra_socket_signalR.html @@ -0,0 +1,2 @@ +module/chat/infra/socket/signalR | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_infra_socket_signal_r_service.html b/doc/TypeDoc/modules/module_chat_infra_socket_signal_r_service.html new file mode 100644 index 000000000..73b9b48fe --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_infra_socket_signal_r_service.html @@ -0,0 +1,3 @@ +module/chat/infra/socket/signal-r.service | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_infra_socket_socket.html b/doc/TypeDoc/modules/module_chat_infra_socket_socket.html new file mode 100644 index 000000000..52d2953c4 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_infra_socket_socket.html @@ -0,0 +1,3 @@ +module/chat/infra/socket/socket | gabinete-digital
diff --git a/doc/TypeDoc/modules/module_chat_type.html b/doc/TypeDoc/modules/module_chat_type.html new file mode 100644 index 000000000..6e6010d71 --- /dev/null +++ b/doc/TypeDoc/modules/module_chat_type.html @@ -0,0 +1 @@ +module/chat/type | gabinete-digital

Module module/chat/type

diff --git a/doc/TypeDoc/modules/utils_ToBase64.html b/doc/TypeDoc/modules/utils_ToBase64.html new file mode 100644 index 000000000..c253a3c59 --- /dev/null +++ b/doc/TypeDoc/modules/utils_ToBase64.html @@ -0,0 +1,2 @@ +utils/ToBase64 | gabinete-digital

Module utils/ToBase64

Index

Functions

diff --git a/doc/TypeDoc/modules/utils_allowedDocExtension.html b/doc/TypeDoc/modules/utils_allowedDocExtension.html new file mode 100644 index 000000000..4747192cf --- /dev/null +++ b/doc/TypeDoc/modules/utils_allowedDocExtension.html @@ -0,0 +1,2 @@ +utils/allowedDocExtension | gabinete-digital
diff --git a/doc/TypeDoc/modules/utils_imageCompressore.html b/doc/TypeDoc/modules/utils_imageCompressore.html new file mode 100644 index 000000000..9826267a7 --- /dev/null +++ b/doc/TypeDoc/modules/utils_imageCompressore.html @@ -0,0 +1,2 @@ +utils/imageCompressore | gabinete-digital
diff --git a/doc/TypeDoc/types/infra_camera_camera_service.takePictureParams.html b/doc/TypeDoc/types/infra_camera_camera_service.takePictureParams.html new file mode 100644 index 000000000..4a6618c6d --- /dev/null +++ b/doc/TypeDoc/types/infra_camera_camera_service.takePictureParams.html @@ -0,0 +1,2 @@ +takePictureParams | gabinete-digital
takePictureParams: {
    cameraResultType: CameraResultType;
    quality?: number;
}

Parameters for taking a picture.

+
diff --git a/doc/TypeDoc/types/module_chat_data_data_source_member_list_member_list_local_data_source_service.IMemberTable.html b/doc/TypeDoc/types/module_chat_data_data_source_member_list_member_list_local_data_source_service.IMemberTable.html new file mode 100644 index 000000000..ee8f84290 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_data_data_source_member_list_member_list_local_data_source_service.IMemberTable.html @@ -0,0 +1 @@ +IMemberTable | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_data_dto_message_messageDeleteInputDTO.MessageDeleteInputDTO.html b/doc/TypeDoc/types/module_chat_data_dto_message_messageDeleteInputDTO.MessageDeleteInputDTO.html new file mode 100644 index 000000000..2a482f0a9 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_data_dto_message_messageDeleteInputDTO.MessageDeleteInputDTO.html @@ -0,0 +1 @@ +MessageDeleteInputDTO | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_data_dto_message_messageInputDtO.MessageInputDTO.html b/doc/TypeDoc/types/module_chat_data_dto_message_messageInputDtO.MessageInputDTO.html new file mode 100644 index 000000000..eb512ec74 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_data_dto_message_messageInputDtO.MessageInputDTO.html @@ -0,0 +1 @@ +MessageInputDTO | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_data_dto_message_messageListInputDTO.MessageListInputDTO.html b/doc/TypeDoc/types/module_chat_data_dto_message_messageListInputDTO.MessageListInputDTO.html new file mode 100644 index 000000000..5e2288630 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_data_dto_message_messageListInputDTO.MessageListInputDTO.html @@ -0,0 +1 @@ +MessageListInputDTO | gabinete-digital
MessageListInputDTO: z.infer<typeof MessageListInputDTOSchema>
diff --git a/doc/TypeDoc/types/module_chat_data_dto_message_messageOutputDTO.MessageOutPutDTO.html b/doc/TypeDoc/types/module_chat_data_dto_message_messageOutputDTO.MessageOutPutDTO.html new file mode 100644 index 000000000..70d20fdb2 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_data_dto_message_messageOutputDTO.MessageOutPutDTO.html @@ -0,0 +1 @@ +MessageOutPutDTO | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_data_dto_message_messageOutputDTO.MessageOutPutDataDTO.html b/doc/TypeDoc/types/module_chat_data_dto_message_messageOutputDTO.MessageOutPutDataDTO.html new file mode 100644 index 000000000..a53573fe7 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_data_dto_message_messageOutputDTO.MessageOutPutDataDTO.html @@ -0,0 +1 @@ +MessageOutPutDataDTO | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_data_dto_room_addMemberToRoomInputDto.AddMemberToRoomInputDTO.html b/doc/TypeDoc/types/module_chat_data_dto_room_addMemberToRoomInputDto.AddMemberToRoomInputDTO.html new file mode 100644 index 000000000..95a5eb9b3 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_data_dto_room_addMemberToRoomInputDto.AddMemberToRoomInputDTO.html @@ -0,0 +1 @@ +AddMemberToRoomInputDTO | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_data_dto_room_outPut.OutPutDTO.html b/doc/TypeDoc/types/module_chat_data_dto_room_outPut.OutPutDTO.html new file mode 100644 index 000000000..4460dbd2a --- /dev/null +++ b/doc/TypeDoc/types/module_chat_data_dto_room_outPut.OutPutDTO.html @@ -0,0 +1 @@ +OutPutDTO | gabinete-digital
OutPutDTO: z.infer<typeof OutPutDTOSchema>
diff --git a/doc/TypeDoc/types/module_chat_data_dto_room_roomByIdInputDTO.RoomByIdInputDTO.html b/doc/TypeDoc/types/module_chat_data_dto_room_roomByIdInputDTO.RoomByIdInputDTO.html new file mode 100644 index 000000000..5958c6316 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_data_dto_room_roomByIdInputDTO.RoomByIdInputDTO.html @@ -0,0 +1 @@ +RoomByIdInputDTO | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_data_dto_room_roomByIdOutputDTO.RoomByIdMemberItemOutputDTO.html b/doc/TypeDoc/types/module_chat_data_dto_room_roomByIdOutputDTO.RoomByIdMemberItemOutputDTO.html new file mode 100644 index 000000000..1431d54f1 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_data_dto_room_roomByIdOutputDTO.RoomByIdMemberItemOutputDTO.html @@ -0,0 +1 @@ +RoomByIdMemberItemOutputDTO | gabinete-digital
RoomByIdMemberItemOutputDTO: z.infer<typeof MemberSchema>
diff --git a/doc/TypeDoc/types/module_chat_data_dto_room_roomByIdOutputDTO.RoomByIdOutputDTO.html b/doc/TypeDoc/types/module_chat_data_dto_room_roomByIdOutputDTO.RoomByIdOutputDTO.html new file mode 100644 index 000000000..0b5798594 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_data_dto_room_roomByIdOutputDTO.RoomByIdOutputDTO.html @@ -0,0 +1 @@ +RoomByIdOutputDTO | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_data_dto_room_roomInputDTO.RoomInputDTO.html b/doc/TypeDoc/types/module_chat_data_dto_room_roomInputDTO.RoomInputDTO.html new file mode 100644 index 000000000..238dc64f1 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_data_dto_room_roomInputDTO.RoomInputDTO.html @@ -0,0 +1 @@ +RoomInputDTO | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_data_dto_room_roomListOutputDTO.RoomListItemOutPutDTO.html b/doc/TypeDoc/types/module_chat_data_dto_room_roomListOutputDTO.RoomListItemOutPutDTO.html new file mode 100644 index 000000000..9ca6bde3e --- /dev/null +++ b/doc/TypeDoc/types/module_chat_data_dto_room_roomListOutputDTO.RoomListItemOutPutDTO.html @@ -0,0 +1 @@ +RoomListItemOutPutDTO | gabinete-digital
RoomListItemOutPutDTO: z.infer<typeof RoomListItemOutPutDTOSchema>
diff --git a/doc/TypeDoc/types/module_chat_data_dto_room_roomListOutputDTO.RoomListOutPutDTO.html b/doc/TypeDoc/types/module_chat_data_dto_room_roomListOutputDTO.RoomListOutPutDTO.html new file mode 100644 index 000000000..bb17d84f5 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_data_dto_room_roomListOutputDTO.RoomListOutPutDTO.html @@ -0,0 +1 @@ +RoomListOutPutDTO | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_data_dto_room_roomOutputDTO.RoomOutPutDTO.html b/doc/TypeDoc/types/module_chat_data_dto_room_roomOutputDTO.RoomOutPutDTO.html new file mode 100644 index 000000000..5be0f06e4 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_data_dto_room_roomOutputDTO.RoomOutPutDTO.html @@ -0,0 +1 @@ +RoomOutPutDTO | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_data_dto_room_roomUpdateInputDTO.RoomUpdateInputDTO.html b/doc/TypeDoc/types/module_chat_data_dto_room_roomUpdateInputDTO.RoomUpdateInputDTO.html new file mode 100644 index 000000000..bdc9b3f02 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_data_dto_room_roomUpdateInputDTO.RoomUpdateInputDTO.html @@ -0,0 +1 @@ +RoomUpdateInputDTO | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_data_dto_room_roomUpdateOutputDTO.RoomUpdateOutputDTO.html b/doc/TypeDoc/types/module_chat_data_dto_room_roomUpdateOutputDTO.RoomUpdateOutputDTO.html new file mode 100644 index 000000000..998d0e3f7 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_data_dto_room_roomUpdateOutputDTO.RoomUpdateOutputDTO.html @@ -0,0 +1 @@ +RoomUpdateOutputDTO | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_data_dto_room_userRemoveListInputDTO.UserRemoveListInputDTO.html b/doc/TypeDoc/types/module_chat_data_dto_room_userRemoveListInputDTO.UserRemoveListInputDTO.html new file mode 100644 index 000000000..eeeb9b16a --- /dev/null +++ b/doc/TypeDoc/types/module_chat_data_dto_room_userRemoveListInputDTO.UserRemoveListInputDTO.html @@ -0,0 +1 @@ +UserRemoveListInputDTO | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_data_dto_typing_typingInputDTO.UserTypingDTO.html b/doc/TypeDoc/types/module_chat_data_dto_typing_typingInputDTO.UserTypingDTO.html new file mode 100644 index 000000000..79e748a13 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_data_dto_typing_typingInputDTO.UserTypingDTO.html @@ -0,0 +1 @@ +UserTypingDTO | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_domain_use_case_member_admin_use_case_service.MemberSetAdminDTO.html b/doc/TypeDoc/types/module_chat_domain_use_case_member_admin_use_case_service.MemberSetAdminDTO.html new file mode 100644 index 000000000..8d6f74932 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_domain_use_case_member_admin_use_case_service.MemberSetAdminDTO.html @@ -0,0 +1 @@ +MemberSetAdminDTO | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_domain_use_case_message_create_use_case_service.MessageInputUseCase.html b/doc/TypeDoc/types/module_chat_domain_use_case_message_create_use_case_service.MessageInputUseCase.html new file mode 100644 index 000000000..00da1c603 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_domain_use_case_message_create_use_case_service.MessageInputUseCase.html @@ -0,0 +1 @@ +MessageInputUseCase | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_domain_use_case_message_delete_live_use_case_service.MessageDeleteInputDTO.html b/doc/TypeDoc/types/module_chat_domain_use_case_message_delete_live_use_case_service.MessageDeleteInputDTO.html new file mode 100644 index 000000000..c329d76d2 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_domain_use_case_message_delete_live_use_case_service.MessageDeleteInputDTO.html @@ -0,0 +1 @@ +MessageDeleteInputDTO | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_domain_use_case_message_reaction_use_case_service.MessageReactionInput.html b/doc/TypeDoc/types/module_chat_domain_use_case_message_reaction_use_case_service.MessageReactionInput.html new file mode 100644 index 000000000..f41181bc8 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_domain_use_case_message_reaction_use_case_service.MessageReactionInput.html @@ -0,0 +1 @@ +MessageReactionInput | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_domain_use_case_message_update_use_case_service.MessageUpdateInput.html b/doc/TypeDoc/types/module_chat_domain_use_case_message_update_use_case_service.MessageUpdateInput.html new file mode 100644 index 000000000..2333490e7 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_domain_use_case_message_update_use_case_service.MessageUpdateInput.html @@ -0,0 +1 @@ +MessageUpdateInput | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_domain_use_case_socket_member_list_update_status_use_case_service.MemberListUPdateStatusInputDTO.html b/doc/TypeDoc/types/module_chat_domain_use_case_socket_member_list_update_status_use_case_service.MemberListUPdateStatusInputDTO.html new file mode 100644 index 000000000..ae63d88bf --- /dev/null +++ b/doc/TypeDoc/types/module_chat_domain_use_case_socket_member_list_update_status_use_case_service.MemberListUPdateStatusInputDTO.html @@ -0,0 +1 @@ +MemberListUPdateStatusInputDTO | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_members.DexieMembersTableSchema.html b/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_members.DexieMembersTableSchema.html new file mode 100644 index 000000000..932225719 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_members.DexieMembersTableSchema.html @@ -0,0 +1 @@ +DexieMembersTableSchema | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_members.MemberTable.html b/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_members.MemberTable.html new file mode 100644 index 000000000..942fae8ef --- /dev/null +++ b/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_members.MemberTable.html @@ -0,0 +1 @@ +MemberTable | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_message.DexieMessageTable.html b/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_message.DexieMessageTable.html new file mode 100644 index 000000000..dc31be75d --- /dev/null +++ b/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_message.DexieMessageTable.html @@ -0,0 +1 @@ +DexieMessageTable | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_message.MessageTable.html b/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_message.MessageTable.html new file mode 100644 index 000000000..8db2d94c9 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_message.MessageTable.html @@ -0,0 +1 @@ +MessageTable | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_room.DexieRoomsTableSchema.html b/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_room.DexieRoomsTableSchema.html new file mode 100644 index 000000000..9a4e27276 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_room.DexieRoomsTableSchema.html @@ -0,0 +1 @@ +DexieRoomsTableSchema | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_room.RoomTable.html b/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_room.RoomTable.html new file mode 100644 index 000000000..76f5fa085 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_room.RoomTable.html @@ -0,0 +1 @@ +RoomTable | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_typing.DexieTypingsTableSchema.html b/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_typing.DexieTypingsTableSchema.html new file mode 100644 index 000000000..359163c29 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_typing.DexieTypingsTableSchema.html @@ -0,0 +1 @@ +DexieTypingsTableSchema | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_typing.TypingTable.html b/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_typing.TypingTable.html new file mode 100644 index 000000000..0db24ebaa --- /dev/null +++ b/doc/TypeDoc/types/module_chat_infra_database_dexie_schema_typing.TypingTable.html @@ -0,0 +1 @@ +TypingTable | gabinete-digital
diff --git a/doc/TypeDoc/types/module_chat_infra_socket_signal_r_service.ISignalRInput.html b/doc/TypeDoc/types/module_chat_infra_socket_signal_r_service.ISignalRInput.html new file mode 100644 index 000000000..4fa36d241 --- /dev/null +++ b/doc/TypeDoc/types/module_chat_infra_socket_signal_r_service.ISignalRInput.html @@ -0,0 +1 @@ +ISignalRInput | gabinete-digital
ISignalRInput: z.infer<typeof SignalRInputSchema>
diff --git a/doc/TypeDoc/variables/module_chat_data_data_source_member_list_member_list_local_data_source_service.roomMemberList.html b/doc/TypeDoc/variables/module_chat_data_data_source_member_list_member_list_local_data_source_service.roomMemberList.html new file mode 100644 index 000000000..edd7a1ddc --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_data_data_source_member_list_member_list_local_data_source_service.roomMemberList.html @@ -0,0 +1 @@ +roomMemberList | gabinete-digital
roomMemberList: Dexie & {
    memberList: EntityTable<{
        $roomIdUserId?: string;
        id?: string;
        joinAt?: string;
        roomId?: string;
        status?: string;
        user?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
    }, "$roomIdUserId", InsertType<{
        $roomIdUserId?: string;
        id?: string;
        joinAt?: string;
        roomId?: string;
        status?: string;
        user?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
    }, "$roomIdUserId">>;
} = ...
diff --git a/doc/TypeDoc/variables/module_chat_data_data_source_room_room_memory_data_source.initialState.html b/doc/TypeDoc/variables/module_chat_data_data_source_room_room_memory_data_source.initialState.html new file mode 100644 index 000000000..ee7cdb200 --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_data_data_source_room_room_memory_data_source.initialState.html @@ -0,0 +1 @@ +initialState | gabinete-digital
diff --git a/doc/TypeDoc/variables/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.initialState.html b/doc/TypeDoc/variables/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.initialState.html new file mode 100644 index 000000000..74e8736a2 --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_data_data_source_userTyping_user_typing_memory_data_source_service.initialState.html @@ -0,0 +1 @@ +initialState | gabinete-digital
diff --git a/doc/TypeDoc/variables/module_chat_data_dto_message_messageDeleteInputDTO.MessageDeleteInputDTOSchema.html b/doc/TypeDoc/variables/module_chat_data_dto_message_messageDeleteInputDTO.MessageDeleteInputDTOSchema.html new file mode 100644 index 000000000..2550cbdf6 --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_data_dto_message_messageDeleteInputDTO.MessageDeleteInputDTOSchema.html @@ -0,0 +1 @@ +MessageDeleteInputDTOSchema | gabinete-digital
MessageDeleteInputDTOSchema: ZodObject<{
    messageId: ZodString;
    requestId: ZodString;
    roomId: ZodString;
    senderId: ZodNumber;
}, "strip", ZodTypeAny, {
    messageId?: string;
    requestId?: string;
    roomId?: string;
    senderId?: number;
}, {
    messageId?: string;
    requestId?: string;
    roomId?: string;
    senderId?: number;
}> = ...
diff --git a/doc/TypeDoc/variables/module_chat_data_dto_message_messageInputDtO.MessageInputDTOSchema.html b/doc/TypeDoc/variables/module_chat_data_dto_message_messageInputDtO.MessageInputDTOSchema.html new file mode 100644 index 000000000..5270e0160 --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_data_dto_message_messageInputDtO.MessageInputDTOSchema.html @@ -0,0 +1 @@ +MessageInputDTOSchema | gabinete-digital
MessageInputDTOSchema: ZodObject<{
    attachments: ZodOptional<ZodArray<ZodObject<{
        applicationId: ZodString;
        docId: ZodString;
        file: ZodString;
        fileName: ZodString;
        fileType: ZodNativeEnum<typeof MessageAttachmentFileType>;
        source: ZodNativeEnum<typeof MessageAttachmentSource>;
    }, "strip", ZodTypeAny, {
        applicationId?: string;
        docId?: string;
        file?: string;
        fileName?: string;
        fileType?: MessageAttachmentFileType;
        source?: MessageAttachmentSource;
    }, {
        applicationId?: string;
        docId?: string;
        file?: string;
        fileName?: string;
        fileType?: MessageAttachmentFileType;
        source?: MessageAttachmentSource;
    }>, "many">>;
    canEdit: ZodBoolean;
    message: ZodString;
    messageType: ZodNumber;
    oneShot: ZodBoolean;
    requestId: ZodString;
    requireUnlock: ZodBoolean;
    roomId: ZodString;
    senderId: ZodNumber;
}, "strip", ZodTypeAny, {
    attachments?: {
        applicationId?: string;
        docId?: string;
        file?: string;
        fileName?: string;
        fileType?: MessageAttachmentFileType;
        source?: MessageAttachmentSource;
    }[];
    canEdit?: boolean;
    message?: string;
    messageType?: number;
    oneShot?: boolean;
    requestId?: string;
    requireUnlock?: boolean;
    roomId?: string;
    senderId?: number;
}, {
    attachments?: {
        applicationId?: string;
        docId?: string;
        file?: string;
        fileName?: string;
        fileType?: MessageAttachmentFileType;
        source?: MessageAttachmentSource;
    }[];
    canEdit?: boolean;
    message?: string;
    messageType?: number;
    oneShot?: boolean;
    requestId?: string;
    requireUnlock?: boolean;
    roomId?: string;
    senderId?: number;
}> = ...
diff --git a/doc/TypeDoc/variables/module_chat_data_dto_message_messageOutputDTO.MessageOutPutDTOSchema.html b/doc/TypeDoc/variables/module_chat_data_dto_message_messageOutputDTO.MessageOutPutDTOSchema.html new file mode 100644 index 000000000..5487328bd --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_data_dto_message_messageOutputDTO.MessageOutPutDTOSchema.html @@ -0,0 +1 @@ +MessageOutPutDTOSchema | gabinete-digital
MessageOutPutDTOSchema: ZodObject<{
    data: ZodArray<ZodObject<{
        attachments: ZodArray<ZodObject<{
            applicationId: ZodOptional<ZodString>;
            docId: ZodOptional<ZodString>;
            file: ZodString;
            fileName: ZodString;
            fileType: ZodNativeEnum<typeof MessageAttachmentFileType>;
            source: ZodNativeEnum<typeof MessageAttachmentSource>;
        }, "strip", ZodTypeAny, {
            applicationId?: string;
            docId?: string;
            file?: string;
            fileName?: string;
            fileType?: MessageAttachmentFileType;
            source?: MessageAttachmentSource;
        }, {
            applicationId?: string;
            docId?: string;
            file?: string;
            fileName?: string;
            fileType?: MessageAttachmentFileType;
            source?: MessageAttachmentSource;
        }>, "many">;
        canEdit: ZodBoolean;
        deliverAt: ZodNullable<ZodString>;
        id: ZodString;
        info: ZodArray<ZodObject<{}, "strip", ZodTypeAny, {}, {}>, "many">;
        message: ZodNullable<ZodString>;
        messageType: ZodNumber;
        oneShot: ZodBoolean;
        reactions: ZodArray<ZodObject<{
            id: ZodString;
            reactedAt: ZodString;
            reaction: ZodString;
            sender: ZodObject<{}, "strip", ZodTypeAny, {}, {}>;
        }, "strip", ZodTypeAny, {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }, {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }>, "many">;
        requestId: ZodOptional<ZodString>;
        requireUnlock: ZodBoolean;
        roomId: ZodString;
        sender: ZodObject<{
            userPhoto: ZodOptional<ZodString>;
            wxFullName: ZodString;
            wxUserId: ZodNumber;
            wxeMail: ZodString;
        }, "strip", ZodTypeAny, {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        }, {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        }>;
        sentAt: ZodString;
    }, "strip", ZodTypeAny, {
        attachments?: {
            applicationId?: string;
            docId?: string;
            file?: string;
            fileName?: string;
            fileType?: MessageAttachmentFileType;
            source?: MessageAttachmentSource;
        }[];
        canEdit?: boolean;
        deliverAt?: string;
        id?: string;
        info?: {}[];
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        reactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[];
        requestId?: string;
        requireUnlock?: boolean;
        roomId?: string;
        sender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        sentAt?: string;
    }, {
        attachments?: {
            applicationId?: string;
            docId?: string;
            file?: string;
            fileName?: string;
            fileType?: MessageAttachmentFileType;
            source?: MessageAttachmentSource;
        }[];
        canEdit?: boolean;
        deliverAt?: string;
        id?: string;
        info?: {}[];
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        reactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[];
        requestId?: string;
        requireUnlock?: boolean;
        roomId?: string;
        sender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        sentAt?: string;
    }>, "many">;
    message: ZodString;
    success: ZodBoolean;
}, "strip", ZodTypeAny, {
    data?: {
        attachments?: {
            applicationId?: string;
            docId?: string;
            file?: string;
            fileName?: string;
            fileType?: MessageAttachmentFileType;
            source?: MessageAttachmentSource;
        }[];
        canEdit?: boolean;
        deliverAt?: string;
        id?: string;
        info?: {}[];
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        reactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[];
        requestId?: string;
        requireUnlock?: boolean;
        roomId?: string;
        sender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        sentAt?: string;
    }[];
    message?: string;
    success?: boolean;
}, {
    data?: {
        attachments?: {
            applicationId?: string;
            docId?: string;
            file?: string;
            fileName?: string;
            fileType?: MessageAttachmentFileType;
            source?: MessageAttachmentSource;
        }[];
        canEdit?: boolean;
        deliverAt?: string;
        id?: string;
        info?: {}[];
        message?: string;
        messageType?: number;
        oneShot?: boolean;
        reactions?: {
            id?: string;
            reactedAt?: string;
            reaction?: string;
            sender?: {};
        }[];
        requestId?: string;
        requireUnlock?: boolean;
        roomId?: string;
        sender?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        sentAt?: string;
    }[];
    message?: string;
    success?: boolean;
}> = ...
diff --git a/doc/TypeDoc/variables/module_chat_data_dto_message_messageOutputDTO.MessageOutPutDataDTOSchema.html b/doc/TypeDoc/variables/module_chat_data_dto_message_messageOutputDTO.MessageOutPutDataDTOSchema.html new file mode 100644 index 000000000..8e77b6ebd --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_data_dto_message_messageOutputDTO.MessageOutPutDataDTOSchema.html @@ -0,0 +1 @@ +MessageOutPutDataDTOSchema | gabinete-digital
MessageOutPutDataDTOSchema: ZodObject<{
    attachments: ZodArray<ZodObject<{
        applicationId: ZodOptional<ZodString>;
        docId: ZodOptional<ZodString>;
        file: ZodString;
        fileName: ZodString;
        fileType: ZodNativeEnum<typeof MessageAttachmentFileType>;
        source: ZodNativeEnum<typeof MessageAttachmentSource>;
    }, "strip", ZodTypeAny, {
        applicationId?: string;
        docId?: string;
        file?: string;
        fileName?: string;
        fileType?: MessageAttachmentFileType;
        source?: MessageAttachmentSource;
    }, {
        applicationId?: string;
        docId?: string;
        file?: string;
        fileName?: string;
        fileType?: MessageAttachmentFileType;
        source?: MessageAttachmentSource;
    }>, "many">;
    canEdit: ZodBoolean;
    deliverAt: ZodNullable<ZodString>;
    id: ZodString;
    info: ZodArray<ZodObject<{}, "strip", ZodTypeAny, {}, {}>, "many">;
    message: ZodNullable<ZodString>;
    messageType: ZodNumber;
    oneShot: ZodBoolean;
    reactions: ZodArray<ZodObject<{
        id: ZodString;
        reactedAt: ZodString;
        reaction: ZodString;
        sender: ZodObject<{}, "strip", ZodTypeAny, {}, {}>;
    }, "strip", ZodTypeAny, {
        id?: string;
        reactedAt?: string;
        reaction?: string;
        sender?: {};
    }, {
        id?: string;
        reactedAt?: string;
        reaction?: string;
        sender?: {};
    }>, "many">;
    requestId: ZodOptional<ZodString>;
    requireUnlock: ZodBoolean;
    roomId: ZodString;
    sender: ZodObject<{
        userPhoto: ZodOptional<ZodString>;
        wxFullName: ZodString;
        wxUserId: ZodNumber;
        wxeMail: ZodString;
    }, "strip", ZodTypeAny, {
        userPhoto?: string;
        wxFullName?: string;
        wxUserId?: number;
        wxeMail?: string;
    }, {
        userPhoto?: string;
        wxFullName?: string;
        wxUserId?: number;
        wxeMail?: string;
    }>;
    sentAt: ZodString;
}, "strip", ZodTypeAny, {
    attachments?: {
        applicationId?: string;
        docId?: string;
        file?: string;
        fileName?: string;
        fileType?: MessageAttachmentFileType;
        source?: MessageAttachmentSource;
    }[];
    canEdit?: boolean;
    deliverAt?: string;
    id?: string;
    info?: {}[];
    message?: string;
    messageType?: number;
    oneShot?: boolean;
    reactions?: {
        id?: string;
        reactedAt?: string;
        reaction?: string;
        sender?: {};
    }[];
    requestId?: string;
    requireUnlock?: boolean;
    roomId?: string;
    sender?: {
        userPhoto?: string;
        wxFullName?: string;
        wxUserId?: number;
        wxeMail?: string;
    };
    sentAt?: string;
}, {
    attachments?: {
        applicationId?: string;
        docId?: string;
        file?: string;
        fileName?: string;
        fileType?: MessageAttachmentFileType;
        source?: MessageAttachmentSource;
    }[];
    canEdit?: boolean;
    deliverAt?: string;
    id?: string;
    info?: {}[];
    message?: string;
    messageType?: number;
    oneShot?: boolean;
    reactions?: {
        id?: string;
        reactedAt?: string;
        reaction?: string;
        sender?: {};
    }[];
    requestId?: string;
    requireUnlock?: boolean;
    roomId?: string;
    sender?: {
        userPhoto?: string;
        wxFullName?: string;
        wxUserId?: number;
        wxeMail?: string;
    };
    sentAt?: string;
}> = ...
diff --git a/doc/TypeDoc/variables/module_chat_data_dto_room_addMemberToRoomInputDto.AddMemberToRoomInputDTOSchema.html b/doc/TypeDoc/variables/module_chat_data_dto_room_addMemberToRoomInputDto.AddMemberToRoomInputDTOSchema.html new file mode 100644 index 000000000..b45416772 --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_data_dto_room_addMemberToRoomInputDto.AddMemberToRoomInputDTOSchema.html @@ -0,0 +1 @@ +AddMemberToRoomInputDTOSchema | gabinete-digital
AddMemberToRoomInputDTOSchema: ZodObject<{
    id: ZodString;
    members: ZodArray<ZodNumber, "many">;
}, "strip", ZodTypeAny, {
    id?: string;
    members?: number[];
}, {
    id?: string;
    members?: number[];
}> = ...
diff --git a/doc/TypeDoc/variables/module_chat_data_dto_room_roomByIdInputDTO.RoomByIdInputDTOSchema.html b/doc/TypeDoc/variables/module_chat_data_dto_room_roomByIdInputDTO.RoomByIdInputDTOSchema.html new file mode 100644 index 000000000..9577e40b6 --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_data_dto_room_roomByIdInputDTO.RoomByIdInputDTOSchema.html @@ -0,0 +1 @@ +RoomByIdInputDTOSchema | gabinete-digital
diff --git a/doc/TypeDoc/variables/module_chat_data_dto_room_roomByIdOutputDTO.RoomByIdOutputDTOSchema.html b/doc/TypeDoc/variables/module_chat_data_dto_room_roomByIdOutputDTO.RoomByIdOutputDTOSchema.html new file mode 100644 index 000000000..675f6a62c --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_data_dto_room_roomByIdOutputDTO.RoomByIdOutputDTOSchema.html @@ -0,0 +1 @@ +RoomByIdOutputDTOSchema | gabinete-digital
RoomByIdOutputDTOSchema: ZodObject<{
    data: ZodObject<{
        createdAt: ZodString;
        createdBy: ZodObject<{
            userPhoto: ZodNullable<ZodString>;
            wxFullName: ZodString;
            wxUserId: ZodNumber;
            wxeMail: ZodString;
        }, "strip", ZodTypeAny, {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        }, {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        }>;
        expirationDate: ZodNullable<ZodString>;
        id: ZodString;
        members: ZodArray<ZodObject<{
            id: ZodString;
            isAdmin: ZodBoolean;
            joinAt: ZodString;
            user: ZodObject<{
                userPhoto: ZodNullable<ZodString>;
                wxFullName: ZodString;
                wxUserId: ZodNumber;
                wxeMail: ZodString;
            }, "strip", ZodTypeAny, {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            }, {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            }>;
        }, "strip", ZodTypeAny, {
            id?: string;
            isAdmin?: boolean;
            joinAt?: string;
            user?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
        }, {
            id?: string;
            isAdmin?: boolean;
            joinAt?: string;
            user?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
        }>, "many">;
        roomName: ZodString;
        roomType: ZodNumber;
    }, "strip", ZodTypeAny, {
        createdAt?: string;
        createdBy?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        expirationDate?: string;
        id?: string;
        members?: {
            id?: string;
            isAdmin?: boolean;
            joinAt?: string;
            user?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
        }[];
        roomName?: string;
        roomType?: number;
    }, {
        createdAt?: string;
        createdBy?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        expirationDate?: string;
        id?: string;
        members?: {
            id?: string;
            isAdmin?: boolean;
            joinAt?: string;
            user?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
        }[];
        roomName?: string;
        roomType?: number;
    }>;
    message: ZodString;
    success: ZodBoolean;
}, "strip", ZodTypeAny, {
    data?: {
        createdAt?: string;
        createdBy?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        expirationDate?: string;
        id?: string;
        members?: {
            id?: string;
            isAdmin?: boolean;
            joinAt?: string;
            user?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
        }[];
        roomName?: string;
        roomType?: number;
    };
    message?: string;
    success?: boolean;
}, {
    data?: {
        createdAt?: string;
        createdBy?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        expirationDate?: string;
        id?: string;
        members?: {
            id?: string;
            isAdmin?: boolean;
            joinAt?: string;
            user?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
        }[];
        roomName?: string;
        roomType?: number;
    };
    message?: string;
    success?: boolean;
}> = ...
diff --git a/doc/TypeDoc/variables/module_chat_data_dto_room_roomInputDTO.RoomInputDTOSchema.html b/doc/TypeDoc/variables/module_chat_data_dto_room_roomInputDTO.RoomInputDTOSchema.html new file mode 100644 index 000000000..6bda91639 --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_data_dto_room_roomInputDTO.RoomInputDTOSchema.html @@ -0,0 +1 @@ +RoomInputDTOSchema | gabinete-digital
RoomInputDTOSchema: ZodObject<{
    createdBy: ZodNumber;
    expirationDate: ZodOptional<ZodNullable<ZodString>>;
    members: ZodArray<ZodNumber, "many">;
    roomName: ZodString;
    roomType: ZodNumber;
}, "strip", ZodTypeAny, {
    createdBy?: number;
    expirationDate?: string;
    members?: number[];
    roomName?: string;
    roomType?: number;
}, {
    createdBy?: number;
    expirationDate?: string;
    members?: number[];
    roomName?: string;
    roomType?: number;
}> = ...
diff --git a/doc/TypeDoc/variables/module_chat_data_dto_room_roomListOutputDTO.RoomListOutPutDTOSchema.html b/doc/TypeDoc/variables/module_chat_data_dto_room_roomListOutputDTO.RoomListOutPutDTOSchema.html new file mode 100644 index 000000000..26da90ffc --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_data_dto_room_roomListOutputDTO.RoomListOutPutDTOSchema.html @@ -0,0 +1 @@ +RoomListOutPutDTOSchema | gabinete-digital
RoomListOutPutDTOSchema: ZodObject<{
    data: ZodArray<ZodObject<{
        chatRoom: ZodObject<{
            createdAt: ZodString;
            createdBy: ZodObject<{
                userPhoto: ZodNullable<ZodString>;
                wxFullName: ZodString;
                wxUserId: ZodNumber;
                wxeMail: ZodString;
            }, "strip", ZodTypeAny, {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            }, {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            }>;
            expirationDate: ZodNullable<ZodString>;
            id: ZodString;
            roomName: ZodString;
            roomType: ZodNumber;
        }, "strip", ZodTypeAny, {
            createdAt?: string;
            createdBy?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
            expirationDate?: string;
            id?: string;
            roomName?: string;
            roomType?: number;
        }, {
            createdAt?: string;
            createdBy?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
            expirationDate?: string;
            id?: string;
            roomName?: string;
            roomType?: number;
        }>;
        joinAt: ZodString;
    }, "strip", ZodTypeAny, {
        chatRoom?: {
            createdAt?: string;
            createdBy?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
            expirationDate?: string;
            id?: string;
            roomName?: string;
            roomType?: number;
        };
        joinAt?: string;
    }, {
        chatRoom?: {
            createdAt?: string;
            createdBy?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
            expirationDate?: string;
            id?: string;
            roomName?: string;
            roomType?: number;
        };
        joinAt?: string;
    }>, "many">;
    message: ZodString;
    success: ZodBoolean;
}, "strip", ZodTypeAny, {
    data?: {
        chatRoom?: {
            createdAt?: string;
            createdBy?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
            expirationDate?: string;
            id?: string;
            roomName?: string;
            roomType?: number;
        };
        joinAt?: string;
    }[];
    message?: string;
    success?: boolean;
}, {
    data?: {
        chatRoom?: {
            createdAt?: string;
            createdBy?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
            expirationDate?: string;
            id?: string;
            roomName?: string;
            roomType?: number;
        };
        joinAt?: string;
    }[];
    message?: string;
    success?: boolean;
}> = ...
diff --git a/doc/TypeDoc/variables/module_chat_data_dto_room_roomOutputDTO.RoomOutPutDTOSchema.html b/doc/TypeDoc/variables/module_chat_data_dto_room_roomOutputDTO.RoomOutPutDTOSchema.html new file mode 100644 index 000000000..fff6cb36f --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_data_dto_room_roomOutputDTO.RoomOutPutDTOSchema.html @@ -0,0 +1 @@ +RoomOutPutDTOSchema | gabinete-digital
RoomOutPutDTOSchema: ZodObject<{
    data: ZodObject<{
        createdAt: ZodString;
        createdBy: ZodNullable<ZodAny>;
        expirationDate: ZodNullable<ZodString>;
        id: ZodString;
        roomName: ZodString;
        roomType: ZodAny;
    }, "strip", ZodTypeAny, {
        createdAt?: string;
        createdBy?: any;
        expirationDate?: string;
        id?: string;
        roomName?: string;
        roomType?: any;
    }, {
        createdAt?: string;
        createdBy?: any;
        expirationDate?: string;
        id?: string;
        roomName?: string;
        roomType?: any;
    }>;
    message: ZodString;
    success: ZodBoolean;
}, "strip", ZodTypeAny, {
    data?: {
        createdAt?: string;
        createdBy?: any;
        expirationDate?: string;
        id?: string;
        roomName?: string;
        roomType?: any;
    };
    message?: string;
    success?: boolean;
}, {
    data?: {
        createdAt?: string;
        createdBy?: any;
        expirationDate?: string;
        id?: string;
        roomName?: string;
        roomType?: any;
    };
    message?: string;
    success?: boolean;
}> = ...
diff --git a/doc/TypeDoc/variables/module_chat_data_dto_room_roomUpdateInputDTO.RoomUpdateInputDTOSchema.html b/doc/TypeDoc/variables/module_chat_data_dto_room_roomUpdateInputDTO.RoomUpdateInputDTOSchema.html new file mode 100644 index 000000000..826d75d19 --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_data_dto_room_roomUpdateInputDTO.RoomUpdateInputDTOSchema.html @@ -0,0 +1 @@ +RoomUpdateInputDTOSchema | gabinete-digital
RoomUpdateInputDTOSchema: ZodObject<{
    roomId: ZodString;
    roomName: ZodString;
    roomType: ZodNumber;
}, "strip", ZodTypeAny, {
    roomId?: string;
    roomName?: string;
    roomType?: number;
}, {
    roomId?: string;
    roomName?: string;
    roomType?: number;
}> = ...
diff --git a/doc/TypeDoc/variables/module_chat_data_dto_room_roomUpdateOutputDTO.RoomUpdateOutputDTOSchema.html b/doc/TypeDoc/variables/module_chat_data_dto_room_roomUpdateOutputDTO.RoomUpdateOutputDTOSchema.html new file mode 100644 index 000000000..70da53a4e --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_data_dto_room_roomUpdateOutputDTO.RoomUpdateOutputDTOSchema.html @@ -0,0 +1 @@ +RoomUpdateOutputDTOSchema | gabinete-digital
RoomUpdateOutputDTOSchema: ZodObject<{
    data: ZodObject<{
        createdAt: ZodString;
        createdBy: ZodObject<{
            userPhoto: ZodNullable<ZodString>;
            wxFullName: ZodString;
            wxUserId: ZodNumber;
            wxeMail: ZodString;
        }, "strip", ZodTypeAny, {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        }, {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        }>;
        expirationDate: ZodNullable<ZodString>;
        id: ZodString;
        members: ZodArray<ZodObject<{
            id: ZodString;
            joinAt: ZodString;
            user: ZodObject<{
                userPhoto: ZodNullable<ZodString>;
                wxFullName: ZodString;
                wxUserId: ZodNumber;
                wxeMail: ZodString;
            }, "strip", ZodTypeAny, {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            }, {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            }>;
        }, "strip", ZodTypeAny, {
            id?: string;
            joinAt?: string;
            user?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
        }, {
            id?: string;
            joinAt?: string;
            user?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
        }>, "many">;
        roomName: ZodString;
        roomType: ZodNumber;
    }, "strip", ZodTypeAny, {
        createdAt?: string;
        createdBy?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        expirationDate?: string;
        id?: string;
        members?: {
            id?: string;
            joinAt?: string;
            user?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
        }[];
        roomName?: string;
        roomType?: number;
    }, {
        createdAt?: string;
        createdBy?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        expirationDate?: string;
        id?: string;
        members?: {
            id?: string;
            joinAt?: string;
            user?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
        }[];
        roomName?: string;
        roomType?: number;
    }>;
    message: ZodString;
    success: ZodBoolean;
}, "strip", ZodTypeAny, {
    data?: {
        createdAt?: string;
        createdBy?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        expirationDate?: string;
        id?: string;
        members?: {
            id?: string;
            joinAt?: string;
            user?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
        }[];
        roomName?: string;
        roomType?: number;
    };
    message?: string;
    success?: boolean;
}, {
    data?: {
        createdAt?: string;
        createdBy?: {
            userPhoto?: string;
            wxFullName?: string;
            wxUserId?: number;
            wxeMail?: string;
        };
        expirationDate?: string;
        id?: string;
        members?: {
            id?: string;
            joinAt?: string;
            user?: {
                userPhoto?: string;
                wxFullName?: string;
                wxUserId?: number;
                wxeMail?: string;
            };
        }[];
        roomName?: string;
        roomType?: number;
    };
    message?: string;
    success?: boolean;
}> = ...
diff --git a/doc/TypeDoc/variables/module_chat_data_dto_room_userRemoveListInputDTO.UserRemoveListInputDTOSchema.html b/doc/TypeDoc/variables/module_chat_data_dto_room_userRemoveListInputDTO.UserRemoveListInputDTOSchema.html new file mode 100644 index 000000000..973f9e3c9 --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_data_dto_room_userRemoveListInputDTO.UserRemoveListInputDTOSchema.html @@ -0,0 +1 @@ +UserRemoveListInputDTOSchema | gabinete-digital
UserRemoveListInputDTOSchema: ZodObject<{
    id: ZodString;
    members: ZodArray<ZodNumber, "many">;
}, "strip", ZodTypeAny, {
    id?: string;
    members?: number[];
}, {
    id?: string;
    members?: number[];
}> = ...
diff --git a/doc/TypeDoc/variables/module_chat_data_dto_typing_typingInputDTO.UserTypingDTOSchema.html b/doc/TypeDoc/variables/module_chat_data_dto_typing_typingInputDTO.UserTypingDTOSchema.html new file mode 100644 index 000000000..d7cab99da --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_data_dto_typing_typingInputDTO.UserTypingDTOSchema.html @@ -0,0 +1 @@ +UserTypingDTOSchema | gabinete-digital
UserTypingDTOSchema: ZodObject<{
    requestId: ZodString;
    roomId: ZodString;
    userId: ZodString;
    userName: ZodString;
}, "strip", ZodTypeAny, {
    requestId?: string;
    roomId?: string;
    userId?: string;
    userName?: string;
}, {
    requestId?: string;
    roomId?: string;
    userId?: string;
    userName?: string;
}> = ...
diff --git a/doc/TypeDoc/variables/module_chat_domain_chat_service_service.InstanceId.html b/doc/TypeDoc/variables/module_chat_domain_chat_service_service.InstanceId.html new file mode 100644 index 000000000..bfbf3620a --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_domain_chat_service_service.InstanceId.html @@ -0,0 +1 @@ +InstanceId | gabinete-digital
diff --git a/doc/TypeDoc/variables/module_chat_domain_use_case_message_delete_live_use_case_service.MessageDeleteInputDTOSchema.html b/doc/TypeDoc/variables/module_chat_domain_use_case_message_delete_live_use_case_service.MessageDeleteInputDTOSchema.html new file mode 100644 index 000000000..edcd82597 --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_domain_use_case_message_delete_live_use_case_service.MessageDeleteInputDTOSchema.html @@ -0,0 +1 @@ +MessageDeleteInputDTOSchema | gabinete-digital
MessageDeleteInputDTOSchema: ZodObject<{
    messageId: ZodString;
    requestId: ZodOptional<ZodString>;
    roomId: ZodString;
    senderId: ZodNumber;
}, "strip", ZodTypeAny, {
    messageId?: string;
    requestId?: string;
    roomId?: string;
    senderId?: number;
}, {
    messageId?: string;
    requestId?: string;
    roomId?: string;
    senderId?: number;
}> = ...
diff --git a/doc/TypeDoc/variables/module_chat_domain_use_case_socket_member_list_update_status_use_case_service.MemberListUPdateStatus.html b/doc/TypeDoc/variables/module_chat_domain_use_case_socket_member_list_update_status_use_case_service.MemberListUPdateStatus.html new file mode 100644 index 000000000..e6d4f7879 --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_domain_use_case_socket_member_list_update_status_use_case_service.MemberListUPdateStatus.html @@ -0,0 +1 @@ +MemberListUPdateStatus | gabinete-digital
MemberListUPdateStatus: ZodArray<ZodObject<{
    key: ZodString;
    value: ZodObject<{
        userId: ZodNumber;
        userName: ZodString;
    }, "strip", ZodTypeAny, {
        userId?: number;
        userName?: string;
    }, {
        userId?: number;
        userName?: string;
    }>;
}, "strip", ZodTypeAny, {
    key?: string;
    value?: {
        userId?: number;
        userName?: string;
    };
}, {
    key?: string;
    value?: {
        userId?: number;
        userName?: string;
    };
}>, "many"> = ...
diff --git a/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_members.MemberTableColumn.html b/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_members.MemberTableColumn.html new file mode 100644 index 000000000..0669ce5a0 --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_members.MemberTableColumn.html @@ -0,0 +1 @@ +MemberTableColumn | gabinete-digital
MemberTableColumn: "$roomIdUserId, userId, id, user, joinAt, roomId, status, wxUserId, isAdmin" = '$roomIdUserId, userId, id, user, joinAt, roomId, status, wxUserId, isAdmin'
diff --git a/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_members.MemberTableSchema.html b/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_members.MemberTableSchema.html new file mode 100644 index 000000000..1df63071a --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_members.MemberTableSchema.html @@ -0,0 +1 @@ +MemberTableSchema | gabinete-digital
MemberTableSchema: ZodObject<{
    $roomIdUserId: ZodOptional<ZodString>;
    id: ZodString;
    isAdmin: ZodBoolean;
    joinAt: ZodString;
    roomId: ZodString;
    status: ZodString;
    userPhoto: ZodNullable<ZodString>;
    wxFullName: ZodString;
    wxUserId: ZodNumber;
    wxeMail: ZodString;
}, "strip", ZodTypeAny, {
    $roomIdUserId?: string;
    id?: string;
    isAdmin?: boolean;
    joinAt?: string;
    roomId?: string;
    status?: string;
    userPhoto?: string;
    wxFullName?: string;
    wxUserId?: number;
    wxeMail?: string;
}, {
    $roomIdUserId?: string;
    id?: string;
    isAdmin?: boolean;
    joinAt?: string;
    roomId?: string;
    status?: string;
    userPhoto?: string;
    wxFullName?: string;
    wxUserId?: number;
    wxeMail?: string;
}> = ...
diff --git a/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_message.MessageTable-1.html b/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_message.MessageTable-1.html new file mode 100644 index 000000000..bee8320ac --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_message.MessageTable-1.html @@ -0,0 +1 @@ +MessageTable | gabinete-digital
MessageTable: ZodObject<{
    $id: ZodOptional<ZodNumber>;
    attachments: ZodOptional<ZodArray<ZodObject<{}, "strip", ZodTypeAny, {}, {}>, "many">>;
    canEdit: ZodBoolean;
    id: ZodOptional<ZodString>;
    info: ZodOptional<ZodArray<ZodObject<{}, "strip", ZodTypeAny, {}, {}>, "many">>;
    message: ZodNullable<ZodString>;
    messageType: ZodNumber;
    oneShot: ZodBoolean;
    reactions: ZodOptional<ZodArray<ZodObject<{
        id: ZodString;
        reactedAt: ZodString;
        reaction: ZodString;
        sender: ZodObject<{}, "strip", ZodTypeAny, {}, {}>;
    }, "strip", ZodTypeAny, {
        id?: string;
        reactedAt?: string;
        reaction?: string;
        sender?: {};
    }, {
        id?: string;
        reactedAt?: string;
        reaction?: string;
        sender?: {};
    }>, "many">>;
    requireUnlock: ZodBoolean;
    roomId: ZodString;
    sender: ZodObject<{
        userPhoto: ZodString;
        wxFullName: ZodString;
        wxUserId: ZodNumber;
        wxeMail: ZodString;
    }, "strip", ZodTypeAny, {
        userPhoto?: string;
        wxFullName?: string;
        wxUserId?: number;
        wxeMail?: string;
    }, {
        userPhoto?: string;
        wxFullName?: string;
        wxUserId?: number;
        wxeMail?: string;
    }>;
    sending: ZodOptional<ZodBoolean>;
    sentAt: ZodOptional<ZodString>;
}, "strip", ZodTypeAny, {
    $id?: number;
    attachments?: {}[];
    canEdit?: boolean;
    id?: string;
    info?: {}[];
    message?: string;
    messageType?: number;
    oneShot?: boolean;
    reactions?: {
        id?: string;
        reactedAt?: string;
        reaction?: string;
        sender?: {};
    }[];
    requireUnlock?: boolean;
    roomId?: string;
    sender?: {
        userPhoto?: string;
        wxFullName?: string;
        wxUserId?: number;
        wxeMail?: string;
    };
    sending?: boolean;
    sentAt?: string;
}, {
    $id?: number;
    attachments?: {}[];
    canEdit?: boolean;
    id?: string;
    info?: {}[];
    message?: string;
    messageType?: number;
    oneShot?: boolean;
    reactions?: {
        id?: string;
        reactedAt?: string;
        reaction?: string;
        sender?: {};
    }[];
    requireUnlock?: boolean;
    roomId?: string;
    sender?: {
        userPhoto?: string;
        wxFullName?: string;
        wxUserId?: number;
        wxeMail?: string;
    };
    sending?: boolean;
    sentAt?: string;
}> = ...
diff --git a/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_message.messageTableColumn.html b/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_message.messageTableColumn.html new file mode 100644 index 000000000..e3d3b0243 --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_message.messageTableColumn.html @@ -0,0 +1 @@ +messageTableColumn | gabinete-digital
messageTableColumn: "++$id, id, roomId, senderId, message, messageType, canEdit, oneShot, requireUnlock" = '++$id, id, roomId, senderId, message, messageType, canEdit, oneShot, requireUnlock'
diff --git a/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_room.RoomTableColumn.html b/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_room.RoomTableColumn.html new file mode 100644 index 000000000..b2e9d1fae --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_room.RoomTableColumn.html @@ -0,0 +1 @@ +RoomTableColumn | gabinete-digital
RoomTableColumn: "id, createdBy, roomName, roomType, expirationDate, lastMessage" = 'id, createdBy, roomName, roomType, expirationDate, lastMessage'
diff --git a/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_room.RoomTableSchema.html b/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_room.RoomTableSchema.html new file mode 100644 index 000000000..ec92b2051 --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_room.RoomTableSchema.html @@ -0,0 +1 @@ +RoomTableSchema | gabinete-digital
RoomTableSchema: ZodObject<{
    createdAt: ZodAny;
    createdBy: ZodObject<{
        userPhoto: ZodOptional<ZodNullable<ZodString>>;
        wxFullName: ZodString;
        wxUserId: ZodNumber;
        wxeMail: ZodString;
    }, "strip", ZodTypeAny, {
        userPhoto?: string;
        wxFullName?: string;
        wxUserId?: number;
        wxeMail?: string;
    }, {
        userPhoto?: string;
        wxFullName?: string;
        wxUserId?: number;
        wxeMail?: string;
    }>;
    expirationDate: ZodNullable<ZodAny>;
    id: ZodString;
    roomName: ZodString;
}, "strip", ZodTypeAny, {
    createdAt?: any;
    createdBy?: {
        userPhoto?: string;
        wxFullName?: string;
        wxUserId?: number;
        wxeMail?: string;
    };
    expirationDate?: any;
    id?: string;
    roomName?: string;
}, {
    createdAt?: any;
    createdBy?: {
        userPhoto?: string;
        wxFullName?: string;
        wxUserId?: number;
        wxeMail?: string;
    };
    expirationDate?: any;
    id?: string;
    roomName?: string;
}> = ...
diff --git a/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_typing.TypingTableColumn.html b/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_typing.TypingTableColumn.html new file mode 100644 index 000000000..b664a52ab --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_typing.TypingTableColumn.html @@ -0,0 +1 @@ +TypingTableColumn | gabinete-digital
TypingTableColumn: "id, userId, userName, chatRoomId, entryDate" = 'id, userId, userName, chatRoomId, entryDate'
diff --git a/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_typing.TypingTableSchema.html b/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_typing.TypingTableSchema.html new file mode 100644 index 000000000..618bbb58d --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_infra_database_dexie_schema_typing.TypingTableSchema.html @@ -0,0 +1 @@ +TypingTableSchema | gabinete-digital
TypingTableSchema: ZodObject<{
    chatRoomId: ZodString;
    entryDate: ZodString;
    id: ZodOptional<ZodString>;
    userId: ZodOptional<ZodString>;
    userName: ZodString;
}, "strip", ZodTypeAny, {
    chatRoomId?: string;
    entryDate?: string;
    id?: string;
    userId?: string;
    userName?: string;
}, {
    chatRoomId?: string;
    entryDate?: string;
    id?: string;
    userId?: string;
    userName?: string;
}> = ...
diff --git a/doc/TypeDoc/variables/module_chat_infra_database_dexie_service.chatDatabase.html b/doc/TypeDoc/variables/module_chat_infra_database_dexie_service.chatDatabase.html new file mode 100644 index 000000000..40d34df5d --- /dev/null +++ b/doc/TypeDoc/variables/module_chat_infra_database_dexie_service.chatDatabase.html @@ -0,0 +1 @@ +chatDatabase | gabinete-digital
chatDatabase: Dexie & {
    members: DexieMembersTableSchema;
    message: DexieMessageTable;
    room: DexieRoomsTableSchema;
    typing: DexieTypingsTableSchema;
} = ...
diff --git a/doc/architecture.md b/doc/architecture.md new file mode 100644 index 000000000..5166922b4 --- /dev/null +++ b/doc/architecture.md @@ -0,0 +1,109 @@ +# Software Architecture documentation +This Architecture promotes a clear separation of concerns by dividing the system into layers, each with its own responsibility. However, rather than using a traditional layered approach, we'll focus on a component-based structure where each component adheres to SOLID principles and can operate independently. The architecture consist of the following layers: + +- **Components**: Business components +- **Presentation**: UI components and Angular services. + +## Architecture Layers + +![Alt text](./svg/aa.svg) + +### Components + +![Alt text](./svg/business-co.svg) + +Components are the core business logic units in the application. The components are divided into two sub-layers: + +**Domain Layer** + +- Contains business logic and rules. +- Models the business entities. +- Does not depend on the data layer or any other external services. + +**Data Layer** + +- Responsible for data access and persistence. +- Contains repositories or data services that interact with APIs or databases. +- Isolated from the domain layer to ensure a clear separation of concerns. + +### Presentation +![Alt text](./svg/ui-layer.svg) + +The presentation layer is responsible for the user interface and interactions. It consists of Angular UI components and services: + + +## File Structure Explanation +The project is divided into several key sections, each serving a specific purpose: + +**Source Code (src)** + +- **common**: Shared utilities such as decorators, interceptors, and guards. + +- **core**: Business Object divided by features to store shared entity, use case and repository interface + +- **infra**: Infrastructure code such as storage, HTTP clients, logging, camera, and file system. + +- **libs**: Reusable libraries (e.g., session management, cryptography). + +- **components**: Business Feature divided by responsibility + +- **UI**: Presentation layer with Angular divided by Feature + +- **utils**: Utility functions and constants. + + +├── package-lock.json +├── package.json +├── src +│ ├── common +│ ├── core +│ │ ├── attachment +│ │ │ ├── entity +│ │ │ ├── repository +│ │ │ └── use-cases +│ ├── module +│ │ ├── gabinete +│ │ │ ├── domain +│ │ │ ├── data +│ │ ├── Agenda +│ │ │ ├── domain +│ │ │ ├── data +│ ├── UI +│ │ ├── pages +│ │ │ ├── share +| │ │ │ ├── buttons +│ │ │ │ └── modal +│ │ │ ├── Home +│ │ │ | ├── service +│ │ │ │ └── store +│ │ │ ├── Agenda +│ │ │ ├── Gabinete +│ │ │ ├── Actions +│ │ │ ├── Chat +│ ├── infra +│ │ ├── http +│ │ ├── socket +│ │ ├── database +│ │ ├── camera +│ ├── utils +│ │ ├── date.ts +│ │ ├── exception.ts +│ │ ├── sort.ts +│ ├── libs + + +## Achieving Reusability + + + +### Example: Gabinete Page + +Consider a Gabinete scenario: +- **Business components**: Event Component, Gabinete Component +- **UI components**: Gabinete UI Business + +In this setup, the Event Component functionalities are reusable without any dependency on UI details. If the product team introduces create-event functionality in the Gabinete screen, the Event Component module can be added as a dependency to the Gabinete UI module seamlessly. +![Alt text](./svg/aa-relationship.svg) + +## Conclusion +This file structure supports Clean Architecture by ensuring a clear separation of concerns and adhering to SOLID principles. Each part of the application is modular, making it easy to maintain, test, and extend. This setup promotes a clean and organized project that scales well as complexity grows. diff --git a/doc/svg/Group.svg b/doc/svg/Group.svg new file mode 100644 index 000000000..02274f57a --- /dev/null +++ b/doc/svg/Group.svg @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/svg/aa-relationship.svg b/doc/svg/aa-relationship.svg new file mode 100644 index 000000000..2b92c8b53 --- /dev/null +++ b/doc/svg/aa-relationship.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/svg/aa.svg b/doc/svg/aa.svg new file mode 100644 index 000000000..a1e55766e --- /dev/null +++ b/doc/svg/aa.svg @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/svg/bunesscomponent.svg b/doc/svg/bunesscomponent.svg new file mode 100644 index 000000000..6268063be --- /dev/null +++ b/doc/svg/bunesscomponent.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/doc/svg/business-co.svg b/doc/svg/business-co.svg new file mode 100644 index 000000000..56a16031f --- /dev/null +++ b/doc/svg/business-co.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/svg/ui-layer.svg b/doc/svg/ui-layer.svg new file mode 100644 index 000000000..ad87fb105 --- /dev/null +++ b/doc/svg/ui-layer.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/doc/version.md b/doc/version.md new file mode 100644 index 000000000..1a941e668 --- /dev/null +++ b/doc/version.md @@ -0,0 +1,49 @@ +# Release History + +This document provides a detailed history of all versions of the app, including new features, improvements, bug fixes, known issues, deprecations, and technical changes. + +--- + +## Version v1.2.0 (Release Date: September 12, 2024) + +### Overview +This release introduces several performance improvements, UI enhancements, and bug fixes related to file uploads. + +### New Features + +| Feature | Description | Impact | +|:-------------|:----------:|--------------:| +| . | . | . + +### Improvements +| Improvement | Description | Area Impacted | +|:-------------|:----------:|--------------:| +| . | . | . + +### Bug Fixes +| Bug | Description | Status | +|:-------------|:----------:|--------------:| +| . | . | . + +### Known Issues + +| Issue | Description | Workaround | +|:-------------|:----------:|--------------:| +| . | . | . + +### Deprecations + +| Deprecated | Replacement | Reason for Deprecation | +|:-------------|:----------:|--------------:| +| Rocket chat | Gabinite digital Chat | Reducing external solution | + + +### Technical Changes +- **Angular Upgrade:** Upgraded Angular from version 11 to 12. + +--- + + +## How to Use This Document + +Each version is documented chronologically, with detailed notes on new features, improvements, bug fixes, technical changes, and deprecations. When searching for specific information on a release, you can navigate by version numbers or by feature categories. diff --git a/endpoints_documentation.md b/endpoints_documentation.md new file mode 100644 index 000000000..3f3c6b744 --- /dev/null +++ b/endpoints_documentation.md @@ -0,0 +1,221 @@ + +# Endpoints Documentation + +## 1. Get Actions + +**Endpoint:** +``` +GET https://gdapi-dev.dyndns.info/jwt/api/presidentialActions +``` + +**Query Parameters:** +None + +**Body:** +None + +--- + +## 2. Post Action + +**Endpoint:** +``` +POST https://gdapi-dev.dyndns.info/jwt/api/presidentialActions +``` + +**Query Parameters:** +None + +**Body:** +```json +{ + "ProcessId": null, + "Description": "teste 345", + "Detail": "teste", + "DateBegin": "2024-07-19T13:30:00.730Z", + "DateEnd": "2024-07-19T13:45:00.730Z", + "ActionType": "Evento" +} +``` + +--- + +## 3. Put Action + +**Endpoint:** +``` +PUT https://gdapi-dev.dyndns.info/jwt/api/presidentialActions +``` + +**Query Parameters:** +None + +**Body:** +```json +{ + "ProcessId": 15412, + "Description": "teste 345 45", + "Detail": "teste", + "DateBegin": "2024-07-19T14:30:00+01:00", + "DateEnd": "2024-07-19T14:45:00+01:00", + "ActionType": "Evento" +} +``` + +--- + +## 4. Delete Action + +**Endpoint:** +``` +DELETE https://gdapi-dev.dyndns.info/jwt/api/presidentialActions/{actionId} +``` + +**Query Parameters:** +None + +**Body:** +None + +--- + +## 5. Get Folder Info + +**Endpoint:** +``` +GET https://gdapi-dev.dyndns.info/jwt/api/presidentialActions/{actionId} +``` + +**Query Parameters:** +None + +**Body:** +None + +--- + +## 6. Get Publications IDs + +**Endpoint:** +``` +GET https://gdapi-dev.dyndns.info/jwt/api/presidentialActions/{actionId}/posts/ids +``` + +**Query Parameters:** +- `folderId`: The ID of the folder (e.g., `15388`) + +**Body:** +None + +--- + + +## 7. Get publication + +**Endpoint:** +``` +GET https://gdapi-dev.dyndns.info/jwt/api/presidentialActions/v2/posts/{publicationId} +``` + +**Query Parameters:** +- `id`: The ID of the publication (e.g., `15388`) + +**Body:** +None + +--- + +## 8. Post publication + +**Endpoint:** +``` +POST https://gdapi-dev.dyndns.info/jwt/api/presidentialActions/{actionId}/v2/posts +``` + +**Query Parameters:** +None + + +**Body:** +```json +{ + "DateIndex": "2024-07-19T15:07:09.348Z", + "DatePublication": "2024-07-19T15:07:09.348Z", + "DocumentId": null, + "Files": [{ + "FileBase64": "data:image/jpeg;base64,.." + }], + "Message": "2024-07-19T14:45:00+01:00", + "ProcessId": 15388, + "Title": "554", +} +``` + +--- + +## 9. Put publication + +**Endpoint:** +``` +PUT https://gdapi-dev.dyndns.info/jwt/api/presidentialActions/{publicationId}/posts +``` + +**Query Parameters:** +None + +**Body:** +```json +{ + "DateIndex": "2024-07-19T15:07:09.348Z", + "DatePublication": "2024-07-19T15:07:09.348Z", + "DocumentId": 142663, + "Files": [{ + "FileBase64": "data:image/jpeg;base64,.." + }], + "Message": "2024-07-19T14:45:00+01:00", + "ProcessId": 15388, + "Title": "554", +} +``` + +--- + + + +## 10. Delete publication + +**Endpoint:** +``` +Delete https://gdapi-dev.dyndns.info/jwt/api/presidentialActions/{actionId}/posts/{publicationId} +``` + +**Query Parameters:** +None + +**Body:** +None + +--- + + +## 11. Post Chuck + +**Endpoint:** +``` +Post https://gdapi-dev.dyndns.info/jwt/api/ObjectServer/StreamFiles?path={path} +``` + +**Query Parameters:** +None + +**Body:** +```json +{ + "base64": "889234598237495...", + "index": 4, + "length": 15, + "path": "88d7c4f6-9e4b-47e3-ae93-8203384d14e5.mp4", +} +``` + +--- diff --git a/gabinete-digital-fo.code-workspace b/gabinete-digital-fo.code-workspace index f1b39c052..adcf73350 100644 --- a/gabinete-digital-fo.code-workspace +++ b/gabinete-digital-fo.code-workspace @@ -1,19 +1,30 @@ { "folders": [ { + "name": "gabinete-digital-fo", "path": "." }, { - "path": "../beast-ORM-v0" + "name": "socket-server", + "path": "../socket-server" }, { - "path": "../new-doc" + "name": "logs", + "path": "../logs" }, { - "path": "../IDOC" + "name": "opentelemetry-js-main", + "path": "../../../Downloads/opentelemetry-js-main/opentelemetry-js-main" }, { - "path": "../sih" + "name": "nestjs-microservice-boilerplate-api-master", + "path": "../../../Downloads/nestjs-microservice-boilerplate-api-master" + }, + { + "path": "../../../Downloads/swiper-master" + }, + { + "path": "../sentry" } ], "settings": { diff --git a/gabinete.postman_collection.json b/gabinete.postman_collection.json new file mode 100644 index 000000000..c49113d9d --- /dev/null +++ b/gabinete.postman_collection.json @@ -0,0 +1,78 @@ +{ + "info": { + "_postman_id": "2be7c96a-9d34-45fe-9dc9-8fe62efaefbf", + "name": "gabinete", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "32154620" + }, + "item": [ + { + "name": "send notification to perter's phone", + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "key=AAAAum9znm8:APA91bFtKgVFS7XhJrYkn1m6If3pLwHqCVDcpotFbk8qFtAg_3FdptH7BvOGVRBlX-0wdbSIV9uKhF7iogLLAo1-bf02FwRbeofnC-6JGC2IzFbWK_zto8wp1f5q_zrwkmU0s3wqksv6" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n\"to\":\"fGrBJ52QRqG4rcuHur2_5l:APA91bGerKl6LcrqKjnG8Xvm-JaHxJfuMmKjYn7hJk-m5jhUAy2PIuhJ-yjkv0bGwPPKHeBAbYmDTB5zp_-D1sUetJJ8I8tPsP3pUl6nRRhDgPYO4N-97typ8wn5Le6xHK1ncFyOk2yR\",\r\n \"data\": {\r\n \"IdObject\": \"30847_101\",\r\n \"Service\": \"gabinete-digital\",\r\n \"Object\": \"despachos\",\r\n \"FolderId\": \"10469\"\r\n },\r\n \"notification\": {\r\n \"body\": \"Recebeu o Despacho nº 000025-0823 para vossa atenção\",\r\n \"title\": \"teste deferimento 11/02_1\"\r\n }\r\n}" + }, + "url": { + "raw": "https://fcm.googleapis.com/fcm/send", + "protocol": "https", + "host": [ + "fcm", + "googleapis", + "com" + ], + "path": [ + "fcm", + "send" + ] + } + }, + "response": [] + }, + { + "name": "send notification", + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "key=AAAAum9znm8:APA91bFtKgVFS7XhJrYkn1m6If3pLwHqCVDcpotFbk8qFtAg_3FdptH7BvOGVRBlX-0wdbSIV9uKhF7iogLLAo1-bf02FwRbeofnC-6JGC2IzFbWK_zto8wp1f5q_zrwkmU0s3wqksv6" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n\"to\":\"ci3PSyhViJStOUiILtqYal:APA91bFJ-eGiCFeSt0ar2hC8UzNfRtcbAYN43frpmRfTBG4-vZO8Yxv1CoE2Bn5PJnmYo37s3RIp0s267p7Eq9V2ycbjBxRSdWVbuUSYHMFN-oqa5OXr6lsLqrSnNGVDwq_pNgGsIF7S\",\r\n\"notification\" : {\r\n \"body\" : \"Body of Your Notification\",\r\n \"title\": \"Title of Your Notification\"\r\n}\r\n}" + }, + "url": { + "raw": "https://fcm.googleapis.com/fcm/send", + "protocol": "https", + "host": [ + "fcm", + "googleapis", + "com" + ], + "path": [ + "fcm", + "send" + ] + } + }, + "response": [] + } + ] +} \ No newline at end of file diff --git a/ios/App/App.xcodeproj/project.pbxproj b/ios/App/App.xcodeproj/project.pbxproj index 2325a68ae..776ca85de 100644 --- a/ios/App/App.xcodeproj/project.pbxproj +++ b/ios/App/App.xcodeproj/project.pbxproj @@ -15,7 +15,7 @@ 504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC3101FED79650016851F /* LaunchScreen.storyboard */; }; 50B271D11FEDC1A000F3C39B /* public in Resources */ = {isa = PBXBuildFile; fileRef = 50B271D01FEDC1A000F3C39B /* public */; }; A084ECDBA7D38E1E42DFC39D /* Pods_App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */; }; - A9D8C5112B87AF2B00C95FBB /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = A9D8C5102B87AF2B00C95FBB /* GoogleService-Info.plist */; }; + A99931862B9691C4001D9C4F /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = A99931852B9691C4001D9C4F /* GoogleService-Info.plist */; }; A9D8C5192B87B08300C95FBB /* ShareViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9D8C5182B87B08300C95FBB /* ShareViewController.swift */; }; A9D8C51C2B87B08300C95FBB /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A9D8C51A2B87B08300C95FBB /* MainInterface.storyboard */; }; A9D8C5202B87B08300C95FBB /* Share.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = A9D8C5162B87B08300C95FBB /* Share.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; @@ -55,7 +55,7 @@ 504EC3111FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 504EC3131FED79650016851F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 50B271D01FEDC1A000F3C39B /* public */ = {isa = PBXFileReference; lastKnownFileType = folder; path = public; sourceTree = ""; }; - A9D8C5102B87AF2B00C95FBB /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../../Downloads/GoogleService-Info.plist"; sourceTree = ""; }; + A99931852B9691C4001D9C4F /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../../Downloads/GoogleService-Info.plist"; sourceTree = ""; }; A9D8C5162B87B08300C95FBB /* Share.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = Share.appex; sourceTree = BUILT_PRODUCTS_DIR; }; A9D8C5182B87B08300C95FBB /* ShareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareViewController.swift; sourceTree = ""; }; A9D8C51B2B87B08300C95FBB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = ""; }; @@ -117,8 +117,8 @@ 504EC3061FED79650016851F /* App */ = { isa = PBXGroup; children = ( + A99931852B9691C4001D9C4F /* GoogleService-Info.plist */, A9D8C5252B888E8300C95FBB /* App.entitlements */, - A9D8C5102B87AF2B00C95FBB /* GoogleService-Info.plist */, 50379B222058CBB4000EE86E /* capacitor.config.json */, 504EC3071FED79650016851F /* AppDelegate.swift */, 504EC30B1FED79650016851F /* Main.storyboard */, @@ -243,7 +243,7 @@ 50379B232058CBB4000EE86E /* capacitor.config.json in Resources */, 504EC30D1FED79650016851F /* Main.storyboard in Resources */, 2FAD9763203C412B000D30F8 /* config.xml in Resources */, - A9D8C5112B87AF2B00C95FBB /* GoogleService-Info.plist in Resources */, + A99931862B9691C4001D9C4F /* GoogleService-Info.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -489,16 +489,16 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = App/App.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 106; DEVELOPMENT_TEAM = 94BRNM2LSS; ENABLE_USER_SCRIPT_SANDBOXING = NO; INFOPLIST_FILE = App/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 17.0; + IPHONEOS_DEPLOYMENT_TARGET = 16.3; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2; + MARKETING_VERSION = 6.4; OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\""; PRODUCT_BUNDLE_IDENTIFIER = com.gpr.gabinetedigital.teste; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -516,16 +516,16 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = App/App.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 106; DEVELOPMENT_TEAM = 94BRNM2LSS; ENABLE_USER_SCRIPT_SANDBOXING = NO; INFOPLIST_FILE = App/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 17.0; + IPHONEOS_DEPLOYMENT_TARGET = 16.3; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2; + MARKETING_VERSION = 6.4; PRODUCT_BUNDLE_IDENTIFIER = com.gpr.gabinetedigital.teste; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = ""; diff --git a/ios/App/App/App.entitlements b/ios/App/App/App.entitlements index eeb23ac7a..df026f3ab 100644 --- a/ios/App/App/App.entitlements +++ b/ios/App/App/App.entitlements @@ -2,6 +2,8 @@ + aps-environment + development com.apple.security.application-groups group.gabinete diff --git a/ios/App/App/AppDelegate.swift b/ios/App/App/AppDelegate.swift index 0b80fba39..a30b0eeb3 100644 --- a/ios/App/App/AppDelegate.swift +++ b/ios/App/App/AppDelegate.swift @@ -1,6 +1,8 @@ import UIKit import Capacitor import SendIntent +import FirebaseCore +import Firebase @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { @@ -10,8 +12,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. + FirebaseApp.configure() + return true } + + func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. @@ -42,6 +48,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // Called when the application is about to terminate. // Save data if appropriate. See also applicationDidEnterBackground:. } + func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { + NotificationCenter.default.post(name: .capacitorDidRegisterForRemoteNotifications, object: deviceToken) + + Messaging.messaging().apnsToken = deviceToken + } + + func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) { + NotificationCenter.default.post(name: .capacitorDidFailToRegisterForRemoteNotifications, object: error) + } func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { var success = true diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-1024.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-1024.png new file mode 100644 index 000000000..b85ec353d Binary files /dev/null and b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-1024.png differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png deleted file mode 100644 index 2f503741c..000000000 Binary files a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png and /dev/null differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x-1.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x-1.png deleted file mode 100644 index dd72c1ce8..000000000 Binary files a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x-1.png and /dev/null differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png deleted file mode 100644 index dd72c1ce8..000000000 Binary files a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png and /dev/null differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png deleted file mode 100644 index 7fbf0a84a..000000000 Binary files a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png and /dev/null differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png deleted file mode 100644 index f996ea18f..000000000 Binary files a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png and /dev/null differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x-1.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x-1.png deleted file mode 100644 index bb2935fb7..000000000 Binary files a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x-1.png and /dev/null differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png deleted file mode 100644 index bb2935fb7..000000000 Binary files a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png and /dev/null differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png deleted file mode 100644 index 21d16e5b1..000000000 Binary files a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png and /dev/null differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png deleted file mode 100644 index dd72c1ce8..000000000 Binary files a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png and /dev/null differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x-1.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x-1.png deleted file mode 100644 index ff0754519..000000000 Binary files a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x-1.png and /dev/null differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png deleted file mode 100644 index ff0754519..000000000 Binary files a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png and /dev/null differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png deleted file mode 100644 index 3401fa887..000000000 Binary files a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png and /dev/null differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png deleted file mode 100644 index adf6ba01d..000000000 Binary files a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png and /dev/null differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png deleted file mode 100644 index ffd0da781..000000000 Binary files a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png and /dev/null differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png deleted file mode 100644 index 90aea7cd2..000000000 Binary files a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png and /dev/null differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png deleted file mode 100644 index 2f5eafb6b..000000000 Binary files a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png and /dev/null differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png deleted file mode 100644 index 89c8d0448..000000000 Binary files a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png and /dev/null differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png deleted file mode 100644 index ef541c90a..000000000 Binary files a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png and /dev/null differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json index 90eea7ec7..f22e10cde 100644 --- a/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,116 +1,14 @@ { "images" : [ { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "AppIcon-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "AppIcon-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "AppIcon-29x29@2x-1.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "AppIcon-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "AppIcon-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "AppIcon-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "AppIcon-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "AppIcon-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "AppIcon-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "AppIcon-20x20@2x-1.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "AppIcon-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "AppIcon-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "AppIcon-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "AppIcon-40x40@2x-1.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "AppIcon-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "AppIcon-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "AppIcon-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "AppIcon-512@2x.png", - "scale" : "1x" + "filename" : "AppIcon-1024.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/ios/App/App/Assets.xcassets/Contents.json b/ios/App/App/Assets.xcassets/Contents.json index da4a164c9..73c00596a 100644 --- a/ios/App/App/Assets.xcassets/Contents.json +++ b/ios/App/App/Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png index 33ea6c970..07a32962e 100644 Binary files a/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png and b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png differ diff --git a/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png index 33ea6c970..07a32962e 100644 Binary files a/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png and b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png differ diff --git a/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png index 33ea6c970..07a32962e 100644 Binary files a/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png and b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png differ diff --git a/ios/App/App/Info.plist b/ios/App/App/Info.plist index a3dc95ea3..2e3b9eca0 100644 --- a/ios/App/App/Info.plist +++ b/ios/App/App/Info.plist @@ -30,9 +30,19 @@ gabinetedigital + + CFBundleTypeRole + Editor + CFBundleURLSchemes + + com.googleusercontent.apps.800733765231-5da370m1mntjk7cg8cc2d331sp8cj91d + + CFBundleVersion $(CURRENT_PROJECT_VERSION) + FirebaseAppDelegateProxyEnabled + LSApplicationCategoryType LSRequiresIPhoneOS @@ -41,12 +51,6 @@ NSAllowsArbitraryLoads - NSAllowsArbitraryLoadsForMedia - - NSAllowsArbitraryLoadsInWebContent - - NSAllowsLocalNetworking - NSCameraUsageDescription This app requires access to the camera. @@ -56,6 +60,10 @@ This app requires access to the photo library. NSPhotoLibraryUsageDescription This app requires access to the photo library. + UIBackgroundModes + + remote-notification + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -79,5 +87,24 @@ UIViewControllerBasedStatusBarAppearance + NSExtensionActivationRule + + NSExtensionActivationSupportsFileWithMaxCount + 5 + NSExtensionActivationSupportsImageWithMaxCount + 5 + NSExtensionActivationSupportsMovieWithMaxCount + 5 + NSExtensionActivationSupportsText + + NSExtensionActivationSupportsWebPageWithMaxCount + 1 + NSExtensionActivationSupportsWebURLWithMaxCount + 1 + NSExtensionActivationUsesStrictMatching + + + UNUserNotificationCenterDelegate + YourApp.NotificationDelegate diff --git a/ios/App/Share/Info.plist b/ios/App/Share/Info.plist index 1bc711114..4bcc55b8d 100644 --- a/ios/App/Share/Info.plist +++ b/ios/App/Share/Info.plist @@ -14,30 +14,27 @@ NSExtensionAttributes NSExtensionActivationRule - TRUEPREDICATE + + NSExtensionActivationSupportsFileWithMaxCount + 5 + NSExtensionActivationSupportsImageWithMaxCount + 5 + NSExtensionActivationSupportsMovieWithMaxCount + 5 + NSExtensionActivationSupportsText + + NSExtensionActivationSupportsWebPageWithMaxCount + 1 + NSExtensionActivationSupportsWebURLWithMaxCount + 1 + NSExtensionActivationUsesStrictMatching + + NSExtensionMainStoryboard MainInterface NSExtensionPointIdentifier com.apple.share-services - NSExtensionAttributes - - NSExtensionActivationRule - - NSExtensionActivationSupportsFileWithMaxCount - 5 - NSExtensionActivationSupportsImageWithMaxCount - 5 - NSExtensionActivationSupportsMovieWithMaxCount - 5 - NSExtensionActivationSupportsText - - NSExtensionActivationSupportsWebPageWithMaxCount - 1 - NSExtensionActivationSupportsWebURLWithMaxCount - 1 - - diff --git a/nice.ts b/nice.ts new file mode 100644 index 000000000..ba3bd7058 --- /dev/null +++ b/nice.ts @@ -0,0 +1,87 @@ +import { Injectable } from '@angular/core'; +import { Observable, Subject, BehaviorSubject } from 'rxjs'; +import { webSocket, WebSocketSubject } from 'rxjs/webSocket'; +import { catchError, retryWhen, tap, delay } from 'rxjs/operators'; + +interface WebSocketMessage { +type: string; +payload: any; +} + +interface WebSocketError { +type: string; +error: any; +} + +@Injectable({ +providedIn: 'root' +}) +export class MessageLiveDataSourceService { + private socket$: WebSocketSubject; + private messageSubject$: Subject; + private connectionStatus$: BehaviorSubject; + private reconnectAttempts = 0; + private readonly maxReconnectAttempts = 5; + + constructor() { + this.messageSubject$ = new Subject(); + this.connectionStatus$ = new BehaviorSubject(false); + } + + public connect(url: string) { + this.socket$ = webSocket(url); + + this.socket$.pipe( + tap({ + error: () => { + this.connectionStatus$.next(false); + } + }), + retryWhen(errors => errors.pipe( + tap(() => { + this.reconnectAttempts++; + if (this.reconnectAttempts >= this.maxReconnectAttempts) { + throw new Error('Max reconnect attempts reached'); + } + }), + delay(1000) + )) + ).subscribe( + (message) => { + this.messageSubject$.next(message); + this.connectionStatus$.next(true); + this.reconnectAttempts = 0; + }, + (err) => { + console.error('WebSocket connection error:', err); + }, + () => { + console.log('WebSocket connection closed'); + this.connectionStatus$.next(false); + } + ); + } + + public sendMessage(message: WebSocketMessage): Observable { + return new Observable(observer => { + this.socket$.next(message); + observer.next(); + observer.complete(); + }).pipe( + catchError(err => { + console.error('Send message error:', err); + return new Observable(observer => { + observer.error({ type: 'SEND_ERROR', error: err }); + }); + }) + ); + } + + public get messages$(): Observable { + return this.messageSubject$.asObservable(); + } + + public get connectionStatus(): Observable { + return this.connectionStatus$.asObservable(); + } +} diff --git a/package-lock.json b/package-lock.json index fd3d134d0..883619c02 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,12 +45,15 @@ "@capacitor/haptics": "^4.1.0", "@capacitor/ios": "^5.4.2", "@capacitor/keyboard": "^4.1.0", + "@capacitor/local-notifications": "^6.0.0", "@capacitor/network": "^4.1.0", "@capacitor/push-notifications": "^5.1.0", "@capacitor/share": "^4.1.0", "@capacitor/storage": "^1.2.5", "@capawesome/capacitor-file-picker": "^5.3.0", "@capawesome/capacitor-screen-orientation": "^5.0.1", + "@ffmpeg/ffmpeg": "^0.12.10", + "@ffmpeg/util": "^0.12.1", "@fortawesome/angular-fontawesome": "^0.9.0", "@fortawesome/fontawesome-free": "^5.15.3", "@fortawesome/fontawesome-svg-core": "^1.2.35", @@ -92,11 +95,23 @@ "@logisticinfotech/ionic4-datepicker": "^1.4.4", "@microsoft/signalr": "^8.0.0", "@ng-bootstrap/ng-bootstrap": "^9.1.2", + "@ngrx/store": "^10.1.2", "@ngx-translate/core": "^13.0.0", "@ngxs/store": "^3.8.2", + "@opentelemetry/exporter-metrics-otlp-http": "^0.52.1", + "@opentelemetry/exporter-otlp-http": "^0.26.0", + "@opentelemetry/exporter-trace-otlp-http": "^0.52.1", + "@opentelemetry/exporter-trace-otlp-proto": "^0.48.0", + "@opentelemetry/exporter-zipkin": "^1.25.0", + "@opentelemetry/resources": "^1.25.0", + "@opentelemetry/sdk-metrics": "^1.25.1", + "@opentelemetry/sdk-trace-base": "^1.25.0", + "@opentelemetry/sdk-trace-web": "^1.25.0", + "@opentelemetry/semantic-conventions": "^1.25.0", "@pdftron/pdfjs-express": "^8.0.1", - "@sentry/angular": "7.73.0", + "@sentry/angular": "^7.73.0", "@sentry/capacitor": "^0.14.0", + "@sentry/tracing": "^7.114.0", "@teamhive/capacitor-video-recorder": "^5.0.0", "@tinymce/tinymce-angular": "^4.2.4", "@types/jest-environment-puppeteer": "^5.0.3", @@ -124,25 +139,28 @@ "cordova-plugin-filepath": "^1.5.8", "cordova-plugin-multiple-documents-picker": "^1.0.0", "cordova-plugin-okhttp": "^2.0.0", - "cordova-plugin-screen-orientation": "^3.0.2", + "cordova-plugin-screen-orientation": "^3.0.4", "cordova-res": "^0.15.3", "cordova-sqlite-storage": "^6.0.0", "cross-env": "^7.0.3", "crypto-js": "^4.0.0", "date-fns": "^2.17.0", "depd": "^2.0.0", + "dexie": "^4.0.7", "dompurify": "^3.0.6", "dotenv": "^10.0.0", "duration": "^0.2.2", "faker": "^5.5.3", "fifo-process-queue": "^1.2.0", + "file-saver": "^2.0.5", "firebase": "^8.10.1", "g": "^2.0.1", + "gelf-pro": "^1.3.12", "global": "^4.4.0", "hammerjs": "^2.0.8", "howler": "^2.2.3", "http-server": "^14.1.1", - "husky": "^8.0.2", + "husky": "^8.0.3", "ionic-angular": "^3.9.10", "ionic-image-loader": "^6.3.3", "ionic-image-loader-v5": "^1.0.2", @@ -152,17 +170,20 @@ "ionicons": "^5.5.3", "jest-puppeteer": "^7.0.1", "lite-server": "^2.6.1", + "log4js": "^6.9.1", "minisearch": "^6.0.1", "moment": "^2.29.3", "neverthrow": "^6.1.0", "ng-lazyload-image": "^9.1.2", "ng2-pdf-viewer": "^3.0.8", "ngx-cookie-service": "^12.0.3", + "ngx-cropper": "^2.0.0-beta", "ngx-extended-pdf-viewer": "^13.0.0-alpha.2", "ngx-image-compress": "^11.0.3", "ngx-image-cropper": "^5.0.1", "ngx-letters-avatar": "^1.0.2", "ngx-socket-io": "^3.2.0", + "path-browserify": "^1.0.1", "pdfjs": "^2.4.6", "pdfjs-dist": "^2.9.359", "puppeteer": "^19.7.1", @@ -195,6 +216,7 @@ "@capacitor/cli": "^4.8.1", "@ionic/angular-toolkit": "^6.1.0", "@ionic/lab": "3.1.7", + "@sentry/cli": "^2.32.2", "@types/core-js": "^2.5.7", "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.3", @@ -4063,6 +4085,14 @@ "@capacitor/core": "^4.0.0" } }, + "node_modules/@capacitor/local-notifications": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@capacitor/local-notifications/-/local-notifications-6.0.0.tgz", + "integrity": "sha512-a/g/ZlPgaBXue374oNzGvvNZWNpnclfcLzfE/P/PjhHxdHsM7J3OK0IfmjrEsRiON4AEIga+dkHi5yBjNAHCFw==", + "peerDependencies": { + "@capacitor/core": "^6.0.0" + } + }, "node_modules/@capacitor/network": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@capacitor/network/-/network-4.1.0.tgz", @@ -4328,6 +4358,33 @@ "node": ">=10.0.0" } }, + "node_modules/@ffmpeg/ffmpeg": { + "version": "0.12.10", + "resolved": "https://registry.npmjs.org/@ffmpeg/ffmpeg/-/ffmpeg-0.12.10.tgz", + "integrity": "sha512-lVtk8PW8e+NUzGZhPTWj2P1J4/NyuCrbDD3O9IGpSeLYtUZKBqZO8CNj1WYGghep/MXoM8e1qVY1GztTkf8YYQ==", + "dependencies": { + "@ffmpeg/types": "^0.12.2" + }, + "engines": { + "node": ">=18.x" + } + }, + "node_modules/@ffmpeg/types": { + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/@ffmpeg/types/-/types-0.12.2.tgz", + "integrity": "sha512-NJtxwPoLb60/z1Klv0ueshguWQ/7mNm106qdHkB4HL49LXszjhjCCiL+ldHJGQ9ai2Igx0s4F24ghigy//ERdA==", + "engines": { + "node": ">=16.x" + } + }, + "node_modules/@ffmpeg/util": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/@ffmpeg/util/-/util-0.12.1.tgz", + "integrity": "sha512-10jjfAKWaDyb8+nAkijcsi9wgz/y26LOc1NKJradNMyCIl6usQcBbhkjX5qhALrSBcOy6TOeksunTYa+a03qNQ==", + "engines": { + "node": ">=18.x" + } + }, "node_modules/@firebase/analytics": { "version": "0.6.18", "resolved": "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.6.18.tgz", @@ -7537,6 +7594,18 @@ "rxjs": "^6.5.5" } }, + "node_modules/@ngrx/store": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/@ngrx/store/-/store-10.1.2.tgz", + "integrity": "sha512-FUjN786ch4Qt9WgJ78ef7Yquq3mPCekgcWgZrs4ycZw1f+KdfTHLTk1bGDtO8A8CzOya5yTT7KhxbdVjbOS5ng==", + "dependencies": { + "tslib": "^2.0.0" + }, + "peerDependencies": { + "@angular/core": "^10.0.0", + "rxjs": "^6.5.3" + } + }, "node_modules/@ngtools/webpack": { "version": "12.2.18", "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-12.2.18.tgz", @@ -7689,6 +7758,872 @@ "read-package-json-fast": "^2.0.1" } }, + "node_modules/@opentelemetry/api": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.7.0.tgz", + "integrity": "sha512-AdY5wvN0P2vXBi3b29hxZgSFvdhdxPB9+f0B6s//P9Q8nibRWeA3cHm8UmLpio9ABigkVHJ5NMPk+Mz8VCCyrw==", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@opentelemetry/api-logs": { + "version": "0.52.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.52.1.tgz", + "integrity": "sha512-qnSqB2DQ9TPP96dl8cDubDvrUyWc0/sK81xHTK8eSUspzDM3bsewX903qclQFvVhgStjRWdC5bLb3kQqMkfV5A==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/api-metrics": { + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-metrics/-/api-metrics-0.26.0.tgz", + "integrity": "sha512-idDSUTx+LRwJiHhVHhdh45SWow5u9lKNDROKu5AMzsIVPI29utH5FfT9vor8qMM6blxWWvlT22HUNdNMWqUQfQ==", + "deprecated": "Please use @opentelemetry/api >= 1.3.0", + "engines": { + "node": ">=8.0.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.2" + } + }, + "node_modules/@opentelemetry/core": { + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.0.tgz", + "integrity": "sha512-n0B3s8rrqGrasTgNkXLKXzN0fXo+6IYP7M5b7AMsrZM33f/y6DS6kJ0Btd7SespASWq8bgL3taLo0oe0vB52IQ==", + "dependencies": { + "@opentelemetry/semantic-conventions": "1.25.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/exporter-metrics-otlp-http": { + "version": "0.52.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-http/-/exporter-metrics-otlp-http-0.52.1.tgz", + "integrity": "sha512-oAHPOy1sZi58bwqXaucd19F/v7+qE2EuVslQOEeLQT94CDuZJJ4tbWzx8DpYBTrOSzKqqrMtx9+PMxkrcbxOyQ==", + "dependencies": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/otlp-exporter-base": "0.52.1", + "@opentelemetry/otlp-transformer": "0.52.1", + "@opentelemetry/resources": "1.25.1", + "@opentelemetry/sdk-metrics": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/exporter-metrics-otlp-http/node_modules/@opentelemetry/core": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz", + "integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==", + "dependencies": { + "@opentelemetry/semantic-conventions": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/exporter-metrics-otlp-http/node_modules/@opentelemetry/resources": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.25.1.tgz", + "integrity": "sha512-pkZT+iFYIZsVn6+GzM0kSX+u3MSLCY9md+lIJOoKl/P+gJFfxJte/60Usdp8Ce4rOs8GduUpSPNe1ddGyDT1sQ==", + "dependencies": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/semantic-conventions": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/exporter-metrics-otlp-http/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz", + "integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/exporter-otlp-http": { + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-otlp-http/-/exporter-otlp-http-0.26.0.tgz", + "integrity": "sha512-V3FcUEIVDZ66b3/6vjSBjwwozf/XV5eUXuELNzN8PAvGZH4mw36vaWlaxnGEV8HaZb2hbu2KbRpcOzqxx3tFDA==", + "deprecated": "Please use trace and metric specific exporters @opentelemetry/exporter-trace-otlp-http and @opentelemetry/exporter-metrics-otlp-http", + "dependencies": { + "@opentelemetry/api-metrics": "0.26.0", + "@opentelemetry/core": "1.0.0", + "@opentelemetry/resources": "1.0.0", + "@opentelemetry/sdk-metrics-base": "0.26.0", + "@opentelemetry/sdk-trace-base": "1.0.0" + }, + "engines": { + "node": ">=8.0.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.2" + } + }, + "node_modules/@opentelemetry/exporter-otlp-http/node_modules/@opentelemetry/core": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.0.0.tgz", + "integrity": "sha512-1+qvKilADnSFW4PiXy+f7D22pvfGVxepZ69GcbF8cTcbQTUt7w63xEBWn5f5j92x9I3c0sqbW1RUx5/a4wgzxA==", + "dependencies": { + "@opentelemetry/semantic-conventions": "1.0.0", + "semver": "^7.3.5" + }, + "engines": { + "node": ">=8.5.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.2" + } + }, + "node_modules/@opentelemetry/exporter-otlp-http/node_modules/@opentelemetry/resources": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.0.0.tgz", + "integrity": "sha512-ORP8F2LLcJEm5M3H24RmdlMdiDc70ySPushpkrAW34KZGdZXwkrFoFXZhhs5MUxPT+fLrTuBafXxZVr8eHtFuQ==", + "dependencies": { + "@opentelemetry/core": "1.0.0", + "@opentelemetry/semantic-conventions": "1.0.0" + }, + "engines": { + "node": ">=8.0.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.2" + } + }, + "node_modules/@opentelemetry/exporter-otlp-http/node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.0.0.tgz", + "integrity": "sha512-/rXoyQlDlJTJ4SOVAbP0Gpj89B8oZ2hJApYG2Dq5klkgFAtDifN8271TIzwtM8/ET8HUhgx9eyoUJi42LhIesg==", + "dependencies": { + "@opentelemetry/core": "1.0.0", + "@opentelemetry/resources": "1.0.0", + "@opentelemetry/semantic-conventions": "1.0.0", + "lodash.merge": "^4.6.2" + }, + "engines": { + "node": ">=8.0.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.2" + } + }, + "node_modules/@opentelemetry/exporter-otlp-http/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.0.0.tgz", + "integrity": "sha512-XCZ6ZSmc8FOspxKUU+Ow9UtJeSSRcS5rFBYGpjzix02U2v+X9ofjOjgNRnpvxlSvkccYIhdTuwcvNskmZ46SeA==", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@opentelemetry/exporter-trace-otlp-http": { + "version": "0.52.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-http/-/exporter-trace-otlp-http-0.52.1.tgz", + "integrity": "sha512-05HcNizx0BxcFKKnS5rwOV+2GevLTVIRA0tRgWYyw4yCgR53Ic/xk83toYKts7kbzcI+dswInUg/4s8oyA+tqg==", + "dependencies": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/otlp-exporter-base": "0.52.1", + "@opentelemetry/otlp-transformer": "0.52.1", + "@opentelemetry/resources": "1.25.1", + "@opentelemetry/sdk-trace-base": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz", + "integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==", + "dependencies": { + "@opentelemetry/semantic-conventions": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/resources": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.25.1.tgz", + "integrity": "sha512-pkZT+iFYIZsVn6+GzM0kSX+u3MSLCY9md+lIJOoKl/P+gJFfxJte/60Usdp8Ce4rOs8GduUpSPNe1ddGyDT1sQ==", + "dependencies": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/semantic-conventions": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.25.1.tgz", + "integrity": "sha512-C8k4hnEbc5FamuZQ92nTOp8X/diCY56XUTnMiv9UTuJitCzaNNHAVsdm5+HLCdI8SLQsLWIrG38tddMxLVoftw==", + "dependencies": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/resources": "1.25.1", + "@opentelemetry/semantic-conventions": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz", + "integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/exporter-trace-otlp-proto": { + "version": "0.48.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-proto/-/exporter-trace-otlp-proto-0.48.0.tgz", + "integrity": "sha512-hVXr/8DYlAKAzQYMsCf3ZsGweS6NTK3IHIEqmLokJZYcvJQBEEazeAdISfrL/utWnapg1Qnpw8u+W6SpxNzmTw==", + "dependencies": { + "@opentelemetry/core": "1.21.0", + "@opentelemetry/otlp-exporter-base": "0.48.0", + "@opentelemetry/otlp-proto-exporter-base": "0.48.0", + "@opentelemetry/otlp-transformer": "0.48.0", + "@opentelemetry/resources": "1.21.0", + "@opentelemetry/sdk-trace-base": "1.21.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/api-logs": { + "version": "0.48.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.48.0.tgz", + "integrity": "sha512-1/aMiU4Eqo3Zzpfwu51uXssp5pzvHFObk8S9pKAiXb1ne8pvg1qxBQitYL1XUiAMEXFzgjaidYG2V6624DRhhw==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/core": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.21.0.tgz", + "integrity": "sha512-KP+OIweb3wYoP7qTYL/j5IpOlu52uxBv5M4+QhSmmUfLyTgu1OIS71msK3chFo1D6Y61BIH3wMiMYRCxJCQctA==", + "dependencies": { + "@opentelemetry/semantic-conventions": "1.21.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.8.0" + } + }, + "node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/otlp-exporter-base": { + "version": "0.48.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.48.0.tgz", + "integrity": "sha512-T4LJND+Ugl87GUONoyoQzuV9qCn4BFIPOnCH1biYqdGhc2JahjuLqVD9aefwLzGBW638iLAo88Lh68h2F1FLiA==", + "dependencies": { + "@opentelemetry/core": "1.21.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/otlp-transformer": { + "version": "0.48.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.48.0.tgz", + "integrity": "sha512-yuoS4cUumaTK/hhxW3JUy3wl2U4keMo01cFDrUOmjloAdSSXvv1zyQ920IIH4lymp5Xd21Dj2/jq2LOro56TJg==", + "dependencies": { + "@opentelemetry/api-logs": "0.48.0", + "@opentelemetry/core": "1.21.0", + "@opentelemetry/resources": "1.21.0", + "@opentelemetry/sdk-logs": "0.48.0", + "@opentelemetry/sdk-metrics": "1.21.0", + "@opentelemetry/sdk-trace-base": "1.21.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.8.0" + } + }, + "node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/resources": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.21.0.tgz", + "integrity": "sha512-1Z86FUxPKL6zWVy2LdhueEGl9AHDJcx+bvHStxomruz6Whd02mE3lNUMjVJ+FGRoktx/xYQcxccYb03DiUP6Yw==", + "dependencies": { + "@opentelemetry/core": "1.21.0", + "@opentelemetry/semantic-conventions": "1.21.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.8.0" + } + }, + "node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/sdk-logs": { + "version": "0.48.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.48.0.tgz", + "integrity": "sha512-lRcA5/qkSJuSh4ItWCddhdn/nNbVvnzM+cm9Fg1xpZUeTeozjJDBcHnmeKoOaWRnrGYBdz6UTY6bynZR9aBeAA==", + "dependencies": { + "@opentelemetry/core": "1.21.0", + "@opentelemetry/resources": "1.21.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.4.0 <1.8.0", + "@opentelemetry/api-logs": ">=0.39.1" + } + }, + "node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/sdk-metrics": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.21.0.tgz", + "integrity": "sha512-on1jTzIHc5DyWhRP+xpf+zrgrREXcHBH4EDAfaB5mIG7TWpKxNXooQ1JCylaPsswZUv4wGnVTinr4HrBdGARAQ==", + "dependencies": { + "@opentelemetry/core": "1.21.0", + "@opentelemetry/resources": "1.21.0", + "lodash.merge": "^4.6.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.8.0" + } + }, + "node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.21.0.tgz", + "integrity": "sha512-yrElGX5Fv0umzp8Nxpta/XqU71+jCAyaLk34GmBzNcrW43nqbrqvdPs4gj4MVy/HcTjr6hifCDCYA3rMkajxxA==", + "dependencies": { + "@opentelemetry/core": "1.21.0", + "@opentelemetry/resources": "1.21.0", + "@opentelemetry/semantic-conventions": "1.21.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.8.0" + } + }, + "node_modules/@opentelemetry/exporter-trace-otlp-proto/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.21.0.tgz", + "integrity": "sha512-lkC8kZYntxVKr7b8xmjCVUgE0a8xgDakPyDo9uSWavXPyYqLgYYGdEd2j8NxihRyb6UwpX3G/hFUF4/9q2V+/g==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/exporter-zipkin": { + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-zipkin/-/exporter-zipkin-1.25.0.tgz", + "integrity": "sha512-nnhY0e5DHg8BfUSNCQZoGZnGeqz+zMTeEUOh1dfgtaXmF99uM0QPuTa1i2lH+eZqebP8w1WDWZlewu9FUlHqIg==", + "dependencies": { + "@opentelemetry/core": "1.25.0", + "@opentelemetry/resources": "1.25.0", + "@opentelemetry/sdk-trace-base": "1.25.0", + "@opentelemetry/semantic-conventions": "1.25.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/@opentelemetry/otlp-exporter-base": { + "version": "0.52.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.52.1.tgz", + "integrity": "sha512-z175NXOtX5ihdlshtYBe5RpGeBoTXVCKPPLiQlD6FHvpM4Ch+p2B0yWKYSrBfLH24H9zjJiBdTrtD+hLlfnXEQ==", + "dependencies": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/otlp-transformer": "0.52.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz", + "integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==", + "dependencies": { + "@opentelemetry/semantic-conventions": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz", + "integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/otlp-proto-exporter-base": { + "version": "0.48.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-proto-exporter-base/-/otlp-proto-exporter-base-0.48.0.tgz", + "integrity": "sha512-14GSTvPZPfrWsB54fYMGb8v+Uge5xGXyz0r2rf4SzcRnO2hXCPHEuL3yyL50emaKPAY+fj29Dm0bweawe8UA6A==", + "dependencies": { + "@opentelemetry/core": "1.21.0", + "@opentelemetry/otlp-exporter-base": "0.48.0", + "protobufjs": "^7.2.3" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/@opentelemetry/otlp-proto-exporter-base/node_modules/@opentelemetry/core": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.21.0.tgz", + "integrity": "sha512-KP+OIweb3wYoP7qTYL/j5IpOlu52uxBv5M4+QhSmmUfLyTgu1OIS71msK3chFo1D6Y61BIH3wMiMYRCxJCQctA==", + "dependencies": { + "@opentelemetry/semantic-conventions": "1.21.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.8.0" + } + }, + "node_modules/@opentelemetry/otlp-proto-exporter-base/node_modules/@opentelemetry/otlp-exporter-base": { + "version": "0.48.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.48.0.tgz", + "integrity": "sha512-T4LJND+Ugl87GUONoyoQzuV9qCn4BFIPOnCH1biYqdGhc2JahjuLqVD9aefwLzGBW638iLAo88Lh68h2F1FLiA==", + "dependencies": { + "@opentelemetry/core": "1.21.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, + "node_modules/@opentelemetry/otlp-proto-exporter-base/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.21.0.tgz", + "integrity": "sha512-lkC8kZYntxVKr7b8xmjCVUgE0a8xgDakPyDo9uSWavXPyYqLgYYGdEd2j8NxihRyb6UwpX3G/hFUF4/9q2V+/g==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/otlp-proto-exporter-base/node_modules/@types/node": { + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.1.0.tgz", + "integrity": "sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==", + "dependencies": { + "undici-types": "~6.13.0" + } + }, + "node_modules/@opentelemetry/otlp-proto-exporter-base/node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + }, + "node_modules/@opentelemetry/otlp-proto-exporter-base/node_modules/protobufjs": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.2.tgz", + "integrity": "sha512-RXyHaACeqXeqAKGLDl68rQKbmObRsTIn4TYVUUug1KfS47YWCo5MacGITEryugIgZqORCvJWEk4l449POg5Txg==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@opentelemetry/otlp-proto-exporter-base/node_modules/undici-types": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.13.0.tgz", + "integrity": "sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg==" + }, + "node_modules/@opentelemetry/otlp-transformer": { + "version": "0.52.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.52.1.tgz", + "integrity": "sha512-I88uCZSZZtVa0XniRqQWKbjAUm73I8tpEy/uJYPPYw5d7BRdVk0RfTBQw8kSUl01oVWEuqxLDa802222MYyWHg==", + "dependencies": { + "@opentelemetry/api-logs": "0.52.1", + "@opentelemetry/core": "1.25.1", + "@opentelemetry/resources": "1.25.1", + "@opentelemetry/sdk-logs": "0.52.1", + "@opentelemetry/sdk-metrics": "1.25.1", + "@opentelemetry/sdk-trace-base": "1.25.1", + "protobufjs": "^7.3.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz", + "integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==", + "dependencies": { + "@opentelemetry/semantic-conventions": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/resources": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.25.1.tgz", + "integrity": "sha512-pkZT+iFYIZsVn6+GzM0kSX+u3MSLCY9md+lIJOoKl/P+gJFfxJte/60Usdp8Ce4rOs8GduUpSPNe1ddGyDT1sQ==", + "dependencies": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/semantic-conventions": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.25.1.tgz", + "integrity": "sha512-C8k4hnEbc5FamuZQ92nTOp8X/diCY56XUTnMiv9UTuJitCzaNNHAVsdm5+HLCdI8SLQsLWIrG38tddMxLVoftw==", + "dependencies": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/resources": "1.25.1", + "@opentelemetry/semantic-conventions": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz", + "integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/otlp-transformer/node_modules/@types/node": { + "version": "20.14.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.6.tgz", + "integrity": "sha512-JbA0XIJPL1IiNnU7PFxDXyfAwcwVVrOoqyzzyQTyMeVhBzkJVMSkC1LlVsRQ2lpqiY4n6Bb9oCS6lzDKVQxbZw==", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@opentelemetry/otlp-transformer/node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + }, + "node_modules/@opentelemetry/otlp-transformer/node_modules/protobufjs": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.2.tgz", + "integrity": "sha512-RXyHaACeqXeqAKGLDl68rQKbmObRsTIn4TYVUUug1KfS47YWCo5MacGITEryugIgZqORCvJWEk4l449POg5Txg==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@opentelemetry/resources": { + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.25.0.tgz", + "integrity": "sha512-iHjydPMYJ+Li1auveJCq2rp5U2h6Mhq8BidiyE0jfVlDTFyR1ny8AfJHfmFzJ/RAM8vT8L7T21kcmGybxZC7lQ==", + "dependencies": { + "@opentelemetry/core": "1.25.0", + "@opentelemetry/semantic-conventions": "1.25.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-logs": { + "version": "0.52.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.52.1.tgz", + "integrity": "sha512-MBYh+WcPPsN8YpRHRmK1Hsca9pVlyyKd4BxOC4SsgHACnl/bPp4Cri9hWhVm5+2tiQ9Zf4qSc1Jshw9tOLGWQA==", + "dependencies": { + "@opentelemetry/api-logs": "0.52.1", + "@opentelemetry/core": "1.25.1", + "@opentelemetry/resources": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.4.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/core": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz", + "integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==", + "dependencies": { + "@opentelemetry/semantic-conventions": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/resources": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.25.1.tgz", + "integrity": "sha512-pkZT+iFYIZsVn6+GzM0kSX+u3MSLCY9md+lIJOoKl/P+gJFfxJte/60Usdp8Ce4rOs8GduUpSPNe1ddGyDT1sQ==", + "dependencies": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/semantic-conventions": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz", + "integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/sdk-metrics": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.25.1.tgz", + "integrity": "sha512-9Mb7q5ioFL4E4dDrc4wC/A3NTHDat44v4I3p2pLPSxRvqUbDIQyMVr9uK+EU69+HWhlET1VaSrRzwdckWqY15Q==", + "dependencies": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/resources": "1.25.1", + "lodash.merge": "^4.6.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.3.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-metrics-base": { + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics-base/-/sdk-metrics-base-0.26.0.tgz", + "integrity": "sha512-PbJsso7Vy/CLATAOyXbt/VP7ZQ2QYnvlq28lhOWaLPw8aqLogMBvidNGRrt7rF4/hfzLT6pMgpAAcit2C/nUMA==", + "deprecated": "Please use @opentelemetry/sdk-metrics", + "dependencies": { + "@opentelemetry/api-metrics": "0.26.0", + "@opentelemetry/core": "1.0.0", + "@opentelemetry/resources": "1.0.0", + "lodash.merge": "^4.6.2" + }, + "engines": { + "node": ">=8.0.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.2" + } + }, + "node_modules/@opentelemetry/sdk-metrics-base/node_modules/@opentelemetry/core": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.0.0.tgz", + "integrity": "sha512-1+qvKilADnSFW4PiXy+f7D22pvfGVxepZ69GcbF8cTcbQTUt7w63xEBWn5f5j92x9I3c0sqbW1RUx5/a4wgzxA==", + "dependencies": { + "@opentelemetry/semantic-conventions": "1.0.0", + "semver": "^7.3.5" + }, + "engines": { + "node": ">=8.5.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.2" + } + }, + "node_modules/@opentelemetry/sdk-metrics-base/node_modules/@opentelemetry/resources": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.0.0.tgz", + "integrity": "sha512-ORP8F2LLcJEm5M3H24RmdlMdiDc70ySPushpkrAW34KZGdZXwkrFoFXZhhs5MUxPT+fLrTuBafXxZVr8eHtFuQ==", + "dependencies": { + "@opentelemetry/core": "1.0.0", + "@opentelemetry/semantic-conventions": "1.0.0" + }, + "engines": { + "node": ">=8.0.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.2" + } + }, + "node_modules/@opentelemetry/sdk-metrics-base/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.0.0.tgz", + "integrity": "sha512-XCZ6ZSmc8FOspxKUU+Ow9UtJeSSRcS5rFBYGpjzix02U2v+X9ofjOjgNRnpvxlSvkccYIhdTuwcvNskmZ46SeA==", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz", + "integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==", + "dependencies": { + "@opentelemetry/semantic-conventions": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/resources": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.25.1.tgz", + "integrity": "sha512-pkZT+iFYIZsVn6+GzM0kSX+u3MSLCY9md+lIJOoKl/P+gJFfxJte/60Usdp8Ce4rOs8GduUpSPNe1ddGyDT1sQ==", + "dependencies": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/semantic-conventions": "1.25.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz", + "integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.25.0.tgz", + "integrity": "sha512-6+g2fiRQUG39guCsKVeY8ToeuUf3YUnPkN6DXRA1qDmFLprlLvZm9cS6+chgbW70cZJ406FTtSCDnJwxDC5sGQ==", + "dependencies": { + "@opentelemetry/core": "1.25.0", + "@opentelemetry/resources": "1.25.0", + "@opentelemetry/semantic-conventions": "1.25.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/sdk-trace-web": { + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-web/-/sdk-trace-web-1.25.0.tgz", + "integrity": "sha512-TAWRDRiVOeliE1A99z8idWb4pwEKKY9Vj5aTpLtrF4cvPOl0mPg3ZczvOw/HnpfRsWY0Ra/J3vS5uFSpoqPwEA==", + "dependencies": { + "@opentelemetry/core": "1.25.0", + "@opentelemetry/sdk-trace-base": "1.25.0", + "@opentelemetry/semantic-conventions": "1.25.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/semantic-conventions": { + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.0.tgz", + "integrity": "sha512-M+kkXKRAIAiAP6qYyesfrC5TOmDpDVtsxuGfPcqd9B/iBrac+E14jYwrgm0yZBUIbIP2OnqC3j+UgkXLm1vxUQ==", + "engines": { + "node": ">=14" + } + }, "node_modules/@pdftron/pdfjs-express": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/@pdftron/pdfjs-express/-/pdfjs-express-8.1.0.tgz", @@ -7930,6 +8865,161 @@ } } }, + "node_modules/@sentry/capacitor/node_modules/@sentry/tracing": { + "version": "7.73.0", + "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-7.73.0.tgz", + "integrity": "sha512-LOQR6Hkc8ZoflCXWtMlxTbCBEwv0MSOr3vesnRsmlFG8TW1YUIneU+wKnVxToWAZ8fq+6ubclnuIUKHfqTk/Tg==", + "dependencies": { + "@sentry-internal/tracing": "7.73.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/cli": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.32.2.tgz", + "integrity": "sha512-m/6Z3FWu+rTd8jepVlJPKQhvbT8vCjt0N7BSWZiEUVW/8mhwAYJiwO0b+Ch/u4IqbBg1dp3805q5TFPl4AdrNw==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "https-proxy-agent": "^5.0.0", + "node-fetch": "^2.6.7", + "progress": "^2.0.3", + "proxy-from-env": "^1.1.0", + "which": "^2.0.2" + }, + "bin": { + "sentry-cli": "bin/sentry-cli" + }, + "engines": { + "node": ">= 10" + }, + "optionalDependencies": { + "@sentry/cli-darwin": "2.32.2", + "@sentry/cli-linux-arm": "2.32.2", + "@sentry/cli-linux-arm64": "2.32.2", + "@sentry/cli-linux-i686": "2.32.2", + "@sentry/cli-linux-x64": "2.32.2", + "@sentry/cli-win32-i686": "2.32.2", + "@sentry/cli-win32-x64": "2.32.2" + } + }, + "node_modules/@sentry/cli-darwin": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli-darwin/-/cli-darwin-2.32.2.tgz", + "integrity": "sha512-GDtePIavx3FKSRowdPdtIssahn46MfFFYNN+s7a9MjlhFwJtvC9A1bSDw7ksEtDaQolepUwmLPHaVe19y0T/zw==", + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-linux-arm": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm/-/cli-linux-arm-2.32.2.tgz", + "integrity": "sha512-u9s08wr8bDDqsAl6pk9iGGlOHtU+T8btU6voNKy71QzeIBpV9c8VVk/OnmP9aswp/ea4NY416yjnzcTvCrFKAw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux", + "freebsd" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-linux-arm64": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.32.2.tgz", + "integrity": "sha512-VECLVC1rLyvXk6rTVUfmfs4vhANjMgm4BVKGlA3rydmf2PJw2/NfipH3KeyijdE2vEoyLri+/6HH883pP0iniQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux", + "freebsd" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-linux-i686": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-i686/-/cli-linux-i686-2.32.2.tgz", + "integrity": "sha512-XhofQz32OqLrQK1DEOsryhT7d29Df6VkccvxueGoIt2gpXEXtgRczsUwZjZqquDdkNCt+HPj9eUGcj8pY8JkmQ==", + "cpu": [ + "x86", + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux", + "freebsd" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-linux-x64": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-x64/-/cli-linux-x64-2.32.2.tgz", + "integrity": "sha512-anyng4Qqt7zX4ZY4IzDH1RJWAVZNBe6sUHcuciNy7giCU3B4/XnxAHlwYmBSN5txpaumsWdstPgRKEUJG6AOSA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux", + "freebsd" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-win32-i686": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli-win32-i686/-/cli-win32-i686-2.32.2.tgz", + "integrity": "sha512-/auqx7QXG7F556fNK7vaB26pX7Far1CQMfI65iV4u/VWg6gV2WfvJWXB4iowhjqkYv56sZ+zOymLkEVF0R8wtg==", + "cpu": [ + "x86", + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@sentry/cli-win32-x64": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli-win32-x64/-/cli-win32-x64-2.32.2.tgz", + "integrity": "sha512-w7hW2sEWVYQquqdILBSFhcVW+HdoyLqVPPkLPAXRSLTwBnuni9nQEIdXr0h/7db+K3cm7PvWndp5ixVyswLHZA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, "node_modules/@sentry/core": { "version": "7.73.0", "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.73.0.tgz", @@ -8009,11 +9099,55 @@ } }, "node_modules/@sentry/tracing": { - "version": "7.73.0", - "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-7.73.0.tgz", - "integrity": "sha512-LOQR6Hkc8ZoflCXWtMlxTbCBEwv0MSOr3vesnRsmlFG8TW1YUIneU+wKnVxToWAZ8fq+6ubclnuIUKHfqTk/Tg==", + "version": "7.114.0", + "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-7.114.0.tgz", + "integrity": "sha512-eldEYGADReZ4jWdN5u35yxLUSTOvjsiZAYd4KBEpf+Ii65n7g/kYOKAjNl7tHbrEG1EsMW4nDPWStUMk1w+tfg==", "dependencies": { - "@sentry-internal/tracing": "7.73.0" + "@sentry-internal/tracing": "7.114.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/tracing/node_modules/@sentry-internal/tracing": { + "version": "7.114.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.114.0.tgz", + "integrity": "sha512-dOuvfJN7G+3YqLlUY4HIjyWHaRP8vbOgF+OsE5w2l7ZEn1rMAaUbPntAR8AF9GBA6j2zWNoSo8e7GjbJxVofSg==", + "dependencies": { + "@sentry/core": "7.114.0", + "@sentry/types": "7.114.0", + "@sentry/utils": "7.114.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/tracing/node_modules/@sentry/core": { + "version": "7.114.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.114.0.tgz", + "integrity": "sha512-YnanVlmulkjgZiVZ9BfY9k6I082n+C+LbZo52MTvx3FY6RE5iyiPMpaOh67oXEZRWcYQEGm+bKruRxLVP6RlbA==", + "dependencies": { + "@sentry/types": "7.114.0", + "@sentry/utils": "7.114.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/tracing/node_modules/@sentry/types": { + "version": "7.114.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.114.0.tgz", + "integrity": "sha512-tsqkkyL3eJtptmPtT0m9W/bPLkU7ILY7nvwpi1hahA5jrM7ppoU0IMaQWAgTD+U3rzFH40IdXNBFb8Gnqcva4w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/@sentry/tracing/node_modules/@sentry/utils": { + "version": "7.114.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.114.0.tgz", + "integrity": "sha512-319N90McVpupQ6vws4+tfCy/03AdtsU0MurIE4+W5cubHME08HtiEWlfacvAxX+yuKFhvdsO4K4BB/dj54ideg==", + "dependencies": { + "@sentry/types": "7.114.0" }, "engines": { "node": ">=8" @@ -12878,9 +14012,9 @@ ] }, "node_modules/cordova-plugin-screen-orientation": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/cordova-plugin-screen-orientation/-/cordova-plugin-screen-orientation-3.0.2.tgz", - "integrity": "sha512-2w6CMC+HGvbhogJetalwGurL2Fx8DQCCPy3wlSZHN1/W7WoQ5n9ujVozcoKrY4VaagK6bxrPFih+ElkO8Uqfzg==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/cordova-plugin-screen-orientation/-/cordova-plugin-screen-orientation-3.0.4.tgz", + "integrity": "sha512-AswRuUKJ8J3HycUilTJsIB50aa9TLrwndPNBFG+wfAPhHEqIBF0HaD0q3HbAK7ypgmaj0cvbzk84qP51IcTfrQ==", "engines": { "cordovaDependencies": { "4.0.0": { @@ -14072,10 +15206,9 @@ } }, "node_modules/date-format": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.11.tgz", - "integrity": "sha512-VS20KRyorrbMCQmpdl2hg5KaOUsda1RbnsJg461FfrcyCUg+pkd0b40BSW4niQyTheww4DBXQnS7HwSrKkipLw==", - "dev": true, + "version": "4.0.14", + "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.14.tgz", + "integrity": "sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg==", "engines": { "node": ">=4.0" } @@ -14634,6 +15767,11 @@ "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1094867.tgz", "integrity": "sha512-pmMDBKiRVjh0uKK6CT1WqZmM3hBVSgD+N2MrgyV1uNizAZMw4tx6i/RTc+/uCsKSCmg0xXx7arCP/OFcIwTsiQ==" }, + "node_modules/dexie": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/dexie/-/dexie-4.0.7.tgz", + "integrity": "sha512-M+Lo6rk4pekIfrc2T0o2tvVJwL6EAAM/B78DNfb8aaxFVoI1f8/rz5KTxuAnApkwqTSuxx7T5t0RKH7qprapGg==" + }, "node_modules/di": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz", @@ -16463,6 +17601,11 @@ "node": ">=4" } }, + "node_modules/file-saver": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz", + "integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA==" + }, "node_modules/file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", @@ -16603,10 +17746,9 @@ } }, "node_modules/flatted": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.6.tgz", - "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", - "dev": true + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==" }, "node_modules/flatten": { "version": "1.0.3", @@ -16864,6 +18006,14 @@ "node": ">=0.10.0" } }, + "node_modules/gelf-pro": { + "version": "1.3.12", + "resolved": "https://registry.npmjs.org/gelf-pro/-/gelf-pro-1.3.12.tgz", + "integrity": "sha512-gZcOmLA26WbszShVHhDwjONMZZFvtpctibjY3Mu84sAzMg8VJscFp94UOO4zGLoCfepOWvcysdu+IZT0mWfL6Q==", + "dependencies": { + "lodash": "~4.17.21" + } + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -17882,9 +19032,9 @@ } }, "node_modules/husky": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.2.tgz", - "integrity": "sha512-Tkv80jtvbnkK3mYWxPZePGFpQ/tT3HNSs/sasF9P2YfkMezDl3ON37YN6jUUI4eTg5LcyVynlb6r4eyvOmspvg==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", + "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", "bin": { "husky": "lib/bin.js" }, @@ -26041,6 +27191,11 @@ "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==" }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + }, "node_modules/lodash.once": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", @@ -26122,16 +27277,15 @@ } }, "node_modules/log4js": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.5.2.tgz", - "integrity": "sha512-DXtpNtt+KDOMT7RHUDIur/WsSA3rntlUh9Zg4XCdV42wUuMmbFkl38+LZ92Z5QvQA7mD5kAVkLiBSEH/tvUB8A==", - "dev": true, + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.9.1.tgz", + "integrity": "sha512-1somDdy9sChrr9/f4UlzhdaGfDR2c/SaD2a4T7qEkG4jTS57/B3qmnjLYePwQ8cqWnUHZI0iAKxMBpCZICiZ2g==", "dependencies": { - "date-format": "^4.0.10", + "date-format": "^4.0.14", "debug": "^4.3.4", - "flatted": "^3.2.5", + "flatted": "^3.2.7", "rfdc": "^1.3.0", - "streamroller": "^3.1.1" + "streamroller": "^3.1.5" }, "engines": { "node": ">=8.0" @@ -26141,7 +27295,6 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -27743,6 +28896,24 @@ "@angular/core": "^12.0.0" } }, + "node_modules/ngx-cropper": { + "version": "2.0.0-beta", + "resolved": "https://registry.npmjs.org/ngx-cropper/-/ngx-cropper-2.0.0-beta.tgz", + "integrity": "sha512-nyX0OgPBYhIj6M7lVDswnn0yAALxvByl052iRKiUyQc4gn1Xf1LBX+my7Zfg6oq7F91hvwojTeYqvTeHkDMVfQ==", + "dependencies": { + "cropperjs": "^1.4.1", + "tslib": "^1.9.0" + }, + "peerDependencies": { + "@angular/common": "^6.0.0-rc.0 || ^6.0.0", + "@angular/core": "^6.0.0-rc.0 || ^6.0.0" + } + }, + "node_modules/ngx-cropper/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, "node_modules/ngx-extended-pdf-viewer": { "version": "13.0.0-alpha.2", "resolved": "https://registry.npmjs.org/ngx-extended-pdf-viewer/-/ngx-extended-pdf-viewer-13.0.0-alpha.2.tgz", @@ -28935,6 +30106,11 @@ "node": ">=0.10.0" } }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" + }, "node_modules/path-dirname": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", @@ -32911,8 +34087,7 @@ "node_modules/rfdc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", - "dev": true + "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==" }, "node_modules/right-align": { "version": "0.1.3", @@ -35070,24 +36245,22 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, "node_modules/streamroller": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.1.1.tgz", - "integrity": "sha512-iPhtd9unZ6zKdWgMeYGfSBuqCngyJy1B/GPi/lTpwGpa3bajuX30GjUVd0/Tn/Xhg0mr4DOSENozz9Y06qyonQ==", - "dev": true, + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.1.5.tgz", + "integrity": "sha512-KFxaM7XT+irxvdqSP1LGLgNWbYN7ay5owZ3r/8t77p+EtSUAfUgtl7be3xtqtOmGUl9K9YPO2ca8133RlTjvKw==", "dependencies": { - "date-format": "^4.0.10", + "date-format": "^4.0.14", "debug": "^4.3.4", - "fs-extra": "^10.1.0" + "fs-extra": "^8.1.0" }, "engines": { "node": ">=8.0" } }, "node_modules/streamroller/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", "dependencies": { "ms": "2.1.2" }, @@ -35101,17 +36274,32 @@ } }, "node_modules/streamroller/node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "dev": true, + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "dependencies": { "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" }, "engines": { - "node": ">=12" + "node": ">=6 <7 || >=8" + } + }, + "node_modules/streamroller/node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/streamroller/node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "engines": { + "node": ">= 4.0.0" } }, "node_modules/string_decoder": { @@ -41544,6 +42732,11 @@ "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.1.tgz", "integrity": "sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g==" }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -46589,6 +47782,12 @@ "integrity": "sha512-5fanmJLdkXLEaro0oezkmpC15tBGlsLW4cp1jQTMPwyX6NLlPUFHdWUhMERzxL2QXHmHvtoFMJ4m15Eymgefuw==", "requires": {} }, + "@capacitor/local-notifications": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@capacitor/local-notifications/-/local-notifications-6.0.0.tgz", + "integrity": "sha512-a/g/ZlPgaBXue374oNzGvvNZWNpnclfcLzfE/P/PjhHxdHsM7J3OK0IfmjrEsRiON4AEIga+dkHi5yBjNAHCFw==", + "requires": {} + }, "@capacitor/network": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@capacitor/network/-/network-4.1.0.tgz", @@ -46785,6 +47984,24 @@ "integrity": "sha512-Fxt+AfXgjMoin2maPIYzFZnQjAXjAL0PHscM5pRTtatFqB+vZxAM9tLp2Optnuw3QOQC40jTNeGYFOMvyf7v9g==", "dev": true }, + "@ffmpeg/ffmpeg": { + "version": "0.12.10", + "resolved": "https://registry.npmjs.org/@ffmpeg/ffmpeg/-/ffmpeg-0.12.10.tgz", + "integrity": "sha512-lVtk8PW8e+NUzGZhPTWj2P1J4/NyuCrbDD3O9IGpSeLYtUZKBqZO8CNj1WYGghep/MXoM8e1qVY1GztTkf8YYQ==", + "requires": { + "@ffmpeg/types": "^0.12.2" + } + }, + "@ffmpeg/types": { + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/@ffmpeg/types/-/types-0.12.2.tgz", + "integrity": "sha512-NJtxwPoLb60/z1Klv0ueshguWQ/7mNm106qdHkB4HL49LXszjhjCCiL+ldHJGQ9ai2Igx0s4F24ghigy//ERdA==" + }, + "@ffmpeg/util": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/@ffmpeg/util/-/util-0.12.1.tgz", + "integrity": "sha512-10jjfAKWaDyb8+nAkijcsi9wgz/y26LOc1NKJradNMyCIl6usQcBbhkjX5qhALrSBcOy6TOeksunTYa+a03qNQ==" + }, "@firebase/analytics": { "version": "0.6.18", "resolved": "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.6.18.tgz", @@ -49321,6 +50538,14 @@ "tslib": "^2.0.0" } }, + "@ngrx/store": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/@ngrx/store/-/store-10.1.2.tgz", + "integrity": "sha512-FUjN786ch4Qt9WgJ78ef7Yquq3mPCekgcWgZrs4ycZw1f+KdfTHLTk1bGDtO8A8CzOya5yTT7KhxbdVjbOS5ng==", + "requires": { + "tslib": "^2.0.0" + } + }, "@ngtools/webpack": { "version": "12.2.18", "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-12.2.18.tgz", @@ -49433,6 +50658,581 @@ "read-package-json-fast": "^2.0.1" } }, + "@opentelemetry/api": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.7.0.tgz", + "integrity": "sha512-AdY5wvN0P2vXBi3b29hxZgSFvdhdxPB9+f0B6s//P9Q8nibRWeA3cHm8UmLpio9ABigkVHJ5NMPk+Mz8VCCyrw==" + }, + "@opentelemetry/api-logs": { + "version": "0.52.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.52.1.tgz", + "integrity": "sha512-qnSqB2DQ9TPP96dl8cDubDvrUyWc0/sK81xHTK8eSUspzDM3bsewX903qclQFvVhgStjRWdC5bLb3kQqMkfV5A==", + "requires": { + "@opentelemetry/api": "^1.0.0" + } + }, + "@opentelemetry/api-metrics": { + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-metrics/-/api-metrics-0.26.0.tgz", + "integrity": "sha512-idDSUTx+LRwJiHhVHhdh45SWow5u9lKNDROKu5AMzsIVPI29utH5FfT9vor8qMM6blxWWvlT22HUNdNMWqUQfQ==", + "requires": {} + }, + "@opentelemetry/core": { + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.0.tgz", + "integrity": "sha512-n0B3s8rrqGrasTgNkXLKXzN0fXo+6IYP7M5b7AMsrZM33f/y6DS6kJ0Btd7SespASWq8bgL3taLo0oe0vB52IQ==", + "requires": { + "@opentelemetry/semantic-conventions": "1.25.0" + } + }, + "@opentelemetry/exporter-metrics-otlp-http": { + "version": "0.52.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-metrics-otlp-http/-/exporter-metrics-otlp-http-0.52.1.tgz", + "integrity": "sha512-oAHPOy1sZi58bwqXaucd19F/v7+qE2EuVslQOEeLQT94CDuZJJ4tbWzx8DpYBTrOSzKqqrMtx9+PMxkrcbxOyQ==", + "requires": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/otlp-exporter-base": "0.52.1", + "@opentelemetry/otlp-transformer": "0.52.1", + "@opentelemetry/resources": "1.25.1", + "@opentelemetry/sdk-metrics": "1.25.1" + }, + "dependencies": { + "@opentelemetry/core": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz", + "integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==", + "requires": { + "@opentelemetry/semantic-conventions": "1.25.1" + } + }, + "@opentelemetry/resources": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.25.1.tgz", + "integrity": "sha512-pkZT+iFYIZsVn6+GzM0kSX+u3MSLCY9md+lIJOoKl/P+gJFfxJte/60Usdp8Ce4rOs8GduUpSPNe1ddGyDT1sQ==", + "requires": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/semantic-conventions": "1.25.1" + } + }, + "@opentelemetry/semantic-conventions": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz", + "integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==" + } + } + }, + "@opentelemetry/exporter-otlp-http": { + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-otlp-http/-/exporter-otlp-http-0.26.0.tgz", + "integrity": "sha512-V3FcUEIVDZ66b3/6vjSBjwwozf/XV5eUXuELNzN8PAvGZH4mw36vaWlaxnGEV8HaZb2hbu2KbRpcOzqxx3tFDA==", + "requires": { + "@opentelemetry/api-metrics": "0.26.0", + "@opentelemetry/core": "1.0.0", + "@opentelemetry/resources": "1.0.0", + "@opentelemetry/sdk-metrics-base": "0.26.0", + "@opentelemetry/sdk-trace-base": "1.0.0" + }, + "dependencies": { + "@opentelemetry/core": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.0.0.tgz", + "integrity": "sha512-1+qvKilADnSFW4PiXy+f7D22pvfGVxepZ69GcbF8cTcbQTUt7w63xEBWn5f5j92x9I3c0sqbW1RUx5/a4wgzxA==", + "requires": { + "@opentelemetry/semantic-conventions": "1.0.0", + "semver": "^7.3.5" + } + }, + "@opentelemetry/resources": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.0.0.tgz", + "integrity": "sha512-ORP8F2LLcJEm5M3H24RmdlMdiDc70ySPushpkrAW34KZGdZXwkrFoFXZhhs5MUxPT+fLrTuBafXxZVr8eHtFuQ==", + "requires": { + "@opentelemetry/core": "1.0.0", + "@opentelemetry/semantic-conventions": "1.0.0" + } + }, + "@opentelemetry/sdk-trace-base": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.0.0.tgz", + "integrity": "sha512-/rXoyQlDlJTJ4SOVAbP0Gpj89B8oZ2hJApYG2Dq5klkgFAtDifN8271TIzwtM8/ET8HUhgx9eyoUJi42LhIesg==", + "requires": { + "@opentelemetry/core": "1.0.0", + "@opentelemetry/resources": "1.0.0", + "@opentelemetry/semantic-conventions": "1.0.0", + "lodash.merge": "^4.6.2" + } + }, + "@opentelemetry/semantic-conventions": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.0.0.tgz", + "integrity": "sha512-XCZ6ZSmc8FOspxKUU+Ow9UtJeSSRcS5rFBYGpjzix02U2v+X9ofjOjgNRnpvxlSvkccYIhdTuwcvNskmZ46SeA==" + } + } + }, + "@opentelemetry/exporter-trace-otlp-http": { + "version": "0.52.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-http/-/exporter-trace-otlp-http-0.52.1.tgz", + "integrity": "sha512-05HcNizx0BxcFKKnS5rwOV+2GevLTVIRA0tRgWYyw4yCgR53Ic/xk83toYKts7kbzcI+dswInUg/4s8oyA+tqg==", + "requires": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/otlp-exporter-base": "0.52.1", + "@opentelemetry/otlp-transformer": "0.52.1", + "@opentelemetry/resources": "1.25.1", + "@opentelemetry/sdk-trace-base": "1.25.1" + }, + "dependencies": { + "@opentelemetry/core": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz", + "integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==", + "requires": { + "@opentelemetry/semantic-conventions": "1.25.1" + } + }, + "@opentelemetry/resources": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.25.1.tgz", + "integrity": "sha512-pkZT+iFYIZsVn6+GzM0kSX+u3MSLCY9md+lIJOoKl/P+gJFfxJte/60Usdp8Ce4rOs8GduUpSPNe1ddGyDT1sQ==", + "requires": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/semantic-conventions": "1.25.1" + } + }, + "@opentelemetry/sdk-trace-base": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.25.1.tgz", + "integrity": "sha512-C8k4hnEbc5FamuZQ92nTOp8X/diCY56XUTnMiv9UTuJitCzaNNHAVsdm5+HLCdI8SLQsLWIrG38tddMxLVoftw==", + "requires": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/resources": "1.25.1", + "@opentelemetry/semantic-conventions": "1.25.1" + } + }, + "@opentelemetry/semantic-conventions": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz", + "integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==" + } + } + }, + "@opentelemetry/exporter-trace-otlp-proto": { + "version": "0.48.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-proto/-/exporter-trace-otlp-proto-0.48.0.tgz", + "integrity": "sha512-hVXr/8DYlAKAzQYMsCf3ZsGweS6NTK3IHIEqmLokJZYcvJQBEEazeAdISfrL/utWnapg1Qnpw8u+W6SpxNzmTw==", + "requires": { + "@opentelemetry/core": "1.21.0", + "@opentelemetry/otlp-exporter-base": "0.48.0", + "@opentelemetry/otlp-proto-exporter-base": "0.48.0", + "@opentelemetry/otlp-transformer": "0.48.0", + "@opentelemetry/resources": "1.21.0", + "@opentelemetry/sdk-trace-base": "1.21.0" + }, + "dependencies": { + "@opentelemetry/api-logs": { + "version": "0.48.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.48.0.tgz", + "integrity": "sha512-1/aMiU4Eqo3Zzpfwu51uXssp5pzvHFObk8S9pKAiXb1ne8pvg1qxBQitYL1XUiAMEXFzgjaidYG2V6624DRhhw==", + "requires": { + "@opentelemetry/api": "^1.0.0" + } + }, + "@opentelemetry/core": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.21.0.tgz", + "integrity": "sha512-KP+OIweb3wYoP7qTYL/j5IpOlu52uxBv5M4+QhSmmUfLyTgu1OIS71msK3chFo1D6Y61BIH3wMiMYRCxJCQctA==", + "requires": { + "@opentelemetry/semantic-conventions": "1.21.0" + } + }, + "@opentelemetry/otlp-exporter-base": { + "version": "0.48.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.48.0.tgz", + "integrity": "sha512-T4LJND+Ugl87GUONoyoQzuV9qCn4BFIPOnCH1biYqdGhc2JahjuLqVD9aefwLzGBW638iLAo88Lh68h2F1FLiA==", + "requires": { + "@opentelemetry/core": "1.21.0" + } + }, + "@opentelemetry/otlp-transformer": { + "version": "0.48.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.48.0.tgz", + "integrity": "sha512-yuoS4cUumaTK/hhxW3JUy3wl2U4keMo01cFDrUOmjloAdSSXvv1zyQ920IIH4lymp5Xd21Dj2/jq2LOro56TJg==", + "requires": { + "@opentelemetry/api-logs": "0.48.0", + "@opentelemetry/core": "1.21.0", + "@opentelemetry/resources": "1.21.0", + "@opentelemetry/sdk-logs": "0.48.0", + "@opentelemetry/sdk-metrics": "1.21.0", + "@opentelemetry/sdk-trace-base": "1.21.0" + } + }, + "@opentelemetry/resources": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.21.0.tgz", + "integrity": "sha512-1Z86FUxPKL6zWVy2LdhueEGl9AHDJcx+bvHStxomruz6Whd02mE3lNUMjVJ+FGRoktx/xYQcxccYb03DiUP6Yw==", + "requires": { + "@opentelemetry/core": "1.21.0", + "@opentelemetry/semantic-conventions": "1.21.0" + } + }, + "@opentelemetry/sdk-logs": { + "version": "0.48.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.48.0.tgz", + "integrity": "sha512-lRcA5/qkSJuSh4ItWCddhdn/nNbVvnzM+cm9Fg1xpZUeTeozjJDBcHnmeKoOaWRnrGYBdz6UTY6bynZR9aBeAA==", + "requires": { + "@opentelemetry/core": "1.21.0", + "@opentelemetry/resources": "1.21.0" + } + }, + "@opentelemetry/sdk-metrics": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.21.0.tgz", + "integrity": "sha512-on1jTzIHc5DyWhRP+xpf+zrgrREXcHBH4EDAfaB5mIG7TWpKxNXooQ1JCylaPsswZUv4wGnVTinr4HrBdGARAQ==", + "requires": { + "@opentelemetry/core": "1.21.0", + "@opentelemetry/resources": "1.21.0", + "lodash.merge": "^4.6.2" + } + }, + "@opentelemetry/sdk-trace-base": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.21.0.tgz", + "integrity": "sha512-yrElGX5Fv0umzp8Nxpta/XqU71+jCAyaLk34GmBzNcrW43nqbrqvdPs4gj4MVy/HcTjr6hifCDCYA3rMkajxxA==", + "requires": { + "@opentelemetry/core": "1.21.0", + "@opentelemetry/resources": "1.21.0", + "@opentelemetry/semantic-conventions": "1.21.0" + } + }, + "@opentelemetry/semantic-conventions": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.21.0.tgz", + "integrity": "sha512-lkC8kZYntxVKr7b8xmjCVUgE0a8xgDakPyDo9uSWavXPyYqLgYYGdEd2j8NxihRyb6UwpX3G/hFUF4/9q2V+/g==" + } + } + }, + "@opentelemetry/exporter-zipkin": { + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-zipkin/-/exporter-zipkin-1.25.0.tgz", + "integrity": "sha512-nnhY0e5DHg8BfUSNCQZoGZnGeqz+zMTeEUOh1dfgtaXmF99uM0QPuTa1i2lH+eZqebP8w1WDWZlewu9FUlHqIg==", + "requires": { + "@opentelemetry/core": "1.25.0", + "@opentelemetry/resources": "1.25.0", + "@opentelemetry/sdk-trace-base": "1.25.0", + "@opentelemetry/semantic-conventions": "1.25.0" + } + }, + "@opentelemetry/otlp-exporter-base": { + "version": "0.52.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.52.1.tgz", + "integrity": "sha512-z175NXOtX5ihdlshtYBe5RpGeBoTXVCKPPLiQlD6FHvpM4Ch+p2B0yWKYSrBfLH24H9zjJiBdTrtD+hLlfnXEQ==", + "requires": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/otlp-transformer": "0.52.1" + }, + "dependencies": { + "@opentelemetry/core": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz", + "integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==", + "requires": { + "@opentelemetry/semantic-conventions": "1.25.1" + } + }, + "@opentelemetry/semantic-conventions": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz", + "integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==" + } + } + }, + "@opentelemetry/otlp-proto-exporter-base": { + "version": "0.48.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-proto-exporter-base/-/otlp-proto-exporter-base-0.48.0.tgz", + "integrity": "sha512-14GSTvPZPfrWsB54fYMGb8v+Uge5xGXyz0r2rf4SzcRnO2hXCPHEuL3yyL50emaKPAY+fj29Dm0bweawe8UA6A==", + "requires": { + "@opentelemetry/core": "1.21.0", + "@opentelemetry/otlp-exporter-base": "0.48.0", + "protobufjs": "^7.2.3" + }, + "dependencies": { + "@opentelemetry/core": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.21.0.tgz", + "integrity": "sha512-KP+OIweb3wYoP7qTYL/j5IpOlu52uxBv5M4+QhSmmUfLyTgu1OIS71msK3chFo1D6Y61BIH3wMiMYRCxJCQctA==", + "requires": { + "@opentelemetry/semantic-conventions": "1.21.0" + } + }, + "@opentelemetry/otlp-exporter-base": { + "version": "0.48.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.48.0.tgz", + "integrity": "sha512-T4LJND+Ugl87GUONoyoQzuV9qCn4BFIPOnCH1biYqdGhc2JahjuLqVD9aefwLzGBW638iLAo88Lh68h2F1FLiA==", + "requires": { + "@opentelemetry/core": "1.21.0" + } + }, + "@opentelemetry/semantic-conventions": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.21.0.tgz", + "integrity": "sha512-lkC8kZYntxVKr7b8xmjCVUgE0a8xgDakPyDo9uSWavXPyYqLgYYGdEd2j8NxihRyb6UwpX3G/hFUF4/9q2V+/g==" + }, + "@types/node": { + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.1.0.tgz", + "integrity": "sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==", + "requires": { + "undici-types": "~6.13.0" + } + }, + "long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + }, + "protobufjs": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.2.tgz", + "integrity": "sha512-RXyHaACeqXeqAKGLDl68rQKbmObRsTIn4TYVUUug1KfS47YWCo5MacGITEryugIgZqORCvJWEk4l449POg5Txg==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + } + }, + "undici-types": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.13.0.tgz", + "integrity": "sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg==" + } + } + }, + "@opentelemetry/otlp-transformer": { + "version": "0.52.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.52.1.tgz", + "integrity": "sha512-I88uCZSZZtVa0XniRqQWKbjAUm73I8tpEy/uJYPPYw5d7BRdVk0RfTBQw8kSUl01oVWEuqxLDa802222MYyWHg==", + "requires": { + "@opentelemetry/api-logs": "0.52.1", + "@opentelemetry/core": "1.25.1", + "@opentelemetry/resources": "1.25.1", + "@opentelemetry/sdk-logs": "0.52.1", + "@opentelemetry/sdk-metrics": "1.25.1", + "@opentelemetry/sdk-trace-base": "1.25.1", + "protobufjs": "^7.3.0" + }, + "dependencies": { + "@opentelemetry/core": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz", + "integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==", + "requires": { + "@opentelemetry/semantic-conventions": "1.25.1" + } + }, + "@opentelemetry/resources": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.25.1.tgz", + "integrity": "sha512-pkZT+iFYIZsVn6+GzM0kSX+u3MSLCY9md+lIJOoKl/P+gJFfxJte/60Usdp8Ce4rOs8GduUpSPNe1ddGyDT1sQ==", + "requires": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/semantic-conventions": "1.25.1" + } + }, + "@opentelemetry/sdk-trace-base": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.25.1.tgz", + "integrity": "sha512-C8k4hnEbc5FamuZQ92nTOp8X/diCY56XUTnMiv9UTuJitCzaNNHAVsdm5+HLCdI8SLQsLWIrG38tddMxLVoftw==", + "requires": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/resources": "1.25.1", + "@opentelemetry/semantic-conventions": "1.25.1" + } + }, + "@opentelemetry/semantic-conventions": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz", + "integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==" + }, + "@types/node": { + "version": "20.14.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.6.tgz", + "integrity": "sha512-JbA0XIJPL1IiNnU7PFxDXyfAwcwVVrOoqyzzyQTyMeVhBzkJVMSkC1LlVsRQ2lpqiY4n6Bb9oCS6lzDKVQxbZw==", + "requires": { + "undici-types": "~5.26.4" + } + }, + "long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + }, + "protobufjs": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.2.tgz", + "integrity": "sha512-RXyHaACeqXeqAKGLDl68rQKbmObRsTIn4TYVUUug1KfS47YWCo5MacGITEryugIgZqORCvJWEk4l449POg5Txg==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + } + } + } + }, + "@opentelemetry/resources": { + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.25.0.tgz", + "integrity": "sha512-iHjydPMYJ+Li1auveJCq2rp5U2h6Mhq8BidiyE0jfVlDTFyR1ny8AfJHfmFzJ/RAM8vT8L7T21kcmGybxZC7lQ==", + "requires": { + "@opentelemetry/core": "1.25.0", + "@opentelemetry/semantic-conventions": "1.25.0" + } + }, + "@opentelemetry/sdk-logs": { + "version": "0.52.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.52.1.tgz", + "integrity": "sha512-MBYh+WcPPsN8YpRHRmK1Hsca9pVlyyKd4BxOC4SsgHACnl/bPp4Cri9hWhVm5+2tiQ9Zf4qSc1Jshw9tOLGWQA==", + "requires": { + "@opentelemetry/api-logs": "0.52.1", + "@opentelemetry/core": "1.25.1", + "@opentelemetry/resources": "1.25.1" + }, + "dependencies": { + "@opentelemetry/core": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz", + "integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==", + "requires": { + "@opentelemetry/semantic-conventions": "1.25.1" + } + }, + "@opentelemetry/resources": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.25.1.tgz", + "integrity": "sha512-pkZT+iFYIZsVn6+GzM0kSX+u3MSLCY9md+lIJOoKl/P+gJFfxJte/60Usdp8Ce4rOs8GduUpSPNe1ddGyDT1sQ==", + "requires": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/semantic-conventions": "1.25.1" + } + }, + "@opentelemetry/semantic-conventions": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz", + "integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==" + } + } + }, + "@opentelemetry/sdk-metrics": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.25.1.tgz", + "integrity": "sha512-9Mb7q5ioFL4E4dDrc4wC/A3NTHDat44v4I3p2pLPSxRvqUbDIQyMVr9uK+EU69+HWhlET1VaSrRzwdckWqY15Q==", + "requires": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/resources": "1.25.1", + "lodash.merge": "^4.6.2" + }, + "dependencies": { + "@opentelemetry/core": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz", + "integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==", + "requires": { + "@opentelemetry/semantic-conventions": "1.25.1" + } + }, + "@opentelemetry/resources": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.25.1.tgz", + "integrity": "sha512-pkZT+iFYIZsVn6+GzM0kSX+u3MSLCY9md+lIJOoKl/P+gJFfxJte/60Usdp8Ce4rOs8GduUpSPNe1ddGyDT1sQ==", + "requires": { + "@opentelemetry/core": "1.25.1", + "@opentelemetry/semantic-conventions": "1.25.1" + } + }, + "@opentelemetry/semantic-conventions": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz", + "integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==" + } + } + }, + "@opentelemetry/sdk-metrics-base": { + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics-base/-/sdk-metrics-base-0.26.0.tgz", + "integrity": "sha512-PbJsso7Vy/CLATAOyXbt/VP7ZQ2QYnvlq28lhOWaLPw8aqLogMBvidNGRrt7rF4/hfzLT6pMgpAAcit2C/nUMA==", + "requires": { + "@opentelemetry/api-metrics": "0.26.0", + "@opentelemetry/core": "1.0.0", + "@opentelemetry/resources": "1.0.0", + "lodash.merge": "^4.6.2" + }, + "dependencies": { + "@opentelemetry/core": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.0.0.tgz", + "integrity": "sha512-1+qvKilADnSFW4PiXy+f7D22pvfGVxepZ69GcbF8cTcbQTUt7w63xEBWn5f5j92x9I3c0sqbW1RUx5/a4wgzxA==", + "requires": { + "@opentelemetry/semantic-conventions": "1.0.0", + "semver": "^7.3.5" + } + }, + "@opentelemetry/resources": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.0.0.tgz", + "integrity": "sha512-ORP8F2LLcJEm5M3H24RmdlMdiDc70ySPushpkrAW34KZGdZXwkrFoFXZhhs5MUxPT+fLrTuBafXxZVr8eHtFuQ==", + "requires": { + "@opentelemetry/core": "1.0.0", + "@opentelemetry/semantic-conventions": "1.0.0" + } + }, + "@opentelemetry/semantic-conventions": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.0.0.tgz", + "integrity": "sha512-XCZ6ZSmc8FOspxKUU+Ow9UtJeSSRcS5rFBYGpjzix02U2v+X9ofjOjgNRnpvxlSvkccYIhdTuwcvNskmZ46SeA==" + } + } + }, + "@opentelemetry/sdk-trace-base": { + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.25.0.tgz", + "integrity": "sha512-6+g2fiRQUG39guCsKVeY8ToeuUf3YUnPkN6DXRA1qDmFLprlLvZm9cS6+chgbW70cZJ406FTtSCDnJwxDC5sGQ==", + "requires": { + "@opentelemetry/core": "1.25.0", + "@opentelemetry/resources": "1.25.0", + "@opentelemetry/semantic-conventions": "1.25.0" + } + }, + "@opentelemetry/sdk-trace-web": { + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-web/-/sdk-trace-web-1.25.0.tgz", + "integrity": "sha512-TAWRDRiVOeliE1A99z8idWb4pwEKKY9Vj5aTpLtrF4cvPOl0mPg3ZczvOw/HnpfRsWY0Ra/J3vS5uFSpoqPwEA==", + "requires": { + "@opentelemetry/core": "1.25.0", + "@opentelemetry/sdk-trace-base": "1.25.0", + "@opentelemetry/semantic-conventions": "1.25.0" + } + }, + "@opentelemetry/semantic-conventions": { + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.0.tgz", + "integrity": "sha512-M+kkXKRAIAiAP6qYyesfrC5TOmDpDVtsxuGfPcqd9B/iBrac+E14jYwrgm0yZBUIbIP2OnqC3j+UgkXLm1vxUQ==" + }, "@pdftron/pdfjs-express": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/@pdftron/pdfjs-express/-/pdfjs-express-8.1.0.tgz", @@ -49623,8 +51423,87 @@ "@sentry/tracing": "7.73.0", "@sentry/types": "7.73.0", "@sentry/utils": "7.73.0" + }, + "dependencies": { + "@sentry/tracing": { + "version": "7.73.0", + "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-7.73.0.tgz", + "integrity": "sha512-LOQR6Hkc8ZoflCXWtMlxTbCBEwv0MSOr3vesnRsmlFG8TW1YUIneU+wKnVxToWAZ8fq+6ubclnuIUKHfqTk/Tg==", + "requires": { + "@sentry-internal/tracing": "7.73.0" + } + } } }, + "@sentry/cli": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.32.2.tgz", + "integrity": "sha512-m/6Z3FWu+rTd8jepVlJPKQhvbT8vCjt0N7BSWZiEUVW/8mhwAYJiwO0b+Ch/u4IqbBg1dp3805q5TFPl4AdrNw==", + "dev": true, + "requires": { + "@sentry/cli-darwin": "2.32.2", + "@sentry/cli-linux-arm": "2.32.2", + "@sentry/cli-linux-arm64": "2.32.2", + "@sentry/cli-linux-i686": "2.32.2", + "@sentry/cli-linux-x64": "2.32.2", + "@sentry/cli-win32-i686": "2.32.2", + "@sentry/cli-win32-x64": "2.32.2", + "https-proxy-agent": "^5.0.0", + "node-fetch": "^2.6.7", + "progress": "^2.0.3", + "proxy-from-env": "^1.1.0", + "which": "^2.0.2" + } + }, + "@sentry/cli-darwin": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli-darwin/-/cli-darwin-2.32.2.tgz", + "integrity": "sha512-GDtePIavx3FKSRowdPdtIssahn46MfFFYNN+s7a9MjlhFwJtvC9A1bSDw7ksEtDaQolepUwmLPHaVe19y0T/zw==", + "dev": true, + "optional": true + }, + "@sentry/cli-linux-arm": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm/-/cli-linux-arm-2.32.2.tgz", + "integrity": "sha512-u9s08wr8bDDqsAl6pk9iGGlOHtU+T8btU6voNKy71QzeIBpV9c8VVk/OnmP9aswp/ea4NY416yjnzcTvCrFKAw==", + "dev": true, + "optional": true + }, + "@sentry/cli-linux-arm64": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.32.2.tgz", + "integrity": "sha512-VECLVC1rLyvXk6rTVUfmfs4vhANjMgm4BVKGlA3rydmf2PJw2/NfipH3KeyijdE2vEoyLri+/6HH883pP0iniQ==", + "dev": true, + "optional": true + }, + "@sentry/cli-linux-i686": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-i686/-/cli-linux-i686-2.32.2.tgz", + "integrity": "sha512-XhofQz32OqLrQK1DEOsryhT7d29Df6VkccvxueGoIt2gpXEXtgRczsUwZjZqquDdkNCt+HPj9eUGcj8pY8JkmQ==", + "dev": true, + "optional": true + }, + "@sentry/cli-linux-x64": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli-linux-x64/-/cli-linux-x64-2.32.2.tgz", + "integrity": "sha512-anyng4Qqt7zX4ZY4IzDH1RJWAVZNBe6sUHcuciNy7giCU3B4/XnxAHlwYmBSN5txpaumsWdstPgRKEUJG6AOSA==", + "dev": true, + "optional": true + }, + "@sentry/cli-win32-i686": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli-win32-i686/-/cli-win32-i686-2.32.2.tgz", + "integrity": "sha512-/auqx7QXG7F556fNK7vaB26pX7Far1CQMfI65iV4u/VWg6gV2WfvJWXB4iowhjqkYv56sZ+zOymLkEVF0R8wtg==", + "dev": true, + "optional": true + }, + "@sentry/cli-win32-x64": { + "version": "2.32.2", + "resolved": "https://registry.npmjs.org/@sentry/cli-win32-x64/-/cli-win32-x64-2.32.2.tgz", + "integrity": "sha512-w7hW2sEWVYQquqdILBSFhcVW+HdoyLqVPPkLPAXRSLTwBnuni9nQEIdXr0h/7db+K3cm7PvWndp5ixVyswLHZA==", + "dev": true, + "optional": true + }, "@sentry/core": { "version": "7.73.0", "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.73.0.tgz", @@ -49698,11 +51577,45 @@ } }, "@sentry/tracing": { - "version": "7.73.0", - "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-7.73.0.tgz", - "integrity": "sha512-LOQR6Hkc8ZoflCXWtMlxTbCBEwv0MSOr3vesnRsmlFG8TW1YUIneU+wKnVxToWAZ8fq+6ubclnuIUKHfqTk/Tg==", + "version": "7.114.0", + "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-7.114.0.tgz", + "integrity": "sha512-eldEYGADReZ4jWdN5u35yxLUSTOvjsiZAYd4KBEpf+Ii65n7g/kYOKAjNl7tHbrEG1EsMW4nDPWStUMk1w+tfg==", "requires": { - "@sentry-internal/tracing": "7.73.0" + "@sentry-internal/tracing": "7.114.0" + }, + "dependencies": { + "@sentry-internal/tracing": { + "version": "7.114.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.114.0.tgz", + "integrity": "sha512-dOuvfJN7G+3YqLlUY4HIjyWHaRP8vbOgF+OsE5w2l7ZEn1rMAaUbPntAR8AF9GBA6j2zWNoSo8e7GjbJxVofSg==", + "requires": { + "@sentry/core": "7.114.0", + "@sentry/types": "7.114.0", + "@sentry/utils": "7.114.0" + } + }, + "@sentry/core": { + "version": "7.114.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.114.0.tgz", + "integrity": "sha512-YnanVlmulkjgZiVZ9BfY9k6I082n+C+LbZo52MTvx3FY6RE5iyiPMpaOh67oXEZRWcYQEGm+bKruRxLVP6RlbA==", + "requires": { + "@sentry/types": "7.114.0", + "@sentry/utils": "7.114.0" + } + }, + "@sentry/types": { + "version": "7.114.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.114.0.tgz", + "integrity": "sha512-tsqkkyL3eJtptmPtT0m9W/bPLkU7ILY7nvwpi1hahA5jrM7ppoU0IMaQWAgTD+U3rzFH40IdXNBFb8Gnqcva4w==" + }, + "@sentry/utils": { + "version": "7.114.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.114.0.tgz", + "integrity": "sha512-319N90McVpupQ6vws4+tfCy/03AdtsU0MurIE4+W5cubHME08HtiEWlfacvAxX+yuKFhvdsO4K4BB/dj54ideg==", + "requires": { + "@sentry/types": "7.114.0" + } + } } }, "@sentry/types": { @@ -53547,9 +55460,9 @@ "integrity": "sha512-k8Fr3Zcv2kcsTD7TYrPPBZX/kEDSCjnPQOtaQBOFmCS3IcJNgWQY8LYST57zkIijaTKeQR7JZo4DvW1Oda3o2Q==" }, "cordova-plugin-screen-orientation": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/cordova-plugin-screen-orientation/-/cordova-plugin-screen-orientation-3.0.2.tgz", - "integrity": "sha512-2w6CMC+HGvbhogJetalwGurL2Fx8DQCCPy3wlSZHN1/W7WoQ5n9ujVozcoKrY4VaagK6bxrPFih+ElkO8Uqfzg==" + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/cordova-plugin-screen-orientation/-/cordova-plugin-screen-orientation-3.0.4.tgz", + "integrity": "sha512-AswRuUKJ8J3HycUilTJsIB50aa9TLrwndPNBFG+wfAPhHEqIBF0HaD0q3HbAK7ypgmaj0cvbzk84qP51IcTfrQ==" }, "cordova-plugin-statusbar": { "version": "2.4.3", @@ -54400,10 +56313,9 @@ "integrity": "sha512-6ujwvwgPID6zbI0o7UbURi2vlLDR9uP26+tW6Lg+Ji3w7dd0i3DOcjcClLjLPranT60SSEFBwdSyYwn/ZkPIuw==" }, "date-format": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.11.tgz", - "integrity": "sha512-VS20KRyorrbMCQmpdl2hg5KaOUsda1RbnsJg461FfrcyCUg+pkd0b40BSW4niQyTheww4DBXQnS7HwSrKkipLw==", - "dev": true + "version": "4.0.14", + "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.14.tgz", + "integrity": "sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg==" }, "dayjs": { "version": "1.11.8", @@ -54819,6 +56731,11 @@ "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1094867.tgz", "integrity": "sha512-pmMDBKiRVjh0uKK6CT1WqZmM3hBVSgD+N2MrgyV1uNizAZMw4tx6i/RTc+/uCsKSCmg0xXx7arCP/OFcIwTsiQ==" }, + "dexie": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/dexie/-/dexie-4.0.7.tgz", + "integrity": "sha512-M+Lo6rk4pekIfrc2T0o2tvVJwL6EAAM/B78DNfb8aaxFVoI1f8/rz5KTxuAnApkwqTSuxx7T5t0RKH7qprapGg==" + }, "di": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz", @@ -56230,6 +58147,11 @@ "escape-string-regexp": "^1.0.5" } }, + "file-saver": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz", + "integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA==" + }, "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", @@ -56345,10 +58267,9 @@ } }, "flatted": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.6.tgz", - "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", - "dev": true + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==" }, "flatten": { "version": "1.0.3", @@ -56535,6 +58456,14 @@ } } }, + "gelf-pro": { + "version": "1.3.12", + "resolved": "https://registry.npmjs.org/gelf-pro/-/gelf-pro-1.3.12.tgz", + "integrity": "sha512-gZcOmLA26WbszShVHhDwjONMZZFvtpctibjY3Mu84sAzMg8VJscFp94UOO4zGLoCfepOWvcysdu+IZT0mWfL6Q==", + "requires": { + "lodash": "~4.17.21" + } + }, "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -57360,9 +59289,9 @@ } }, "husky": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.2.tgz", - "integrity": "sha512-Tkv80jtvbnkK3mYWxPZePGFpQ/tT3HNSs/sasF9P2YfkMezDl3ON37YN6jUUI4eTg5LcyVynlb6r4eyvOmspvg==" + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", + "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==" }, "iconv-lite": { "version": "0.6.3", @@ -63728,6 +65657,11 @@ "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==" }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + }, "lodash.once": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", @@ -63790,23 +65724,21 @@ } }, "log4js": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.5.2.tgz", - "integrity": "sha512-DXtpNtt+KDOMT7RHUDIur/WsSA3rntlUh9Zg4XCdV42wUuMmbFkl38+LZ92Z5QvQA7mD5kAVkLiBSEH/tvUB8A==", - "dev": true, + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.9.1.tgz", + "integrity": "sha512-1somDdy9sChrr9/f4UlzhdaGfDR2c/SaD2a4T7qEkG4jTS57/B3qmnjLYePwQ8cqWnUHZI0iAKxMBpCZICiZ2g==", "requires": { - "date-format": "^4.0.10", + "date-format": "^4.0.14", "debug": "^4.3.4", - "flatted": "^3.2.5", + "flatted": "^3.2.7", "rfdc": "^1.3.0", - "streamroller": "^3.1.1" + "streamroller": "^3.1.5" }, "dependencies": { "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, "requires": { "ms": "2.1.2" } @@ -65066,6 +66998,22 @@ "tslib": "^2.0.0" } }, + "ngx-cropper": { + "version": "2.0.0-beta", + "resolved": "https://registry.npmjs.org/ngx-cropper/-/ngx-cropper-2.0.0-beta.tgz", + "integrity": "sha512-nyX0OgPBYhIj6M7lVDswnn0yAALxvByl052iRKiUyQc4gn1Xf1LBX+my7Zfg6oq7F91hvwojTeYqvTeHkDMVfQ==", + "requires": { + "cropperjs": "^1.4.1", + "tslib": "^1.9.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + } + } + }, "ngx-extended-pdf-viewer": { "version": "13.0.0-alpha.2", "resolved": "https://registry.npmjs.org/ngx-extended-pdf-viewer/-/ngx-extended-pdf-viewer-13.0.0-alpha.2.tgz", @@ -65999,6 +67947,11 @@ "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", "integrity": "sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==" }, + "path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" + }, "path-dirname": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", @@ -68954,8 +70907,7 @@ "rfdc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", - "dev": true + "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==" }, "right-align": { "version": "0.1.3", @@ -70648,35 +72600,45 @@ } }, "streamroller": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.1.1.tgz", - "integrity": "sha512-iPhtd9unZ6zKdWgMeYGfSBuqCngyJy1B/GPi/lTpwGpa3bajuX30GjUVd0/Tn/Xhg0mr4DOSENozz9Y06qyonQ==", - "dev": true, + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.1.5.tgz", + "integrity": "sha512-KFxaM7XT+irxvdqSP1LGLgNWbYN7ay5owZ3r/8t77p+EtSUAfUgtl7be3xtqtOmGUl9K9YPO2ca8133RlTjvKw==", "requires": { - "date-format": "^4.0.10", + "date-format": "^4.0.14", "debug": "^4.3.4", - "fs-extra": "^10.1.0" + "fs-extra": "^8.1.0" }, "dependencies": { "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", "requires": { "ms": "2.1.2" } }, "fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "dev": true, + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "requires": { "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" } } }, @@ -75669,6 +77631,11 @@ "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.1.tgz", "integrity": "sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g==" }, + "undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + }, "unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", diff --git a/package.json b/package.json index 9ffb77015..354b3d941 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,12 @@ "cypress:open": "cypress open", "cypress:run": "cypress run", "docker:build": "docker build -t gabinetedigital:0.0.0.1 .", - "docker:publish": "docker run -p gabinetedigital:0.0.0.1" + "docker:publish": "docker run -p gabinetedigital:0.0.0.1", + "build:oapr": "ionic cap build android --configuration oapr", + "build:dev": "ionic cap build android --configuration dev", + "sentry:releases": "sentry-cli releases new -p your-project-name $(git rev-parse HEAD) && sentry-cli releases set-commits --auto $(git rev-parse HEAD) && sentry-cli releases files $(git rev-parse HEAD) upload-sourcemaps ./www --rewrite && sentry-cli releases finalize $(git rev-parse HEAD)", + "build:sentry": "npm run build && npm run sentry:releases", + "sentry:sourcemaps": "sentry-cli sourcemaps inject --org equilibrium-sa --project oapr-gabinetedigital-fo ./www && sentry-cli sourcemaps upload --org equilibrium-sa --project oapr-gabinetedigital-fo ./www" }, "private": true, "dependencies": { @@ -59,12 +64,15 @@ "@capacitor/haptics": "^4.1.0", "@capacitor/ios": "^5.4.2", "@capacitor/keyboard": "^4.1.0", + "@capacitor/local-notifications": "^6.0.0", "@capacitor/network": "^4.1.0", "@capacitor/push-notifications": "^5.1.0", "@capacitor/share": "^4.1.0", "@capacitor/storage": "^1.2.5", "@capawesome/capacitor-file-picker": "^5.3.0", "@capawesome/capacitor-screen-orientation": "^5.0.1", + "@ffmpeg/ffmpeg": "^0.12.10", + "@ffmpeg/util": "^0.12.1", "@fortawesome/angular-fontawesome": "^0.9.0", "@fortawesome/fontawesome-free": "^5.15.3", "@fortawesome/fontawesome-svg-core": "^1.2.35", @@ -106,11 +114,23 @@ "@logisticinfotech/ionic4-datepicker": "^1.4.4", "@microsoft/signalr": "^8.0.0", "@ng-bootstrap/ng-bootstrap": "^9.1.2", + "@ngrx/store": "^10.1.2", "@ngx-translate/core": "^13.0.0", "@ngxs/store": "^3.8.2", + "@opentelemetry/exporter-metrics-otlp-http": "^0.52.1", + "@opentelemetry/exporter-otlp-http": "^0.26.0", + "@opentelemetry/exporter-trace-otlp-http": "^0.52.1", + "@opentelemetry/exporter-trace-otlp-proto": "^0.48.0", + "@opentelemetry/exporter-zipkin": "^1.25.0", + "@opentelemetry/resources": "^1.25.0", + "@opentelemetry/sdk-metrics": "^1.25.1", + "@opentelemetry/sdk-trace-base": "^1.25.0", + "@opentelemetry/sdk-trace-web": "^1.25.0", + "@opentelemetry/semantic-conventions": "^1.25.0", "@pdftron/pdfjs-express": "^8.0.1", - "@sentry/angular": "7.73.0", + "@sentry/angular": "^7.73.0", "@sentry/capacitor": "^0.14.0", + "@sentry/tracing": "^7.114.0", "@teamhive/capacitor-video-recorder": "^5.0.0", "@tinymce/tinymce-angular": "^4.2.4", "@types/jest-environment-puppeteer": "^5.0.3", @@ -138,25 +158,28 @@ "cordova-plugin-filepath": "^1.5.8", "cordova-plugin-multiple-documents-picker": "^1.0.0", "cordova-plugin-okhttp": "^2.0.0", - "cordova-plugin-screen-orientation": "^3.0.2", + "cordova-plugin-screen-orientation": "^3.0.4", "cordova-res": "^0.15.3", "cordova-sqlite-storage": "^6.0.0", "cross-env": "^7.0.3", "crypto-js": "^4.0.0", "date-fns": "^2.17.0", "depd": "^2.0.0", + "dexie": "^4.0.7", "dompurify": "^3.0.6", "dotenv": "^10.0.0", "duration": "^0.2.2", "faker": "^5.5.3", "fifo-process-queue": "^1.2.0", + "file-saver": "^2.0.5", "firebase": "^8.10.1", "g": "^2.0.1", + "gelf-pro": "^1.3.12", "global": "^4.4.0", "hammerjs": "^2.0.8", "howler": "^2.2.3", "http-server": "^14.1.1", - "husky": "^8.0.2", + "husky": "^8.0.3", "ionic-angular": "^3.9.10", "ionic-image-loader": "^6.3.3", "ionic-image-loader-v5": "^1.0.2", @@ -166,12 +189,14 @@ "ionicons": "^5.5.3", "jest-puppeteer": "^7.0.1", "lite-server": "^2.6.1", + "log4js": "^6.9.1", "minisearch": "^6.0.1", "moment": "^2.29.3", "neverthrow": "^6.1.0", "ng-lazyload-image": "^9.1.2", "ng2-pdf-viewer": "^3.0.8", "ngx-cookie-service": "^12.0.3", + "ngx-cropper": "^2.0.0-beta", "ngx-extended-pdf-viewer": "^13.0.0-alpha.2", "ngx-image-compress": "^11.0.3", "ngx-image-cropper": "^5.0.1", @@ -209,6 +234,7 @@ "@capacitor/cli": "^4.8.1", "@ionic/angular-toolkit": "^6.1.0", "@ionic/lab": "3.1.7", + "@sentry/cli": "^2.32.2", "@types/core-js": "^2.5.7", "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.3", diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 3808095bb..d9bd2a28d 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -301,8 +301,25 @@ const routes = [ { path: 'not-found', loadChildren: () => import('./pages/not-found/not-found.module').then( m => m.NotFoundPageModule) + }, + { + path: 'view-document-second-options', + loadChildren: () => import('./modals/view-document-second-options/view-document-second-options.module').then( m => m.ViewDocumentSecondOptionsPageModule) + }, + { + path: 'crop-image', + loadChildren: () => import('./modals/crop-image/crop-image.module').then( m => m.CropImagePageModule) + }, + { + path: 'event-recurrence', + loadChildren: () => import('./modals/event-recurrence/event-recurrence.module').then( m => m.EventRecurrencePageModule) + }, + { + path: 'delete-event-recurrence', + loadChildren: () => import('./modals/delete-event-recurrence/delete-event-recurrence.module').then( m => m.DeleteEventRecurrencePageModule) } + /* path: 'chat', component: ChatPage diff --git a/src/app/app.component.ts b/src/app/app.component.ts index a8e9d3c9c..04671f596 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -12,6 +12,7 @@ import { Storage } from '@ionic/storage'; import { ChatController } from './controller/chat'; import { register } from 'swiper/element/bundle'; import { DomSanitizer } from '@angular/platform-browser'; +import {ScreenOrientation} from "@ionic-native/screen-orientation/ngx"; const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { parse: { @@ -41,7 +42,8 @@ export class AppComponent { public ThemeService: ThemeService, private storage: Storage, private ChatSystemService: ChatSystemService, - private sanitizer: DomSanitizer + private sanitizer: DomSanitizer, + private screenOrientation: ScreenOrientation ) { window["sanitizer"] = this.sanitizer @@ -77,9 +79,20 @@ export class AppComponent { if (this.platform.is("tablet")) { window.screen.orientation.unlock(); } else if( this.platform.is("mobile")) { - // window.screen.orientation.lock('portrait'); + if(this.platform.is('ios')){ + this.screenOrientation.lock('portrait') + } else { + window.screen.orientation.lock('portrait'); + } } - }); } } + + + +window.onerror = function(message, source, lineno, colno, error) { + if (error) message = error.stack; + console.log('send', 'event', 'window.onerror', message, navigator.userAgent); +} +// ============================================================================ diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 37e5b2dd3..25143448c 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -29,6 +29,7 @@ import { Network } from '@ionic-native/network/ngx'; import { MultipleDocumentsPicker } from '@awesome-cordova-plugins/multiple-document-picker/ngx'; import { DocumentViewer } from '@awesome-cordova-plugins/document-viewer/ngx'; import { FFMpeg } from '@awesome-cordova-plugins/ffmpeg/ngx'; +import { FFmpeg } from '@ffmpeg/ffmpeg'; @@ -87,11 +88,21 @@ import { LoggingInterceptorService } from './services/logging-interceptor.servic import { PopupQuestionPipe } from './modals/popup-question.pipe'; import '@teamhive/capacitor-video-recorder'; import { tokenInterceptor } from './interceptors/token.interceptors'; +import { chatTokenInterceptor } from './interceptors/chatToken.interceptor'; import { InputFilterDirective } from './services/directives/input-filter.directive'; import { VisibilityDirective } from './services/directives/visibility.directive'; import { DeplomaOptionsPageModule } from './shared/popover/deploma-options/deploma-options.module'; import { DiplomaOptionsPage } from './shared/popover/deploma-options/deploma-options.page'; +import { ImageCropperModule } from 'ngx-image-cropper'; +import { metricsInterceptor, MetricsInterceptor } from './interceptors/metter.interceptor'; +import { environment } from 'src/environments/environment'; +import { StoreModule } from '@ngrx/store'; + +import {MatMenuModule} from '@angular/material/menu'; +import {MatIconModule} from '@angular/material/icon'; +import { AngularCropperjsModule } from 'angular-cropperjs'; +import { calendarReducer } from './module/agenda/data/data-source/agenda-memory-source.service'; // import { ServiceWorkerModule } from '@angular/service-worker'; // import { AngularFireModule } from '@angular/fire'; // import { AngularFireMessagingModule } from '@angular/fire/messaging'; @@ -111,10 +122,18 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */ // We recommend adjusting this value in production. tracesSampleRate: 1.0, integrations: [ - new BrowserTracing({ - tracingOrigins: ['localhost', 'https://gd-api.oapr.gov.ao/api/'], - }) as Integration, - ] + // new BrowserTracing({ + // tracingOrigins: ['localhost', 'https://gd-api.oapr.gov.ao/api/'], + // }) as Integration, + ], + beforeSend(event, hint) { + + // Modify the event here + // console.log('Intercepted Sentry event:', event); + + // Optionally, return null to drop the event or return the modified event + return event; + } }, // Forward the init method to the sibling Framework. SentrySibling.init @@ -122,6 +141,7 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */ @NgModule({ declarations: [AppComponent, PopupQuestionPipe, InputFilterDirective], imports: [BrowserModule, + StoreModule.forRoot({ calendar: calendarReducer }), CommonModule, FormsModule, CalendarModule.forRoot({ @@ -175,6 +195,10 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */ // options DeplomaOptionsPageModule, CreateProcessPageModule, + ImageCropperModule, + + MatMenuModule, + MatIconModule ], entryComponents: [ DiplomaOptionsPage, @@ -215,8 +239,12 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */ FileOpener, DocumentViewer, FFMpeg, + FFmpeg, { provide: HTTP_INTERCEPTORS, useClass: LoggingInterceptorService, multi: true }, - tokenInterceptor + chatTokenInterceptor, + tokenInterceptor, + metricsInterceptor + ], bootstrap: [AppComponent], diff --git a/src/app/guards/auth.guard.ts b/src/app/guards/auth.guard.ts index 05c6ea954..682c75262 100644 --- a/src/app/guards/auth.guard.ts +++ b/src/app/guards/auth.guard.ts @@ -68,7 +68,7 @@ export class AuthGuard implements CanActivate { return false } } else if (pathname.startsWith('/home/events')) { - if(SessionStore.user.OwnerCalendars.length >= 1 || this.p.userPermission([this.p.permissionList.Gabinete.access])) { + if(SessionStore?.user?.OwnerCalendars.length >= 1 || this.p.userPermission([this.p.permissionList.Gabinete.access])) { return true } else { this.router.navigate(['/login']); diff --git a/src/app/guards/inactivity.guard.ts b/src/app/guards/inactivity.guard.ts index 35ea3028c..ec340857d 100644 --- a/src/app/guards/inactivity.guard.ts +++ b/src/app/guards/inactivity.guard.ts @@ -26,10 +26,10 @@ export class InactivityGuard implements CanActivate { // console.log('hire inactinity!', state.url) if ( (this.platform.is('desktop') || this.platform.is('mobileweb')) ) { - + if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)) { //When user has got access to Agenda but does not have their own calendar, goes to Agenda - if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0){ + if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore?.user?.OwnerCalendars.length == 0){ this.router.navigate(['/home/agenda']); } else{ @@ -79,7 +79,7 @@ export class InactivityGuard implements CanActivate { if((SessionStore?.user?.Inactivity)) { if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){ //When user has got access to Agenda but does not have their own calendar, goes to Agenda - if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0) { + if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore?.user?.OwnerCalendars.length == 0) { this.router.navigate(['/home/agenda']); } else{ @@ -98,14 +98,14 @@ export class InactivityGuard implements CanActivate { buttons: [{ text: 'Ok', handler: () => { - + } }] }).then( async (alertPopup)=>{ await alertPopup.present(); }) } - + return false } diff --git a/src/app/home/home-routing.module.ts b/src/app/home/home-routing.module.ts index 53b16aa2f..988385635 100644 --- a/src/app/home/home-routing.module.ts +++ b/src/app/home/home-routing.module.ts @@ -148,10 +148,6 @@ const routes: Routes = [ path:':SerialNumber/:caller', loadChildren: ()=> import('../pages/gabinete-digital/expediente/expediente-detail/expediente-detail.module').then(m => m.ExpedienteDetailPageModule) }, - { - path:'events/:eventId/:caller', - loadChildren: ()=> import('../pages/events/event-detail/event-detail.module').then(m => m.EventDetailPageModule), - }, { path:'expediente-task-modal', loadChildren: ()=> import('../pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.module').then(m => m.ExpedientTaskModalPageModule), @@ -366,7 +362,7 @@ const routes: Routes = [ }, ], - canActivate: [AuthGuard] + // canActivate: [AuthGuard] }, { @@ -380,7 +376,7 @@ const routes: Routes = [ }, ], - canActivate: [AuthGuard] + // canActivate: [AuthGuard] }, { path: 'inactivity', @@ -390,7 +386,7 @@ const routes: Routes = [ loadChildren: ()=> import('../pages/inactivity/inactivity.module').then(m => m.InactivityPageModule) }, ], - canActivate: [InactivityGuard] + // canActivate: [InactivityGuard] }, { path: 'login', @@ -400,7 +396,7 @@ const routes: Routes = [ loadChildren: ()=> import('../pages/inactivity/inactivity.module').then(m => m.InactivityPageModule) }, ], - canActivate: [InactivityGuard] + // canActivate: [InactivityGuard] }, { path: 'pin', @@ -410,7 +406,7 @@ const routes: Routes = [ loadChildren: ()=> import('../pages/inactivity/inactivity.module').then(m => m.InactivityPageModule) }, ], - canActivate: [InactivityGuard] + // canActivate: [InactivityGuard] }, diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index f24a47bb4..5ca662914 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -1,7 +1,6 @@ import { Component, NgZone, OnInit } from '@angular/core'; import { Event } from '../models/event.model'; -import { NotificationsService } from '../services/notifications.service'; -import { AlertController, ModalController, Platform } from '@ionic/angular'; +import { AlertController, Platform } from '@ionic/angular'; import { Router } from '@angular/router'; import { ToDayEventStorage } from '../store/to-day-event-storage.service'; import { TotalDocumentStore } from '../store/total-document.service'; @@ -17,19 +16,15 @@ import { RoleIdService } from 'src/app/services/role-id.service'; import { ActiveTabService } from 'src/app/services/active-tab.service'; import { Device } from '@capacitor/device'; import { RouteService } from 'src/app/services/route.service'; +import { CaptureLogService } from 'src/app/services/monitoring/capture-log/capture-log.service'; import { NetworkServiceService, ConnectionStatus } from 'src/app/services/network-service.service'; import { UserSession } from '../models/user.model'; import { PermissionList } from '../models/permission/permissionList'; import { SendIntent } from "send-intent"; - -// import { ChunkService } from "src/app/services/stream/chunk.service" -// import { StreamService } from "src/app/services/stream/stream.service" import { Plugins } from '@capacitor/core'; -import { NewActionPage } from '../pages/publications/new-action/new-action.page'; -import { PublicationsPage } from '../pages/publications/publications.page'; -// import { fetchData } from 'plugins/Echo'; import { Encoding, Filesystem, FilesystemDirectory } from '@capacitor/filesystem'; import { sendIntent } from 'src/app/services/shareIntent' +import { NativeNotificationService } from 'src/app/services/native-notification.service' const { App } = Plugins; @@ -90,12 +85,10 @@ export class HomePage implements OnInit { constructor( private router: Router, public modalCtrl: AlertController, - private notificationsService: NotificationsService, public platform: Platform, public p: PermissionService, private backgroundservice: BackgroundService, private storage: Storage, - private eventservice: EventsService, private processservice: ProcessesService, public RouteService: RouteService, private RochetChatConnectorService: RochetChatConnectorService, @@ -103,12 +96,10 @@ export class HomePage implements OnInit { public eventService: EventsService, public ActiveTabService: ActiveTabService, private RoleIdService: RoleIdService, - private modalController: ModalController, private zone: NgZone, public alertController: AlertController, - - // private ChunkService: ChunkService, - // private StreamService: StreamService + public CaptureLogService: CaptureLogService, + private NativeNotificationService: NativeNotificationService ) { if (SessionStore.exist) { this.user = SessionStore.user; @@ -188,7 +179,7 @@ export class HomePage implements OnInit { if ("serviceWorker" in navigator) { navigator.serviceWorker.onmessage = (event) => { - console.log('Mensagem recebida do Service Worker:', event.data.data); + console.log('Mensagem recebida do Service Worker:', event.data); let object = { notification: event.data } @@ -347,7 +338,7 @@ export class HomePage implements OnInit { logDeviceInfo = async () => { const info = await Device.getInfo(); - /* console.log('DEVICE INFO ',info); */ + console.log('DEVICE INFO ',info); } updateList() { @@ -363,30 +354,30 @@ export class HomePage implements OnInit { } async synchWhenOnline() { - try { - await this.storage.get('eventEdit').then((req) => { - JSON.parse(req).forEach(element => { - this.eventservice.editEvent(element, 2, 3).subscribe((res) => { - this.storage.remove('eventEdit') - //this.sqliteservice.deleteeventsTable(); - }) - }); - }) - } catch (error) { + // try { + // await this.storage.get('eventEdit').then((req) => { + // JSON.parse(req).forEach(element => { + // this.eventservice.editEvent(element, 2, 3).subscribe((res) => { + // this.storage.remove('eventEdit') + // //this.sqliteservice.deleteeventsTable(); + // }) + // }); + // }) + // } catch (error) { - } + // } - try { - await this.storage.get('eventDelete').then((req) => { - JSON.parse(req).forEach(element => { - this.eventservice.deleteEvent(element.eventid, element.eventDeleteType, element.calendarName).subscribe((res) => { - this.storage.remove('eventDelete') - }) - }); - }) - } catch (error) { + // try { + // await this.storage.get('eventDelete').then((req) => { + // JSON.parse(req).forEach(element => { + // this.eventservice.deleteEvent(element.eventid, element.eventDeleteType, element.calendarName).subscribe((res) => { + // this.storage.remove('eventDelete') + // }) + // }); + // }) + // } catch (error) { - } + // } try { await this.storage.get('event-listRever').then((req) => { @@ -432,3 +423,10 @@ export class HomePage implements OnInit { } } + + + +window.onerror = function(message, source, lineno, colno, error) { + if (error) message = error.stack; + console.log('send', 'event', 'window.onerror', message, navigator.userAgent); +} diff --git a/src/app/infra/camera/adaptor.ts b/src/app/infra/camera/adaptor.ts new file mode 100644 index 000000000..f5f48b227 --- /dev/null +++ b/src/app/infra/camera/adaptor.ts @@ -0,0 +1,8 @@ +import { CameraSource } from "@capacitor/camera"; + +export interface ITakePictureParams { + width?: number, + height?: number, + quality: number, + source: CameraSource +} diff --git a/src/app/infra/camera/camera.service.ts b/src/app/infra/camera/camera.service.ts new file mode 100644 index 000000000..c73a4e32e --- /dev/null +++ b/src/app/infra/camera/camera.service.ts @@ -0,0 +1,38 @@ +import { Injectable } from '@angular/core'; +import { Camera, CameraResultType, CameraSource } from '@capacitor/camera'; +import { ITakePictureParams } from './adaptor'; +import { err, ok, Result } from 'neverthrow'; +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; +import { error } from '../../services/Either/index'; + +@Injectable({ + providedIn: 'root' +}) +export class CameraService { + + constructor() { } + + + async takePicture(data: ITakePictureParams, tracing?: TracingType): Promise> { + try { + tracing?.addEvent('take picture') + const capturedImage = await Camera.getPhoto({ + ...data, + // allowEditing: true, + resultType: CameraResultType.Base64, + }); + tracing?.addEvent('end take picture') + tracing.log('image log', { + base64: capturedImage.base64String + }) + return ok(capturedImage.base64String) + } catch(error) { + tracing?.log("camera error", { + error + }) + tracing?.hasError('capture image') + return err(error) + } + + } +} diff --git a/src/app/interceptors/chatToken.interceptor.ts b/src/app/interceptors/chatToken.interceptor.ts new file mode 100644 index 000000000..f440cb4a2 --- /dev/null +++ b/src/app/interceptors/chatToken.interceptor.ts @@ -0,0 +1,180 @@ +import { Injectable } from '@angular/core'; +import { + HttpInterceptor, + HttpRequest, + HttpHandler, + HttpEvent, + HttpErrorResponse, + HTTP_INTERCEPTORS, + HttpHeaders, +} from '@angular/common/http'; +import { Observable, throwError, BehaviorSubject } from 'rxjs'; +import { catchError, switchMap, filter, take } from 'rxjs/operators'; +import { HttpClient } from '@angular/common/http'; +import { Router } from '@angular/router'; +import { SessionStore } from '../store/session.service'; +import { environment } from "src/environments/environment"; +import { PermissionService } from '../services/permission.service'; +import { NetworkServiceService } from 'src/app/services/network-service.service'; +import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service'; + +@Injectable() +export class ChatTokenInterceptor implements HttpInterceptor { + private isRefreshing = false; + headers: HttpHeaders; + options: any; + private refreshChatTokenSubject: BehaviorSubject = new BehaviorSubject( + null + ); + + private excludedDomains = ['Login',environment.apiURL, 'http://localhost:8019'];// Add other domains as needed + + constructor(private http: HttpClient, private router: Router, private p: PermissionService, private NetworkServiceService: NetworkServiceService, + private RochetChatConnectorService: RochetChatConnectorService) { } + + intercept( + request: HttpRequest, + next: HttpHandler + ): Observable> { + if (this.shouldExcludeDomain(request)) { + return next.handle(request); + } + + if (SessionStore.user.Authorization) { + request = this.addToken(request, SessionStore.user.Authorization); + } + + return next.handle(request).pipe( + catchError((error) => { + if (error instanceof HttpErrorResponse && error.status === 401) { + return this.handle401Error(request, next); + } else { + return throwError(error); + } + }) + ); + } + + private shouldExcludeDomain(request: HttpRequest): boolean { + const url = request.url.toLowerCase(); + return this.excludedDomains.some((domain) => url.includes(domain.toLowerCase())); + } + + private handle401Error( + request: HttpRequest, + next: HttpHandler + ): Observable> { + if (!this.isRefreshing) { + this.isRefreshing = true; + this.refreshChatTokenSubject.next(null); + + return this.refreshToken().pipe( + switchMap((token: any) => { + this.isRefreshing = false; + + let data = { + status: token['status'], + data: { + userId: token['data'].userId, + authToken: token['data'].authToken + } + } + SessionStore.user.ChatData = data + SessionStore.save() + /* this.setheader() */ + + + + this.refreshChatTokenSubject.next(token.Authorization); + return next.handle(this.addToken(request, token.Authorization)); + }) + ); + } else { + return this.refreshChatTokenSubject.pipe( + filter((token) => token != null), + take(1), + switchMap((jwt) => { + return next.handle(this.addToken(request, jwt)); + }) + ); + } + } + + private addToken(request: HttpRequest, token: string) { + let headers = new HttpHeaders(); + + try { + + headers = headers.set('X-User-Id', SessionStore?.user?.ChatData?.data?.userId); + headers = headers.set('X-Auth-Token', SessionStore?.user?.ChatData?.data.authToken); + + return request.clone({ + setHeaders: { + Authorization: `Bearer ${token}`, + ...headers.keys().reduce((acc, key) => ({ ...acc, [key]: headers.get(key) }), {}), + }, + }) + } catch (error) { + + + return request.clone({ + setHeaders: { + Authorization: `Bearer ${token}`, + }, + }) + } + } + + /* private addToken(request: HttpRequest, token: string) { + return request.clone({ + setHeaders: { + Authorization: `Bearer ${token}`, + }, + }); + } */ + + private refreshToken(): Observable { + return this.http + .get(environment.apiURL + 'UserAuthentication/RegenereChatToken', { + /* refreshToken: SessionStore.user.RefreshToken, */ + }) + .pipe( + catchError((error) => { + // Handle token refresh failure + console.log('ChatToken refresh failed:', error); + return throwError(error); + }) + ); + } + + + + setheader() { + try { + + if (this.p.userPermission(this.p.permissionList.Chat.access) && SessionStore.user.ChatData) { + this.headers = new HttpHeaders();; + + if (this.p.userPermission(this.p.permissionList.Chat.access)) { + // + this.headers = this.headers.set('X-User-Id', SessionStore.user.ChatData.data.userId); + this.headers = this.headers.set('X-Auth-Token', SessionStore.user.ChatData.data.authToken); + this.options = { + headers: this.headers, + }; + + } + } + } catch (error) { + + } + } +} + + + +export const chatTokenInterceptor = { + provide: HTTP_INTERCEPTORS, + useClass: ChatTokenInterceptor, + multi: true +}; diff --git a/src/app/interceptors/metter.interceptor.ts b/src/app/interceptors/metter.interceptor.ts new file mode 100644 index 000000000..c5e951afe --- /dev/null +++ b/src/app/interceptors/metter.interceptor.ts @@ -0,0 +1,37 @@ +import { Injectable } from '@angular/core'; +import { HTTP_INTERCEPTORS, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { tap } from 'rxjs/operators'; +import { meter, RequestCounter } from '../services/monitoring/opentelemetry/matrix'; + + +@Injectable() +export class MetricsInterceptor implements HttpInterceptor { + intercept(req: HttpRequest, next: HttpHandler): Observable> { + return next.handle(req).pipe( + tap(event => { + if (event instanceof HttpResponse) { + // Capture the status code and check protocol + if (req.method !== 'GET' && !req.urlWithParams.includes('metrics')) { + + console.log('response', event.body) + const path = req.urlWithParams; + const url = new URL(path); + if (window.location.protocol !== 'https:') { + let attributes = { path: url.pathname, method: req.method }; + const statusCode = event.status; + const extendedAttributes = { ...attributes, status: statusCode }; + RequestCounter.add(1, extendedAttributes); + } + } + } + }) + ); + } +} + +export const metricsInterceptor = { + provide: HTTP_INTERCEPTORS, + useClass: MetricsInterceptor, + multi: true +}; diff --git a/src/app/interceptors/token.interceptors.ts b/src/app/interceptors/token.interceptors.ts index 1a4ad808d..2d8027338 100644 --- a/src/app/interceptors/token.interceptors.ts +++ b/src/app/interceptors/token.interceptors.ts @@ -8,12 +8,12 @@ import { HTTP_INTERCEPTORS, HttpClient, } from "@angular/common/http"; -import { AuthService } from '../services/auth.service'; import { Observable, throwError, BehaviorSubject, of } from "rxjs"; import { catchError, filter, take, switchMap, tap } from "rxjs/operators"; import { SessionStore } from '../store/session.service'; import { environment } from "src/environments/environment"; import { Router } from "@angular/router"; +import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; @Injectable() export class TokenInterceptor implements HttpInterceptor { @@ -22,9 +22,9 @@ export class TokenInterceptor implements HttpInterceptor { null ); - private excludedDomains = ['Login', environment.apiChatUrl]; // Add the domains you want to exclude + private excludedDomains = [ 'Login', environment.apiChatUrl, 'http://localhost:8019']; // Add the domains you want to exclude - constructor(private http: HttpClient, private router: Router,) { } + constructor(private http: HttpClient, private router: Router,private httpErrorHandle: HttpErrorHandle,) { } intercept( @@ -41,9 +41,13 @@ export class TokenInterceptor implements HttpInterceptor { } return next.handle(request).pipe( + catchError((error) => { + console.log('interceptor ',error) if (error instanceof HttpErrorResponse && error.status === 401) { return this.handle401Error(request, next); + } else if (error.url.includes('https://gdapi-dev.dyndns.info/stage/api/v2') && error.status === 0){ + return this.handle401Error(request, next); } else { return throwError(error); } @@ -118,9 +122,14 @@ export class TokenInterceptor implements HttpInterceptor { if (environment.production) { window.location.pathname = '/auth' } else { - /* const pathBeforeGoOut = window.location.pathname */ - this.router.navigateByUrl('/auth', { replaceUrl: true }); + const pathBeforeGoOut = window.location.pathname + console.log('Before auth',window.location.pathname) + this.router.navigateByUrl('/auth', { replaceUrl: true }).then(() =>{ + if(pathBeforeGoOut != "/auth") { + this.httpErrorHandle.httpsSucessMessagge('sessonExpired') + } + }) } return of(false); }) diff --git a/src/app/pages/agenda/evandre/evandre-routing.module.ts b/src/app/modals/crop-image/crop-image-routing.module.ts similarity index 65% rename from src/app/pages/agenda/evandre/evandre-routing.module.ts rename to src/app/modals/crop-image/crop-image-routing.module.ts index 3fb00a40b..44fc8145d 100644 --- a/src/app/pages/agenda/evandre/evandre-routing.module.ts +++ b/src/app/modals/crop-image/crop-image-routing.module.ts @@ -1,12 +1,12 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; -import { EvandrePage } from './evandre.page'; +import { CropImagePage } from './crop-image.page'; const routes: Routes = [ { path: '', - component: EvandrePage + component: CropImagePage } ]; @@ -14,4 +14,4 @@ const routes: Routes = [ imports: [RouterModule.forChild(routes)], exports: [RouterModule], }) -export class EvandrePageRoutingModule {} +export class CropImagePageRoutingModule {} diff --git a/src/app/modals/crop-image/crop-image.module.ts b/src/app/modals/crop-image/crop-image.module.ts new file mode 100644 index 000000000..bc7549919 --- /dev/null +++ b/src/app/modals/crop-image/crop-image.module.ts @@ -0,0 +1,22 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import { IonicModule } from '@ionic/angular'; + +import { CropImagePageRoutingModule } from './crop-image-routing.module'; + +import { CropImagePage } from './crop-image.page'; +import { ImageCropperModule } from 'ngx-image-cropper'; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + CropImagePageRoutingModule, + ImageCropperModule + ], + declarations: [CropImagePage] +}) +export class CropImagePageModule {} diff --git a/src/app/modals/crop-image/crop-image.page.html b/src/app/modals/crop-image/crop-image.page.html new file mode 100644 index 000000000..1207eab1c --- /dev/null +++ b/src/app/modals/crop-image/crop-image.page.html @@ -0,0 +1,42 @@ + + + cropImage + + + + + +
+ +
+ + + +
+ + + + + + + + + + + diff --git a/src/app/pages/agenda/evandre/evandre.page.scss b/src/app/modals/crop-image/crop-image.page.scss similarity index 100% rename from src/app/pages/agenda/evandre/evandre.page.scss rename to src/app/modals/crop-image/crop-image.page.scss diff --git a/src/app/pages/agenda/evandre/evandre.page.spec.ts b/src/app/modals/crop-image/crop-image.page.spec.ts similarity index 62% rename from src/app/pages/agenda/evandre/evandre.page.spec.ts rename to src/app/modals/crop-image/crop-image.page.spec.ts index adce8c07c..e1ad274d2 100644 --- a/src/app/pages/agenda/evandre/evandre.page.spec.ts +++ b/src/app/modals/crop-image/crop-image.page.spec.ts @@ -1,19 +1,19 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { IonicModule } from '@ionic/angular'; -import { EvandrePage } from './evandre.page'; +import { CropImagePage } from './crop-image.page'; -describe('EvandrePage', () => { - let component: EvandrePage; - let fixture: ComponentFixture; +describe('CropImagePage', () => { + let component: CropImagePage; + let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ EvandrePage ], + declarations: [ CropImagePage ], imports: [IonicModule.forRoot()] }).compileComponents(); - fixture = TestBed.createComponent(EvandrePage); + fixture = TestBed.createComponent(CropImagePage); component = fixture.componentInstance; fixture.detectChanges(); })); diff --git a/src/app/modals/crop-image/crop-image.page.ts b/src/app/modals/crop-image/crop-image.page.ts new file mode 100644 index 000000000..7476c9dae --- /dev/null +++ b/src/app/modals/crop-image/crop-image.page.ts @@ -0,0 +1,71 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ModalController } from '@ionic/angular'; +import { NavParams } from '@ionic/angular'; +import { ImageCroppedEvent, ImageCropperComponent } from 'ngx-image-cropper'; +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; + +@Component({ + selector: 'app-crop-image', + templateUrl: './crop-image.page.html', + styleUrls: ['./crop-image.page.scss'], +}) +export class CropImagePage implements OnInit { + + imageChangedEvent: any = ''; + croppedImage: any = ''; + @ViewChild('cropper') cropper: ImageCropperComponent; + capturedImage: any = ""; + base64ToCroppe = ""; + + constructor( + private navParams: NavParams, + private modalController: ModalController, + ) { + this.base64ToCroppe = this.navParams.get('base64ToCroppe') + console.log('To cropp',this.base64ToCroppe) + } + + ngOnInit() { + console.log('To cropp',this.base64ToCroppe) + } + + fileChangeEvent(event: any): void { + this.imageChangedEvent = event; + } + + @XTracerAsync({name:'crop-image/imageCropped', bugPrint: true, autoFinish: true}) + imageCropped(event: ImageCroppedEvent, tracing?: TracingType) { + this.croppedImage = event.base64; + + console.log('Croped image', event) + console.log('Croped image 22', this.croppedImage) + tracing.addEvent('Croped image') + tracing.setAttribute('outcome','success') + // event.blob can be used to upload the cropped image + } + + imageLoaded($event) { + + } + + loadImageFailed() { + console.log('cropp iage faile') + } + + @XTracerAsync({name:'crop-image/save', bugPrint: true, autoFinish: true}) + save(tracing?: TracingType) { + + this.modalController.dismiss({ + base64ToCroppe: this.croppedImage + }); + + tracing.addEvent('done') + + tracing.setAttribute('outcome','success') + } + + cancel() { + this.modalController.dismiss() + } + +} diff --git a/src/app/modals/delegar/delegar.page.ts b/src/app/modals/delegar/delegar.page.ts index c049f3cf0..f0ec93920 100644 --- a/src/app/modals/delegar/delegar.page.ts +++ b/src/app/modals/delegar/delegar.page.ts @@ -167,6 +167,7 @@ export class DelegarPage implements OnInit { modal.onDidDismiss().then((data) => { if(data) { + this.taskParticipants = [] data = data['data']; const newAttendees: EventPerson[] = data['taskParticipants']; const newAttendeesCC: EventPerson[] = data['taskParticipantsCc']; @@ -179,6 +180,7 @@ export class DelegarPage implements OnInit { await modal.present(); } else { + this.taskParticipants = [] this.showAttendees=true } } @@ -234,6 +236,7 @@ export class DelegarPage implements OnInit { dynamicSetIntervenient({taskParticipants}){ this.taskParticipants = taskParticipants; + this.showAttendees = false } diff --git a/src/app/pages/events/event-detail-modal/event-detail-modal-routing.module.ts b/src/app/modals/delete-event-recurrence/delete-event-recurrence-routing.module.ts similarity index 57% rename from src/app/pages/events/event-detail-modal/event-detail-modal-routing.module.ts rename to src/app/modals/delete-event-recurrence/delete-event-recurrence-routing.module.ts index bebfe4ea1..7661d98a9 100644 --- a/src/app/pages/events/event-detail-modal/event-detail-modal-routing.module.ts +++ b/src/app/modals/delete-event-recurrence/delete-event-recurrence-routing.module.ts @@ -1,12 +1,12 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; -import { EventDetailModalPage } from './event-detail-modal.page'; +import { DeleteEventRecurrencePage } from './delete-event-recurrence.page'; const routes: Routes = [ { path: '', - component: EventDetailModalPage + component: DeleteEventRecurrencePage } ]; @@ -14,4 +14,4 @@ const routes: Routes = [ imports: [RouterModule.forChild(routes)], exports: [RouterModule], }) -export class EventDetailModalPageRoutingModule {} +export class DeleteEventRecurrencePageRoutingModule {} diff --git a/src/app/modals/delete-event-recurrence/delete-event-recurrence.module.ts b/src/app/modals/delete-event-recurrence/delete-event-recurrence.module.ts new file mode 100644 index 000000000..8b4387c5b --- /dev/null +++ b/src/app/modals/delete-event-recurrence/delete-event-recurrence.module.ts @@ -0,0 +1,20 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import { IonicModule } from '@ionic/angular'; + +import { DeleteEventRecurrencePageRoutingModule } from './delete-event-recurrence-routing.module'; + +import { DeleteEventRecurrencePage } from './delete-event-recurrence.page'; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + DeleteEventRecurrencePageRoutingModule + ], + declarations: [DeleteEventRecurrencePage] +}) +export class DeleteEventRecurrencePageModule {} diff --git a/src/app/modals/delete-event-recurrence/delete-event-recurrence.page.html b/src/app/modals/delete-event-recurrence/delete-event-recurrence.page.html new file mode 100644 index 000000000..fa0d0ba52 --- /dev/null +++ b/src/app/modals/delete-event-recurrence/delete-event-recurrence.page.html @@ -0,0 +1,22 @@ + + +
Este é um evento recorrente
+
+ + + + + + + + + + +
+
diff --git a/src/app/modals/delete-event-recurrence/delete-event-recurrence.page.scss b/src/app/modals/delete-event-recurrence/delete-event-recurrence.page.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/modals/delete-event-recurrence/delete-event-recurrence.page.spec.ts b/src/app/modals/delete-event-recurrence/delete-event-recurrence.page.spec.ts new file mode 100644 index 000000000..5d354641b --- /dev/null +++ b/src/app/modals/delete-event-recurrence/delete-event-recurrence.page.spec.ts @@ -0,0 +1,24 @@ +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { DeleteEventRecurrencePage } from './delete-event-recurrence.page'; + +describe('DeleteEventRecurrencePage', () => { + let component: DeleteEventRecurrencePage; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DeleteEventRecurrencePage ], + imports: [IonicModule.forRoot()] + }).compileComponents(); + + fixture = TestBed.createComponent(DeleteEventRecurrencePage); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/modals/delete-event-recurrence/delete-event-recurrence.page.ts b/src/app/modals/delete-event-recurrence/delete-event-recurrence.page.ts new file mode 100644 index 000000000..a80c9b1fd --- /dev/null +++ b/src/app/modals/delete-event-recurrence/delete-event-recurrence.page.ts @@ -0,0 +1,26 @@ +import { Component, OnInit } from '@angular/core'; +import { ModalController } from '@ionic/angular'; + + +export type EventDeleteRecurrenceComponentReturn = 'DeleteAll' | 'DeleteOne' | 'Cancel' + +@Component({ + selector: 'app-delete-event-recurrence', + templateUrl: './delete-event-recurrence.page.html', + styleUrls: ['./delete-event-recurrence.page.scss'], +}) +export class DeleteEventRecurrencePage implements OnInit { + + constructor( + private modalController: ModalController + ) { } + + ngOnInit() { + } + + + + close(data: EventDeleteRecurrenceComponentReturn) { + this.modalController.dismiss(data) + } +} diff --git a/src/app/modals/document-detail/document-detail.page.html b/src/app/modals/document-detail/document-detail.page.html index 533cd81da..4e0a48e46 100644 --- a/src/app/modals/document-detail/document-detail.page.html +++ b/src/app/modals/document-detail/document-detail.page.html @@ -51,7 +51,7 @@ >
- {{LoadedDocument.Assunto}} + {{LoadedDocument.Assunto || 'Sem título'}}
{{ LoadedDocument.Sender }} diff --git a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html index 8e48ac78b..dc59f8fbf 100644 --- a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html +++ b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html @@ -21,7 +21,7 @@
O campo deve ter pelo menos 4 caracteres. @@ -35,15 +35,15 @@
- + - +
{{ environment.agendaPR}}
@@ -51,14 +51,34 @@
Agenda do {{calendars.Fullname}}
Minha agenda
- +
- +
- + + +
+
+
+ +
+
+ + + + + Agenda {{ calendars }} + + + + +
+
+
+
@@ -73,7 +93,7 @@ + + + Nunca + + + Diário + + + Semanalmente + + + Mensal + + + Anual + + + + +
+
+
+ + +
+
+
+ +
+ +
+ + + + + + + + +
+
+
+
@@ -194,7 +300,7 @@
- +

- {{document.Assunto}} + {{document.Assunto || document.SourceName}} {{ TaskService.attachmentAppName(document)}} {{document.appName}} @@ -353,7 +459,7 @@

- +
diff --git a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts index ef6a05478..cb0b4bd92 100644 --- a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts +++ b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts @@ -23,7 +23,13 @@ import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { environment } from 'src/environments/environment'; import { TaskService } from 'src/app/services/task.service' import { ContactsService } from 'src/app/services/contacts.service'; - +import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service'; +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; +import { Observable } from 'rxjs'; +import { TableSharedCalendar } from 'src/app/module/agenda/data/data-source/agenda-local-data-source.service'; +import { isHttpError } from 'src/app/services/http.service'; +import { RoleIdService } from 'src/app/services/role-id.service'; +import { Utils } from 'src/app/module/agenda/utils'; const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { parse: { @@ -97,25 +103,32 @@ export class DocumentSetUpMeetingPage implements OnInit { eventPipe = new EventPipe() CalendarName; CalendarNameShow = true - CalendarNamesOptions testeFormDefaul = "Eudes" environment = environment eventPersons: EventPerson[]; contacts: EventPerson[]; + sharedCalendar: Observable + selectedUserCalendar:any; + sessionStore = SessionStore; + hasChangeCalendar = false + eventRecurence = 'never'; + + CalendarNamesOptions = ['Oficial', 'Pessoal'] constructor( private modalController: ModalController, private router: Router, private navParams: NavParams, - authService: AuthService, private toastService: ToastService, private calendarService: EventsService, - private eventService: EventService, public ThemeService: ThemeService, public _eventService: EventsService, private httpErroHandle: HttpErrorHandle, public TaskService: TaskService, private contactsService: ContactsService, + private agendaDataRepository: AgendaDataRepositoryService, + public RoleIdService: RoleIdService, + public utils: Utils, ) { this.loggeduser = SessionStore.user; this.document = this.navParams.get('document') @@ -192,6 +205,14 @@ export class DocumentSetUpMeetingPage implements OnInit { this.changeAgenda() + this.postData.EventRecurrence = { + frequency: this.eventRecurence, + until: "", + Type: '' , + } + + this.postData.IsAllDayEvent = false; + } ngOnInit() { @@ -199,14 +220,36 @@ export class DocumentSetUpMeetingPage implements OnInit { this.setDefaultTime() this.getRecurrenceTypes(); this.fetchContacts("") - - + this.setCalendarByDefault(true) } ngOnDestroy() { clearInterval(this.myInterval) } + changeSegmentCalendar() { + this.hasChangeCalendar = true + } + + + async changeAgenda() { + + const result = await this.agendaDataRepository.geCalendars() + + const selectedCalendar = result.find(e => e.wxUserId == this.selectedUserCalendar) + + if(selectedCalendar) { + if(selectedCalendar.shareType == 1) { + this.CalendarNamesOptions = ['Oficial'] + } else if(selectedCalendar.shareType == 2) { + this.CalendarNamesOptions = ['Pessoal'] + } else if (selectedCalendar.shareType == 3) { + this.CalendarNamesOptions = ['Oficial', 'Pessoal'] + } + } + + } + myInterval = setInterval(() => { document.querySelectorAll('.ngx-mat-timepicker input').forEach((e: any) => { if (e) { @@ -270,7 +313,7 @@ export class DocumentSetUpMeetingPage implements OnInit { Validators.required ]), participantes: new FormControl(this.taskParticipants, [ - // Validators.required + Validators.required ]), Categories: new FormControl(this.postData.Category, [ // Validators.required @@ -279,34 +322,25 @@ export class DocumentSetUpMeetingPage implements OnInit { }) } - changeAgenda() { + async setCalendarByDefault(force) { + if (!this.selectedUserCalendar || force) { - this.CalendarNameShow = false - - setTimeout(() => { - - this.CalendarNameShow = true - - if (this._eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this._eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) { - - this.CalendarNamesOptions = ['Oficial', 'Pessoal'] - - } else if (this._eventService.calendarNamesType[this.CalendarName]?.['Oficial']) { - this.CalendarNamesOptions = ['Oficial'] - this.postData.CalendarName = 'Oficial' - - } else if (this._eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) { - this.CalendarNamesOptions = ['Pessoal'] - this.postData.CalendarName = 'Pessoal' + const data = await this.agendaDataRepository.geCalendars() + const prObject = data.find(e => e?.roleId == 100000014) + if(prObject) { + this.selectedUserCalendar = prObject.wxUserId } else { - this.CalendarNamesOptions = ['Oficial', 'Pessoal'] + this.selectedUserCalendar = SessionStore.user.UserId } - }, 50) + this.changeAgenda() + + } } - async saveTask() { + @XTracerAsync({name:'document-setup-metting', bugPrint: true}) + async saveTask(tracing?: TracingType) { if (this.loggeduser.Profile != 'PR') { this.injectValidation() @@ -314,49 +348,93 @@ export class DocumentSetUpMeetingPage implements OnInit { if (this.Form.invalid) return false } - let Attendees = this.taskParticipants.concat(this.taskParticipantsCc); - - let postEvent = { - EventId: '', - Subject: this.postData.Subject, - Body: this.postData.Body.Text, - Location: this.postData.Location, - CalendarId: this.selectedCalendarId(), - CalendarName: this.postData.CalendarName, - StartDate: this.postData.StartDate, - EndDate: this.postData.EndDate, - EventType: 'Reunião', - Attendees: Attendees, - IsMeeting: false, // - IsRecurring: this.postData.IsRecurring, - AppointmentState: 0, // - TimeZone: '', // - Organizer: '', // - Category: 'Reunião', - HasAttachments: false, - EventRecurrence: { - Type: this.EventRecurrenceType, - LastOccurrence: this.Occurrence, - }, - Attachments: this.attachments, - } + this.postData.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); const laoder = this.toastService.loading(); + const calendar = await this.agendaDataRepository.getCalendarByUserId(this.selectedUserCalendar) + if(calendar.isOk()) { + + const value = await this.agendaDataRepository.createEvent(this.postData, this.attachments, calendar.value, tracing, true) + if(value.isOk()) { - this.eventService.create({ body: postEvent, calendar: this.postData.CalendarName }).subscribe(async (respose) => { - laoder.remove(); this.httpErroHandle.httpsSucessMessagge('new event'); this.modalController.dismiss() - }, (error) => { - laoder.remove(); - this.httpErroHandle.httpStatusHandle(error) - }, () => { - laoder.remove(); - }); + } else { + + if(!isHttpError(value.error)) { + this.toastService._badRequest('Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico. #1') + console.log(value.error) + } else { + this.httpErroHandle.httpStatusHandle(value.error.status) + } + console.log('create event error: ', value.error) + tracing.setAttribute('outcome', 'failed') + } + + + } else { + + + tracing.setAttribute('outcome', 'failed') + tracing.setAttribute('no', 'this.selectedUserCalendar') + } + + laoder.remove(); } + onCheckboxChange(event: any) { + if (this.postData.IsAllDayEvent) { + this.postData.IsAllDayEvent = this.postData.IsAllDayEvent; + this.postData.StartDate = this.setAlldayTime(this.postData.StartDate) + this.postData.EndDate = this.setAlldayTimeEndDate(this.postData.EndDate) + + console.log('Recurso ativado!!'); + } else { + this.postData.IsAllDayEvent = this.postData.IsAllDayEvent; + this.postData.EndDate = this.setAlldayTimeEndDateNotAlday(this.postData.EndDate) + console.log('Recurso desativado'); + + } + } + + + + setAlldayTime(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(0) + date.setMinutes(0) + date.setSeconds(0); + + + return date + } + + setAlldayTimeEndDate(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(23) + date.setMinutes(59) + date.setSeconds(0); + + + return date + } + + setAlldayTimeEndDateNotAlday(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(23) + date.setMinutes(0) + date.setSeconds(0); + + + return date + } + + async addParticipants() { this.adding = "intervenient"; diff --git a/src/app/services/events/attachments/attachments-routing.module.ts b/src/app/modals/event-recurrence/event-recurrence-routing.module.ts similarity index 61% rename from src/app/services/events/attachments/attachments-routing.module.ts rename to src/app/modals/event-recurrence/event-recurrence-routing.module.ts index 4ea13a050..7c1a2322d 100644 --- a/src/app/services/events/attachments/attachments-routing.module.ts +++ b/src/app/modals/event-recurrence/event-recurrence-routing.module.ts @@ -1,12 +1,12 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; -import { AttachmentsPage } from './attachments.page'; +import { EventRecurrencePage } from './event-recurrence.page'; const routes: Routes = [ { path: '', - component: AttachmentsPage + component: EventRecurrencePage } ]; @@ -14,4 +14,4 @@ const routes: Routes = [ imports: [RouterModule.forChild(routes)], exports: [RouterModule], }) -export class AttachmentsPageRoutingModule {} +export class EventRecurrencePageRoutingModule {} diff --git a/src/app/services/events/attendees/attendees.module.ts b/src/app/modals/event-recurrence/event-recurrence.module.ts similarity index 50% rename from src/app/services/events/attendees/attendees.module.ts rename to src/app/modals/event-recurrence/event-recurrence.module.ts index f21feadb2..be0b1c935 100644 --- a/src/app/services/events/attendees/attendees.module.ts +++ b/src/app/modals/event-recurrence/event-recurrence.module.ts @@ -4,18 +4,17 @@ import { FormsModule } from '@angular/forms'; import { IonicModule } from '@ionic/angular'; -import { AttendeesPageRoutingModule } from './attendees-routing.module'; +import { EventRecurrencePageRoutingModule } from './event-recurrence-routing.module'; -import { AttendeesPageModal } from './attendees.page'; +import { EventRecurrencePage } from './event-recurrence.page'; @NgModule({ imports: [ CommonModule, FormsModule, IonicModule, - AttendeesPageRoutingModule + EventRecurrencePageRoutingModule ], - declarations: [AttendeesPageModal], - exports: [AttendeesPageModal] + declarations: [EventRecurrencePage] }) -export class AttendeesPageModule {} +export class EventRecurrencePageModule {} diff --git a/src/app/modals/event-recurrence/event-recurrence.page.html b/src/app/modals/event-recurrence/event-recurrence.page.html new file mode 100644 index 000000000..395ba7714 --- /dev/null +++ b/src/app/modals/event-recurrence/event-recurrence.page.html @@ -0,0 +1,22 @@ + + +
Este é um evento recorrente
+
+ + + + + + + + + + +
+
diff --git a/src/app/modals/event-recurrence/event-recurrence.page.scss b/src/app/modals/event-recurrence/event-recurrence.page.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/modals/event-recurrence/event-recurrence.page.spec.ts b/src/app/modals/event-recurrence/event-recurrence.page.spec.ts new file mode 100644 index 000000000..a13602171 --- /dev/null +++ b/src/app/modals/event-recurrence/event-recurrence.page.spec.ts @@ -0,0 +1,24 @@ +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { EventRecurrencePage } from './event-recurrence.page'; + +describe('EventRecurrencePage', () => { + let component: EventRecurrencePage; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ EventRecurrencePage ], + imports: [IonicModule.forRoot()] + }).compileComponents(); + + fixture = TestBed.createComponent(EventRecurrencePage); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/modals/event-recurrence/event-recurrence.page.ts b/src/app/modals/event-recurrence/event-recurrence.page.ts new file mode 100644 index 000000000..3dd9a3b7a --- /dev/null +++ b/src/app/modals/event-recurrence/event-recurrence.page.ts @@ -0,0 +1,22 @@ +import { Component, OnInit } from '@angular/core'; +import { ModalController } from '@ionic/angular'; + +export type EventRecurrenceComponentReturn = 'EditAll' | 'EditOne' | 'Cancel' + +@Component({ + selector: 'app-event-recurrence', + templateUrl: './event-recurrence.page.html', + styleUrls: ['./event-recurrence.page.scss'], +}) +export class EventRecurrencePage implements OnInit { + + constructor( + private modalController: ModalController + ) { } + + ngOnInit() {} + + close(data: EventRecurrenceComponentReturn) { + this.modalController.dismiss(data) + } +} diff --git a/src/app/modals/forward/forward.page.html b/src/app/modals/forward/forward.page.html index a9add5085..e29b40dee 100644 --- a/src/app/modals/forward/forward.page.html +++ b/src/app/modals/forward/forward.page.html @@ -52,7 +52,7 @@ -

{{attachment.Description}}

+

{{attachment.Description || 'Sem título'}}

{{attachment.Stakeholders}} {{ attachment.CreateDate | date: 'dd-MM-yyyy' }}

diff --git a/src/app/modals/profile/edit-profile/edit-profile.module.ts b/src/app/modals/profile/edit-profile/edit-profile.module.ts index 622248725..c905afab4 100644 --- a/src/app/modals/profile/edit-profile/edit-profile.module.ts +++ b/src/app/modals/profile/edit-profile/edit-profile.module.ts @@ -8,12 +8,26 @@ import { EditProfilePageRoutingModule } from './edit-profile-routing.module'; import { EditProfilePage } from './edit-profile.page'; + + + +import {MatMenuModule} from '@angular/material/menu'; +import {MatButtonModule} from '@angular/material/button'; +import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; + +import {MatIconModule} from '@angular/material/icon'; + @NgModule({ imports: [ CommonModule, FormsModule, IonicModule, - EditProfilePageRoutingModule + EditProfilePageRoutingModule, + + FontAwesomeModule, + MatMenuModule, + MatButtonModule, + MatIconModule, ], declarations: [EditProfilePage] }) diff --git a/src/app/modals/profile/edit-profile/edit-profile.page.html b/src/app/modals/profile/edit-profile/edit-profile.page.html index 8b36f5b01..9808fd404 100644 --- a/src/app/modals/profile/edit-profile/edit-profile.page.html +++ b/src/app/modals/profile/edit-profile/edit-profile.page.html @@ -58,39 +58,46 @@
-
+
+
+
-
- +
+ - - --> -
- -
- -
- - - - -
- + class="profile-pic" src="assets/images/theme/gov/icons-profile.svg"> + + +
+ +
+ +
+ + +
+ +
+
+ + + +
+
@@ -118,13 +125,13 @@
-
@@ -155,10 +166,7 @@
- + \ No newline at end of file + diff --git a/src/app/modals/profile/edit-profile/edit-profile.page.ts b/src/app/modals/profile/edit-profile/edit-profile.page.ts index a3a46df6a..59025bafe 100644 --- a/src/app/modals/profile/edit-profile/edit-profile.page.ts +++ b/src/app/modals/profile/edit-profile/edit-profile.page.ts @@ -6,12 +6,16 @@ import { SessionStore } from 'src/app/store/session.service'; import { environment } from 'src/environments/environment'; import { BackgroundService } from 'src/app/services/background.service'; import { ThemeService } from 'src/app/services/theme.service'; -import { Camera, CameraResultType, CameraSource, Photo } from '@capacitor/camera'; -import { Filesystem, Directory } from '@capacitor/filesystem'; -import { File } from '@awesome-cordova-plugins/file/ngx'; +import { CameraSource } from '@capacitor/camera'; import { StorageService } from 'src/app/services/storage.service'; -import { AttachmentsService } from 'src/app/services/attachments.service'; - +import { CameraService } from 'src/app/infra/camera/camera.service'; +import { ToastService } from 'src/app/services/toast.service'; +import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; +import { UserRepositoryService } from 'src/app/module/user/data/user-repository.service'; +import { isHttpError } from 'src/app/services/http.service'; +import { UserProfilePicture } from 'src/app/module/user/data/datasource/user-local-repository.service'; +import { Observable } from 'rxjs'; @Component({ selector: 'app-edit-profile', @@ -27,19 +31,28 @@ export class EditProfilePage implements OnInit { capturedImageTitle = ''; profilePicture = ""; + profilePictureSubject: Observable + camecaIcons = false + constructor(private modalController: ModalController, private animationController: AnimationController, public platform: Platform, private BackgroundService: BackgroundService, public ThemeService: ThemeService, - private file: File, private storageService: StorageService, - private attachmentService: AttachmentsService + private CameraService: CameraService, + private toastService: ToastService, + private httpErrorHandle: HttpErrorHandle, + private UserRepositoryService: UserRepositoryService - ) { } + ) { + this.profilePictureSubject = this.UserRepositoryService.getProfilePictureLive() as any + } ngOnInit() { - + setTimeout(() => { + this.camecaIcons = true + }, 100) this.getProfilpictureFromStorage(); } getProfilpictureFromStorage() { @@ -54,27 +67,7 @@ export class EditProfilePage implements OnInit { this.profilePicture = ""; }) } - /* getProfilpicture(guid) { - console.log('Get picture ', guid.path) - this.attachmentService.getUserProfilePhoto().subscribe(async (picture: any) => { - - console.log('Get picture ', picture) - this.storageService.store(this.SessionStore.user.RoleID.toString() + "guid", guid.path) - this.storageService.store(this.SessionStore.user.RoleID.toString(), picture).then((value) => { - this.profilePicture = picture - this.SessionStore.user.UserPhoto = picture; - - - console.log('picture saved') - }).catch((error) => { - console.log('picture not saved') - }); - - }, ((error) => { - console.log('Error get profile picture: ', error) - })) - - } */ + close() { this.modalController.dismiss(); @@ -171,48 +164,57 @@ export class EditProfilePage implements OnInit { this.BackgroundService.paint(); } + CameraSource = CameraSource + @XTracerAsync({name:'edit-profile/takePicture', bugPrint: true}) + async uploadPicture(source: CameraSource, tracing?: TracingType) { - async takePicture() { - const capturedImage = await Camera.getPhoto({ + const capturedImage = await this.CameraService.takePicture({ width: 250, height: 250, quality: 100, - // allowEditing: true, - resultType: CameraResultType.Base64, - source: CameraSource.Camera - }); + source: source + }, tracing) + + if(capturedImage.isOk()) { + + this.capturedImage = capturedImage.value; + var object = { + "ImageBase64": this.capturedImage + } + + tracing.addEvent('serialize image') + + const guid = await this.UserRepositoryService.addUserProfilePhoto(object) + + + if(guid.isOk()) { + tracing.addEvent('upload image') + + const base = await this.UserRepositoryService.getUserProfilePhoto(guid.value, tracing) + + if(base.isOk()) { + tracing.addEvent('download image') + this.profilePicture = 'data:image/jpeg;base64,' + base.value; + + tracing.setAttribute("picture.save", "true") + + } else { + if(!isHttpError(base.error)) { + this.toastService._badRequest('Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico.') + } else { + this.httpErrorHandle.httpStatusHandle(base.error) + } + } + } else { + + if(!isHttpError(guid.error)) { + this.toastService._badRequest('Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico.') + } else { + this.httpErrorHandle.httpStatusHandle(guid.error) + } + } - this.capturedImage = capturedImage.base64String; - var object = JSON.stringify({ - "ImageBase64": this.capturedImage } - ) - console.log('ATTACHME ', object) - - this.attachmentService.addUserProfilePhoto(object).subscribe((guid) => { - console.log('GUID ', guid) - console.log(this.SessionStore.user.RoleID.toString()) - - //get user profile picture base64 - this.attachmentService.getUserProfilePhoto(guid).subscribe((base) => { - console.log('before picture saved',base) - this.storageService.store(this.SessionStore.user.RoleID.toString(), 'data:image/jpeg;base64,'+base).then((value) => { - this.profilePicture = 'data:image/jpeg;base64,' + base; - - - console.log('picture saved',value) - }).catch((error) => { - console.log('picture not saved') - }); - - },(error) => { - console.log('profile picture erro: ', error) - }) - - /* this.getProfilpicture(guid); */ - }, ((error) => { - console.log('Erro Upload profile picture ', error) - })) } @@ -268,4 +270,3 @@ export class EditProfilePage implements OnInit { } } - diff --git a/src/app/modals/profile/profile.page.html b/src/app/modals/profile/profile.page.html index ea9778bcf..71b1cbc25 100644 --- a/src/app/modals/profile/profile.page.html +++ b/src/app/modals/profile/profile.page.html @@ -39,8 +39,8 @@
-
- +
-
+
+ src={{calendarData.base64}}>
- + + +
+ + + + +
+ +
+
diff --git a/src/app/modals/view-document-second-options/view-document-second-options.page.scss b/src/app/modals/view-document-second-options/view-document-second-options.page.scss new file mode 100644 index 000000000..d13f62918 --- /dev/null +++ b/src/app/modals/view-document-second-options/view-document-second-options.page.scss @@ -0,0 +1,27 @@ +.left{ + float: left; + } + .middle{ + float: left; + padding-left: 5px !important; + } + .right{ + float: right; + margin-left: auto; + } + + + .container-img { + background-image: url(/assets/gif/theme/gov/Blocks-loader.svg); + background-repeat: no-repeat; + background-position-x: center; + background-position-y: center; + } + + + @media only screen and (max-width: 650px) { + + .container-img { + background-size: 25%; + } + } \ No newline at end of file diff --git a/src/app/modals/view-document-second-options/view-document-second-options.page.spec.ts b/src/app/modals/view-document-second-options/view-document-second-options.page.spec.ts new file mode 100644 index 000000000..7e0ace560 --- /dev/null +++ b/src/app/modals/view-document-second-options/view-document-second-options.page.spec.ts @@ -0,0 +1,24 @@ +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { ViewDocumentSecondOptionsPage } from './view-document-second-options.page'; + +describe('ViewDocumentSecondOptionsPage', () => { + let component: ViewDocumentSecondOptionsPage; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ ViewDocumentSecondOptionsPage ], + imports: [IonicModule.forRoot()] + }).compileComponents(); + + fixture = TestBed.createComponent(ViewDocumentSecondOptionsPage); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/modals/view-document-second-options/view-document-second-options.page.ts b/src/app/modals/view-document-second-options/view-document-second-options.page.ts new file mode 100644 index 000000000..9b403ff3a --- /dev/null +++ b/src/app/modals/view-document-second-options/view-document-second-options.page.ts @@ -0,0 +1,40 @@ +import { Component, OnInit } from '@angular/core'; +import { DomSanitizer } from '@angular/platform-browser'; +import { ModalController, NavParams } from '@ionic/angular'; + +@Component({ + selector: 'app-view-document-second-options', + templateUrl: './view-document-second-options.page.html', + styleUrls: ['./view-document-second-options.page.scss'], +}) +export class ViewDocumentSecondOptionsPage implements OnInit { + + fileUrl: string; + filename: string; + completeUrl: string + trustedUrl: any; + + + constructor( + private modalController: ModalController, + private navParams: NavParams, + private sanitazer: DomSanitizer, + ) { + this.fileUrl = this.navParams.get('fileUrl'); + this.filename = this.navParams.get('filename'); + this.completeUrl = `/assets/www/pdfjs/web/viewer.html?file=${this.fileUrl}`; + } + + ngOnInit() { + console.log(this.fileUrl) + console.log(this.completeUrl) + + const link: string = this.completeUrl.replace('//pdfjs/web/', '/pdfjs/web/') + this.trustedUrl = this.sanitazer.bypassSecurityTrustResourceUrl(link); + } + + close() { + this.modalController.dismiss(); + } + +} diff --git a/src/app/modals/view-document/view-document.page.ts b/src/app/modals/view-document/view-document.page.ts index 5f32c03fd..4611b5ade 100644 --- a/src/app/modals/view-document/view-document.page.ts +++ b/src/app/modals/view-document/view-document.page.ts @@ -92,6 +92,55 @@ export class ViewDocumentPage implements OnInit { } + + // @XTracerAsync({name:'view-document/LoadViewer', bugPrint: true, daley: 4000}) + // async LoadViewer(tracing?: TracingType) { + // this.processes.GetViewer(this.docId, this.applicationId).subscribe(async(res)=> { + + // const link: string = res.replace('//pdfjs/web/', '/pdfjs/web/') + // this.trustedUrl = this.sanitazer.bypassSecurityTrustResourceUrl(link); + + // // const iframe = document.getElementById("iframe") + // // const handleLoad = () => { + // // this.loader = false + // // }; + + // // iframe.addEventListener('load', handleLoad, true) + + // if(res == "") { + // const alert = await this.alertController.create({ + // cssClass: 'my-custom-class', + // //header: 'Apagar evento!', + // message: 'Sem imagem', + // buttons: [ + // { + // text: 'Sim', + // handler: () => { + // this.close(); + // } + // } + // ] + // }); + // } + + // tracing.setAttribute('outcome', 'success') + + // }, (error)=>{ + // if(isHttpError(error)) { + // tracing?.setAttribute('status.code', error.status.toString()) + // if (error.status == 400) { + // tracing?.bugFlag() + // tracing?.setAttribute('outcome', 'failed') + // } + // } + // tracing.setAttribute('outcome', 'failed') + // this.close(); + // }); + + // } + + + close() { this.modalController.dismiss(); } diff --git a/src/app/modals/view-event/view-event.page.html b/src/app/modals/view-event/view-event.page.html index 5c570a082..3c3e17779 100644 --- a/src/app/modals/view-event/view-event.page.html +++ b/src/app/modals/view-event/view-event.page.html @@ -24,7 +24,7 @@

{{loadedEvent.Subject}}

-
- - - -
-
PR
-
MDGPR
-
Agenda do {{calendars.Fullname}}
-
- - Minha agenda -
+ + +
PR
+
+ Minha agenda +
+ + + + + + +
+
PR
+
MDGPR
+
Agenda {{calendars.wxFullName}}
+
+ Minha agenda
+
-
-
{{ environment.agendaPR}}
-
{{ environment.agendaVP}}
-
Agenda do {{calendars.Fullname}}
-
Minha agenda
+
+
{{ environment.agendaPR}}
+
{{ environment.agendaVP}}
+
Agenda {{calendars.wxFullName}}
+
+ Minha agenda
+
+ @@ -116,7 +125,7 @@ - diff --git a/src/app/pages/agenda/edit-event/edit-event.page.ts b/src/app/pages/agenda/edit-event/edit-event.page.ts index 04f8d0ddb..f47405907 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.ts +++ b/src/app/pages/agenda/edit-event/edit-event.page.ts @@ -1,13 +1,11 @@ import { Component, OnInit } from '@angular/core'; import { FormControl, FormGroup, Validators } from '@angular/forms'; -import { Router } from '@angular/router'; import { AlertController, ModalController, NavParams } from '@ionic/angular'; import { Attachment } from 'src/app/models/attachment.model'; import { EventBody } from 'src/app/models/eventbody.model'; import { EventPerson } from 'src/app/models/eventperson.model'; import { AttachmentsService } from 'src/app/services/attachments.service'; import { EventsService } from 'src/app/services/events.service'; -import { ToastService } from 'src/app/services/toast.service'; import { Event } from '../../../models/event.model'; import { AttendeesPageModal } from '../../events/attendees/attendees.page'; import { SearchPage } from '../../search/search.page'; @@ -18,7 +16,14 @@ import { SessionStore } from 'src/app/store/session.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service' import { environment } from 'src/environments/environment'; import { ContactsService } from 'src/app/services/contacts.service'; -import { DomSanitizerService } from 'src/app/services/DomSanitizer.service'; +import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service'; +import { TableSharedCalendar } from 'src/app/module/agenda/data/data-source/agenda-local-data-source.service'; +import { Observable } from 'rxjs'; +import { RoleIdService } from 'src/app/services/role-id.service' +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; +import { EventRecurrencePage, EventRecurrenceComponentReturn } from 'src/app/modals/event-recurrence/event-recurrence.page'; +import { Utils } from 'src/app/module/agenda/utils'; +import { AttendeesLIstChangeDetector } from 'src/app/module/agenda/data/async/change/attendeesLIstChangeDetector'; const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { parse: { @@ -31,6 +36,14 @@ const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { monthYearA11yLabel: "MMMM YYYY" } } + + +export interface EditEventPageParams { + eventId: string + caller?: string + closeModal: Boolean +} + @Component({ selector: 'app-edit-event', templateUrl: './edit-event.page.html', @@ -41,6 +54,8 @@ const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { }) export class EditEventPage implements OnInit { + static params: EditEventPageParams + Form: FormGroup; validateFrom = false @@ -56,11 +71,9 @@ export class EditEventPage implements OnInit { selectedDate: Date; initCalendarName: string; caller: string; - recurringTypes: any; selectedRecurringType: any; CalendarNameOwnerName = '' - CalendarNamesOptions = [] public date: any; public disabled = false; @@ -89,6 +102,18 @@ export class EditEventPage implements OnInit { sesseionStora = SessionStore environment = environment allDayCheck: boolean = false; + deletedAttachmentsList = []; + addedAttachmentsList = []; + + sharedCalendar: Observable + hasChangeCalendar = false + selectedUserCalendar:any; + SessionStore = SessionStore + serverCurrentList = [] + + CalendarNamesOptions = ['Oficial', 'Pessoal'] + editAllEvent = false + closeModal = false constructor( private modalController: ModalController, @@ -96,24 +121,27 @@ export class EditEventPage implements OnInit { public eventsService: EventsService, public alertController: AlertController, private attachmentsService: AttachmentsService, - private toastService: ToastService, - private router: Router, public ThemeService: ThemeService, private httpErrorHandle: HttpErrorHandle, private contactsService: ContactsService, - private domSanitazerService: DomSanitizerService + private agendaDataRepository: AgendaDataRepositoryService, + private utils: Utils, + public RoleIdService: RoleIdService, ) { /* this.postEvent = new Event(); */ this.isEventEdited = false; /* this.postEvent.EventRecurrence = { Type:'-1', LastOccurrence:''}; */ this.postEvent = this.navParams.get('event'); - this.postEvent.StartDate = new Date(this.ajustMinuts(this.postEvent.StartDate)) - this.postEvent.EndDate = new Date(this.ajustMinuts(this.postEvent.EndDate)) + this.serverCurrentList = this.postEvent.Attendees + console.log('this.postEvent', this.postEvent) this.caller = this.navParams.get('caller'); + this.closeModal = this.navParams.get('closeModal'); + this.initCalendarName = this.postEvent.CalendarName; this.allDayCheck = this.postEvent.IsAllDayEvent; + this.validationEditAllEvent() @@ -125,13 +153,15 @@ export class EditEventPage implements OnInit { this.postEvent.Attendees[index].UserType = userData.UserType } + console.log('jhv', this.postEvent.Category) + } if (this.postEvent) { if (this.postEvent.Body) { - if (typeof (this.postEvent.Body.Text) == 'string') { + if (typeof (this.postEvent?.Body?.Text) == 'string') { this.postEvent.Body.Text = this.postEvent.Body.Text.replace(/<[^>]+>/g, ''); } } @@ -150,21 +180,44 @@ export class EditEventPage implements OnInit { }) } - if (this.postEvent.IsRecurring == false) { + if (this.postEvent.EventRecurrence.frequency == 'never') { this.isRecurring = "Não se repete"; } else { this.isRecurring = "Repete"; } - this.getAttachments(this.postEvent.EventId); + this.loadedEventAttachments = this.postEvent?.Attachments + this.agendaDataRepository.getSharedCalendar() this.CalendarNameOwnerName = this.eventsService.detectCalendarNameByCalendarId(this.postEvent.CalendarId) this.changeAgenda() + this.sharedCalendar = this.agendaDataRepository.getShareCalendarItemsLiveWithOrder() + } + + hasPrCalendar(data: TableSharedCalendar[]) { + for(const e of data) { + if(e.roleId == this.RoleIdService.PRES) { + return true + } + } + + return false + } + changeSegmentCalendar() { + this.hasChangeCalendar = true } ngOnInit() { + this.selectedUserCalendar = this.postEvent.owner.wxUserId + + if (!this.postEvent.IsRecurring) { + this.postEvent.EventRecurrence.frequency = 'never' + } else { + this.postEvent.EventRecurrence.frequency = this.utils.recurenceTypeSeleted(this.postEvent.EventRecurrence.frequency) + } + this.postEvent.Category = this.setEventType(this.postEvent.Category) window.onresize = (event) => { // if not mobile remove all component @@ -176,7 +229,6 @@ export class EditEventPage implements OnInit { this.showAttendees = true; } - this.getRecurrenceTypes(); setTimeout(() => { this.selectedRecurringType = this.postEvent.EventRecurrence.Type.toString(); }, 500); @@ -204,20 +256,9 @@ export class EditEventPage implements OnInit { } cancel() { - this.modalController.dismiss({action:'cancel'}); + this.modalController.dismiss({ action: 'cancel' }); } - goBack() { - - this.router.navigate(['/home', this.caller]); - } - - getRecurrenceTypes() { - this.eventsService.getRecurrenceTypes().subscribe(res => { - - this.recurringTypes = res; - }); - } roundTimeQuarterHour(timeToReturn = new Date()) { let date = timeToReturn || new Date(); @@ -360,129 +401,178 @@ export class EditEventPage implements OnInit { } } + async validationEditAllEvent() { + if (this.postEvent.IsRecurring) { - async save() { + const modal = await this.modalController.create({ + component: EventRecurrencePage, + componentProps: {}, + cssClass: 'event-recurrence-modal', + }); + + modal.onDidDismiss().then((res) => { + + const data: EventRecurrenceComponentReturn = res.data + if(data =='EditAll') { + this.editAllEvent = true + } else if (data == 'EditOne') { + this.editAllEvent = false + } else if(data == 'Cancel') { + this.cancel() + } else { + this.cancel() + } + }); + + await modal.present(); + } + } + + + onDateChange(e) { + + const cloneDateStartDate = new Date(this.postEvent.StartDate); + const cloneDateEndDate = new Date(this.postEvent.EndDate); + + if(cloneDateStartDate.getTime() >= cloneDateEndDate.getTime()) { + cloneDateStartDate.setHours(cloneDateStartDate.getHours() + 1); + this.postEvent.EndDate = cloneDateStartDate + } + + } + + @XTracerAsync({name:'mobile/create-event', bugPrint: true, daley: 4000}) + async save_v2(tracing?: TracingType) { this.injectValidation() this.runValidation() - if (this.Form.invalid) return false; - if (this.selectedRecurringType != '-1') { - this.postEvent.EventRecurrence.Type = this.selectedRecurringType; + + + if (this.Form.invalid) { + return false } - - this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc) - this.postEvent.Subject = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Subject/* ) */; - this.postEvent.Location = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Location/* ) */; - this.postEvent.Body.Text = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Body.Text/* ) */; - - this.postEvent.EventRecurrence.Type = this.selectedRecurringType; - - if (this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') { - this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => { - - if (window['reloadCalendar']) { - window['reloadCalendar']() - } - - if (this.initCalendarName != this.postEvent.CalendarName) { - - let body = { - "EventId": this.postEvent.EventId, - "CalendarDestinationName": this.postEvent.CalendarName, - } - try { - await this.eventsService.changeAgenda(body).toPromise(); - } catch (error) { } - finally { - } - - } - - this.httpErrorHandle.httpsSucessMessagge('Editar evento') - - }, error => { - this.httpErrorHandle.httpStatusHandle(error) - }); - } else { - this.eventsService.editEvent(this.postEvent, 2, 3, this.postEvent.CalendarId).subscribe(async () => { - - if (window['reloadCalendar']) { - window['reloadCalendar']() - } - - if (this.initCalendarName != this.postEvent.CalendarName) { - - let body = { - "EventId": this.postEvent.EventId, - "CalendarDestinationName": this.postEvent.CalendarName, - } - try { - await this.eventsService.changeAgenda(body).toPromise(); - } catch (error) { } - finally { - } - - } - - this.httpErrorHandle.httpsSucessMessagge('Editar evento') - - }, error => { - this.httpErrorHandle.httpStatusHandle(error) - }); - } - - - - this.isEventEdited = true; - - - await this.saveDocument() - - this.goBack(); - } - - - async saveDocument() { - + this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); try { - for (let e of this.loadedEventAttachments) { - const id: any = e.Id - const remove = e['remove'] + const calendar = await this.agendaDataRepository.getCalendarByUserId(this.selectedUserCalendar) - if (id == 'add') { - //data.selected - const DocumentToSave = { - SourceTitle: e.SourceName, - ParentId: this.postEvent.EventId, - Source: '1', - SourceId: e.SourceId, - ApplicationId: e.ApplicationId.toString(), - Id: '0', - Link: '', - SerialNumber: '', - }; + if(calendar.isOk()) { + const _value = await this.agendaDataRepository.updateEvent(this.postEvent.EventId, this.postEvent, this.editAllEvent, calendar.value, tracing)//.subscribe((value) => { - // await this.attachmentsService.setEventAttachmentById(DocumentToSave).toPromise(); - } else if (remove) { - await this.attachmentsService.deleteEventAttachmentById(e.Id).toPromise() + + // _value.then((value) => { + // if(value.isOk()) { + // console.log(value.value) + // this.close(); + // this.httpErrorHandle.httpsSucessMessagge('Editar evento') + // tracing.setAttribute('outcome', 'success') + // } else { + + // tracing.setAttribute('outcome', 'failed') + // console.log('edit event error: ', value.error) + // } + // }) + + console.log({serverCurrentList: this.serverCurrentList, Attendees: this.postEvent.Attendees}) + + const { insert, remove } = AttendeesLIstChangeDetector(this.serverCurrentList as any, this.postEvent.Attendees as any) + + console.log({insert, remove }) + if(insert.length >= 1) { + + try { + await this.agendaDataRepository.addEventAttendee(this.postEvent.EventId, insert, tracing).toPromise() + } catch (error) { + tracing.setAttribute('failed.attendees', 'true') + console.log('add Attendee error: ', error) + } + + // this.agendaDataRepository.addEventAttendee(this.postEvent.EventId, insert, tracing).subscribe((value) => { + // console.log(value) + // }, ((error) => { + // tracing.setAttribute('failed.attendees', 'true') + // console.log('add Attendee error: ', error) + // })); + } + + if(remove.length >= 1) { + try { + await this.agendaDataRepository.removeEventAttendee(this.postEvent.EventId, remove).toPromise(); + } catch (error) { + tracing.setAttribute('failed.attendees', 'true') + console.log('add Attendee error: ', error) + } + + // this.agendaDataRepository.removeEventAttendee(this.postEvent.EventId, remove).subscribe((value) => { + // console.log(value) + // }, ((error) => { + // tracing.setAttribute('failed.attendees', 'true') + // console.log('add Attendee error: ', error) + // })); + + } + + + if (this.addedAttachmentsList.length > 0) { + try { + await this.agendaDataRepository.addEventAttachment(this.postEvent.EventId, this.loadedEventAttachments, tracing).toPromise(); + } catch (error) { + console.log('add attachment error: ', error) + } + + // this.agendaDataRepository.addEventAttachment(this.postEvent.EventId, this.loadedEventAttachments, tracing).subscribe((value) => { + // console.log(value) + // }, ((error) => { + // console.log('add attachment error: ', error) + // })); + } + + if (this.deletedAttachmentsList.length > 0) { + try { + await this.agendaDataRepository.removeEventAttachment(this.postEvent.EventId, { attachments: this.deletedAttachmentsList }).toPromise() + } catch (error) { + console.log('remove attachment error: ', error) + tracing.setAttribute('failed.remove.attachment', 'true') + } + + // this.agendaDataRepository.removeEventAttachment(this.postEvent.EventId, { attachments: this.deletedAttachmentsList }).subscribe((value) => { + // console.log(value) + // }, ((error) => { + // console.log('remove attachment error: ', error) + // tracing.setAttribute('failed.remove.attachment', 'true') + // })); + } + + if(_value.isOk()) { + console.log(_value.value) + this.close(); + this.httpErrorHandle.httpsSucessMessagge('Editar evento') + tracing.setAttribute('outcome', 'success') + } else { + tracing.setAttribute('outcome', 'failed') + console.log('edit event error: ', _value.error) + } + + + this.isEventEdited = true; + } else { + console.log(calendar.error) } + + + } catch (error) { - - } finally { - + this.httpErrorHandle.httpStatusHandle(error) + console.log('edit: ', error) } - this.modalController.dismiss({ - isEventEdited: this.isEventEdited, - postEvent: this.postEvent - }); - } + + async openAttendees() { if (window.innerWidth > 801) { this.showAttendees = true; @@ -556,7 +646,7 @@ export class EditEventPage implements OnInit { if (this.postEvent.HasAttachments) { this.attachmentsService.getAttachmentsById(eventId).subscribe(res => { - this.loadedEventAttachments = res; + // this.loadedEventAttachments = res; }, ((erro) => { console.error('editgetAttchament', erro) @@ -567,18 +657,21 @@ export class EditEventPage implements OnInit { } deleteAttachment(attachmentID: string, index) { + const indexToRemove = index; // Assuming you already know the index you want to remove - const id: any = this.loadedEventAttachments[index].Id - - if (id == 'add') { - this.loadedEventAttachments = this.loadedEventAttachments.filter((e, i) => i != index) - } else { - this.loadedEventAttachments[index]['remove'] = true + const DocumentId: any = this.loadedEventAttachments[index].Id + if (indexToRemove > -1 && indexToRemove < this.loadedEventAttachments.length) { + this.loadedEventAttachments.splice(indexToRemove, 1); } + this.deletedAttachmentsList.push(DocumentId) } + removeItemById(array, id) { + return array.filter(item => item.docId !== id); + } + async getDoc() { const modal = await this.modalController.create({ component: SearchPage, @@ -586,6 +679,7 @@ export class EditEventPage implements OnInit { componentProps: { type: 'AccoesPresidenciais & ArquivoDespachoElect', showSearchInput: true, + eventAgenda: true, select: true, } }); @@ -594,7 +688,7 @@ export class EditEventPage implements OnInit { if (res) { const data = res.data; - const ApplicationIdDocumentToSave: any = { + /* const ApplicationIdDocumentToSave: any = { SourceName: data.selected.Assunto, ParentId: this.postEvent.EventId, SourceId: data.selected.Id, @@ -607,11 +701,11 @@ export class EditEventPage implements OnInit { Source: '1', Link: '', SerialNumber: '', - } + } */ - this.loadedEventAttachments.push(ApplicationIdDocumentToSave) - this.postEvent.Attachments = this.loadedEventAttachments; + this.loadedEventAttachments.push(data.selected) + this.addedAttachmentsList.push(data.selected) } }) @@ -620,62 +714,80 @@ export class EditEventPage implements OnInit { } - changeAgenda() { + async changeAgenda() { - setTimeout(() => { + const result = await this.agendaDataRepository.geCalendars() - if (this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Oficial'] && this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Pessoal']) { + const selectedCalendar = result.find(e => e.wxUserId == this.selectedUserCalendar) - this.CalendarNamesOptions = ['Oficial', 'Pessoal'] - - } else if (this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Oficial']) { + if(selectedCalendar) { + if(selectedCalendar.shareType == 1) { this.CalendarNamesOptions = ['Oficial'] - this.postEvent.CalendarName = 'Oficial' - - } else if (this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Pessoal']) { + } else if(selectedCalendar.shareType == 2) { this.CalendarNamesOptions = ['Pessoal'] - this.postEvent.CalendarName = 'Pessoal' - - } else { + } else if (selectedCalendar.shareType == 3) { this.CalendarNamesOptions = ['Oficial', 'Pessoal'] } - }, 50) + } } - ajustMinuts(string) { - var partes = string.split(' '); - var horaMinuto = partes[1].split(':'); - if (horaMinuto[1] === '59') { - horaMinuto[1] = '00'; - var novaString = partes[0] + ' ' + horaMinuto.join(':'); + onCheckboxChange(event: any) { - return novaString; - } - return string; - } + if (this.allDayCheck) { + this.postEvent.IsAllDayEvent = this.allDayCheck; + this.postEvent.StartDate = this.setAlldayTime(this.postEvent.StartDate) + this.postEvent.EndDate = this.setAlldayTimeEndDate(this.postEvent.EndDate) + + console.log('Recurso ativado!!'); + } else { + this.postEvent.IsAllDayEvent = this.allDayCheck; + this.postEvent.EndDate = this.setAlldayTimeEndDateNotAlday(this.postEvent.EndDate) + console.log('Recurso desativado'); - onCheckboxChange(event: any) { - if (this.allDayCheck) { - this.postEvent.IsAllDayEvent = this.allDayCheck; - this.postEvent.StartDate = this.setAlldayTime(this.postEvent.StartDate) - - console.log('Recurso ativado!!'); - } else { - this.postEvent.IsAllDayEvent = this.allDayCheck; - console.log('Recurso desativado'); - - } } - - setAlldayTime(timeToReturn) { - let date: any = new Date(timeToReturn) || new Date(); - let newdate = new Date(); - date.setHours(0) - date.setMinutes(0) - date.setSeconds(0); - - - return date + } + + setAlldayTime(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(0) + date.setMinutes(0) + date.setSeconds(0); + + + return date + } + + setAlldayTimeEndDate(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(23) + date.setMinutes(59) + date.setSeconds(0); + + + return date + } + + setAlldayTimeEndDateNotAlday(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(23) + date.setMinutes(0) + date.setSeconds(0); + + + return date + } + + setEventType(eventType) { + var selectedEventType = { + 1: 'Meeting', + 2: 'Travel', + 3: 'Conference', + 4: 'Encontro' } + return selectedEventType[eventType]; + } } diff --git a/src/app/pages/agenda/evandre/evandre.module.ts b/src/app/pages/agenda/evandre/evandre.module.ts deleted file mode 100644 index 8a20cd1c2..000000000 --- a/src/app/pages/agenda/evandre/evandre.module.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; - -import { IonicModule } from '@ionic/angular'; - -import { EvandrePageRoutingModule } from './evandre-routing.module'; - -import { EvandrePage } from './evandre.page'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - EvandrePageRoutingModule - ], - declarations: [EvandrePage] -}) -export class EvandrePageModule {} diff --git a/src/app/pages/agenda/evandre/evandre.page.html b/src/app/pages/agenda/evandre/evandre.page.html deleted file mode 100644 index 0cc537051..000000000 --- a/src/app/pages/agenda/evandre/evandre.page.html +++ /dev/null @@ -1,9 +0,0 @@ - - - evandre - - - - - - diff --git a/src/app/pages/agenda/evandre/evandre.page.ts b/src/app/pages/agenda/evandre/evandre.page.ts deleted file mode 100644 index ff0b84c65..000000000 --- a/src/app/pages/agenda/evandre/evandre.page.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-evandre', - templateUrl: './evandre.page.html', - styleUrls: ['./evandre.page.scss'], -}) -export class EvandrePage implements OnInit { - - constructor() { } - - ngOnInit() { - } - -} diff --git a/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.html b/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.html index b060c378b..1a72816bd 100644 --- a/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.html +++ b/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.html @@ -8,11 +8,9 @@
- - - -
- - + + + +
diff --git a/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts b/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts index c18a9cef6..6fd1b6e8a 100644 --- a/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts +++ b/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts @@ -8,6 +8,7 @@ import { ThemeService } from 'src/app/services/theme.service' import { RouteService } from 'src/app/services/route.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { TaskService } from 'src/app/services/task.service' +import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service'; @Component({ @@ -16,28 +17,31 @@ import { TaskService } from 'src/app/services/task.service' styleUrls: ['./event-actions-popover.page.scss'], }) export class EventActionsPopoverPage implements OnInit { - serialNumber:string; + serialNumber: string; instanceId: string; activityInstanceName: string constructor( private navParams: NavParams, - private processes:ProcessesService, + private processes: ProcessesService, private modalController: ModalController, private popoverController: PopoverController, private toastService: ToastService, private RouteService: RouteService, private httpErrorHandle: HttpErrorHandle, public ThemeService: ThemeService, - public TaskService: TaskService) { - this.serialNumber = this.navParams.get('serialNumber'); - this.instanceId = this.navParams.get('InstanceId'); - this.activityInstanceName = this.navParams.get('InstanceId'); + public TaskService: TaskService, + private agendaDataRepository: AgendaDataRepositoryService) { + this.serialNumber = this.navParams.get('serialNumber'); + this.instanceId = this.navParams.get('InstanceId'); + this.activityInstanceName = this.navParams.get('InstanceId'); } ngOnInit() { + + console.log('Teste tes',this.activityInstanceName) window.onresize = (event) => { - if( window.innerWidth >= 800){ + if (window.innerWidth >= 800) { this.popoverController.dismiss(); } }; @@ -55,27 +59,29 @@ export class EventActionsPopoverPage implements OnInit { async approveTask() { let body = { "serialNumber": this.serialNumber, "action": "Aprovar" } - - + const loader = this.toastService.loading() - try { - await this.processes.PostTaskAction(body).toPromise() - this.TaskService.loadEventosParaAprovacao() - this.httpErrorHandle.httpsSucessMessagge('Evento aprovação') - this.goBack(); - } catch (error) { - this.httpErrorHandle.httpStatusHandle(error) - } - finally { + + const value = await this.agendaDataRepository.approveEvent(this.serialNumber)// .subscribe((value) => { + if(value.isOk()) { + + console.log(value.value) + this.TaskService.loadEventosParaAprovacao() + this.httpErrorHandle.httpsSucessMessagge('Evento aprovação') + this.goBack(); + } else { + + console.log('aprove event error: ', value.error) + this.httpErrorHandle.httpStatusHandle(value.error) + } loader.remove() - } } async ReenviarTask() { let body = { "serialNumber": this.serialNumber, "action": "Reenviar" } - - + + const loader = this.toastService.loading() try { await this.processes.PostTaskAction(body).toPromise() @@ -93,10 +99,10 @@ export class EventActionsPopoverPage implements OnInit { async emendarTask() { this.closePopover(); - + const modal = await this.modalController.create({ component: EmendMessageModalPage, - componentProps:{ + componentProps: { }, cssClass: 'emend-message-modal', backdropDismiss: false @@ -104,36 +110,37 @@ export class EventActionsPopoverPage implements OnInit { modal.onDidDismiss() - .then( async (res) => { - - - if(res.data.option == 'save') { - let body = { "serialNumber": this.serialNumber, - "action": "Emendar", - "dataFields": { + .then(async (res) => { + + + if (res.data.option == 'save') { + let body = { + "serialNumber": this.serialNumber, + "action": "Emendar", + "dataFields": { "ReviewUserComment": res.data, } } - - + + const loader = this.toastService.loading() - - try { - await this.processes.PostTaskAction(body).toPromise(); + + + const result = await this.agendaDataRepository.eventToaprovalStatus(this.serialNumber, 'Revision', res.data.note)// .subscribe((value) => { + if(result.isOk()) { this.httpErrorHandle.httpsSucessMessagge('Rever') this.TaskService.loadEventosParaAprovacao() this.goBack(); - } catch (error) { - this.httpErrorHandle.httpStatusHandle(error) + } else { + console.log('send event to revision error: ', result.error) + this.httpErrorHandle.httpStatusHandle(result.error) } - finally { - loader.remove() - } - } else { - - } + loader.remove() + } else { - }); + } + + }); await modal.present(); @@ -143,17 +150,16 @@ export class EventActionsPopoverPage implements OnInit { let body = { "serialNumber": this.serialNumber, "action": "Descartar" } const loader = this.toastService.loading(); - try { - await this.processes.PostTaskAction(body).toPromise(); + const result = await this.agendaDataRepository.deleteEvent(this.serialNumber, true)//.subscribe((value) => { + if(result.isOk()) { this.TaskService.loadEventosParaAprovacao() - this.httpErrorHandle.httpsSucessMessagge('Rejeitar') + this.httpErrorHandle.httpsSucessMessagge('delete event') this.goBack(); - } catch (error) { - this.httpErrorHandle.httpStatusHandle(error) - } - finally { - loader.remove(); + } else { + console.log('reject event error: ', result.error) + this.httpErrorHandle.httpStatusHandle(result.error) } + loader.remove(); } @@ -171,10 +177,10 @@ export class EventActionsPopoverPage implements OnInit { }); - modal.onDidDismiss().then(res => {}); + modal.onDidDismiss().then(res => { }); await modal.present(); } - + } diff --git a/src/app/pages/agenda/new-event/new-event.page.html b/src/app/pages/agenda/new-event/new-event.page.html index 8a71d5f0e..1a311a6d8 100644 --- a/src/app/pages/agenda/new-event/new-event.page.html +++ b/src/app/pages/agenda/new-event/new-event.page.html @@ -19,7 +19,7 @@
-
+
@@ -27,24 +27,21 @@
- +
PR
+
+ Minha agenda +
+ - - -
{{ environment.agendaPR}}
-
{{ environment.agendaVP}}
-
Agenda do {{calendars.Fullname}}
-
- + + +
PR
+
AGENDA DO MDGPR
+
Agenda {{calendars.wxFullName}}
+
Minha agenda -
+
+
@@ -93,13 +90,13 @@ - + Reunião - + Viagem - + Conferência @@ -120,7 +117,69 @@
- + +
+
+
+ +
+
+ + + + + + Nunca + + + Diário + + + Semanalmente + + + Mensal + + + Anual + + + + +
+
+
+ +
+
+
+ +
+ +
+ + + + + + + + +
+
+
+
@@ -129,34 +188,49 @@
-
+
- + + + + + + +
+ +
+ + @@ -164,7 +238,6 @@
-
@@ -194,28 +267,29 @@
- - -
+
-
- - +
+ + + - - + @@ -274,7 +348,7 @@
--> - +
@@ -306,18 +380,22 @@

- {{document.Assunto}} - {{document.appName}} + {{document.subject}} + + Correspondência + Acções Presidenciais + Arquivo Despacho Electrónico +

-

{{(document.EntidadeOrganicaNome || document.Sender)}} {{(document.Data || document.DocDate) | date: 'dd-MM-yyyy HH:mm'}}

+

{{(document.EntidadeOrganicaNome || document.Sender)}} {{(document.dateEntry || document.DocDate) | date: 'dd-MM-yyyy HH:mm'}}

- - +
- @@ -349,6 +427,6 @@ Cancelar - + diff --git a/src/app/pages/agenda/new-event/new-event.page.ts b/src/app/pages/agenda/new-event/new-event.page.ts index 4235073ba..8726bcb44 100644 --- a/src/app/pages/agenda/new-event/new-event.page.ts +++ b/src/app/pages/agenda/new-event/new-event.page.ts @@ -1,30 +1,32 @@ import { Component, OnInit } from '@angular/core'; import { ModalController, NavParams, Platform } from '@ionic/angular'; -import { EventAttachment } from 'src/app/models/attachment.model'; import { EventBody } from 'src/app/models/eventbody.model'; import { EventPerson } from 'src/app/models/eventperson.model'; import { SearchList } from 'src/app/models/search-document'; import { LoginUserRespose } from 'src/app/models/user.model'; -import { AttachmentsService } from 'src/app/services/attachments.service'; import { EventsService } from 'src/app/services/events.service'; import { ToastService } from 'src/app/services/toast.service'; import { Event } from '../../../models/event.model'; import { AttendeesPageModal } from '../../events/attendees/attendees.page'; import { SearchPage } from '../../search/search.page'; -import { ThemePalette } from '@angular/material/core'; import { FormControl, FormGroup, Validators } from '@angular/forms'; import { ThemeService } from 'src/app/services/theme.service'; import { NgxMatDateFormats } from '@angular-material-components/datetime-picker'; import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker'; import { SessionStore } from 'src/app/store/session.service'; -import { ChatMethodsService } from 'src/app/services/chat/chat-methods.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { environment } from 'src/environments/environment'; import { ProcessesService } from 'src/app/services/processes.service'; import { TaskService } from 'src/app/services/task.service' import { ContactsService } from 'src/app/services/contacts.service'; -import { DomSanitizerService } from 'src/app/services/DomSanitizer.service'; -import { momentG } from 'src/plugin/momentG'; +import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE, ThemePalette } from '@angular/material/core'; +import { MomentDateAdapter } from '@angular/material-moment-adapter'; +import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service'; +import { Observable } from 'rxjs'; +import { TableSharedCalendar } from 'src/app/module/agenda/data/data-source/agenda-local-data-source.service'; +import { map } from 'rxjs/operators'; +import { RoleIdService } from 'src/app/services/role-id.service' +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { parse: { @@ -37,12 +39,25 @@ const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { monthYearA11yLabel: "MMMM YYYY" } } +const MY_DATE_FORMAT = { + parse: { + dateInput: 'DD-MM-YYYY', + }, + display: { + dateInput: 'DD/MM/YYYY', + monthYearLabel: 'MMMM YYYY', + dateA11yLabel: 'LL', + monthYearA11yLabel: 'MMMM YYYY' + } +}; @Component({ selector: 'app-new-event', templateUrl: './new-event.page.html', styleUrls: ['./new-event.page.scss'], providers: [ { provide: NGX_MAT_DATE_FORMATS, useValue: CUSTOM_DATE_FORMATS }, + { provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE] }, + { provide: MAT_DATE_FORMATS, useValue: MY_DATE_FORMAT } ] }) @@ -70,7 +85,6 @@ export class NewEventPage implements OnInit { selectedSegment: string; selectedDate: Date; CalendarDate: Date; - recurringTypes: any; selectedRecurringType: any; adding: "intervenient" | "CC"; @@ -99,22 +113,26 @@ export class NewEventPage implements OnInit { eventPersons: EventPerson[]; contacts: EventPerson[]; allDayCheck: boolean = false; + eventRecurence = 'never'; + sharedCalendar: Observable + selectedUserCalendar:any; + + hasChangeCalendar = false constructor( private modalController: ModalController, private navParams: NavParams, public eventService: EventsService, - private attachmentsService: AttachmentsService, private toastService: ToastService, public ThemeService: ThemeService, private platform: Platform, - private chatMethodService: ChatMethodsService, private hhtpErrorHandle: HttpErrorHandle, private processeService: ProcessesService, public TaskService: TaskService, private contactsService: ContactsService, - private domSanitazerService: DomSanitizerService + private agendaDataRepository: AgendaDataRepositoryService, + public RoleIdService: RoleIdService, ) { this.loggeduser = SessionStore.user; this.postEvent = new Event(); @@ -127,6 +145,55 @@ export class NewEventPage implements OnInit { this.selectedDate = this.navParams.get('eventSelectedDate'); this.taskParticipants = this.navParams.get('attendees'); this.CalendarDate = this.navParams.get('CalendarDate') + + // Define the role priorities + const rolePriorities: { [key: number]: number } = { + 100000014: 1, // Presidente da República + 100000011: 2, // Vice Presidente (example role ID) + // Add other roles with their priorities here + }; + + this.agendaDataRepository.getSharedCalendar() + + this.sharedCalendar = this.agendaDataRepository.getShareCalendarItemsLive().pipe( + map(data => data.sort((a, b) => { + console.log('Raw data:', data); // Debug line + const priorityA = rolePriorities[a.roleId] || Infinity; + const priorityB = rolePriorities[b.roleId] || Infinity; + return priorityA - priorityB; + })) + ) + + + this.setCalendarByDefault(true) + } + + + hasPrCalendar(data: TableSharedCalendar[]) { + for(const e of data) { + if(e.roleId == this.RoleIdService.PRES) { + return true + } + } + + return false + } + changeSegmentCalendar() { + this.hasChangeCalendar = true + } + async setCalendarByDefault(force) { + if (!this.selectedUserCalendar || force) { + + const data = await this.agendaDataRepository.geCalendars() + + const prObject = data.find(e => e?.roleId == 100000014) + if(prObject) { + this.selectedUserCalendar = prObject.wxUserId + } else { + this.selectedUserCalendar = SessionStore.user.UserId + } + + } } ngOnInit() { @@ -147,8 +214,6 @@ export class NewEventPage implements OnInit { this.selectedRecurringType = "-1"; - this.getRecurrenceTypes(); - if (this.selectedSegment != "Combinada") { this.postEvent = { EventId: '', @@ -166,9 +231,10 @@ export class NewEventPage implements OnInit { AppointmentState: 0, TimeZone: '', Organizer: '', - Category: 'Reunião', + Category: 'Meeting', HasAttachments: false, - EventRecurrence: { Type: '-1', LastOccurrence: this.autoEndTime }, + EventRecurrence: { frequency: this.eventRecurence, until: "", + Type: '' }, }; } else { @@ -188,9 +254,10 @@ export class NewEventPage implements OnInit { AppointmentState: 0, TimeZone: '', Organizer: '', - Category: 'Reunião', + Category: 'Meeting', HasAttachments: false, - EventRecurrence: { Type: '-1', LastOccurrence: this.autoEndTime }, + EventRecurrence: { frequency: this.eventRecurence, until: "", + Type: '' }, }; } @@ -276,11 +343,16 @@ export class NewEventPage implements OnInit { } - getRecurrenceTypes() { - this.eventService.getRecurrenceTypes().subscribe(res => { + onDateChange(e) { + + const cloneDateStartDate = new Date(this.postEvent.StartDate); + const cloneDateEndDate = new Date(this.postEvent.EndDate); + + if(cloneDateStartDate.getTime() >= cloneDateEndDate.getTime()) { + cloneDateStartDate.setHours(cloneDateStartDate.getHours() + 1); + this.postEvent.EndDate = cloneDateStartDate + } - this.recurringTypes = res; - }); } onSelectedRecurringChanged(ev: any) { @@ -374,9 +446,9 @@ export class NewEventPage implements OnInit { participantes: new FormControl(this.taskParticipants, [ Validators.required ]), - dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok'] : this.postEvent.EventRecurrence.LastOccurrence && new Date(this.postEvent.EventRecurrence.LastOccurrence).getTime() > new Date(this.postEvent.EndDate).getTime() ? 'ok' : null, [ + /* dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok'] : this.postEvent.EventRecurrence.LastOccurrence && new Date(this.postEvent.EventRecurrence.LastOccurrence).getTime() > new Date(this.postEvent.EndDate).getTime() ? 'ok' : null, [ Validators.required - ]), + ]), */ }) @@ -404,152 +476,82 @@ export class NewEventPage implements OnInit { } } - async save() { + @XTracerAsync({name:'Mobile/create-event', bugPrint: true}) + async save_v2(tracing?: TracingType) { this.injectValidation() this.runValidation() + console.log(new Date(this.postEvent.StartDate).getTime()) + console.log(new Date(this.postEvent.EndDate).getTime()) + console.log(new Date(this.postEvent.StartDate).getTime() < new Date(this.postEvent.EndDate).getTime() ? 'ok' : null) if (this.Form.invalid) { + + /* if (new Date(this.postEvent.StartDate).getTime() < new Date(this.postEvent.EndDate).getTime()) { + this.toastService._badRequest("Data de inicio menor que a data de fim") + } */ + return false } - if (this.documents.length >= 0) { - this.postEvent.HasAttachments = true; - } - if (this.selectedRecurringType != '-1') { - this.postEvent.EventRecurrence.Type = this.selectedRecurringType; - } + const calendar = await this.agendaDataRepository.getCalendarByUserId(this.selectedUserCalendar) + if(calendar.isOk()) { + const loader = this.toastService.loading() + this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); + this.postEvent.IsAllDayEvent = this.allDayCheck; - this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); - this.postEvent.Subject = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Subject/* ); */ - this.postEvent.Location = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Location/* ); */ - this.postEvent.Body.Text = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Body.Text/* ); */ - - let eventId: any; - - const loader = this.toastService.loading() - - try { - - const CalendarId = this.selectedCalendarId() - this.postEvent.CalendarId = CalendarId - - if (this.loggeduser.Profile == 'MDGPR') { - - eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).toPromise(); + const value = await this.agendaDataRepository.createEvent(this.postEvent, this.documents, calendar.value, tracing) + if(value.isOk()) { + console.log(value.value) + loader.remove() this.hhtpErrorHandle.httpsSucessMessagge('new event') - - } - else if (this.loggeduser.Profile == 'PR') { - - const CalendarId = this.selectedCalendarId() - this.postEvent.CalendarId = CalendarId - - eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).toPromise(); - this.hhtpErrorHandle.httpsSucessMessagge('new event') - - } else if (this.loggeduser.Profile == 'SGGPR') { - - - this.saveAproveEvent(); - - - } else { - - const CalendarId = this.selectedCalendarId() - this.postEvent.CalendarId = CalendarId - - eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).toPromise(); - this.hhtpErrorHandle.httpsSucessMessagge('new event') - - } - - //foi adicionado este if para não ter de fazer muitas alterações sobre a criação dos eventos. Deve ser refatorado - if (this.loggeduser.Profile != 'SGGPR') { - - const DocumentToSave: EventAttachment[] = this.documents.map((e) => { - return { - SourceTitle: e.Assunto, - ParentId: eventId, - Source: '1', - SourceId: e.Id, - ApplicationId: e.ApplicationType.toString(), - Id: '', - Link: '', - SerialNumber: '' - }; - }); - - await DocumentToSave.forEach(async (attachments, i) => { - try { - await this.attachmentsService.setEventAttachmentById(attachments).toPromise(); - } catch (error) { - - } - - }); - - let data1 = { - "subject": this.postEvent.Subject, - "start": this.postEvent.StartDate, - "end": this.postEvent.EndDate, - "venue": this.postEvent.Location, - "id": eventId, - "calendarId": CalendarId - } - - if (this.roomId) { - this.chatMethodService.sendMessage(this.roomId, data1); - } - - this.hhtpErrorHandle.httpsSucessMessagge('new event'); - let data = Object.assign(this.postEvent, { id: eventId }) + let data = Object.assign(this.postEvent) this.modalController.dismiss(data); + tracing.setAttribute('outcome', 'success'); + } else { + tracing.setAttribute('outcome', 'failed'); + console.log('create event error: ', value.error) + loader.remove() } - } catch (error) { - this.hhtpErrorHandle.httpStatusHandle(error) - } finally { - loader.remove() + + } else { + } } - selectedCalendarId() { + //This method return calendar onwner user id + selectedCalendarUserId() { if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postEvent.CalendarName == 'Oficial') { - return this.eventService.calendarNamesType[this.CalendarName]['OficialId'] + return this.eventService.calendarNamesType[this.CalendarName]['OwnerId'] } else if (this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal'] && this.postEvent.CalendarName == 'Pessoal') { - return this.eventService.calendarNamesType[this.CalendarName]['PessoalId'] + return this.eventService.calendarNamesType[this.CalendarName]['OwnerId'] } else { return '11:11' } } - changeAgenda() { + async changeAgenda() { - setTimeout(() => { + const result = await this.agendaDataRepository.geCalendars() - if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) { + const selectedCalendar = result.find(e => e.wxUserId == this.selectedUserCalendar) - this.CalendarNamesOptions = ['Oficial', 'Pessoal'] - - } else if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial']) { + if(selectedCalendar) { + if(selectedCalendar.shareType == 1) { this.CalendarNamesOptions = ['Oficial'] - this.postEvent.CalendarName = 'Oficial' - - } else if (this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) { + } else if(selectedCalendar.shareType == 2) { this.CalendarNamesOptions = ['Pessoal'] - this.postEvent.CalendarName = 'Pessoal' - - } else { + } else if (selectedCalendar.shareType == 3) { this.CalendarNamesOptions = ['Oficial', 'Pessoal'] } - }, 50) + } } @@ -618,6 +620,7 @@ export class NewEventPage implements OnInit { componentProps: { type: 'AccoesPresidenciais & ArquivoDespachoElect', showSearchInput: true, + eventAgenda: true, select: true } }); @@ -650,179 +653,6 @@ export class NewEventPage implements OnInit { } } - //Deve ser removido posteriormente - async saveAproveEvent() { - - // console.log(this.postEvent) - // console.log(this.postEvent.CalendarName) - // console.log(this.CalendarName) - // console.log(this.eventService.calendarNamesAry) - const CalendarId = this.selectedCalendarId() - - let selectedCalendar - try { - selectedCalendar = this.eventService.calendarNamesAry.find(calendar => calendar.Fullname === this.CalendarName) - } catch (error) { - - } - // console.log('selectedCalendar', selectedCalendar) - - if (selectedCalendar) { - if (selectedCalendar.Role = 'Presidente da República') { - let loader = this.toastService.loading(); - - const DocumentToSave: EventAttachment[] = this.documents.map((e) => { - return { - SourceTitle: e.Assunto, - ParentId: "AGD_" + this.loggeduser.UserName + "_" + this.processeService.generateInstaceFormatDate(), - Source: '1', - SourceId: e.Id, - ApplicationId: e.ApplicationType.toString(), - Id: '', - Link: '', - SerialNumber: '' - }; - }); - - let body = this.eventToaproveBody(this.postEvent, CalendarId, this.loggeduser.RoleID, this.loggeduser.UserId, DocumentToSave); - await this.processeService.createEventToAprove(this.postEvent.CalendarName, 'pr', body).subscribe((id) => { - loader.remove() - this.modalController.dismiss(); - this.hhtpErrorHandle.httpsSucessMessagge('new event to aprove') - - - - - /* DocumentToSave.forEach((attachments, i) => { - this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => { - if (DocumentToSave.length == (i + 1)) { - this.afterSave(); - } - }); - }); - - if (DocumentToSave.length == 0) { - this.afterSave(); - } */ - - }, (error) => { - loader.remove() - this.hhtpErrorHandle.httpStatusHandle(error) - }); - - - - } else if (selectedCalendar.Role = 'Ministro e Director do Gabinete do PR') { - let loader = this.toastService.loading(); - - const DocumentToSave: EventAttachment[] = this.documents.map((e) => { - return { - SourceTitle: e.Assunto, - ParentId: "AGD_" + this.loggeduser.UserName + "_" + this.processeService.generateInstaceFormatDate(), - Source: '1', - SourceId: e.Id, - ApplicationId: e.ApplicationType.toString(), - Id: '', - Link: '', - SerialNumber: '' - }; - }); - - let body = this.eventToaproveBody(this.postEvent, CalendarId, this.loggeduser.RoleID, this.loggeduser.UserId, DocumentToSave); - await this.processeService.createEventToAprove(this.postEvent.CalendarName, 'md', body).subscribe((id) => { - loader.remove() - this.modalController.dismiss(); - this.hhtpErrorHandle.httpsSucessMessagge('new event to aprove') - - - - /* DocumentToSave.forEach((attachments, i) => { - this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => { - if (DocumentToSave.length == (i + 1)) { - this.afterSave(); - } - }); - }); - - if (DocumentToSave.length == 0) { - this.afterSave(); - } */ - - }, (error) => { - loader.remove() - this.hhtpErrorHandle.httpStatusHandle(error) - }); - - - } - - - - } - - if (!selectedCalendar && this.CalendarName == "Meu calendario") { - console.log('SG generic') - this.postEvent.CalendarName - - const CalendarId = this.selectedCalendarId() - let loader = this.toastService.loading(); - - this.postEvent.CalendarId = CalendarId - - this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe( - (id) => { - loader.remove(); - - const eventId: any = id; - - const DocumentToSave: EventAttachment[] = this.documents.map((e) => { - return { - SourceTitle: e.Assunto, - ParentId: eventId, - Source: '1', - SourceId: e.Id, - ApplicationId: e.ApplicationType.toString(), - Id: '', - Link: '', - SerialNumber: '' - }; - }); - - DocumentToSave.forEach((attachments, i) => { - this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => { - if (DocumentToSave.length == (i + 1)) { - } - }); - }); - - if (DocumentToSave.length == 0) { - } - - this.hhtpErrorHandle.httpsSucessMessagge('new event') - let data = { - "subject": this.postEvent.Subject, - "start": this.postEvent.StartDate, - "end": this.postEvent.EndDate, - "venue": this.postEvent.Location, - "id": id, - "calendarId": CalendarId - } - if (this.roomId) { - this.chatMethodService.sendMessage(this.roomId, data); - } - - let dataa = Object.assign(this.postEvent, { id: eventId }) - this.modalController.dismiss(dataa); - }, (error) => { - - loader.remove() - this.hhtpErrorHandle.httpStatusHandle(error) - }); - - } - - } - // Deve ser removido posteriormente eventToaproveBody(event, calendarId, role, userId, attachments) { let toAproveObject = { @@ -869,6 +699,10 @@ export class NewEventPage implements OnInit { let filterLoggedUserEmail = this.contacts.filter(item => item.RoleDescription == "Ministro e Director do Gabinete do PR") //console.log('Attendes Email', filterLoggedUserEmail) + if(filterLoggedUserEmail.length >= 1) { + filterLoggedUserEmail[0].IsRequired = true + } + this.contacts = filterLoggedUserEmail; const newAttendees: EventPerson[] = this.contacts; @@ -883,12 +717,14 @@ export class NewEventPage implements OnInit { if (this.allDayCheck) { this.postEvent.IsAllDayEvent = this.allDayCheck; this.postEvent.StartDate = this.setAlldayTime(this.postEvent.StartDate) - + this.postEvent.EndDate = this.setAlldayTimeEndDate(this.postEvent.EndDate) + console.log('Recurso ativado!!'); } else { this.postEvent.IsAllDayEvent = this.allDayCheck; + this.postEvent.EndDate = this.setAlldayTimeEndDateNotAlday(this.postEvent.EndDate) console.log('Recurso desativado'); - + } } @@ -900,6 +736,28 @@ export class NewEventPage implements OnInit { date.setSeconds(0); + return date + } + + setAlldayTimeEndDate(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(23) + date.setMinutes(59) + date.setSeconds(0); + + + return date + } + + setAlldayTimeEndDateNotAlday(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(23) + date.setMinutes(0) + date.setSeconds(0); + + return date } } diff --git a/src/app/pages/agenda/view-event/view-event.page.html b/src/app/pages/agenda/view-event/view-event.page.html index 37c45cba9..ea9d396e7 100644 --- a/src/app/pages/agenda/view-event/view-event.page.html +++ b/src/app/pages/agenda/view-event/view-event.page.html @@ -21,7 +21,7 @@
@@ -71,7 +71,7 @@
-
Intervenientes
+
Intervenientes({{ loadedEvent.Attendees.length }})
@@ -90,12 +90,13 @@
-
Documentos Anexados
+
Documentos Anexados({{ loadedEvent.Attachments.length }})

- {{attach.SourceName}} + {{attach.SourceName || attach.subject || attach.sourceName || 'Sem título'}} + {{attach.Stakeholders}}

diff --git a/src/app/pages/agenda/view-event/view-event.page.ts b/src/app/pages/agenda/view-event/view-event.page.ts index 2daf1ba65..8409dbf7b 100644 --- a/src/app/pages/agenda/view-event/view-event.page.ts +++ b/src/app/pages/agenda/view-event/view-event.page.ts @@ -11,14 +11,15 @@ import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTas import { DocumentSetUpMeetingPage } from 'src/app/modals/document-set-up-meeting/document-set-up-meeting.page'; import { ExpedientTaskModalPage } from '../../gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page'; import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page'; -import { BackgroundService } from 'src/app/services/background.service'; -import { StorageService } from 'src/app/services/storage.service'; import { ThemeService } from 'src/app/services/theme.service' import { RouteService } from 'src/app/services/route.service'; import { SessionStore } from 'src/app/store/session.service'; -import { HttpErrorHandle} from 'src/app/services/http-error-handle.service' -import { AttachmentsService } from 'src/app/services/attachments.service'; -import { DateService } from 'src/app/services/date.service'; +import { HttpErrorHandle } from 'src/app/services/http-error-handle.service' +import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service'; +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; +import { isHttpError } from 'src/app/services/http.service'; +import { PermissionService } from 'src/app/services/permission.service'; +import { DeleteEventRecurrencePage, EventDeleteRecurrenceComponentReturn } from 'src/app/modals/delete-event-recurrence/delete-event-recurrence.page'; @Component({ selector: 'app-view-event', @@ -58,20 +59,17 @@ export class ViewEventPage implements OnInit { constructor( private modalController: ModalController, - /* private navParams: NavParams, */ public eventsService: EventsService, public alertController: AlertController, public popoverController: PopoverController, private activatedRoute: ActivatedRoute, private toastService: ToastService, public platform: Platform, - private backgroundservice: BackgroundService, - private storage: StorageService, public ThemeService: ThemeService, private RouteService: RouteService, private httpErrorHandle: HttpErrorHandle, - private attachmentsService: AttachmentsService, - private dateService: DateService + private agendaDataRepository: AgendaDataRepositoryService, + public p: PermissionService, ) { @@ -106,25 +104,6 @@ export class ViewEventPage implements OnInit { ngOnInit() { this.loadEvent(); - this.backgroundservice.registerBackService('Online', () => { - this.storage.get('eventEdit').then((req) => { - JSON.parse(req).forEach(element => { - this.eventsService.editEvent(element, 2, 3).subscribe((res) => { - this.storage.remove('eventEdit') - - }) - }); - }) - this.storage.get('eventDelete').then((req) => { - JSON.parse(req).forEach(element => { - this.eventsService.editEvent(element, 2, 3).subscribe((res) => { - this.storage.remove('eventDelete') - - }) - }); - }) - this.loadEvent(); - }); window.onresize = (event) => { // if not mobile remove all component @@ -135,25 +114,7 @@ export class ViewEventPage implements OnInit { } - // getEventsFromDB () { - // return new Promise((resolve, reject) => { - // if (this.platform.is('desktop') || this.platform.is('mobileweb')) { - // this.storage.get('agendaResponse').then((events) => { - // resolve(events) - // }) - // } else { - // this.sqliteservice.getAllEvents().then((events: any[] = []) => { - // resolve(events) - - // }) - // } - // }).catch ((error) => { - // console.error(error); - // }); - // } - - openOptions() {} close() { this.modalController.dismiss(this.isEventEdited); @@ -184,168 +145,126 @@ export class ViewEventPage implements OnInit { } setTimeZone() { - this.TimeZoneString = this.loadedEvent.TimeZone.split(')')[1] + this.TimeZoneString = this.loadedEvent.TimeZone } - loadEvent() { + @XTracerAsync({name:'mobile/loadEventDetails', bugPrint: true}) + async loadEvent(tracing?: TracingType) { const loader = this.toastService.loading(); - if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') { - this.eventsService.getEvent(this.eventId).subscribe(res => { + let res = await this.agendaDataRepository.getEventById(this.eventId, tracing) - res = this.dateService.fixDate(res as any) - this.loadedEvent = res; - this.setTimeZone() - // this.addEventToDb(res); + if (res.isOk()) { + tracing.setAttribute('outcome', 'success') + console.log('Loaded Event', res.value) + loader.remove() + /* let changeDate = this.dateService.fixDate(res.value as any) as any */ + this.loadedEvent = res.value as any; + this.setTimeZone() + } else { - loader.remove() - }, (error) => { - - - if (error.status === 0) { - this.getFromDb(); + tracing.setAttribute('eventId', this.eventId) + if(!isHttpError(res.error)) { + this.toastService._badRequest('Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico. #13') + console.log(res.error) + } else if (isHttpError(res.error)) { + if(res.error.status == 404) { + this.toastService._badRequest('Este evento já não existe') } else { - this.httpErrorHandle.httpStatusHandle(error) - loader.remove() - this.modalController.dismiss('Eevent not Foud'); - this.RouteService.goBack(); + this.httpErrorHandle.httpStatusHandle(res.error) } - loader.remove() - }); - } else { - - - if(this.CalendarId) { - this.eventsService.genericGetEvent(this.eventId, this.CalendarId).subscribe(res => { - - /* const div = document.createElement("div") - div.innerHTML = res.Body.Text - res.Body.Text = div.innerText */ - res = this.dateService.fixDate(res as any) - this.loadedEvent = res; - console.log('pass,',res) - this.setTimeZone() - - // this.addEventToDb(res); - - loader.remove() - }, (error) => { - - if (error.status === 0) { - this.getFromDb(); - } else { - this.toastService.badRequest('Este evento já não existe na sua agenda') - loader.remove() - this.modalController.dismiss('Eevent not Foud'); - this.RouteService.goBack(); - } - loader.remove() - }); } + + tracing.setAttribute('outcome', 'failed') + + // this.toastService.badRequest('Este evento já não existe na sua agenda') + this.RouteService.goBack(); + } + + loader.remove() + + } + + async deleteYesOrNo() { + if (this.loadedEvent.IsRecurring) { + + const modal = await this.modalController.create({ + component: DeleteEventRecurrencePage, + componentProps: {}, + cssClass: 'event-recurrence-modal', + + }); + + modal.onDidDismiss().then((res) => { + + const data: EventDeleteRecurrenceComponentReturn = res.data + if(data =='DeleteAll') { + this.deleteEvent(true); + + } else if (data == 'DeleteOne') { + this.deleteEvent(false); + } else if(data == 'Cancel') { + this.close() + } else { + this.close() + } + }); + + await modal.present(); + + } else { + this.alertController.create({ + header: 'Eliminar evento?', + message: '', + buttons: [ + { + text: 'Sim', + handler: (data) => { + this.deleteEvent(false); + } + }, + { + text: 'Não', + handler: () => { + // sconsole.log('Let me think'); + } + } + ] + }).then(res => { + res.present(); + }); } } - loadEvent1() { - - - if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') { - this.eventsService.getEvent(this.eventId).subscribe(res => { - - res = this.dateService.fixDate(res as any) - this.loadedEvent = res; - this.setTimeZone() - // this.addEventToDb(res); - }, (error) => { - }); - } else { - - - if(this.CalendarId) { - this.eventsService.genericGetEvent(this.eventId, this.CalendarId).subscribe(res => { - - res = this.dateService.fixDate(res as any) - this.loadedEvent = res; - this.setTimeZone() - - }, (error) => { - - }); - } - - } - - } - - deleteYesOrNo() { - this.alertController.create({ - header: 'Eliminar evento?', - message: '', - buttons: [ - { - text: 'Sim', - handler: () => { - this.deleteEvent(); - } - }, - { - text: 'Não', - handler: () => { - // sconsole.log('Let me think'); - } - } - ] - }).then(res => { - res.present(); - }); - } - - deleteEvent() { + async deleteEvent(deleteAll) { const loader = this.toastService.loading() - if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') { - this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => { - const alert = await this.alertController.create({ - cssClass: 'my-custom-class', - header: 'Evento removido', - buttons: ['OK'] - }); - setTimeout(() => { - alert.dismiss(); - }, 1500); - this.goBack(); - this.httpErrorHandle.httpsSucessMessagge('delete event') - }, () => { }, - () => { - loader.remove(); - }); - - } else { - - this.eventsService.genericDeleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName, this.loadedEvent.CalendarId).subscribe(async () => { - const alert = await this.alertController.create({ - cssClass: 'my-custom-class', - header: 'Evento removido', - buttons: ['OK'] - }); - - setTimeout(() => { - alert.dismiss(); - }, 1500); - this.goBack(); - this.httpErrorHandle.httpsSucessMessagge('delete event') - }, (error) => { - this.httpErrorHandle.httpStatusHandle(error) - }, - () => { - loader.remove(); + console.log(this.loadedEvent.EventId) + const result = await this.agendaDataRepository.deleteEvent(this.loadedEvent.EventId,deleteAll)//.subscribe(async () => { + if(result.isOk()) { + const alert = await this.alertController.create({ + cssClass: 'my-custom-class', + header: 'Evento removido', + buttons: ['OK'] }); + setTimeout(() => { + alert.dismiss(); + }, 1500); + this.goBack(); + this.httpErrorHandle.httpsSucessMessagge('delete event') + } else { + console.log('delete event error: ', result.error) + this.httpErrorHandle.httpStatusHandle(result.error) } + + + loader.remove(); } @@ -388,6 +307,7 @@ export class ViewEventPage implements OnInit { componentProps: { eventId: this.loadedEvent.EventId, caller: this.caller, + closeModal: true }, cssClass: 'modal modal-desktop', @@ -395,14 +315,22 @@ export class ViewEventPage implements OnInit { await modal.present(); modal.onDidDismiss().then((res) => { - if (res) { - setTimeout(() => { - /* this.loadEvent(); */ - this.loadEvent1() - }, 250); + + + if (res.data?.action == 'cancel') { + + console.log('res', res) + } else { + this.loadEvent() this.isEventEdited = true; - console.log('res', res, res.data?.action, 'cancel') + + // if (res.data.Attendees?.length >= 1) { + // this.loadedEvent.HasAttachments = true + // // this.getAttachments() + // } + console.log('res', res) } + }); } @@ -430,34 +358,19 @@ export class ViewEventPage implements OnInit { if (res.data?.action == 'cancel') { - setTimeout(() => { - /* this.loadEvent(); */ - this.loadEvent1() - }, 250); - this.isEventEdited = true; - - if(res.data.Attendees?.length >= 1) { - this.loadedEvent.HasAttachments = true - this.getAttachments() - } console.log('res', res) } else { - setTimeout(() => { - /* this.loadEvent(); */ - this.loadEvent() - - }, 250); + this.loadEvent() this.isEventEdited = true; - if(res.data.Attendees?.length >= 1) { - this.loadedEvent.HasAttachments = true - this.getAttachments() - } - console.log('res', res) + // if (res.data.Attendees?.length >= 1) { + // this.loadedEvent.HasAttachments = true + // // this.getAttachments() + // } + // console.log('res', res) } - this.getAttachments() }); await modal.present(); @@ -468,17 +381,6 @@ export class ViewEventPage implements OnInit { } - getAttachments() { - if(this.loadedEvent.HasAttachments) { - this.attachmentsService.getAttachmentsById(this.loadedEvent.EventId).subscribe(res=>{ - this.loadedEvent.Attachments = res; - - },((erro) => { - console.error('editgetAttchament', erro) - })); - } - } - async LoadDocumentDetails() { const docId = this.loadedEvent.Attachments[this.dicIndex].SourceId @@ -575,4 +477,8 @@ export class ViewEventPage implements OnInit { getFromDb() { } + + stringToNumber(number: string) { + return parseInt(number) + } } diff --git a/src/app/pages/chat/chat.page.html b/src/app/pages/chat/chat.page.html index 18a568ae9..d058c8ae2 100644 --- a/src/app/pages/chat/chat.page.html +++ b/src/app/pages/chat/chat.page.html @@ -73,33 +73,25 @@
{{room.duration}}
-
+
+
{{room.lastMessage.msg}}
+
está escrever ...
-

{{room.lastMessage.msg}}

-

está escrever...

- - -
- +
+ - audio - + audio - + {{ room.lastMessage.attachments[0].title }} - {{room.lastMessage.file.name || room.lastMessage.file.subject || room.lastMessage.attachments[0].title}}
- - - +
diff --git a/src/app/pages/chat/chat.page.ts b/src/app/pages/chat/chat.page.ts index 4fe27b30a..a2a7ea13b 100644 --- a/src/app/pages/chat/chat.page.ts +++ b/src/app/pages/chat/chat.page.ts @@ -33,6 +33,7 @@ import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-co import { RouteService } from 'src/app/services/route.service'; import { Plugins } from '@capacitor/core'; + const { App } = Plugins; @Component({ @@ -127,7 +128,7 @@ export class ChatPage implements OnInit { private eventTriger: EventTrigger, private RochetChatConnectorService: RochetChatConnectorService, private zone: NgZone, - public RouteService: RouteService, + public RouteService: RouteService ) { this.headers = new HttpHeaders();; @@ -177,6 +178,7 @@ export class ChatPage implements OnInit { } + ngOnDestroy() { // this.setStatus('offline'); this.routerSubscription?.unsubscribe(); diff --git a/src/app/pages/chat/group-messages/group-messages.page.html b/src/app/pages/chat/group-messages/group-messages.page.html index 86a3a4b28..16b0b3de4 100644 --- a/src/app/pages/chat/group-messages/group-messages.page.html +++ b/src/app/pages/chat/group-messages/group-messages.page.html @@ -1,6 +1,6 @@ -
+
@@ -45,7 +45,7 @@ - +
@@ -221,8 +221,9 @@
{{msg.u.name ?? ""}} criou esta reunião
-
+ +
De {{showDateDuration(msg.file.start_date)}} a {{showDateDuration(msg.file.end_date)}}
@@ -243,7 +244,7 @@ {{last ? scrollToBottom() : ''}}
-
+
{{user.name}} saiu do grupo
@@ -251,7 +252,7 @@ {{last ? scrollToBottom() : ''}}
-
+
{{user.name}} foi removido do grupo
@@ -260,7 +261,7 @@
-
+
Adicionou {{user.name}}
@@ -277,7 +278,7 @@ - +
{ this.open() @@ -151,6 +152,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { } } + ngOnInit() { this.loggedUser = this.loggedUserChat; @@ -339,29 +341,6 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { this.loadFiles(); } - async goToEvent(event: any) { - let classs; - if (window.innerWidth < 701) { - classs = 'modal modal-desktop' - } else { - classs = 'modal modal-desktop showAsideOptions' - } - - const modal = await this.modalController.create({ - component: ViewEventPage, - componentProps: { - eventId: event.id, - CalendarId: event.calendarId - }, - cssClass: classs, - }); - - modal.onDidDismiss().then((res) => { - - }); - await modal.present(); - } - ngOnDestroy() { window.removeEventListener('scroll', this.scrollChangeCallback, true); } @@ -418,12 +397,9 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { } async getChatMembers() { - this.chatService.getAllUsers().subscribe(res => { - - - this.allUsers = res['users'].filter(data => data.username != SessionStore.user.UserName); - - }); + if(this.ChatSystemService.users.length == 0) { + this.ChatSystemService.getUser() + } } /* load(){ @@ -828,8 +804,47 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { async addFileToChat(types: typeof FileType[]) { + + const roomId = this.roomId + if(this.platform.is('ios')) { + console.log('ios add file ') + + const resultt = await FilePicker.pickFiles({ + types: ['application/pdf'], + multiple: false, + readData: true, + }); + + console.log('RESULT', resultt.files[0]) + + const blobb = this.fileService.base64toBlob(resultt.files[0].data, resultt.files[0].mimeType) + + const formDataa = new FormData(); + formDataa.append('blobFile', blobb); + /* console.log('add file', fileBase64) */ + + this.ChatSystemService.getGroupRoom(roomId).send({ + file: { + "type": resultt.files[0].mimeType, + "guid": '', + }, + attachments: [{ + "title": sanitize(resultt.files[0].name), + "name": sanitize(resultt.files[0].name), + // "text": "description", + "title_link_download": false, + }], + temporaryData: formDataa, + attachmentsModelData: { + fileBase64: '', + } + }) + return + + } + const file: any = await this.fileService.getFileFromDevice(types); @@ -1109,6 +1124,15 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { } async openFile(pdfString, filename, type) { + /* const modal = await this.modalController.create({ + component: ViewDocumentSecondOptionsPage, + componentProps: { + fileUrl: pdfString, + filename: filename + }, + cssClass: 'modal modal-desktop' + }); + await modal.present(); */ const blob = this.b64toBlob(pdfString, type) let pathFile = '' const fileName = filename @@ -1119,10 +1143,16 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { pathFile = this.file.externalRootDirectory } + console.log('file data', pdfString) + console.log(pathFile) + + let removePre = this.removeTextBeforeSlash(pdfString,',') + console.log('file data remove ', removePre) + await Filesystem.writeFile({ path: fileName, - data: pdfString, - directory: Directory.Data, + data: removePre, + directory: Directory.Cache, }).then((dir) => { console.log('DIR ', dir) this.fileOpener @@ -1191,7 +1221,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { }); modal.present(); } else { - this.openFile(str, msg.attachments[0].title, msg.file.type); + this.openFile(msg.attachments[0].image_url, msg.attachments[0].title, msg.file.type); } } } @@ -1266,6 +1296,16 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { reject(error); }; }); + + } + + removeTextBeforeSlash(inputString, controlString) { + if (inputString.includes(controlString)) { + const parts = inputString.split(controlString); + return parts.length > 1 ? parts[1] : inputString; + } else { + return inputString; + } } } diff --git a/src/app/pages/chat/messages/messages.page.html b/src/app/pages/chat/messages/messages.page.html index 5e82e5eb5..d0572fba5 100644 --- a/src/app/pages/chat/messages/messages.page.html +++ b/src/app/pages/chat/messages/messages.page.html @@ -80,7 +80,6 @@
-
{ @@ -839,9 +841,48 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { } async addFileToChat(types: typeof FileType[]) { - console.log('add file') + console.log('add file ') const roomId = this.roomId + if (this.platform.is('ios')) { + console.log('ios add file ') + + const resultt = await FilePicker.pickFiles({ + types: ['application/pdf', 'application/doc', 'application/docx','application/xls', 'application/xlsx', 'application/ppt', + 'application/pptx', 'application/txt'], + multiple: false, + readData: true, + }); + + console.log('RESULT', resultt.files[0].data) + + const blobb = this.fileService.base64toBlob(resultt.files[0].data, resultt.files[0].mimeType) + const blob = new Blob([resultt.files[0].data], {type: resultt.files[0].mimeType}); + + const formDataa = new FormData(); + formDataa.append('blobFile', blobb); + /* console.log('add file', fileBase64) */ + + this.ChatSystemService.getDmRoom(roomId).send({ + file: { + "type": resultt.files[0].mimeType, + "guid": '', + }, + attachments: [{ + "title": sanitize(resultt.files[0].name), + "name": sanitize(resultt.files[0].name), + // "text": "description", + "title_link_download": false, + }], + temporaryData: formDataa, + attachmentsModelData: { + fileBase64: '', + } + }) + return + + } + const file: any = await this.fileService.getFileFromDevice(types); console.log(file) @@ -857,41 +898,41 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { formData.append('blobFile', blob); console.log('add file', fileBase64) */ - const fileName = file.name + const fileName = file.name - const validation = this.FileValidatorService.fileNameValidation(fileName) + const validation = this.FileValidatorService.fileNameValidation(fileName) - if(validation.isOk) { + if (validation.isOk) { - const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch((error) => { - console.error(error); - }))); - console.log(encodedData) - const blob = this.fileService.base64toBlob(encodedData, file.type) + const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch((error) => { + console.error(error); + }))); + console.log(encodedData) + const blob = this.fileService.base64toBlob(encodedData, file.type) - const formData = new FormData(); - formData.append('blobFile', blob); - /* console.log('add file', fileBase64) */ + const formData = new FormData(); + formData.append('blobFile', blob); + /* console.log('add file', fileBase64) */ - this.ChatSystemService.getDmRoom(roomId).send({ - file: { - "type": file.type, - "guid": '', - }, - attachments: [{ - "title": sanitize(fileName), - "name": sanitize(fileName), - // "text": "description", - "title_link_download": false, - }], - temporaryData: formData, - attachmentsModelData: { - fileBase64: encodedData, - } - }); - } else { - this.toastService._badRequest("Ficheiro inválido") - } + this.ChatSystemService.getDmRoom(roomId).send({ + file: { + "type": file.type, + "guid": '', + }, + attachments: [{ + "title": sanitize(fileName), + "name": sanitize(fileName), + // "text": "description", + "title_link_download": false, + }], + temporaryData: formData, + attachmentsModelData: { + fileBase64: encodedData, + } + }); + } else { + this.toastService._badRequest("Ficheiro inválido") + } } @@ -1058,33 +1099,78 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { return blob; } + blobToBase64(blob) { + return new Promise((resolve, _) => { + const reader = new FileReader(); + reader.onloadend = () => resolve(reader.result); + reader.readAsDataURL(blob); + }); + } + async openFile(pdfString, filename, type) { - const blob = this.b64toBlob(pdfString, type) - console.log(blob) + + console.log('url while open ',pdfString) + + /* const modal = await this.modalController.create({ + component: ViewDocumentSecondOptionsPage, + componentProps: { + fileUrl: pdfString, + filename: filename + }, + cssClass: 'modal modal-desktop' + }); + await modal.present(); +/* + await modal.present(); */ + + var blob = new Blob([pdfString], { type: 'application/pdf' }); + + console.log('blob blob', blob) + + this.blobToBase64(blob).then((value) => { + console.log(value) + }).catch((error) => { + console.log(error) + }) + let pathFile = '' const fileName = filename - const contentFile = blob if (this.platform.is('ios')) { pathFile = this.file.documentsDirectory } else { pathFile = this.file.externalRootDirectory } + console.log('file data', pdfString) console.log(pathFile) + let removePre = this.removeTextBeforeSlash(pdfString,',') + console.log('file data remove ', removePre) + await Filesystem.writeFile({ path: fileName, - data: pdfString, - directory: Directory.Data, + data: removePre, + directory: Directory.Cache, }).then((dir) => { console.log('DIR ', dir) this.fileOpener .open(dir.uri, type) .then(() => console.log()) .catch(e => console.error(e)) + }).catch((error) => { + console.log('error writing the file', error) }); } + removeTextBeforeSlash(inputString, controlString) { + if (inputString.includes(controlString)) { + const parts = inputString.split(controlString); + return parts.length > 1 ? parts[1] : inputString; + } else { + return inputString; + } + } + downloadFileFromBrowser(fileName: string, data: any): void { const linkSource = data; const downloadLink = document.createElement("a"); @@ -1148,7 +1234,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { }); modal.present(); } else { - this.openFile(str, msg.attachments[0].title, msg.file.type); + this.openFile(msg.attachments[0].image_url, msg.attachments[0].title, msg.file.type); } } @@ -1239,6 +1325,17 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { }); } + dataURItoBlobIso(dataURI: any) { + const byteString = window.atob(dataURI); + const arrayBuffer = new ArrayBuffer(byteString.length); + const int8Array = new Uint8Array(arrayBuffer); + for (let i = 0; i < byteString.length; i++) { + int8Array[i] = byteString.charCodeAt(i); + } + const blob = new Blob([int8Array], { type: 'application/pdf' }); + return blob; + } + } diff --git a/src/app/pages/chat/new-group/new-group.page.ts b/src/app/pages/chat/new-group/new-group.page.ts index 0786f7a0e..b31738dac 100644 --- a/src/app/pages/chat/new-group/new-group.page.ts +++ b/src/app/pages/chat/new-group/new-group.page.ts @@ -6,6 +6,7 @@ import { ThemeService } from 'src/app/services/theme.service'; import { ChatSystemService } from 'src/app/services/chat/chat-system.service'; import { SessionStore } from 'src/app/store/session.service'; import { ToastService } from 'src/app/services/toast.service'; +import { catchError } from 'rxjs/operators'; @Component({ selector: 'app-new-group', @@ -66,46 +67,72 @@ export class NewGroupPage implements OnInit { let customFields = {} let res: any; - if (this.thedate) { - let customFields = { - "countDownDate": this.thedate - } - res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields); - } - else { - res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields); + if(!SessionStore.user?.ChatData?.data) { + this.toastService._successMessage("Chat temporariamente indisponível") } - this.isGroupCreated = true; - this.addContacts(res.result); - this.ChatSystemService.getRoom([res.result]); + try { - setTimeout(() => { - this.ChatSystemService.subscribeToRoomUpdate(res.result.rid, res.result); - }, 10) - - - - if (res?.result?.rid) { - - this.ChatSystemService.getAllRooms(() => { - if (!this.ChatSystemService.getGroupRoom(res.result.rid)) { - this.createGroupWithAttachmentsCath(res) - } else { - setTimeout(() => { - - this.createGroupWithAttachments(res) - - }, 500) + if (this.thedate) { + let customFields = { + "countDownDate": this.thedate } - }, res.result.rid); + res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields); + } + else { + res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields); + } + + try { + this.isGroupCreated = true; + this.addContacts(res.result); + this.ChatSystemService.getRoom([res.result]); + + setTimeout(() => { + this.ChatSystemService.subscribeToRoomUpdate(res.result.rid, res.result); + }, 10) + + } catch (error) { + await this.ChatSystemService.getUser(); + await this.ChatSystemService.getAllRooms(); + await this.ChatSystemService.subscribeToRoom(); + + this.isGroupCreated = true; + this.addContacts(res.result); + this.ChatSystemService.getRoom([res.result]); + + setTimeout(() => { + this.ChatSystemService.subscribeToRoomUpdate(res.result.rid, res.result); + }, 10) + + } - } else { + if (res?.result?.rid) { - this.toastService._badRequest('Existe um grupo com este nome!'); + this.ChatSystemService.getAllRooms(() => { + if (!this.ChatSystemService.getGroupRoom(res.result.rid)) { + this.createGroupWithAttachmentsCath(res) + } else { + setTimeout(() => { + this.createGroupWithAttachments(res) + + }, 500) + } + }, res.result.rid); + + + + } else { + + this.toastService._badRequest('Existe um grupo com este nome!'); + + } + + } catch(error) { + this.toastService._successMessage("Chat temporariamente indisponível") } } diff --git a/src/app/pages/events/attendees/attendees.page.ts b/src/app/pages/events/attendees/attendees.page.ts index a00eaeefe..1466b46fd 100644 --- a/src/app/pages/events/attendees/attendees.page.ts +++ b/src/app/pages/events/attendees/attendees.page.ts @@ -6,6 +6,8 @@ import { ThemeService } from 'src/app/services/theme.service' import { LoginUserRespose } from 'src/app/models/user.model'; import { SessionStore } from 'src/app/store/session.service'; import { Router } from '@angular/router'; +import { ContactRepositoryService } from 'src/app/services/Repositorys/contacts/repository/contacts-repository.service'; + @Component({ selector: 'app-attendees', @@ -25,18 +27,16 @@ export class AttendeesPageModal implements OnInit { taskParticipants:EventPerson[] = []; taskParticipantsCc:EventPerson[] = []; loggeduser: LoginUserRespose; - @Input() loggedAttendSon: boolean; hideExternalDomain = true; taskType: any; constructor( - private modalCtrl: ModalController, - private contactsService: ContactsService, private navParams: NavParams, private modalController: ModalController, public ThemeService: ThemeService, - private router: Router,) { + private router: Router, + private ContactRepositoryService: ContactRepositoryService) { this.adding = this.navParams.get('adding'); this.taskParticipants = this.navParams.get('taskParticipants'); @@ -49,7 +49,6 @@ export class AttendeesPageModal implements OnInit { } ngOnInit() { - console.log('Pesquisa de contactos current path1',this.router.url) this.fetchContacts(""); if(this.taskParticipants == null || this.taskParticipants == undefined){ @@ -136,14 +135,12 @@ export class AttendeesPageModal implements OnInit { async fetchContacts(filter: string) { this.showLoader = true; - this.contactsService.getContacts(filter).subscribe(_result => { + const RequestResult = await this.ContactRepositoryService.getUsersMap(); + if(RequestResult.isOk()) { + const _result = RequestResult.value - let result - if(this.hideExternalDomain) { - result = _result.filter( e => e.UserType == 'GD') - } else { - result = _result - } + + let result = _result.filter( e => e.UserType == 'GD' && e.EmailAddress.toLocaleLowerCase().includes(filter.toLocaleLowerCase())) if (this.eventPersons != null) { @@ -157,26 +154,19 @@ export class AttendeesPageModal implements OnInit { }); } - if(this.loggedAttendSon) { - this.contacts = result; - this.showLoader = false; - } else { - this.contacts = result; + this.contacts = result as any; // console.log('Attendes Email',this.loggeduser.Email) let filterLoggedUserEmail = this.contacts.filter(item => item.EmailAddress.toLocaleLowerCase() != this.loggeduser.Email.toLocaleLowerCase()) if(this.taskType == 0 || this.taskType == 1){ filterLoggedUserEmail = this.contacts.filter(item => item.IsPR == false) - } + } // console.log('Attendes Email', filterLoggedUserEmail) let filterEmptyEmail = filterLoggedUserEmail.filter(item => item.EmailAddress.toLocaleLowerCase() != "") this.contacts = filterEmptyEmail; //console.log('Attendes Email', this.contacts) this.showLoader = false; - - } - } - ); + } } diff --git a/src/app/pages/events/edit-event/edit-event.page.ts b/src/app/pages/events/edit-event/edit-event.page.ts index 66ea7f577..17b596792 100644 --- a/src/app/pages/events/edit-event/edit-event.page.ts +++ b/src/app/pages/events/edit-event/edit-event.page.ts @@ -162,28 +162,28 @@ export class EditEventPage implements OnInit { Save() { - if (this.ionicForm.valid){ + // if (this.ionicForm.valid){ - this.activatedRoute.paramMap.subscribe(paramMap =>{ - if (paramMap.has("profile")){ + // this.activatedRoute.paramMap.subscribe(paramMap =>{ + // if (paramMap.has("profile")){ - } - }); + // } + // }); - this.eventsService.editEvent(this.loadedEvent, 2, 3).subscribe(async () => - { - const alert = await this.alertController.create({ - cssClass: 'my-custom-class', - header: 'Evento actualizado', - buttons: ['OK'] - }); + // this.eventsService.editEvent(this.loadedEvent, 2, 3).subscribe(async () => + // { + // const alert = await this.alertController.create({ + // cssClass: 'my-custom-class', + // header: 'Evento actualizado', + // buttons: ['OK'] + // }); - setTimeout(()=>{ - alert.dismiss(); - }, 1500); - }); - } + // setTimeout(()=>{ + // alert.dismiss(); + // }, 1500); + // }); + // } } showAlert(){ diff --git a/src/app/pages/events/event-detail-modal/event-detail-modal.module.ts b/src/app/pages/events/event-detail-modal/event-detail-modal.module.ts deleted file mode 100644 index 5472c8c36..000000000 --- a/src/app/pages/events/event-detail-modal/event-detail-modal.module.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; - -import { IonicModule } from '@ionic/angular'; - -import { EventDetailModalPageRoutingModule } from './event-detail-modal-routing.module'; - -import { EventDetailModalPage } from './event-detail-modal.page'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - EventDetailModalPageRoutingModule - ], - declarations: [EventDetailModalPage] -}) -export class EventDetailModalPageModule {} diff --git a/src/app/pages/events/event-detail-modal/event-detail-modal.page.html b/src/app/pages/events/event-detail-modal/event-detail-modal.page.html deleted file mode 100644 index 0f1d3d08a..000000000 --- a/src/app/pages/events/event-detail-modal/event-detail-modal.page.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - Visualizar Evento - - - - - - - -
- - - - - Descrição - - - - Localização - - - - Calendário - - Pessoal - Oficial - - - - Tipo do evento - - Reunião - Viagem - Conferência - Encontro - - - - Data Início - - - - Data Fim - - - -
- - - Editar - - Intervenientes - -
-
-
- - - - {{attendee.Name}} - - -
- -
-
- -
-
-
-
- - - Editar - - Anexos - -
-
-
- - - - - -

{{ att.Description }}

-

{{ att.CreateDate }}

-
-
-
-
-
-
- -
-
- - - - - -

-

-
-
-
- - - - - Sem anexos - - - -
-
-
-
- -
-
- - - - - -
- - - - - - - - - - - - -

- -

-

- -

-

- -

-
-
- - - - - -

- -

-

- -

-

- -

-
-
- - - -

- -

-

- -

-

- -

-
-
-
-
- -
- - -
- Enviar -
-
-
- diff --git a/src/app/pages/events/event-detail-modal/event-detail-modal.page.scss b/src/app/pages/events/event-detail-modal/event-detail-modal.page.scss deleted file mode 100644 index 0d2783cd0..000000000 --- a/src/app/pages/events/event-detail-modal/event-detail-modal.page.scss +++ /dev/null @@ -1,97 +0,0 @@ -@import '~src/function.scss'; - -ion-item-group{ - margin: 15px; -} -.div-item{ - width: 100%; - overflow: auto; - border-bottom: 1px solid #ccc; - margin: 10px 0 5px 0; -} -.div-up{ - width: 100%; - overflow: auto; -} -.div-up h3{ - margin: 0; - padding: 0; - font-size: rem(17); - width: 100%; -} -.div-icon{ - width: 10%; - font-size: rem(22); - float: left; - color: #808080; -} -.div-icon ion-icon{ - display: block; - margin: 0 auto; - -} -.div-content-attachment{ - width: 85%; - float: left; - padding: 0 0 0 12px; -} -.ion-icon-attach{ - color: #666666; - font-size: rem(20); -} - -.btn-attach{ - margin: 15px 0 0 0; - --color: #333; - --border-color:#333; -} -.div-card-button{ - width: 100%; - overflow: auto; - padding: 0 !important; -} -ion-card{ - margin: 2.5% !important; - width: 45%; - float: left; -} -.center{ - text-align: center; - float: center; -} - -/* FFOTER */ -.event-detail-buttons{ - width: 90%; - margin: 10px auto; -} -.event-detail-buttons ion-button{ - width: 90%; - margin: 0 auto; - display: block; - margin-bottom: 25px; -} -.ion-icon-delete{ - font-size: rem(22); - color: red; - background-color: white; - padding-right: 5px; -} -.error{ - color:red; - font-size: rem(12); - font-weight: bold; - padding-bottom: 20px; -} -/* .event-detail-buttons{ - margin-bottom: 80px; - margin-top: 10px; -} */ -.attendees-icon{ - font-size: rem(14); -} -.see-more-button{ - text-transform: initial; - font-size: rem(16); -} - diff --git a/src/app/pages/events/event-detail-modal/event-detail-modal.page.spec.ts b/src/app/pages/events/event-detail-modal/event-detail-modal.page.spec.ts deleted file mode 100644 index 76c8032a4..000000000 --- a/src/app/pages/events/event-detail-modal/event-detail-modal.page.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; - -import { EventDetailModalPage } from './event-detail-modal.page'; - -describe('EventDetailModalPage', () => { - let component: EventDetailModalPage; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ EventDetailModalPage ], - imports: [IonicModule.forRoot()] - }).compileComponents(); - - fixture = TestBed.createComponent(EventDetailModalPage); - component = fixture.componentInstance; - fixture.detectChanges(); - })); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/pages/events/event-detail-modal/event-detail-modal.page.ts b/src/app/pages/events/event-detail-modal/event-detail-modal.page.ts deleted file mode 100644 index 12136919e..000000000 --- a/src/app/pages/events/event-detail-modal/event-detail-modal.page.ts +++ /dev/null @@ -1,250 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { ActivatedRoute, Router } from '@angular/router'; -import { AlertController, ModalController } from '@ionic/angular'; -import { Attachment } from 'src/app/models/attachment.model'; -import { Event } from 'src/app/models/event.model'; -import { EventBody } from 'src/app/models/eventbody.model'; -import { EventPerson } from 'src/app/models/eventperson.model'; -import { AlertService } from 'src/app/services/alert.service'; -import { AttachmentsService } from 'src/app/services/attachments.service'; -import { EventsService } from 'src/app/services/events.service'; -import { AttachmentsPage } from '../attachments/attachments.page'; -import { AttendeesPageModal } from '../attendees/attendees.page'; - -@Component({ - selector: 'app-event-detail-modal', - templateUrl: './event-detail-modal.page.html', - styleUrls: ['./event-detail-modal.page.scss'], -}) -export class EventDetailModalPage implements OnInit { - - loadedEvent: Event; - loadedEventAttachments: Attachment[]; - pageId: string; - showLoader: boolean; - backURL: string; - ionicForm: FormGroup; - isSubmitted = false; - - minDate: Date; - - profile:string; - - constructor( - public formBuilder: FormBuilder, - public alertController: AlertController, - private router: Router, - private activatedRoute: ActivatedRoute, - private eventsService: EventsService, - private modalCtrl: ModalController, - private alertService: AlertService, - private attachamentsService: AttachmentsService, - private route: Router,) { - this.loadedEvent = new Event(); - this.loadedEvent.Body = new EventBody(); - } - - ngOnInit() { - this.loadEvent(); - this.loadAttachments(); - this.ionicForm = this.formBuilder.group({ - subject: ['', [Validators.required]] - }) - - // this.setDefaultTime() - } - - // setDefaultTime() { - // this.loadedEvent.StartDate = new Date() - // this.loadedEvent.EndDate = (new Date(new Date().getTime() + 15 * 60000)) - // } - - get errorControl() { - return this.ionicForm.controls; - } - - loadEvent(){ - let eventid: string; - this.activatedRoute.paramMap.subscribe(paramMap => - { - if (!paramMap.has("eventId")){ - return; - } - else{ - this.pageId = paramMap.get('eventId'); - eventid = paramMap.get('eventId'); - - - } - if (paramMap.has("caller")){ - this.backURL = "/home/" + paramMap.get('caller'); - } - } - ); - this.eventsService.getEvent(eventid).subscribe(response => { - this.loadedEvent = response; - }); - } - - async openAttendees(){ - const modal = await this.modalCtrl.create({ - component: AttendeesPageModal, - componentProps: { - eventAttendees: this.loadedEvent.Attendees - }, - cssClass: 'attendee modal-desktop', - backdropDismiss: false - }); - - - - modal.onDidDismiss().then((data) => { - if (data['data'] != null) - { - let newattendees: EventPerson[] = data['data']; - this.loadedEvent.Attendees = newattendees; - } - }); - - await modal.present(); -} - - getEventAttendees(): EventPerson[] - { - return this.loadedEvent.Attendees; - } - - setEventAttendees(newattendes: EventPerson[]) - { - this.loadedEvent.Attendees = newattendes; - } - - async deleteConfirm() - { - const alert = await this.alertController.create({ - cssClass: 'my-custom-class', - header: 'Apagar evento!', - message: 'Deseja apagar o evento da agenda ' + this.loadedEvent.CalendarName + '?', - buttons: [ - { - text: 'Não', - role: 'cancel', - cssClass: 'secondary', - handler: () => { } - }, { - text: 'Sim', - handler: () => { - this.Delete(); - } - } - ] - }); - - await alert.present(); - } - - Delete() - { - this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => - { - const alert = await this.alertController.create({ - cssClass: 'my-custom-class', - header: 'Evento removido', - buttons: ['OK'] - }); - - setTimeout(()=>{ - alert.dismiss(); - }, 1500); - - this.router.navigate(['/home/events']); - }); - } - - Save() - { - if (this.ionicForm.valid) - { - - this.eventsService.putEvent(this.loadedEvent, 2, 3, "md").subscribe(async () => - { - const alert = await this.alertController.create({ - cssClass: 'my-custom-class', - header: 'Evento actualizado', - buttons: ['OK'] - }); - - setTimeout(()=>{ - alert.dismiss(); - }, 1500); - }); - } - } - - showAlert(){ - this.alertService.presentAlert("Funcionalidade em desenvolvimento"); - } - - loadAttachments() - { - /* this.attachamentsService.getEventAttachments(this.pageId).subscribe(attachments => { - this.loadedEventAttachments = attachments; - }); */ - this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => { - - - },((erro) => { - console.error('loadAttchament', erro) - })); - } - async viewDocument(documenturl:string) - { - const url: string = documenturl.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1"); - /* const browser = this.iab.create(url,"_blank"); - browser.show(); */ - } - - back() - { - //this.back(); - } - doRefresh(event){ - /* this.RefreshEvents(); */ - try { - event?.target?.complete(); -} catch(error) {} - setTimeout(() => { - try { - event?.target?.complete(); -} catch(error) {} - }, 2000); - - } - navigateTo(ev){ - this.route.navigate(['/home/events',ev]); - } - async openAttachments() { - const modal = await this.modalCtrl.create({ - component: AttachmentsPage, - componentProps: { - eventId: this.pageId, - attachments: this.loadedEventAttachments - }, - cssClass: 'attachments', - backdropDismiss: false - }); - - await modal.present(); - - modal.onDidDismiss().then((data) => { - if (data['data'] != null) - { - let newattendees: EventPerson[] = data['data']; - this.loadedEvent.Attendees = newattendees; - } - }); - - } - -} diff --git a/src/app/pages/events/event-detail/event-detail.module.ts b/src/app/pages/events/event-detail/event-detail.module.ts deleted file mode 100644 index 96baa24e9..000000000 --- a/src/app/pages/events/event-detail/event-detail.module.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; - -import { IonicModule } from '@ionic/angular'; - -import { EventDetailPageRoutingModule } from './event-detail-routing.module'; - -import { EventDetailPage } from './event-detail.page'; - - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - ReactiveFormsModule, - EventDetailPageRoutingModule - ], - declarations: [EventDetailPage] -}) -export class EventDetailPageModule {} diff --git a/src/app/pages/events/event-detail/event-detail.page.html b/src/app/pages/events/event-detail/event-detail.page.html deleted file mode 100644 index dd67d33a2..000000000 --- a/src/app/pages/events/event-detail/event-detail.page.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - Visualizar Evento - - - - - - - -
- - -
- - Assunto - - - - - Campo obrigatório - -
- - Descrição - - - - Localização - - - - Calendário - - Pessoal - Oficial - - - - Tipo do evento - - Reunião - Viagem - Conferência - Encontro - - - - Data Início - - - - Data Fim - - - -
- - - Editar - - Intervenientes - -
-
-
- - - - {{attendee.Name}} - - -
- -
-
- -
-
-
-
- - - Editar - - Anexos - -
-
-
- - - - - -

{{ att.Description }}

-

{{ att.CreateDate }}

-
-
-
-
-
-
- -
-
- - - - - - - Sem anexos - - - -
-
-
-
- -
-
- - - - - -
- - - - - - - - - - - - -

- -

-

- -

-

- -

-
-
- - - - - -

- -

-

- -

-

- -

-
-
- - - -

- -

-

- -

-

- -

-
-
-
-
- -
- - -
- -
-
-
- diff --git a/src/app/pages/events/event-detail/event-detail.page.scss b/src/app/pages/events/event-detail/event-detail.page.scss deleted file mode 100644 index 5e735ad92..000000000 --- a/src/app/pages/events/event-detail/event-detail.page.scss +++ /dev/null @@ -1,119 +0,0 @@ -@import '~src/function.scss'; - -ion-item-group{ - margin: 15px; -} -.div-item{ - width: 100%; - overflow: auto; - border-bottom: 1px solid #ccc; - margin: 10px 0 5px 0; -} -.div-up{ - width: 100%; - overflow: auto; -} -.div-up h3{ - margin: 0; - padding: 0; - font-size: rem(17); - width: 100%; -} -.div-icon{ - width: 10%; - font-size: rem(22); - float: left; - color: #808080; -} -.div-icon ion-icon{ - display: block; - margin: 0 auto; - -} -.div-content-attachment{ - width: 85%; - float: left; - padding: 0 0 0 12px; -} -.ion-icon-attach{ - color: #666666; - font-size: rem(20); -} - -.btn-attach{ - margin: 15px 0 0 0; - --color: #333; - --border-color:#333; -} -.div-card-button{ - width: 100%; - overflow: auto; - padding: 0 !important; -} -ion-card{ - margin: 2.5% !important; - width: 45%; - float: left; -} -.center{ - text-align: center; - float: center; -} - -/* FFOTER */ -.event-detail-buttons{ - width: 90%; - margin: 10px auto; -} -.event-detail-buttons ion-button{ - width: 90%; - margin: 0 auto; - display: block; - margin-bottom: 25px; -} -.ion-icon-delete{ - font-size: rem(22); - color: red; - background-color: white; - padding-right: 5px; -} -.error{ - color:red; - font-size: rem(12); - font-weight: bold; - padding-bottom: 20px; -} -/* .event-detail-buttons{ - margin-bottom: 80px; - margin-top: 10px; -} */ -.attendees-icon{ - font-size: rem(14); -} -.see-more-button{ - text-transform: initial; - font-size: rem(16); -} - -.header-content{ - overflow: auto; - margin: 0 auto; - padding-top: 25px; -} -.header-icon-left{ - width: 36px; - font-size: rem(33); - color: #42b9fe; - float: left; - border: 1px solid red; -} -.header-title{ - width: 300px; - font-family: Roboto; - font-size: rem(25); - margin: 0 5px 0 5px; - padding: 0; - color:#000; - float: left; -} - diff --git a/src/app/pages/events/event-detail/event-detail.page.spec.ts b/src/app/pages/events/event-detail/event-detail.page.spec.ts deleted file mode 100644 index a3f346841..000000000 --- a/src/app/pages/events/event-detail/event-detail.page.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; - -import { EventDetailPage } from './event-detail.page'; - -describe('EventDetailPage', () => { - let component: EventDetailPage; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ EventDetailPage ], - imports: [IonicModule.forRoot()] - }).compileComponents(); - - fixture = TestBed.createComponent(EventDetailPage); - component = fixture.componentInstance; - fixture.detectChanges(); - })); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/pages/events/event-detail/event-detail.page.ts b/src/app/pages/events/event-detail/event-detail.page.ts deleted file mode 100644 index 52095b581..000000000 --- a/src/app/pages/events/event-detail/event-detail.page.ts +++ /dev/null @@ -1,254 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { EventsService } from 'src/app/services/events.service'; -import { Router } from '@angular/router'; -import { Event } from '../../../models/event.model'; -import { EventBody } from 'src/app/models/eventbody.model'; -import { AlertController, ModalController } from '@ionic/angular'; -import { EventPerson } from 'src/app/models/eventperson.model'; -import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page'; -import { AlertService } from 'src/app/services/alert.service'; -import { Attachment } from 'src/app/models/attachment.model'; -import { AttachmentsService } from 'src/app/services/attachments.service'; -import { FormGroup, FormBuilder, Validators } from "@angular/forms"; -import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; -import { AttachmentsPage } from '../attachments/attachments.page'; -import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; - - -@Component({ - selector: 'app-event-detail', - templateUrl: './event-detail.page.html', - styleUrls: ['./event-detail.page.scss'], -}) -export class EventDetailPage implements OnInit { - - loadedEvent: Event; - loadedEventAttachments: Attachment[]; - pageId: string; - showLoader: boolean; - backURL: string; - ionicForm: FormGroup; - isSubmitted = false; - - minDate: Date; - - profile:string; - - - constructor( - public formBuilder: FormBuilder, - public alertController: AlertController, - private router: Router, - private activatedRoute: ActivatedRoute, - private eventsService: EventsService, - private modalCtrl: ModalController, - private alertService: AlertService, - private attachamentsService: AttachmentsService, - private route: Router, - private iab: InAppBrowser, - private httpErrorHandle: HttpErrorHandle) { - this.loadedEvent = new Event(); - this.loadedEvent.Body = new EventBody(); - } - - - ngOnInit() { - this.loadEvent(); - this.loadAttachments(); - this.ionicForm = this.formBuilder.group({ - subject: ['', [Validators.required]] - }) - } - - get errorControl() { - return this.ionicForm.controls; - } - - loadEvent(){ - let eventid: string; - this.activatedRoute.paramMap.subscribe(paramMap => - { - if (!paramMap.has("eventId")){ - return; - } - else{ - this.pageId = paramMap.get('eventId'); - eventid = paramMap.get('eventId'); - - } - if (paramMap.has("caller")){ - this.backURL = "/home/" + paramMap.get('caller'); - } - } - ); - this.eventsService.getEvent(eventid).subscribe(response => { - this.loadedEvent = response; - },(error) => { - this.httpErrorHandle.httpStatusHandle(error) - }); - } - - async openAttendees(){ - const modal = await this.modalCtrl.create({ - component: AttendeesPageModal, - componentProps: { - eventAttendees: this.loadedEvent.Attendees - }, - cssClass: 'attendee modal-desktop', - backdropDismiss: false - }); - - - - modal.onDidDismiss().then((data) => { - if (data['data'] != null) - { - let newattendees: EventPerson[] = data['data']; - this.loadedEvent.Attendees = newattendees; - } - }); - await modal.present(); -} - - getEventAttendees(): EventPerson[] - { - return this.loadedEvent.Attendees; - } - - setEventAttendees(newattendes: EventPerson[]) - { - this.loadedEvent.Attendees = newattendes; - } - - async deleteConfirm() - { - const alert = await this.alertController.create({ - cssClass: 'my-custom-class', - header: 'Apagar evento!', - message: 'Deseja apagar o evento da agenda ' + this.loadedEvent.CalendarName + '?', - buttons: [ - { - text: 'Não', - role: 'cancel', - cssClass: 'secondary', - handler: () => { } - }, { - text: 'Sim', - handler: () => { - this.Delete(); - } - } - ] - }); - - await alert.present(); - } - - Delete() - { - this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => - { - /* const alert = await this.alertController.create({ - cssClass: 'my-custom-class', - header: 'Evento removido', - buttons: ['OK'] - }); - - await alert.present(); */ - - this.router.navigate(['/home/events']); - }); - } - - Save() - { - if (this.ionicForm.valid){ - - this.activatedRoute.paramMap.subscribe(paramMap =>{ - if (paramMap.has("profile")){ - - } - }); - - this.eventsService.editEvent(this.loadedEvent, 2, 3).subscribe(async () => - { - const alert = await this.alertController.create({ - cssClass: 'my-custom-class', - header: 'Evento actualizado', - buttons: ['OK'] - }); - - setTimeout(()=>{ - alert.dismiss(); - }, 1500); - }); - } - } - - showAlert(){ - this.alertService.presentAlert("Funcionalidade em desenvolvimento"); - } - - loadAttachments() - { - - this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => { - this.loadedEventAttachments = res; - - },((erro) => { - console.error('loadAttchament', erro) - })); - } - async viewDocument(documenturl:string) - { - const url: string = documenturl.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1"); - const browser = this.iab.create(url,"_blank"); - browser.show(); - } - - back() - { - //this.back(); - } - doRefresh(event){ - /* this.RefreshEvents(); */ - try { - event?.target?.complete(); -} catch(error) {} - setTimeout(() => { - try { - event?.target?.complete(); -} catch(error) {} - }, 2000); - - } - navigateTo(ev){ - this.route.navigate(['/home/events',ev]); - } - async openAttachments(){ - const modal = await this.modalCtrl.create({ - component: AttachmentsPage, - componentProps: { - eventId: this.pageId, - attachments: this.loadedEventAttachments - }, - cssClass: 'attachments', - backdropDismiss: false - }); - - - - modal.onDidDismiss().then((data) => { - if (data['data'] != null) - { - let newattendees: EventPerson[] = data['data']; - this.loadedEvent.Attendees = newattendees; - } - }); - - await modal.present(); - - } - -} diff --git a/src/app/pages/events/events-routing.module.ts b/src/app/pages/events/events-routing.module.ts index 5b2cbdb3c..9f1364e0b 100644 --- a/src/app/pages/events/events-routing.module.ts +++ b/src/app/pages/events/events-routing.module.ts @@ -8,10 +8,6 @@ const routes: Routes = [ path: '', component: EventsPage }, - { - path: 'event-detail', - loadChildren: () => import('./event-detail/event-detail.module').then( m => m.EventDetailPageModule) - }, { path: 'attachments', loadChildren: () => import('./attachments/attachments.module').then( m => m.AttachmentsPageModule) @@ -20,10 +16,6 @@ const routes: Routes = [ path: 'attendees', loadChildren: () => import('./attendees/attendees.module').then( m => m.AttendeesPageModule) }, - { - path: 'event-detail-modal', - loadChildren: () => import('./event-detail-modal/event-detail-modal.module').then( m => m.EventDetailModalPageModule) - }, { path: 'edit-event', loadChildren: () => import('./edit-event/edit-event.module').then( m => m.EditEventPageModule) diff --git a/src/app/pages/events/events.page.html b/src/app/pages/events/events.page.html index af111bdc6..d6cb0cd8d 100644 --- a/src/app/pages/events/events.page.html +++ b/src/app/pages/events/events.page.html @@ -23,26 +23,26 @@
- -
+ +
- +

{{customDate}}

- +

Correspondências com prazo para hoje

{{ TaskService.deadline }}
- +

Correspondências em atraso

{{ TaskService.overdueTasks }}
- +

Correspondências não lidas

@@ -56,12 +56,12 @@

Correspondências com prazo para hoje {{ TaskService.deadline }}

- +

Correspondências em atraso {{ TaskService.overdueTasks }}

- +

Correspondências não lidas {{ TaskService.unread }}

@@ -69,10 +69,10 @@
- +
- +
@@ -87,35 +87,35 @@ slot="end" src="assets/images/icons-arrow-circle-arrow-right.svg" > - + - + - +
- +
- +
{{event.StartDate | date: 'HH:mm'}}
{{event.EndDate | date: 'HH:mm'}}
- +
Todo
o dia
@@ -128,12 +128,12 @@
- +
- +
- +
@@ -150,21 +150,21 @@ slot="end" src="assets/images/icons-arrow-circle-arrow-right.svg" > - + - + - +
@@ -184,15 +184,15 @@
- +
- +
- +
@@ -211,21 +211,21 @@ slot="end" src="assets/images/icons-arrow-circle-arrow-right.svg" > - + - + - +
@@ -233,13 +233,13 @@ - +
- +
{{event.StartDate | date: 'HH:mm'}}
{{event.EndDate | date: 'HH:mm'}}
- +
Todo
o dia
@@ -252,12 +252,12 @@
- + - +
- +
@@ -272,21 +272,21 @@ slot="end" src="assets/images/icons-arrow-circle-arrow-right.svg" > - + - + - +
@@ -304,7 +304,7 @@
- +
@@ -314,4 +314,3 @@ - diff --git a/src/app/pages/events/events.page.ts b/src/app/pages/events/events.page.ts index 847a69cda..89a722e7c 100644 --- a/src/app/pages/events/events.page.ts +++ b/src/app/pages/events/events.page.ts @@ -3,7 +3,6 @@ import { EventsService } from 'src/app/services/events.service'; import { NavigationExtras, Router } from '@angular/router'; import { ActivatedRoute, NavigationEnd } from '@angular/router'; import { ModalController, Platform } from '@ionic/angular'; -import { EventDetailPage } from './event-detail/event-detail.page'; import { ProcessesService } from '../../services/processes.service'; import { ToDayEventStorage } from 'src/app/store/to-day-event-storage.service'; import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe'; @@ -16,6 +15,10 @@ import { ViewEventPage } from 'src/app/modals/view-event/view-event.page'; import { ChangeProfileService } from 'src/app/services/change-profile.service'; import { SessionStore } from 'src/app/store/session.service'; import { TaskService } from 'src/app/services/task.service'; +import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service'; +import { EEventFilterStatus } from 'src/app/module/agenda/data/dto/enums'; +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; + @Component({ selector: 'app-events', templateUrl: './events.page.html', @@ -90,7 +93,8 @@ export class EventsPage implements OnInit { private storage: Storage, public p: PermissionService, private changeProfileService: ChangeProfileService, - public TaskService: TaskService + public TaskService: TaskService, + public AgendaDataRepositoryService: AgendaDataRepositoryService ) { window['zipPhoneCallback'] = function (zipphone) { @@ -217,7 +221,8 @@ export class EventsPage implements OnInit { } - async RefreshEvents() { + @XTracerAsync({name:'home/getTask', bugPrint: true}) + async RefreshEvents(tracing?: TracingType) { this.currentEvent = ""; this.showLoader = true; @@ -225,21 +230,42 @@ export class EventsPage implements OnInit { let date = new Date(); let month = date.getMonth() + 1; + let start = date.getFullYear() + "-" + month + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); let end = date.getFullYear() + "-" + month + "-" + date.getDate() + " 23:59:59"; - if(SessionStore.user) { - let onwEvent:any = await this.eventService.getAllOwnEvents(start, end).catch((error) => { + + try { + if(SessionStore.user) { + + const response = await this.AgendaDataRepositoryService.EventList({ + userId: SessionStore.user.UserId, + calendarOwnerName: SessionStore.user.FullName, + startDate: date.toISOString(), + endDate: new Date(end).toISOString(), + status: EEventFilterStatus.AllToCommunicate + }, tracing) + + if(response.isOk()) { + this.listToPresent = response.value; + if(response.value?.length) { + this.totalEvent = response.value.length; + } + tracing.setAttribute('outcome', 'success') + } else { + tracing.setAttribute('outcome', 'failed') + } + this.showLoader = false; this.showAgendaLoader = false; - console.error(error) - }) - this.listToPresent = onwEvent; - if(onwEvent?.length) { - this.totalEvent = onwEvent.length; + + this.storage.set('events', this.listToPresent) + } else { + tracing.setAttribute('session', 'false') } - - this.storage.set('events', this.listToPresent) - + } catch (error) { + tracing.setAttribute('component.catch', 'true') + tracing.setAttribute('component.catch', JSON.stringify(error)) + tracing.setAttribute('outcome', 'failed') } this.showLoader = false; @@ -310,22 +336,6 @@ export class EventsPage implements OnInit { } } - async openEventDetail1(id: any) { - // - - const modal = await this.modalController.create({ - component: EventDetailPage, - componentProps: { - eventId: id, - }, - cssClass: 'event-detail', - backdropDismiss: false - }); - - modal.onDidDismiss(); - await modal.present(); - - } async openEventDetail(id: any) { // diff --git a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts index 05bfe9d33..a34c72216 100644 --- a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts +++ b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts @@ -671,6 +671,7 @@ export class DespachoPrPage implements OnInit { "path": resd.data.path, "ownerId": resd.data.ownerId, "status": resd.data.status, + "draft": true } this.mergedArray.push(object) console.log('List of draff', resd) diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts index 0dd8836b2..752fbe553 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -27,7 +27,8 @@ import { DocumentViewerOptionService } from "src/app/services/document-viewer-op import { fromEvent, merge, interval, Subscription } from 'rxjs'; import { takeUntil, filter, switchMap, take } from 'rxjs/operators'; import { DespachosOptionsPage } from 'src/app/shared/popover/despachos-options/despachos-options.page'; - +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; +import { AgendaService } from 'src/app/module/agenda/domain/agenda.service' @Component({ selector: 'app-despacho', templateUrl: './despacho.page.html', @@ -77,7 +78,8 @@ export class DespachoPage implements OnInit { private httpErrorHandle: HttpErrorHandle, public TaskService: TaskService, public DeviceService: DeviceService, - private DocumentViewerOptionService: DocumentViewerOptionService + private DocumentViewerOptionService: DocumentViewerOptionService, + private agendaService: AgendaService ) { @@ -94,8 +96,6 @@ export class DespachoPage implements OnInit { this.LoadTaskDetail(this.serialnumber); } - this.modalController.dismiss(); - } ngOnInit() { @@ -159,12 +159,14 @@ export class DespachoPage implements OnInit { "DraftIds": res.workflowInstanceDataFields?.DraftIds } + + // console.log({res}) // this.updateProcessOnDB(res); this.fulltask = res; - this.getDocumentPdf(this.fulltask.Documents) + this.getDocumentPdf({FolderID: res.workflowInstanceDataFields.FolderID}) console.log('All', this.mergedArray) @@ -197,29 +199,68 @@ export class DespachoPage implements OnInit { } }); } - getDocumentPdf(Documents: any) { - Documents.forEach(element => { - let docObject = { - "ApplicationId": element.ApplicationId, - "Assunto": element.Assunto, - "DocDate": element.DocDate, - "DocId": element.DocId, - "DocNumber": element.DocNumber, - "FolderId": element.FolderId, - "Sender": element.Sender, - "SourceDocId": element.SourceDocId, - "content": "", - "path": "", - "ownerId": "", - "status": "", + + getDocumentPdf({FolderID}) { + this.agendaService.getDraftListByProcessId({ + processId: FolderID + }).then(( draftList => { + + if(draftList.isOk()) { + const docObject = draftList.value.data.map((e) => ({ + "id": e.id, + "ownerId": e.ownerId, + "path": e.path, + "description":e.description, + "ApplicationId": "", + "Assunto": e.description, + "DocDate": e.createdAt, + "DocId": "", + "DocNumber": "element.DocNumber", + "FolderId": e.folderId, + "content": e.content, + "Sender": "uuid", + "SourceDocId": "element.SourceDocId", + "status": e.status, + })) + + for(const file of docObject) { + this.mergedArray.push(file); + } + + } - this.mergedArray.push(docObject); - }); + })); } - getDraft(split_stringDraft: string[]) { + + // getDocumentPdf(Documents: any) { + + // Documents.forEach(element => { + // let docObject = { + // "ApplicationId": element.ApplicationId, + // "Assunto": element.Assunto, + // "DocDate": element.DocDate, + // "DocId": element.DocId, + // "DocNumber": element.DocNumber, + // "FolderId": element.FolderId, + // "Sender": element.Sender, + // "SourceDocId": element.SourceDocId, + // "content": "", + // "path": "", + // "ownerId": "", + // "status": "", + // } + // this.mergedArray.push(docObject); + // }); + // } + + @XTracerAsync({name:'task/getDraft', bugPrint: true}) + getDraft(split_stringDraft: string[], tracing?: TracingType) { split_stringDraft.forEach(element => { // console.log('List of ids', element) + tracing.addEvent('start GetDraftByID') this.processes.GetDraftByID(element).subscribe((resd) => { + tracing.addEvent('end GetDraftByID') + tracing.setAttribute('sdfsdf', 'asdfsfd'); let object = { "ApplicationId": "", "Assunto": resd.data.description, @@ -233,9 +274,12 @@ export class DespachoPage implements OnInit { "path": resd.data.path, "ownerId": resd.data.ownerId, "status": resd.data.status, + "draft": true } this.mergedArray.push(object) // console.log('List of draff', resd) + }, (error) => { + console.log(error) }) }); diff --git a/src/app/pages/gabinete-digital/despachos/despachos.page.html b/src/app/pages/gabinete-digital/despachos/despachos.page.html index 3efac5be7..3905b5788 100644 --- a/src/app/pages/gabinete-digital/despachos/despachos.page.html +++ b/src/app/pages/gabinete-digital/despachos/despachos.page.html @@ -95,7 +95,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.ts b/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.ts index 4caa863a8..309970d45 100644 --- a/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.ts +++ b/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.ts @@ -504,6 +504,7 @@ export class DiplomaAssinarPage implements OnInit { "path": resd.data.path, "ownerId": resd.data.ownerId, "status": resd.data.status, + "draft": true }; this.draftArray.push(object); this.mergedArray.push(object); diff --git a/src/app/pages/gabinete-digital/diplomas-assinar/diplomas-assinar.page.html b/src/app/pages/gabinete-digital/diplomas-assinar/diplomas-assinar.page.html index 599547d08..20fccfc7a 100644 --- a/src/app/pages/gabinete-digital/diplomas-assinar/diplomas-assinar.page.html +++ b/src/app/pages/gabinete-digital/diplomas-assinar/diplomas-assinar.page.html @@ -99,7 +99,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/pages/gabinete-digital/diplomas-gerar/diplomas-gerar.page.html b/src/app/pages/gabinete-digital/diplomas-gerar/diplomas-gerar.page.html index fd37bd992..5abddef6e 100644 --- a/src/app/pages/gabinete-digital/diplomas-gerar/diplomas-gerar.page.html +++ b/src/app/pages/gabinete-digital/diplomas-gerar/diplomas-gerar.page.html @@ -87,7 +87,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} @@ -165,7 +165,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.html b/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.html index 4b0693bfa..411b284da 100644 --- a/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.html +++ b/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.html @@ -27,7 +27,7 @@
- +
diff --git a/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts b/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts index 207aeeb48..ad80c3e27 100644 --- a/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts +++ b/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts @@ -22,6 +22,7 @@ import { TaskService } from 'src/app/services/task.service' import { TinyMCEPage } from 'src/app/tiny-mce/tiny-mce.page'; import { DespachosPrOptionsPage } from 'src/app/shared/popover/despachos-pr-options/despachos-pr-options.page'; import { DiplomaOptionsPage } from 'src/app/shared/popover/deploma-options/deploma-options.page'; +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; @Component({ @@ -541,7 +542,9 @@ export class DiplomaPage implements OnInit { this.mergedArray.push(docObject); }); } - async getDraft(split_stringDraft: string[]) { + + @XTracerAsync({name:'task/getDraft', bugPrint: true}) + async getDraft(split_stringDraft: string[], tracing?: TracingType) { this.DraftNames = "" for(const strg of split_stringDraft) { @@ -562,6 +565,7 @@ export class DiplomaPage implements OnInit { "path": resd.data.path, "ownerId": resd.data.ownerId, "status": resd.data.status, + "draft": true } this.mergedArray.push(object) this.DraftNames = this.DraftNames + resd.data.description+";" diff --git a/src/app/pages/gabinete-digital/diplomas/diplomas.page.html b/src/app/pages/gabinete-digital/diplomas/diplomas.page.html index bb9b1beb9..23734c01e 100644 --- a/src/app/pages/gabinete-digital/diplomas/diplomas.page.html +++ b/src/app/pages/gabinete-digital/diplomas/diplomas.page.html @@ -55,7 +55,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} @@ -125,7 +125,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.html b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.html index 5f02fa00a..17b348596 100644 --- a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.html +++ b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.html @@ -10,7 +10,7 @@
-
+
@@ -96,7 +96,7 @@ (click)="viewDocument(document.SourceId, document.ApplicationId)" class="width-100 d-block list">

- {{document.SourceName}} + {{document.SourceName || 'Sem título'}} Correspondencia AccoesPresidenciais ArquivoDespachoElect diff --git a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts index 9c5a8bac7..2fa16d4ad 100644 --- a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts +++ b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts @@ -13,6 +13,7 @@ import { ToastService } from 'src/app/services/toast.service'; import { ThemeService } from 'src/app/services/theme.service' import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { TaskService } from 'src/app/services/task.service' +import { PermissionService } from 'src/app/services/permission.service'; @Component({ selector: 'app-approve-event-modal', @@ -44,7 +45,8 @@ export class ApproveEventModalPage implements OnInit { private toastService: ToastService, public ThemeService: ThemeService, private httpErrorHandle: HttpErrorHandle, - public TaskService: TaskService + public TaskService: TaskService, + public p: PermissionService, ) { @@ -54,7 +56,7 @@ export class ApproveEventModalPage implements OnInit { return; } else{ - this.serialNumber = paramMap.get('serialNumber'); + this.serialNumber = paramMap.get('serialNumber'); } }); } @@ -80,12 +82,12 @@ export class ApproveEventModalPage implements OnInit { this.loadedEvent = res; this.today = new Date(res.workflowInstanceDataFields.StartDate); this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); - + this.InstanceId = res.workflowInstanceDataFields.InstanceId this.getAttachments() }) - + } viewDocument(docId:string, applicationId:string){ @@ -95,7 +97,7 @@ export class ApproveEventModalPage implements OnInit { browser.show(); }); } - + async approveTask(serialNumber:string) { let body = { "serialNumber": serialNumber, "action": "Aprovar" } @@ -112,7 +114,7 @@ export class ApproveEventModalPage implements OnInit { } catch (error) { this.httpErrorHandle.httpStatusHandle(error) - } + } finally { loader.remove() } @@ -128,10 +130,10 @@ export class ApproveEventModalPage implements OnInit { async rejectTask(serialNumber:string) { let body = { "serialNumber": serialNumber, "action": "Rejeitar" } - + const loader = this.toastService.loading() - try { + try { await this.processes.PostTaskAction(body).toPromise() this.toastService._successMessage('Evento Eliminado!', () =>{ @@ -141,10 +143,10 @@ export class ApproveEventModalPage implements OnInit { if(error.status == 0) { this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão') } else { - + this.toastService._badRequest('Evento não rejeitado') } - } + } finally { loader.remove() } @@ -158,7 +160,7 @@ export class ApproveEventModalPage implements OnInit { } catch (error) { console.error('getAttachments', error) } - + } async openOptions(ev:any) { @@ -194,10 +196,10 @@ export class ApproveEventModalPage implements OnInit { modal.onDidDismiss().then( async (res) => { - if(res.data.option == 'save') { - - let body = { - "serialNumber": serialNumber, + if(res.data.option == 'save') { + + let body = { + "serialNumber": serialNumber, "action": "Emendar", "dataFields": { "ReviewUserComment": res.data, @@ -206,7 +208,7 @@ export class ApproveEventModalPage implements OnInit { // const loader = this.toastService.loading() - + try { await this.processes.PostTaskAction(body).toPromise() this.router.navigate(['/home/gabinete-digital/event-list']); @@ -215,11 +217,11 @@ export class ApproveEventModalPage implements OnInit { if(error.status == 0) { this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão') } else { - + this.toastService._badRequest('Evento não enviado para revisão'); } this.router.navigate(['/home/gabinete-digital/event-list']); - } + } finally { loader.remove() } @@ -243,7 +245,7 @@ export class ApproveEventModalPage implements OnInit { // backdropDismiss: false }); - + modal.onDidDismiss().then(res => { this.getTask(); this.getAttachments(); @@ -254,7 +256,7 @@ export class ApproveEventModalPage implements OnInit { await modal.present(); - } + } } diff --git a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.html b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.html index 0d2d354a3..ae92e5fe8 100644 --- a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.html +++ b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.html @@ -22,7 +22,7 @@

-
+
@@ -74,7 +74,7 @@
-
Intervenientes
+
Intervenientes({{loadedEvent.workflowInstanceDataFields.ParticipantsList.length}})
{{att.Name}}
@@ -90,12 +90,12 @@
-
Documentos Anexados
+
Documentos Anexados({{loadedAttachments.length}})
-

{{attachment.Description}}

+

{{attachment.sourceName || attachment.Description || 'Sem título'}}

{{attachment.Stakeholders}}{{ attachment.CreateDate | date: 'dd-MM-yyyy HH:mm' }}

@@ -104,14 +104,12 @@
-
+
- - + + -
- - +
@@ -126,7 +124,7 @@ - +
diff --git a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts index acba86506..14ce4936e 100644 --- a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts +++ b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts @@ -16,7 +16,11 @@ import { RouteService } from 'src/app/services/route.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { TaskService } from 'src/app/services/task.service'; import { AttachmentsService } from 'src/app/services/attachments.service'; - +import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service'; +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; +import { isHttpError } from 'src/app/services/http.service'; +import { EventsService } from 'src/app/services/events.service'; +import { PermissionService } from 'src/app/services/permission.service'; @Component({ selector: 'app-approve-event', @@ -59,6 +63,9 @@ export class ApproveEventPage implements OnInit { private httpErrorHandle: HttpErrorHandle, public TaskService: TaskService, private attachmentsService: AttachmentsService, + public AgendaDataRepositoryService: AgendaDataRepositoryService, + public EventsService: EventsService, + public p: PermissionService, ) { this.activatedRoute.paramMap.subscribe(params => { // @@ -72,6 +79,7 @@ export class ApproveEventPage implements OnInit { }); window['approve-event-getTask'] = () => { + // Mensagem de sucessos this.getTask() } } @@ -94,62 +102,37 @@ export class ApproveEventPage implements OnInit { } - addProcessToDB(data) { + @XTracerAsync({name:'ApproveEventPage/getTask', bugPrint: true}) + async getTask(tracing?: TracingType) { - } + const res = await this.AgendaDataRepositoryService.getEventToApproveById(this.serialNumber, tracing) + if (res.isOk()) { + this.loadedEvent = res.value; + this.today = new Date(res.value.workflowInstanceDataFields.StartDate); - getProcessFromDB() { + // + this.customDate = this.days[this.today.getDay()] + ", " + this.today.getDate() + " de " + (this.months[this.today.getMonth()]); + this.loadedAttachments = res.value.Attachments + tracing.setAttribute('outcome', 'success') + } else if(isHttpError(res.error)) { + tracing.setAttribute('eventId', this.serialNumber) - } - - getTask1 = () => { - this.processes.GetTask(this.serialNumber).subscribe(async res => { - - this.loadedEvent = res - this.addProcessToDB(this.loadedEvent) - - try { - this.today = new Date(this.loadedEvent.workflowInstanceDataFields.StartDate); - this.customDate = this.days[this.today.getDay()] + ", " + this.today.getDate() + " de " + (this.months[this.today.getMonth()]); - - } catch(error) { - // console.log(this.loadedEvent) - throw(error) - } - - }, (error) => { - if(error.status == 0) { - this.getProcessFromDB(); + if(res.error.status == 404) { + this.toastService._badRequest('Este evento já não existe') } else { - this.httpErrorHandle.httpStatusHandle(error) - } - }) - } - - async getTask () { - this.processes.GetTask(this.serialNumber).subscribe(async res => { - - this.loadedEvent = res - this.getAttachments(); - this.addProcessToDB(this.loadedEvent) - - try { - this.today = new Date(this.loadedEvent.workflowInstanceDataFields.StartDate); - this.customDate = this.days[this.today.getDay()] + ", " + this.today.getDate() + " de " + (this.months[this.today.getMonth()]); - - } catch(error) { - // console.log(this.loadedEvent) - throw(error) + this.httpErrorHandle.httpStatusHandle(res.error) } - }, (error) => { - if(error.status == 0) { - this.getProcessFromDB(); - } else { - this.httpErrorHandle.httpStatusHandle(error) - } - }) + tracing.setAttribute('outcome', 'failed') + + this.httpErrorHandle.httpStatusHandle(res.error) + } else if(!isHttpError(res.error)) { + + tracing.setAttribute('outcome', 'failed') + + this.toastService._badRequest('Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico. #12') + } } async approveTask(serialNumber: string) { @@ -158,19 +141,21 @@ export class ApproveEventPage implements OnInit { const loader = this.toastService.loading() - try { - await this.processes.PostTaskAction(body).toPromise() + const result = await this.AgendaDataRepositoryService.approveEvent(serialNumber)//.subscribe(async (value) => { + + if(result.isOk()) { this.goBack(); this.httpErrorHandle.httpsSucessMessagge('Evento aprovação') this.TaskService.loadEventosParaAprovacao(); - } catch (error) { - this.httpErrorHandle.httpStatusHandle(error) - } - finally { - loader.remove() + } else { + + console.log('aprove event error: ', result.error) + this.httpErrorHandle.httpStatusHandle(result.error) } + loader.remove() + } async emendTask(serialNumber: string) { @@ -189,7 +174,7 @@ export class ApproveEventPage implements OnInit { modal.onDidDismiss() .then(async (res) => { - if(res.data.option == 'save') { + if (res.data.option == 'save') { let body = { "serialNumber": serialNumber, @@ -200,30 +185,30 @@ export class ApproveEventPage implements OnInit { } - const loader = this.toastService.loading() + const loader = this.toastService.loading() - try { - await this.processes.PostTaskAction(body).toPromise() - .catch(() => { + const result = await this.AgendaDataRepositoryService.eventToaprovalStatus(serialNumber, 'Revision', res.data.note)//.subscribe((value) => { + if(result.isOk()) { + this.httpErrorHandle.httpsSucessMessagge('Rever') + this.TaskService.loadEventosParaAprovacao(); + this.goBack(); + + } else { + console.log('send event to revision error: ', result.error) + this.httpErrorHandle.httpStatusHandle(result.error) this.offlineManager.storeRequestData('event-listRever', body); - }); - this.httpErrorHandle.httpsSucessMessagge('Rever') - this.TaskService.loadEventosParaAprovacao(); - this.goBack(); - } catch (error) { - this.httpErrorHandle.httpStatusHandle(error) - } finally { + } + + + loader.remove() } - - - } }, (error) => { console.log(error) }); - await modal.present(); + await modal.present(); } @@ -231,17 +216,19 @@ export class ApproveEventPage implements OnInit { let body = { "serialNumber": serialNumber, "action": "Descartar" } const loader = this.toastService.loading() - try { - await this.processes.PostTaskAction(body).toPromise(); - this.httpErrorHandle.httpsSucessMessagge('Rejeitar') + + /* await this.processes.PostTaskAction(body).toPromise(); */ + const result = await this.AgendaDataRepositoryService.deleteEvent(serialNumber, true)//.subscribe((value) => { + if(result.isOk()) { + this.httpErrorHandle.httpsSucessMessagge('delete event') this.TaskService.loadEventosParaAprovacao(); this.goBack(); - } catch (error) { - this.httpErrorHandle.httpStatusHandle(error) - } - finally { - loader.remove() + } else { + + console.log('reject event error: ', result.error) + this.httpErrorHandle.httpStatusHandle(result.error) } + loader.remove() } async viewDocument(DocId: string, Document) { @@ -304,7 +291,7 @@ export class ApproveEventPage implements OnInit { modal.onDidDismiss().then(async (res) => { - if(res.data.option == 'save') { + if (res.data.option == 'save') { let body = { "serialNumber": serialNumber, @@ -379,7 +366,7 @@ export class ApproveEventPage implements OnInit { this.loadedAttachments = await this.attachmentsService.getAttachmentsById(this.loadedEvent.workflowInstanceDataFields.InstanceId).toPromise(); console.log(this.loadedAttachments) } catch (error) { - console.error('getAttchaments',error) + console.error('getAttchaments', error) } diff --git a/src/app/pages/gabinete-digital/event-list/event-list.page.html b/src/app/pages/gabinete-digital/event-list/event-list.page.html index d6dab1089..0f398a75b 100644 --- a/src/app/pages/gabinete-digital/event-list/event-list.page.html +++ b/src/app/pages/gabinete-digital/event-list/event-list.page.html @@ -8,7 +8,7 @@
- +
@@ -56,35 +56,29 @@
- + - -
- - Minha agenda + +
+
AGENDA DO PR
+
AGENDA DO MDGPR
+
Agenda {{calendars.wxFullName}}
+
+ Minha agenda +
-
{{ environment.agendaPR}}
-
{{ environment.agendaVP}}
-
Agenda do {{calendars.Fullname}}
-
- -
Minha agenda
-
{{ environment.agendaPR}}
-
{{ environment.agendaVP}}
-
Agenda do {{calendars.Fullname}}
-
- - -
Minha agenda
-
{{ environment.agendaPR}}
-
{{ environment.agendaVP}}
-
Agenda do {{calendars.Fullname}}
+
+
{{ environment.agendaPR}}
+
{{ environment.agendaVP}}
+
Agenda {{calendars.wxFullName}}
+
+ Minha agenda +
+
@@ -110,10 +104,14 @@ *ngFor="let event of list" (click)="goToEventToApproveDetail(event.serialNumber)">
-
+

{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}

{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}

+
+

Todo

+

o dia

+

{{event.workflowInstanceDataFields.Subject}}

{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}

diff --git a/src/app/pages/gabinete-digital/event-list/event-list.page.ts b/src/app/pages/gabinete-digital/event-list/event-list.page.ts index b42ca219f..ed2b355cd 100644 --- a/src/app/pages/gabinete-digital/event-list/event-list.page.ts +++ b/src/app/pages/gabinete-digital/event-list/event-list.page.ts @@ -14,6 +14,16 @@ import { RouteService } from 'src/app/services/route.service'; import { EventsService } from 'src/app/services/events.service'; import { SessionStore } from 'src/app/store/session.service'; import { environment } from 'src/environments/environment'; +import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service'; +import { map } from 'rxjs/operators'; +import { Observable } from 'rxjs'; +import { TableSharedCalendar } from 'src/app/module/agenda/data/data-source/agenda-local-data-source.service'; +import { RoleIdService } from 'src/app/services/role-id.service' +import { EEventFilterStatus } from 'src/app/module/agenda/data/dto/enums'; +import { isHttpError } from 'src/app/services/http.service'; +import { ToastService } from 'src/app/services/toast.service'; +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; + @Component({ selector: 'app-event-list', @@ -24,7 +34,6 @@ export class EventListPage implements OnInit { // [desktop] event list to approve profile: string; - segment: any; showLoader: boolean; eventPerson: EventPerson; eventBody: EventBody; @@ -48,9 +57,10 @@ export class EventListPage implements OnInit { } SessionStore = SessionStore; - + sharedCalendar: Observable + selectedUserCalendar:any; + constructor( - private processes: ProcessesService, private modalController: ModalController, private router: Router, private sortService: SortService, @@ -59,6 +69,9 @@ export class EventListPage implements OnInit { private RouteService: RouteService, public eventService: EventsService, public TaskService: TaskService, + public AgendaDataRepositoryService: AgendaDataRepositoryService, + public RoleIdService: RoleIdService, + private toastService: ToastService, ) { } ngOnInit() { @@ -66,34 +79,14 @@ export class EventListPage implements OnInit { if(window.location.pathname.includes('gabinete-digital')) { this.showFilter = true } - - this.eventService.onCalendarFinishLoad.subscribe(() => { - if(!this.segment) { - if(this.eventService.calendarNamesAry.includes('Meu calendario')) { - this.segment = 'Meu calendario'; - } else { - this.segment = this.eventService.calendarNamesAry[0].OwnerUserId - } - - // select pr by default - const pr = this.eventService.calendarNamesAry.find( e => e.Role == 'Presidente da República') - if(pr) { - this.segment = pr.OwnerUserId - } - - this.dynamicSearch() - } else { - this.dynamicSearch() - } - }) this.listSubscription = this.eventoaprovacaostore.registerCallback({ id: import.meta.url, funx:() => { this.dynamicSearch() - + } }) @@ -125,18 +118,32 @@ export class EventListPage implements OnInit { } }; + this.sharedCalendar = this.AgendaDataRepositoryService.getShareCalendarItemsLiveWithOrder() + this.setCalendarByDefault(); + + } + + async setCalendarByDefault() { + const data = await this.AgendaDataRepositoryService.geCalendars() + + const prObject = data.find(e => e?.roleId == 100000014) + + if(prObject) { + this.selectedUserCalendar = prObject.wxUserId + } else { + this.selectedUserCalendar = SessionStore.user.UserId + } + + + this.LoadToApproveEvents() } - ngOnDestroy() { this.listSubscription.delete() } - ngAfterViewInit(): void { - - - } + ngAfterViewInit(): void {} reorderList(orderBy: string) { @@ -149,8 +156,8 @@ export class EventListPage implements OnInit { async dynamicSearch() { if(this.showSearch && this.searchSubject) { - - const list = this.eventoaprovacaostore.get(this.segment).filter((task) => { + + const list = this.eventoaprovacaostore.get(this.selectedUserCalendar).filter((task) => { let subject = task.Folio || task.Subject || task.workflowInstanceDataFields.Subject subject = subject.toLowerCase(); return subject.includes(this.searchSubject.toLowerCase()) @@ -158,7 +165,7 @@ export class EventListPage implements OnInit { this.list = this.TaskService.reorderList(this.ordinance, list) } else { - const list = this.eventoaprovacaostore.get(this.segment) + const list = this.eventoaprovacaostore.get(this.selectedUserCalendar) this.list = this.TaskService.reorderList(this.ordinance, list) } @@ -170,51 +177,63 @@ export class EventListPage implements OnInit { this.LoadToApproveEvents(); } - async LoadToApproveEvents() { + @XTracerAsync({name:'EventListPage/LoadToApprove', bugPrint: true}) + async LoadToApproveEvents(tracing?: TracingType) { + console.log('aprove event') this.showLoader = true; - this.skeletonLoader = true - const segment = this.segment - if(this.segment == 'Meu calendario') { - // color - if(SessionStore.user.Profile == 'PR') { + const segment = this.selectedUserCalendar + + if(segment) { + let userId; + + if(this.selectedUserCalendar == SessionStore.user.UserId) { + // color + if(SessionStore.user.Profile == 'PR') { + this.color = 'pr' + } else { + this.color = 'mdgpr' + } + userId = SessionStore.user.UserId + + } else if(segment) { this.color = 'pr' - } else { - this.color = 'mdgpr' + userId = this.selectedUserCalendar } - let eventsList - let genericEvents = await this.processes.eventsToApprove(SessionStore.user.UserId,'mobile agenda').toPromise() - try { - eventsList = this.sortService.sortArrayByDate(genericEvents).reverse(); - } catch (error) { - this.skeletonLoader = false - eventsList = []; + + this.skeletonLoader = true + + let allEvents = await this.AgendaDataRepositoryService.eventToApproveList({ + userId, + status: EEventFilterStatus.Pending + }, tracing) + + if(allEvents.isOk()) { + tracing.setAttribute('outcome', 'success') + + if(allEvents.value.length >= 1) { + const eventsList = this.sortService.sortArrayByDate(allEvents.value).reverse(); + this.eventoaprovacaostore.save(segment, eventsList) + } else { + this.eventoaprovacaostore.save(segment, []) + } + } else { + + tracing.setAttribute('outcome', 'failed') + + if(!isHttpError(allEvents.error)) { + this.toastService._badRequest('Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico. #4') + } + this.eventoaprovacaostore.save(segment, []) + // this.showLoader = false; } - this.eventoaprovacaostore.save(segment, eventsList as any) - this.dynamicSearch() - - } else if(segment) { - - this.color = 'pr' - let eventsList = [] - let allEvents = await this.processes.eventsToApprove(segment,'mobile agenda').toPromise() - try { - eventsList = this.sortService.sortArrayByDate(allEvents).reverse(); - } catch(error) { - this.skeletonLoader = false - eventsList = [] - } - this.showLoader = false; - this.eventoaprovacaostore.save(segment, eventsList) - this.dynamicSearch() + this.skeletonLoader = false } - this.showLoader = false; - this.skeletonLoader = false } @@ -235,7 +254,7 @@ export class EventListPage implements OnInit { } goToEventToApproveDetail(serialNumber: string) { - + /* let navigationExtras: NavigationExtras = { queryParams: { diff --git a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.html b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.html index 8b7889fab..53b3bd4cc 100644 --- a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.html +++ b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.html @@ -25,7 +25,7 @@
-
+
@@ -33,19 +33,22 @@
- +
PR
+
+ Minha agenda +
- - -
{{ environment.agendaPR}}
-
{{ environment.agendaVP}}
-
Agenda do {{calendars.Fullname}}
-
Minha agenda
@@ -72,7 +75,6 @@
- @@ -81,13 +83,10 @@ -
- -
@@ -95,7 +94,6 @@
- @@ -114,10 +112,84 @@ -
+
+ + + + +
+
+ + Todo dia + + +
+
+ +
+
+
+
+
+ + + + + + Nunca + + + Diário + + + Semanalmente + + + Mensal + + + Anual + + + + +
+
+
+ +
+ +
+
+ +
+ +
+ + + + + + + + +
+
+
@@ -129,7 +201,7 @@ @@ -156,9 +228,8 @@
- -
-
-
- -
-
- - - - - - - - -
-
-
-
@@ -318,4 +358,3 @@
- diff --git a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts index fd4ebbb4e..d9639286f 100644 --- a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts +++ b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts @@ -9,7 +9,6 @@ import { AttachmentsService } from 'src/app/services/attachments.service'; import { SearchPage } from 'src/app/pages/search/search.page'; import { SearchList } from 'src/app/models/search-document'; import { LoginUserRespose } from 'src/app/models/user.model'; -import { AuthService } from 'src/app/services/auth.service'; import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page'; import { ToastService } from 'src/app/services/toast.service'; import { FormControl, FormGroup, Validators } from '@angular/forms'; @@ -24,6 +23,12 @@ import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { environment } from 'src/environments/environment'; import { TaskService } from 'src/app/services/task.service' import { ContactsService } from 'src/app/services/contacts.service'; +import { Utils } from 'src/app/module/agenda/utils'; +import { Observable } from 'rxjs'; +import { TableSharedCalendar } from 'src/app/module/agenda/data/data-source/agenda-local-data-source.service'; +import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service'; +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; +import { isHttpError } from 'src/app/services/http.service'; const moment = _rollupMoment || _moment; @@ -66,8 +71,6 @@ export class BookMeetingModalPage implements OnInit { public stepMinute = 15; public stepSecond = 5; - public dateControlStart = new FormControl(moment("DD MM YYYY hh")); - public dateControlEnd = new FormControl(moment("DD MM YYYY hh")); CalendarNamesOptions = ['Oficial', 'Pessoal'] Form: FormGroup; @@ -78,13 +81,6 @@ export class BookMeetingModalPage implements OnInit { showLoader = false - get dateStart() { - return this.dateControlStart.value; - } - - get dateEnd() { - return this.dateControlEnd.value; - } @ViewChild('picker') picker: any; @ViewChild('fim') fim: any; @@ -94,7 +90,7 @@ export class BookMeetingModalPage implements OnInit { task: any; fulltask: any; - taskParticipants: EventPerson[]; + taskParticipants: EventPerson[] = []; taskParticipantsCc: EventPerson[] = []; taskDocId: string; @@ -111,14 +107,19 @@ export class BookMeetingModalPage implements OnInit { showAttendees = false; emptyTextDescription = "Selecionar intervenientes"; - CalendarName - sessionStore = SessionStore; environment = environment loggeduser: LoginUserRespose; eventPersons: EventPerson[]; contacts: EventPerson[]; + hasChangeCalendar = false + selectedUserCalendar:any; + sharedCalendar: Observable + allDayCheck: boolean = false; + CalendarNameShow = true + eventRecurence = 'never'; + constructor( private modalController: ModalController, private navParams: NavParams, @@ -131,8 +132,8 @@ export class BookMeetingModalPage implements OnInit { private httpErroHandle: HttpErrorHandle, public TaskService: TaskService, private contactsService: ContactsService, - - + public utils: Utils, + private agendaDataRepository: AgendaDataRepositoryService, ) { this.taskParticipants = []; @@ -153,19 +154,17 @@ export class BookMeetingModalPage implements OnInit { this.postData.CalendarName = "Oficial"; let startDate = this.roundTimeQuarterHour() - this.dateControlStart = new FormControl(moment(startDate)); - this.dateControlEnd = new FormControl(moment(this.roundTimeQuarterHourPlus15(startDate))); + this.postData.StartDate = startDate; + this.postData.EndDate = this.roundTimeQuarterHourPlus15(startDate); this.postData.Category = 'Reunião' + this.postData.IsAllDayEvent = false - if (!this.CalendarName) { - if (this.eventService.calendarNamesAry.includes('Meu calendario')) { - this.CalendarName = 'Meu calendario'; - // console.log(this.eventService.calendarNamesAry) - } else { - this.CalendarName = this.eventService.calendarNamesAry[0] - } - } + this.postData.EventRecurrence = { + frequency: this.eventRecurence, + until: "", + Type: '' , + }; if (this.taskParticipants.length == 0) { this.taskParticipants = [ @@ -180,11 +179,19 @@ export class BookMeetingModalPage implements OnInit { this.changeAgenda(); this.loggeduser = SessionStore.user; + this.sharedCalendar = this.agendaDataRepository.getShareCalendarItemsLiveWithOrder() + + this.postData.EventRecurrence = { + frequency: 'never', + until: "", + Type: '' + } } ngOnInit() { // console.log('TEsTEROLE',this.eventService.calendarNamesAry) this.adding = "intervenient"; + this.setCalendarByDefault(true) this.getAttachments(); this.setDefaultTime() this.getRecurrenceTypes(); @@ -193,6 +200,24 @@ export class BookMeetingModalPage implements OnInit { } + + async setCalendarByDefault(force) { + if (!this.selectedUserCalendar || force) { + + const data = await this.agendaDataRepository.geCalendars() + + const prObject = data.find(e => e?.roleId == 100000014) + if(prObject) { + this.selectedUserCalendar = prObject.wxUserId + } else { + this.selectedUserCalendar = SessionStore.user.UserId + } + + this.changeAgenda() + + } + } + ngOnDestroy() { clearInterval(this.myInterval) } @@ -205,33 +230,34 @@ export class BookMeetingModalPage implements OnInit { }) }, 1000); + getRecurrenceTypes() { this.calendarService.getRecurrenceTypes().subscribe(res => { this.recurringTypes = res; }); } + changeSegmentCalendar() { + this.hasChangeCalendar = true + } - changeAgenda() { + async changeAgenda() { - setTimeout(() => { + this.CalendarNameShow = false - if (this.calendarService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.calendarService.calendarNamesType[this.CalendarName]?.['Pessoal']) { + const result = await this.agendaDataRepository.geCalendars() - this.CalendarNamesOptions = ['Oficial', 'Pessoal'] - } else if (this.calendarService.calendarNamesType[this.CalendarName]?.['Oficial']) { + const selectedCalendar = result.find(e => e.wxUserId == this.selectedUserCalendar) + if(selectedCalendar) { + if(selectedCalendar.shareType == 1) { this.CalendarNamesOptions = ['Oficial'] - this.postData.CalendarName = 'Oficial' - } else if (this.calendarService.calendarNamesType[this.CalendarName]?.['Pessoal']) { - + } else if(selectedCalendar.shareType == 2) { this.CalendarNamesOptions = ['Pessoal'] - this.postData.CalendarName = 'Pessoal' - } else { - + } else if (selectedCalendar.shareType == 3) { this.CalendarNamesOptions = ['Oficial', 'Pessoal'] } - }, 50) + } } @@ -258,13 +284,13 @@ export class BookMeetingModalPage implements OnInit { runValidation() { this.validateFrom = true - if (new Date(this.dateStart).getTime() > new Date(this.dateEnd).getTime()) { + if (new Date(this.postData.StartDate).getTime() > new Date(this.postData.EndDate).getTime()) { this.toastService._badRequest("A data de fim não pode ser inferior a data de início do evento") } } get dateValid() { - return new Date(this.dateControlStart.value).getTime() < new Date(this.dateControlEnd.value).getTime() ? 'ok' : null + return new Date(this.postData.StartDate).getTime() < new Date(this.postData.EndDate).getTime() ? 'ok' : null } injectValidation() { @@ -293,7 +319,8 @@ export class BookMeetingModalPage implements OnInit { }) } - async saveTask() { + @XTracerAsync({name:'convocar-reunia', bugPrint: true}) + async saveTask(tracing?: TracingType) { if (SessionStore.user.Profile != 'PR') { this.injectValidation() @@ -303,6 +330,8 @@ export class BookMeetingModalPage implements OnInit { let Attendees = this.taskParticipants.concat(this.taskParticipantsCc); + console.log({Attendees}) + this.eventBody = { BodyType: '1', Text: this.postData.Body.Text, @@ -314,26 +343,28 @@ export class BookMeetingModalPage implements OnInit { Location: this.postData.Location, CalendarId: '', CalendarName: this.postData.CalendarName, - StartDate: this.dateStart, - EndDate: this.dateEnd, - EventType: 'Reunião', + StartDate: this.postData.StartDate, + EndDate: this.postData.EndDate, + EventType: 'Meeting', Attendees: Attendees, IsMeeting: false, IsRecurring: false, AppointmentState: 0, TimeZone: 'UTC', Organizer: null, - Category: 'Reunião', + Category: 'Meeting', HasAttachments: true, + IsAllDayEvent: this.postData.IsAllDayEvent, EventRecurrence: { - Type: this.EventRecurrenceType, - LastOccurrence: this.Occurrence - }, + frequency: this.eventRecurence, + until: "", + Type: '' }, Attachments: [] } + this.postData.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); + const DocumentToSave = this.documents.map((e: any) => { - console.log('ASSUNTO', e.Assunto) return { ApplicationId: e.ApplicationType || e.ApplicationId, Source: 1, @@ -344,70 +375,106 @@ export class BookMeetingModalPage implements OnInit { } }); - postData.Attachments = DocumentToSave; + this.postData.Attachments = DocumentToSave as any; + let loader = this.toastService.loading(); + + const calendar = await this.agendaDataRepository.getCalendarByUserId(this.selectedUserCalendar) + if(calendar.isOk()) { + + const value = await this.agendaDataRepository.createEvent(this.postData, this.documents, calendar.value, tracing) + if(value.isOk()) { + + console.log(value.value) + + this.httpErroHandle.httpsSucessMessagge('new event') + loader.remove(); + tracing.setAttribute('outcome', 'success') + this.close(); + } else { + + if(!isHttpError(value.error)) { + this.toastService._badRequest('Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico. #1') + console.log(value.error) + } else { + this.httpErroHandle.httpStatusHandle(value.error.status) + } + console.log('create event error: ', value.error) + tracing.setAttribute('outcome', 'failed') + } + } else { + + + tracing.setAttribute('outcome', 'failed') + tracing.setAttribute('no', 'this.selectedUserCalendar') + } if (this.task.FsId == '8') { - const loader = this.toastService.loading() + // const calendar = await this.agendaDataRepository.getCalendarByUserId(this.selectedUserCalendar) + // if(calendar.isOk()) { - try { - const CalendarId = this.selectedCalendarId() - await this.calendarService.genericPostExpedientEvent(this.task.DocId, postData, "", this.task.SerialNumber, this.task.FsId, CalendarId).toPromise(); + // try { + // const value = await this.agendaDataRepository.createEvent(this.postData, this.documents, calendar.value, tracing).toPromise() + // console.log(value) + // this.httpErroHandle.httpsSucessMessagge('new event') + // loader.remove(); + // tracing.setAttribute('outcome', 'success') + // } catch (error) { + // console.log('create event error: ', error) + // tracing.setAttribute('outcome', 'failed') - this.modalController.dismiss(); - this.httpErroHandle.httpsSucessMessagge('Marcar Reunião') + // this.httpErroHandle.httpStatusHandle(error.status) + // } - } catch (error) { - this.httpErroHandle.httpStatusHandle(error) - } - finally { - loader.remove() - } + // } else { + // } } else if (this.task.FsId == '361') { - console.log('361') - const loader = this.toastService.loading() - try { + // console.log('361') + // const loader = this.toastService.loading() + // try { - const CalendarId = this.selectedCalendarId() - console.log({ CalendarId }) - await this.calendarService.genericCreateTaskEvent(this.task.FolderID | this.task.FolderId, postData, "", this.task.SerialNumber, this.task.FsId, CalendarId).toPromise(); + // const CalendarId = this.selectedCalendarId() + // console.log({ CalendarId }) + // await this.calendarService.genericCreateTaskEvent(this.task.FolderID | this.task.FolderId, postData, "", this.task.SerialNumber, this.task.FsId, CalendarId).toPromise(); - this.close(); - this.httpErroHandle.httpsSucessMessagge('Marcar Reunião') + // this.close(); + // this.httpErroHandle.httpsSucessMessagge('Marcar Reunião') - } catch (error) { - this.httpErroHandle.httpStatusHandle(error) - } finally { - loader.remove() - } + // } catch (error) { + // this.httpErroHandle.httpStatusHandle(error) + // } finally { + // loader.remove() + // } } else { this.toastService._successMessage('Não é possível marcar a reunião de momento'); } + + loader.remove(); } + onCheckboxChange(event: any) { + if (this.allDayCheck) { + this.postData.IsAllDayEvent = this.allDayCheck; + this.postData.StartDate = this.setAlldayTime(this.postData.StartDate) + this.postData.EndDate = this.setAlldayTimeEndDate(this.postData.EndDate) - - selectedCalendarId() { - - if (this.calendarService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postData.CalendarName == 'Oficial') { - return this.calendarService.calendarNamesType[this.CalendarName]['OficialId'] - - } else if (this.calendarService.calendarNamesType[this.CalendarName]?.['Pessoal'] && this.postData.CalendarName == 'Pessoal') { - - return this.calendarService.calendarNamesType[this.CalendarName]['PessoalId'] - + console.log('Recurso ativado!!'); } else { - return '11:11' + this.postData.IsAllDayEvent = this.allDayCheck; + this.postData.EndDate = this.setAlldayTimeEndDateNotAlday(this.postData.EndDate) + console.log('Recurso desativado'); + } } + async addParticipants() { this.adding = "intervenient"; @@ -626,4 +693,37 @@ export class BookMeetingModalPage implements OnInit { } } + + setAlldayTime(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(0) + date.setMinutes(0) + date.setSeconds(0); + + + return date + } + + setAlldayTimeEndDate(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(23) + date.setMinutes(59) + date.setSeconds(0); + + + return date + } + + setAlldayTimeEndDateNotAlday(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(23) + date.setMinutes(0) + date.setSeconds(0); + + + return date + } } diff --git a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts index bfcbd1e79..dfdfc11a1 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts +++ b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts @@ -94,6 +94,10 @@ export class ExpedienteDetailPage implements OnInit { this.caller = params["params"].caller; } }); + + window['attachments-expediente-update'] = () => { + this.LoadTaskDetail(this.serialNumber); + } } ngOnInit() { @@ -247,8 +251,12 @@ export class ExpedienteDetailPage implements OnInit { this.processes.GetTask(serial).subscribe(res => { + console.log('LoadTaskDetail') + this.TaskService.loadExpedientes(); + console.log("res========", res) + this.task = { "SerialNumber": res.serialNumber, "Folio": res.workflowInstanceDataFields.Subject, @@ -366,6 +374,7 @@ export class ExpedienteDetailPage implements OnInit { modal.onDidDismiss().then(async (res) => { if (res) { + console.log('attachment to add ==', res) const data = res.data; this.documents.push(data.selected); let body @@ -389,6 +398,15 @@ export class ExpedienteDetailPage implements OnInit { try { loader.remove() await this.attachmentsService.AddAttachment(body).toPromise() + console.log('attachment post') + setTimeout(() => { + this.LoadTaskDetail(this.serialNumber); + }, 1000); + + setTimeout(() => { + this.LoadTaskDetail(this.serialNumber); + }, 4000); + this.toastService._successMessage() } catch (error) { if (error.status == 0) { @@ -399,9 +417,6 @@ export class ExpedienteDetailPage implements OnInit { } } } - setTimeout(() => { - this.LoadTaskDetail(this.serialNumber); - }, 5000); }, (error) => { console.log(error) @@ -590,9 +605,8 @@ export class ExpedienteDetailPage implements OnInit { await modal.present(); } + // mobile async openOptions(taskAction?: any) { - - if (window.innerWidth > 500) { this.showOptions = true @@ -609,7 +623,16 @@ export class ExpedienteDetailPage implements OnInit { }); return await popover.present().then(() => { this.TaskService.loadExpedientes() + this.LoadTaskDetail(this.serialNumber); + + setTimeout(()=> { + this.LoadTaskDetail(this.serialNumber); + }, 1000) + + setTimeout(()=> { + this.LoadTaskDetail(this.serialNumber); + }, 4000) }, (error) => { console.log(error) }) diff --git a/src/app/pages/gabinete-digital/expediente/expediente.page.html b/src/app/pages/gabinete-digital/expediente/expediente.page.html index 5637f8be3..2689461dc 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente.page.html +++ b/src/app/pages/gabinete-digital/expediente/expediente.page.html @@ -102,7 +102,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts b/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts index 4318a2ec3..542a72252 100644 --- a/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts +++ b/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts @@ -208,7 +208,6 @@ export class ExpedientePrPage implements OnInit { modal.onDidDismiss().then((res)=>{ if(res){ - const data = res.data; this.documents.push(data.selected); diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index 9c0d83882..68cb8861a 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.html +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html @@ -9,7 +9,7 @@
- +
Gabinete Digital @@ -209,7 +209,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' @@ -647,7 +647,7 @@ TaskService.pedidosstore.listParecerCount.length}} correspondência nova

- Pedidos de Parecer solicitados por mim
+ Parecer solicitados por mim
{{ TaskService.pedidosstore.listParecerCount.length}} correspondências novas {{ @@ -906,4 +906,4 @@ [style.display]="showDiplomasGerar ? 'flex' : 'none'">

- \ No newline at end of file + diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.scss b/src/app/pages/gabinete-digital/gabinete-digital.page.scss index 760d40f48..274f01222 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.scss +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.scss @@ -315,7 +315,7 @@ ion-list { float: left; display: inline; margin: 0 !important; - padding: 2.5px 10.5px 2.5px 10.5px; + padding: 2.5px 10.5px 2.5px 0px; } } @@ -356,7 +356,7 @@ ion-list { /* border: 1px solid red; */ ion-label { - padding: 2.5px 10.5px 2.5px 10.5px; + padding: 2.5px 10.5px 2.5px 0px; margin: 0 !important; } } @@ -371,7 +371,7 @@ ion-list { //border: 1px solid blue; ion-label { - padding: 2.5px 10.5px 2.5px 10.5px; + padding: 2.5px 10.5px 2.5px 0px; margin: 0 !important; } } @@ -809,4 +809,4 @@ ion-segment-button { height: 11px; min-width: 27px; min-height: 27px; -} \ No newline at end of file +} diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.ts b/src/app/pages/gabinete-digital/gabinete-digital.page.ts index 5eb47d8c1..068c25b4e 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.ts +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.ts @@ -462,10 +462,10 @@ export class GabineteDigitalPage implements OnInit { async loadAllProcesses() { - // this.skeletonLoader = true - await this.TaskService.LoadTask() - this.dynamicSearch() - // this.skeletonLoader = false + this.skeletonLoader = true + await this.TaskService.LoadTask(); + this.dynamicSearch(); + this.skeletonLoader = false } diff --git a/src/app/pages/gabinete-digital/pedidos/pedidos.page.html b/src/app/pages/gabinete-digital/pedidos/pedidos.page.html index 9a7d4288b..90a7e586d 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedidos.page.html +++ b/src/app/pages/gabinete-digital/pedidos/pedidos.page.html @@ -121,7 +121,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} @@ -160,7 +160,7 @@
- {{task.activityInstanceName}} + {{task.WorkflowName}}
{{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/pages/gabinete-digital/viewer-attachment/prop.ts b/src/app/pages/gabinete-digital/viewer-attachment/prop.ts index 3c78d1a7f..0ea3ef3c5 100644 --- a/src/app/pages/gabinete-digital/viewer-attachment/prop.ts +++ b/src/app/pages/gabinete-digital/viewer-attachment/prop.ts @@ -11,8 +11,9 @@ export const ViewerAttachmentParams = z.object({ SourceDocId: z.string(), content: z.string().nonempty(), path: z.string().nonempty(), - ownerId: z.string().nonempty(), + ownerId: z.number(), status: z.string().nonempty(), + id: z.number().optional() }) export type ViewerAttachment = z.infer; diff --git a/src/app/pages/gabinete-digital/viewer-attachment/viewer-attachment.page.html b/src/app/pages/gabinete-digital/viewer-attachment/viewer-attachment.page.html index 71037aef3..6945d751e 100644 --- a/src/app/pages/gabinete-digital/viewer-attachment/viewer-attachment.page.html +++ b/src/app/pages/gabinete-digital/viewer-attachment/viewer-attachment.page.html @@ -23,7 +23,7 @@
{{ attachment.Assunto || "Sem assunto" }}
- {{ attachment.Sender }} + {{ attachment?.Sender }}
@@ -65,10 +65,10 @@
-
+
(); + constructor( public middlewareRepositoryService: MiddlewareRepositoryService, public DeviceService: DeviceService, - private processes: ProcessesService, private erroHandler: HttpErrorHandle, public p: PermissionService, private processService: ProcessesService, - private HeaderSettingsService: HeaderSettingsService + private AgendaService: AgendaService ) { } ngOnInit() { this.validateParams() const selectFirst = this.taskViewerAttachment[0] + + this.fetchDataSubject.pipe( + switchMap((data: any) => from(this.middlewareRepositoryService.getViewerLink(data))) + ).subscribe({ + next: (linkRequest) => { + this.renderViewer(linkRequest) + + console.log({linkRequest}) + }, + error: (error) => console.error(error) + }); } @@ -56,7 +73,6 @@ export class ViewerAttachmentPage implements OnInit { firstLoad = true async clickDocument(viewerAttachment: ViewerAttachment, i) { - this.draft = false let count = 0 @@ -68,55 +84,52 @@ export class ViewerAttachmentPage implements OnInit { return } - try { + try { this.selectedIndex = i; this.iframeContainer.nativeElement.style.display = 'none' - const requestI = this.selectedIndex - - const linkRequest = await this.middlewareRepositoryService.getViewerLink({ + this.fetchDataSubject.next({ ApplicationId: viewerAttachment.ApplicationId, DocId: viewerAttachment.DocId }) - - if(linkRequest.isOk() && requestI == this.selectedIndex) { - - // Optionally, you can add new content or recreate the iframe - var newIframe = document.createElement('iframe'); - if(linkRequest.value.includes("http")) { - newIframe.src = linkRequest.value; - - newIframe.width = '100%' - newIframe.height = '100%' - this.iframeContainer.nativeElement.innerHTML = "" - - this.iframeContainer.nativeElement.appendChild(newIframe) - - } else { - this.iframeContainer.nativeElement.innerHTML = "Sem documento" - } - - this.loading = false - this.iframeContainer.nativeElement.style.display = 'flex' - } else if (requestI != this.selectedIndex) { - - } else { - - this.loading = false - this.iframeContainer.nativeElement.style.display = 'none' - } - - } catch (error) { - setTimeout(async ()=> { + this.currentIndex = i + } catch (err) { + setTimeout(()=> { this.clickDocument(viewerAttachment, i); }, 1000) } + } + renderViewer(linkRequest: Result) { + if(linkRequest.isOk()) { + + // Optionally, you can add new content or recreate the iframe + var newIframe = document.createElement('iframe'); + if(linkRequest.value.includes("http")) { + + newIframe.src = linkRequest.value; + + newIframe.width = '100%' + newIframe.height = '100%' + this.iframeContainer.nativeElement.innerHTML = "" + + this.iframeContainer.nativeElement.appendChild(newIframe) + } else { + this.iframeContainer.nativeElement.innerHTML = "Sem documento" + } + + this.loading = false + this.iframeContainer.nativeElement.style.display = 'flex' + } else { + + this.loading = false + this.iframeContainer.nativeElement.style.display = 'none' + } } validateParams() { @@ -138,7 +151,10 @@ export class ViewerAttachmentPage implements OnInit { this.draft = this.isSelectedAttachmentIsDraft(this.taskViewerAttachment[this.selectedIndex]) if(!this.draft) { - this.clickDocument(task, this.selectedIndex) + if(this.selectedIndex != this.currentIndex) { + this.clickDocument(task, this.selectedIndex) + } + } } @@ -154,27 +170,28 @@ export class ViewerAttachmentPage implements OnInit { // do other stuff... } - - - - saveDraft(selectedIndex) { + async saveDraft(selectedIndex) { // Lógica que deseja executar em intervalos regulares console.log('Intervalo de 3 segundos...'); const document = this.taskViewerAttachment[selectedIndex] - let objectDraft = { + + const saveResult = await this.AgendaService.draftSaveById({ "status": false, "description": document.Assunto, "content": document.content, "path": document.path, - "ownerId": document.ownerId - } - this.processService.SaveDraftByID(document.DocId, objectDraft).subscribe((res) => { - console.log('Saved tinymce') - - }, (error) => { - this.erroHandler.httpStatusHandle(error) + "ownerId": document.ownerId, + "id": document.id }) + if(saveResult.isOk()) { + console.log('Saved tinymce') + } else { + if(saveResult.error.status) { + this.erroHandler.httpStatusHandle(saveResult.error) + } + + } } onEditorContentChange() { diff --git a/src/app/pages/inactivity/inactivity.page.ts b/src/app/pages/inactivity/inactivity.page.ts index b2950462a..b7afc603a 100644 --- a/src/app/pages/inactivity/inactivity.page.ts +++ b/src/app/pages/inactivity/inactivity.page.ts @@ -131,7 +131,7 @@ export class InactivityPage implements OnInit { if (this.code.length == 4) { if (!SessionStore.hasPin) { - // + // this.storePin() this.pinLogin() } else { @@ -174,7 +174,7 @@ export class InactivityPage implements OnInit { if (this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)) { //When user has got access to Agenda but does not have their own calendar, goes to Agenda - if (this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0) { + if (this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore?.user?.OwnerCalendars?.length == 0) { this.router.navigate(['/home/agenda']); } else { diff --git a/src/app/pages/login/login.page.html b/src/app/pages/login/login.page.html index 1463f960c..e122a65e1 100644 --- a/src/app/pages/login/login.page.html +++ b/src/app/pages/login/login.page.html @@ -31,7 +31,7 @@
- +
diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 471a0e1a6..9716ba458 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -22,6 +22,9 @@ import { Storage } from '@ionic/storage'; import { CPSession } from 'src/app/store/documentManagement'; import { StorageService } from 'src/app/services/storage.service'; import { DeviceService } from 'src/app/services/device.service' +import { Cy } from 'cypress/enum' +import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service'; +import { NotificationRepositoryService } from 'src/app/module/notification/data/notification-repository.service' @Component({ selector: 'app-login', templateUrl: './login.page.html', @@ -41,6 +44,7 @@ export class LoginPage implements OnInit { sessionStore = SessionStore; showPassword = false; passwordIcon = "eye"; + Cy = Cy constructor( private notificatinsservice: NotificationsService, @@ -60,7 +64,9 @@ export class LoginPage implements OnInit { private storage: Storage, private storageService: StorageService, private NotificationHolderService: NotificationHolderService, - private DeviceService: DeviceService + private DeviceService: DeviceService, + public AgendaDataRepositoryService: AgendaDataRepositoryService, + private NotificationRepositoryService: NotificationRepositoryService ) { } ngOnInit() { } @@ -135,7 +141,9 @@ export class LoginPage implements OnInit { loader.remove() + if (attempt) { + if (attempt.UserId == SessionStore.user.UserId) { await this.authService.SetSession(attempt, this.userattempt); @@ -144,9 +152,21 @@ export class LoginPage implements OnInit { if (attempt.ChatData) { - await this.authService.loginToChatWs(); - this.ChatService.setheader() - this.ChatSystemService.loadChat(); + try { + + await this.AgendaDataRepositoryService.getSharedCalendar() + await MessageModel.deleteAll(); + await DeleteMessageModel.deleteAll(); + this.ChatSystemService.clearChat(); + this.NotificationHolderService.clear() + await this.authService.loginToChatWs(); + this.ChatService.setheader() + + this.NotificationRepositoryService.init() + + } catch(error) { + console.log("faild to clear chat") + } } @@ -161,6 +181,9 @@ export class LoginPage implements OnInit { } else { + await this.NotificationRepositoryService.clearData() + + await this.AgendaDataRepositoryService.clearSharedCalendar() this.RochetChatConnectorService.logout(); this.clearStoreService.clear(); this.ChatSystemService.clearChat(); @@ -173,6 +196,7 @@ export class LoginPage implements OnInit { this.storage.clear(); await this.authService.SetSession(attempt, this.userattempt); + this.NotificationRepositoryService.init() /* CPSession.save(data) */ this.changeProfileService.run(); @@ -181,7 +205,6 @@ export class LoginPage implements OnInit { if (attempt.ChatData) { await this.authService.loginToChatWs(); this.ChatService.setheader(); - this.ChatSystemService.loadChat(); } this.storageService.remove("Notifications") this.getToken(); @@ -223,7 +246,7 @@ export class LoginPage implements OnInit { } else { if (this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)) { //When user has got access to Agenda but does not have their own calendar, goes to Agenda - if (this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0) { + if (this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore?.user?.OwnerCalendars.length == 0) { this.router.navigate(['/home/agenda']); } else { diff --git a/src/app/pages/publications/new-publication/new-publication.module.ts b/src/app/pages/publications/new-publication/new-publication.module.ts index aeaa9cc9c..48f26efaa 100644 --- a/src/app/pages/publications/new-publication/new-publication.module.ts +++ b/src/app/pages/publications/new-publication/new-publication.module.ts @@ -9,6 +9,9 @@ import { NewPublicationPageRoutingModule } from './new-publication-routing.modul import { NewPublicationPage } from './new-publication.page'; import '@teamhive/capacitor-video-recorder'; import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; +import { MatProgressBarModule } from '@angular/material/progress-bar'; + + @NgModule({ imports: [ CommonModule, @@ -16,6 +19,7 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; IonicModule, NewPublicationPageRoutingModule, FontAwesomeModule, + MatProgressBarModule, ], exports: [NewPublicationPage], declarations: [NewPublicationPage] diff --git a/src/app/pages/publications/new-publication/new-publication.page.html b/src/app/pages/publications/new-publication/new-publication.page.html index 4ea5b0adc..e7c1b6a17 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.html +++ b/src/app/pages/publications/new-publication/new-publication.page.html @@ -11,7 +11,7 @@
-
@@ -21,44 +21,53 @@
-
-
+
Fotografia Anexada
-
+
-
+
X
+
+ + + +
+ name="image" ngDefaultControl [src]="seleted.url" + (click)="imageSize(capturedImage)" style="height: 69px; width: 69px;">
- - + -

mais {{ seletedContent.length - displayLimit }}

+

mais {{ PublicationFromMvService.form.Files.length - displayLimit }}

-

{{capturedImageTitle}}

+
@@ -66,23 +75,7 @@
- - - -
+
-
+
- - - - -
+
- diff --git a/src/app/pages/publications/new-publication/new-publication.page.ts b/src/app/pages/publications/new-publication/new-publication.page.ts index 7581ea20c..506c05798 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -1,10 +1,8 @@ import { Component, OnInit } from '@angular/core'; -import { ModalController, NavParams, Platform, LoadingController } from '@ionic/angular'; +import { ModalController, NavParams, Platform } from '@ionic/angular'; /* import {Plugins, CameraResultType, CameraSource} from '@capacitor/core'; */ import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'; -import { PublicationsService } from 'src/app/services/publications.service'; -import { Publication } from 'src/app/models/publication'; import { Image } from 'src/app/models/image'; import { PhotoService } from 'src/app/services/photo.service'; //Capacitor @@ -12,29 +10,25 @@ import { PhotoService } from 'src/app/services/photo.service'; import { ToastService } from 'src/app/services/toast.service'; import { FormControl, FormGroup, Validators } from '@angular/forms'; import { ThemePalette } from '@angular/material/core'; -import { formatDate } from 'src/plugin/momentG.js' import { ThemeService } from 'src/app/services/theme.service'; -import { Camera, CameraResultType, CameraSource, Photo } from '@capacitor/camera'; +import { Camera, CameraResultType, CameraSource } from '@capacitor/camera'; -import { Filesystem, Directory, Encoding, FilesystemDirectory, FilesystemEncoding } from '@capacitor/filesystem'; +import { Filesystem, Directory, Encoding, FilesystemDirectory } from '@capacitor/filesystem'; import { NgxImageCompressService } from "ngx-image-compress"; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { PublicationFolderService } from 'src/app/store/publication-folder.service'; -import { RouteService } from 'src/app/services/route.service'; import { FileService } from 'src/app/services/functions/file.service'; -import { readAndCompressImage } from 'browser-image-resizer'; import { FilePicker } from '@capawesome/capacitor-file-picker'; -import { CapacitorVideoPlayer } from 'capacitor-video-player'; -import { CaptureError, CaptureImageOptions, MediaCapture, MediaFile } from '@awesome-cordova-plugins/media-capture/ngx'; -import { Capacitor } from '@capacitor/core'; -import { File } from '@ionic-native/file/ngx'; -import { Media } from '@ionic-native/media/ngx'; +import { CaptureImageOptions, MediaCapture } from '@awesome-cordova-plugins/media-capture/ngx'; import { checkFileTypeService } from 'src/app/services/checkFileType.service'; -import { FileValidatorService } from "src/app/services/file/file-validator.service" import { App } from '@capacitor/app'; import { NavigationExtras, Router } from '@angular/router'; import { VideoconvertService } from 'src/app/services/videoconvert.service' +import { PublicationAttachmentEntity } from 'src/app/shared/publication/upload/upload-streaming.service'; +import { PublicationFromMvService } from "src/app/shared/publication/upload/publication-from-mv.service" +import { CropImagePage } from 'src/app/modals/crop-image/crop-image.page'; +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; const config = { quality: 0.5, @@ -88,8 +82,6 @@ export class NewPublicationPage implements OnInit { validateFrom = false showLoader: boolean; - publication: Publication; - pub: Publication = new Publication(); folderId: string; image: Image = new Image(); @@ -117,7 +109,6 @@ export class NewPublicationPage implements OnInit { photoOrVideo: boolean = false; fileType = ""; filecontent: boolean; - seletedContent: any[] = [] // Set a limit for the number of images to display displayLimit = 4; filesSizeSum = 0; @@ -126,31 +117,58 @@ export class NewPublicationPage implements OnInit { private modalController: ModalController, public photoService: PhotoService, private navParams: NavParams, - private publications: PublicationsService, - private toastService: ToastService, public ThemeService: ThemeService, private platform: Platform, - private loadingCtrl: LoadingController, public imageCompress: NgxImageCompressService, private httpErrorHandle: HttpErrorHandle, public PublicationFolderService: PublicationFolderService, - private RouteService: RouteService, public FileService: FileService, private mediaCapture: MediaCapture, public checkFileType: checkFileTypeService, - private FileValidatorService: FileValidatorService, private router: Router, - private videoconvertService: VideoconvertService + private videoconvertService: VideoconvertService, + public PublicationFromMvService: PublicationFromMvService, + public publicationFolderService: PublicationFolderService, + ) { + this.PublicationFromMvService.clear() this.publicationType = this.navParams.get('publicationType'); this.folderId = this.navParams.get('folderId'); - this.publication = this.navParams.get('publication'); - if (this.publication) { - this.seletedContent = this.publication.Files; + const publication = this.navParams.get('publication'); + if (publication && Array.isArray(publication?.Files)) { this.filecontent = true; + + const newFiles: PublicationAttachmentEntity[] = publication.Files.map(e => { + return new PublicationAttachmentEntity( + { + base64: e.FileBase64, + extension: e.FileExtension, + OriginalFileName: e.OriginalFileName, + FileType: this.checkFileType.checkFileType(e.FileExtension) as any + } + ) + }) + + for (const files of newFiles) { + this.PublicationFromMvService.form.Files.push(files) + } } - console.log('Edit', this.publication) + + if(this.publicationType == '3') { + this.PublicationFromMvService.form.setData({ + DateIndex: publication.DateIndex, + DocumentId: publication.DocumentId, + ProcessId: publication.ProcessId, + Title: publication.Title, + Message: publication.Message, + DatePublication: publication.DatePublication + }) + + } + + + this.publicationTitle = 'Nova Publicação'; this.intent = this.navParams.get('intent'); @@ -158,27 +176,7 @@ export class NewPublicationPage implements OnInit { } - ngOnInit() { - this.reciveSharedContent(); - - this.setTitle(); - Filesystem.mkdir({ - path: IMAGE_DIR, - directory: Directory.Data, - recursive: true - }); - - /* try { - document.addEventListener("click", clickOutside, false); - function clickOutside(e) { - const inside = document.getElementById('container-multiselect').contains(e.target); - this.photoOrVideo = false; - console.log(this.photoOrVideo) - } - } catch (error) { - console.log('click butto', error) - } */ - } + ngOnInit() {} // in use async takePicture() { @@ -188,37 +186,10 @@ export class NewPublicationPage implements OnInit { resultType: CameraResultType.Base64, source: CameraSource.Camera }); - - console.log(capturedImage) - - this.capturedImage = 'data:image/jpeg;base64,' + capturedImage.base64String; - this.capturedImageTitle = 'foto'; - if (this.fileSizeToMB(capturedImage.base64String.length) <= 20) { - const compressedImage = await this.compressImageBase64( - this.capturedImage, - 800, // maxWidth - 800, // maxHeight - 0.9 // quality - ).then((picture) => { - console.log('take picture', this.removeTextBeforeSlash(picture, ','),) - this.filecontent = true; - this.photoOrVideo = false; - let fileObject = { - FileBase64: this.removeTextBeforeSlash(picture, ','), - FileExtension: capturedImage.format, - OriginalFileName: 'image' - } - this.seletedContent.push(fileObject) + this.capturedImageTitle = ''; + this.showCroppModal(); - - }); - } else { - if (this.seletedContent.length === 0) - this.filesSizeSum = 0 - - this.httpErrorHandle.validationMessagge('filessize'); - } } async laodPicture() { @@ -250,29 +221,20 @@ export class NewPublicationPage implements OnInit { this.video = data[0]; console.log('video record', data) data.forEach(async element => { - Capacitor.convertFileSrc(element.fullPath); - console.log('convert url', (Capacitor.convertFileSrc(element.fullPath))); this.filesSizeSum = this.filesSizeSum + element.size - if (this.fileSizeToMB(this.filesSizeSum) <= 20) { - - try { - if (this.platform.is('ios')) { - this.recordevideoIos(element.fullPath) - } else { - - } - - } catch (e) { - console.error('Unable to write file', e); + // element.size + try { + if (this.platform.is('ios')) { + this.recordevideoIos(element.fullPath, element) + } else { + this.recordVideoAndroid(element.fullPath, element) } - } else { - if (this.seletedContent.length === 0) - this.filesSizeSum = 0 - - this.httpErrorHandle.validationMessagge('filessize') + } catch (e) { + console.error('Unable to write file', e); } + }); } catch (error) { console.log('record video error: ', error) @@ -280,53 +242,30 @@ export class NewPublicationPage implements OnInit { } async loadVideo() { - - const result = await FilePicker.pickMedia - ({ - multiple: true, - }); + const result = await FilePicker.pickMedia({ multiple: true, }); console.log(result.files) - result.files.forEach(element => { - + result.files.forEach(async element => { this.filesSizeSum = this.filesSizeSum + element.size if (this.fileSizeToMB(this.filesSizeSum) <= 20) { console.log('pass size verificartion') - if (this.checkFileType.checkFileType(element.mimeType) == 'image' || this.checkFileType.checkFileType(element.mimeType) == 'video') { - let resultUrl = decodeURIComponent(element.path); - console.log('pass type verification ', resultUrl) - + if (this.checkFileType.checkFileType(element.mimeType) == 'video' && this.platform.is('ios')) { + let resultUrl = decodeURIComponent(element.path); console.log('pass type verification ', resultUrl) try { - Filesystem.readFile({ path: resultUrl }) - - .then(async (content) => { - console.log(result) - console.log(content) - this.filecontent = true; - let fileObject; - if (this.removeTextBeforeSlash(element.mimeType, '/') == "mp4") { - fileObject = { - FileBase64: 'data:video/mp4;base64,' + content.data, - FileExtension: this.removeTextBeforeSlash(element.mimeType, '/'), - OriginalFileName: 'video' - } - } else { - fileObject = { - FileBase64: content.data, - FileExtension: this.removeTextBeforeSlash(element.mimeType, '/'), - OriginalFileName: 'image' - } - } - - this.seletedContent.push(fileObject) - }) - .catch((err) => console.error(err)); + this.recordevideoIos(resultUrl, element) + } catch (error) { + console.log('upload video error: ', error) + } + } else if (this.checkFileType.checkFileType(element.mimeType) == 'image' || this.checkFileType.checkFileType(element.mimeType) == 'video') { + let resultUrl = decodeURIComponent(element.path); + console.log('pass type verification ', resultUrl) + try { + this.loadVideoAndroid(resultUrl, element) } catch (error) { console.log('upload video error: ', error) } - } } else { - if (this.seletedContent.length === 0) + if (this.PublicationFromMvService.form.Files.length === 0) this.filesSizeSum = 0 this.httpErrorHandle.validationMessagge('filessize') @@ -392,14 +331,14 @@ export class NewPublicationPage implements OnInit { injectValidation() { this.Form = new FormGroup({ - Subject: new FormControl(this.pub.Title, [ + Subject: new FormControl(this.PublicationFromMvService.form.Title, [ Validators.required, // Validators.minLength(4) ]), capturedImage: new FormControl(this.capturedImage, [ ]), - Message: new FormControl(this.pub.Message, [ + Message: new FormControl(this.PublicationFromMvService.form.Message, [ Validators.required, Validators.maxLength(1000) @@ -415,183 +354,85 @@ export class NewPublicationPage implements OnInit { if (this.Form.invalid) return false - if (this.seletedContent.length != 0) { + if (this.PublicationFromMvService.form.Files.length != 0) { - if (this.publicationType == '3') { - const loader = this.toastService.loading() + this.close(); - // has file - if (this.PublicationFolderService.PublicationHasImage(this.publication)) { - this.publication = { - DateIndex: this.publication.DateIndex, - DocumentId: this.publication.DocumentId, - ProcessId: this.publication.ProcessId, - Title: this.pub.Title, - Message: this.pub.Message, - DatePublication: this.publication.DatePublication, - OriginalFileName: this.publication.OriginalFileName, - Files: this.seletedContent, - } - - /* } else if (this.capturedVideo != '' && this.capturedImage == '') { - this.publication = { - DateIndex: this.publication.DateIndex, - DocumentId: this.publication.DocumentId, - ProcessId: this.publication.ProcessId, - Title: this.pub.Title, - Message: this.pub.Message, - DatePublication: this.publication.DatePublication, - OriginalFileName: this.publication.OriginalFileName || 'video', - Files: this.seletedContent, - FileExtension: 'mp4', - } - } */ - // no names - } else if (!this.PublicationFolderService.PublicationHasImage(this.publication)) { - this.publication = { - DateIndex: this.publication.DateIndex, - DocumentId: this.publication.DocumentId, - ProcessId: this.publication.ProcessId, - Title: this.pub.Title, - Message: this.pub.Message, - DatePublication: this.publication.DatePublication, - OriginalFileName: this.publication.OriginalFileName, - Files: this.seletedContent, - } - - - } /* else { - this.publication = { - DateIndex: this.publication.DateIndex, - DocumentId: this.publication.DocumentId, - ProcessId: this.publication.ProcessId, - Title: this.pub.Title, - Message: this.pub.Message, - DatePublication: this.publication.DatePublication, - OriginalFileName: this.publication.OriginalFileName, - FileBase64: this.publication.FileBase64, - FileExtension: this.publication.FileExtension || 'jpeg', - } - - } */ - - - try { - - const response = await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise() - - this.httpErrorHandle.httpsSucessMessagge('Editar publicação') - console.log({ response }) - - - this.close(); - } catch (error) { - if (error.status == 404) { - this.PublicationFolderService.deletePost(this.publication.ProcessId, this.publication.DocumentId) - this.close(); - } - this.httpErrorHandle.httpStatusHandle(error) - } finally { - loader.remove() - } - - } - else { - - const date = formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss') - - /* this.seletedContent = this.seletedContent.map((e) => { - if(e.FileExtension == "mp4") { - return { - FileBase64: e.FileBase64, - FileExtension: 'data:video/mp4;base64,'+e.FileExtension, - OriginalFileName: "video", - } - } - - return e - }) */ - - /* if (this.capturedImage != '') { */ - this.publication = { - DateIndex: date, - DocumentId: null, - ProcessId: JSON.stringify(this.folderId), - Title: this.pub.Title, - Message: this.pub.Message, - DatePublication: date, - OriginalFileName: this.capturedImageTitle || 'foto', - Files: this.seletedContent, - /* FileExtension: 'jpeg', */ - } - - /* } else if (this.capturedVideo != '') { - this.publication = { - DateIndex: date, - DocumentId: null, - ProcessId: this.folderId, - Title: this.pub.Title, - Message: this.pub.Message, - DatePublication: date, - OriginalFileName: this.capturedImageTitle || 'video', - Files: this.seletedContent, - FileExtension: 'mp4', - } - } */ - - - const loader = this.toastService.loading() - - try { - - - await this.publications.CreatePublication(this.folderId, this.publication).toPromise(); - this.httpErrorHandle.httpsSucessMessagge('Criar publicação') - if (window["sharedContent"]) { - - window["sharedContent"] = null - window["openFolder"] = true - - if(window.innerWidth <= 700) { - this.router.navigate(['/home/publications', this.folderId]); - } else if(window.innerWidth >= 701){ - let navigationExtras: NavigationExtras = { queryParams: { "folderId": this.folderId, } }; - this.router.navigate(['/home/publications']); - } - - return - } - - this.close(); - } catch (error) { - this.httpErrorHandle.httpStatusHandle(error) - } finally { - loader.remove() - } - - } - - this.PublicationFolderService.getPublicationsIds(this.folderId) + this.PublicationFromMvService.publicationType = this.publicationType as any + this.PublicationFromMvService.setFolderId(this.folderId) + await this.PublicationFromMvService.save() } else { this.httpErrorHandle.validationMessagge("noFileSelected") } } + ngOnDestroy() { + // if(!this.PublicationFromMvService.form.send) { + // this.PublicationFromMvService.cancel() + // } + } + close() { - this.modalController.dismiss(this.publication).then(() => { - this.showLoader = true; - }); + if (window["sharedContent"]) { + + if (this.platform.is('android')) { + window["sharedContent"] = null; + + this.publicationFolderService.gotoAction = this.folderId; + + this.modalController.dismiss({}).then(() => { + if(this.platform.is('tablet')) { + this.router.navigate(['/home/publications']) + } else { + this.router.navigate(['/home/publications', this.folderId]) + } + }); + } else { + window["sharedContent"] = null; + this.publicationFolderService.gotoAction = this.folderId; + + this.modalController.dismiss({}).then(() => { + if(this.platform.is('tablet')) { + this.router.navigate(['/home/publications']) + } else { + this.router.navigate(['/home/publications', this.folderId]) + } + + }); + + } + } else { + this.modalController.dismiss({}).then(() => {}); + } + } + + cancel() { + + this.PublicationFromMvService.form.cancel = true + if(this.PublicationFromMvService.form.send == false) { + this.PublicationFromMvService.cancel() + this.PublicationFromMvService.ObjectMergeNotification.close() + } if (window["sharedContent"]) { - this.closeApp(); + + if (this.platform.is('android')) { + App.exitApp() + } else { + window["sharedContent"] = null; + this.close() + } + } else { + this.close() } + } clear() { this.capturedImageTitle = null; - this.seletedContent = []; + this.PublicationFromMvService.form.Files = []; } setTitle() { @@ -603,8 +444,6 @@ export class NewPublicationPage implements OnInit { } else if (this.publicationType == '3') { this.publicationTitle = 'Editar Publicação'; - this.pub = this.navParams.get('publication'); - } } @@ -628,7 +467,7 @@ export class NewPublicationPage implements OnInit { deletePublicationImage() { - this.seletedContent = [] + this.PublicationFromMvService.form.Files = [] } async compressImageBase64(base64String: string, maxWidth: number, maxHeight: number, quality: number): Promise { @@ -768,32 +607,42 @@ export class NewPublicationPage implements OnInit { let FileExtension = this.removeTextBeforeSlash(element.title, '.') if (this.checkFileType.checkFileType(FileExtension) == 'image' || this.checkFileType.checkFileType(FileExtension) == 'video') { let resultUrl = decodeURIComponent(element.url); - Filesystem.readFile({ path: resultUrl }).then(async (content) => { - let fileObject; - try { - if (this.checkFileType.checkFileType(FileExtension) == 'image') { - fileObject = { - FileBase64: this.removeTextBeforeSlash(content.data, ','), - FileExtension: FileExtension, - OriginalFileName: 'shared', - } - } else if (this.checkFileType.checkFileType(FileExtension) == 'video') { - fileObject = { - FileBase64: 'data:video/mp4;base64,' + this.removeTextBeforeSlash(content.data, ','), - FileExtension: FileExtension, - OriginalFileName: 'shared', - } + if (this.platform.is('ios')) { + const stringGerada = this.gerarStringAleatoria(); + console.log(stringGerada); + this.shareContentIso(resultUrl, FileExtension, stringGerada) + } else { + this.shareContentAndroid(resultUrl, FileExtension) + } - } - console.log('shared base', content.data) + /* + Filesystem.readFile({ path: resultUrl }).then(async (content) => { + let fileObject; + try { + if (this.checkFileType.checkFileType(FileExtension) == 'image') { + fileObject = { + FileBase64: this.removeTextBeforeSlash(content.data, ','), + FileExtension: FileExtension, + OriginalFileName: 'shared', + } - this.seletedContent.push(fileObject) - } catch (error) { - console.log('error shared filesystem', error) - } + } else if (this.checkFileType.checkFileType(FileExtension) == 'video') { + fileObject = { + FileBase64: 'data:video/mp4;base64,' + this.removeTextBeforeSlash(content.data, ','), + FileExtension: FileExtension, + OriginalFileName: 'shared', + } - }) + } + console.log('shared base', content.data) + + this.seletedContent.push(fileObject) + } catch (error) { + console.log('error shared filesystem', error) + } + + }) */ } else { this.httpErrorHandle.validationMessagge('filetype'); } @@ -809,66 +658,299 @@ export class NewPublicationPage implements OnInit { } deleteFromSeletedContent(index) { - this.seletedContent.splice(index, 1) + this.PublicationFromMvService.form.Files.splice(index, 1) } - closeApp() { - if (this.platform.is('android')) - App.exitApp() - } - async recordevideoIos(fullPath) { + async recordevideoIos(fullPath, element) { + try { - const directory = await Filesystem.getUri({ - directory: Directory.Cache, - path: '', - }); + const directory = await Filesystem.getUri({ + directory: Directory.Cache, + path: '', + }); - this.videoconvertService.convertVideo(fullPath,directory.uri,'mp4'); + const stringGerada = this.gerarStringAleatoria(); - Filesystem.readFile({ path: `${directory.uri}output.mp4`}) + this.videoconvertService.convertVideo(fullPath, directory.uri, stringGerada, 'mp4').then(async () => { + await Filesystem.readFile({ path: `${directory.uri}${stringGerada}.mp4` }) - .then(async (content) => { - console.log(content.data) - this.filecontent = true; - let fileObject = { - FileBase64: 'data:video/mp4;base64,' + content.data, - FileExtension: 'mp4', - OriginalFileName: 'video' - } - this.seletedContent.push(fileObject) - }) - .catch((erro) => console.error('read converted video erro ', erro)); - } catch (error) { + .then(async (content) => { + this.filecontent = true; + + const newAttachment = new PublicationAttachmentEntity( + { + base64: content.data, + extension: 'mp4', + FileType: this.checkFileType.checkFileType('mp4') as any, + OriginalFileName: 'load video' + } + ) + + newAttachment.needUpload() + + this.PublicationFromMvService.form.Files.push(newAttachment) + + const deleteSecretFile = async () => { + await Filesystem.deleteFile({ + path: `${stringGerada}.mp4`, + directory: Directory.Cache, + }); + }; + await deleteSecretFile().then((value) => { + console.log('delete file', value) + }) + }) + .catch((erro) => console.error('read converted video erro ', erro)); + }); + + + } catch (error) { console.log('record video ios erro, ', error) - } + } } - async recordVideoAndroid(fullPath) { + async recordVideoAndroid(fullPath, element) { + try { - const savedFile = await Filesystem.copy({ - from: Capacitor.convertFileSrc(fullPath), - to: "video.mp4", - toDirectory: FilesystemDirectory.Data - }); - console.log(savedFile.uri) - Filesystem.readFile({ path: savedFile.uri }) + const savedFile = await Filesystem.copy({ + from: fullPath, + to: "video.mp4", + toDirectory: FilesystemDirectory.Data + }); + console.log(savedFile.uri) + Filesystem.readFile({ path: savedFile.uri }) - .then(async (content) => { - this.filecontent = true; - let fileObject = { - FileBase64: 'data:video/mp4;base64,' + content.data, - FileExtension: 'mp4', - OriginalFileName: 'video' - } - this.seletedContent.push(fileObject) - }) - .catch((error) => console.error('reade converted video erro ',error)); + .then(async (content) => { + + this.filecontent = true; + + const newAttachment = new PublicationAttachmentEntity( + { + base64: content.data, + extension: 'mp4', + FileType: this.checkFileType.checkFileType('mp4') as any, + OriginalFileName: 'load video' + } + ) + + newAttachment.needUpload() + this.PublicationFromMvService.form.Files.push(newAttachment) + + + }) + .catch((error) => console.error('reade converted video erro ', error)); } catch (error) { console.log('record video android erro ', error) } } + loadVideoIso() { + + } + + + @XTracerAsync({name:'new-publication-mobile/gallery', bugPrint: true, autoFinish: true}) + loadVideoAndroid(resultUrl, element, tracing?: TracingType) { + Filesystem.readFile({ path: resultUrl }) + + .then(async (content) => { + + this.filecontent = true; + + if (this.removeTextBeforeSlash(element.mimeType, '/') == "mp4") { + const newAttachment = new PublicationAttachmentEntity( + { + base64: content.data, + extension: this.removeTextBeforeSlash(element.mimeType, '/'), + FileType: this.checkFileType.checkFileType(this.removeTextBeforeSlash(element.mimeType, '/')) as any, + OriginalFileName: 'load video' + } + ) + + newAttachment.needUpload() + this.PublicationFromMvService.form.Files.push(newAttachment) + + tracing.setAttribute('outcome','success') + tracing.finish() + + } else { + this.capturedImage = 'data:image/jpeg;base64,' + content.data; + // tracing.log("capture file from gallery", { base64: content.data }) + this.showCroppModal(tracing) + tracing.finish() + /* const newAttachment = new PublicationAttachmentEntity( + { + base64: 'data:image/jpeg;base64,' + content.data, + extension: this.removeTextBeforeSlash(element.mimeType, '/'), + FileType: this.checkFileType.checkFileType(this.removeTextBeforeSlash(element.mimeType, '/')) as any, + OriginalFileName: 'image' + } + ) + + this.PublicationFromMvService.form.Files.push(newAttachment) */ + } + + + }) + .catch((err) => console.error(err)); + + } + + gerarStringAleatoria() { + const caracteres = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + let stringAleatoria = ''; + + for (let i = 0; i < 4; i++) { + const indiceAleatorio = Math.floor(Math.random() * caracteres.length); + stringAleatoria += caracteres.charAt(indiceAleatorio); + } + + return stringAleatoria; + } + + async shareContentIso(fullPath, FileExtension, filename) { + + try { + + if (this.checkFileType.checkFileType(FileExtension) == 'image') { + + Filesystem.readFile({ path: fullPath }).then(async (content) => { + try { + + console.log('shared base', content.data) + this.capturedImage = 'data:image/jpeg;base64,' + this.removeTextBeforeSlash(content.data, ','); + this.showCroppModal() + } catch (error) { + console.log('error shared filesystem', error) + } + + }) + } else if (this.checkFileType.checkFileType(FileExtension) == 'video') { + const directory = await Filesystem.getUri({ + directory: Directory.Cache, + path: '', + }); + + this.videoconvertService.convertVideo(fullPath, directory.uri, filename, 'mp4').then(async () => { + await Filesystem.readFile({ path: `${directory.uri}${filename}.mp4` }) + + .then(async (content) => { + console.log(content.data) + this.filecontent = true; + /* fileObject = { + FileBase64: this.removeTextBeforeSlash(content.data, ','), + FileExtension: 'mp4', + OriginalFileName: 'shared', + } */ + + const newAttachment = new PublicationAttachmentEntity( + { + base64: content.data, + extension: 'mp4', + FileType: this.checkFileType.checkFileType('mp4') as any, + OriginalFileName: 'shared' + } + ) + newAttachment.needUpload() + + this.PublicationFromMvService.form.Files.push(newAttachment) + + const deleteSecretFile = async () => { + await Filesystem.deleteFile({ + path: `${filename}.mp4`, + directory: Directory.Cache, + }); + }; + deleteSecretFile().then((value) => { + console.log('delete file', value) + + }) + .catch((erro) => console.error('read converted video erro ', erro)); + }); + + }); + + } + } catch (error) { + console.log('record video ios erro, ', error) + } + + } + + + shareContentAndroid(resultUrl, FileExtension) { + + console.log({resultUrl, FileExtension}) + + Filesystem.readFile({ path: resultUrl }).then(async (content) => { + try { + if (this.checkFileType.checkFileType(FileExtension) == 'image') { + this.capturedImage = 'data:image/jpeg;base64,' + this.removeTextBeforeSlash(content.data, ','); + this.showCroppModal() + + } else if (this.checkFileType.checkFileType(FileExtension) == 'video') { + + let newAttachment = new PublicationAttachmentEntity( + { + base64: content.data, + extension: 'mp4', + FileType: this.checkFileType.checkFileType('mp4') as any, + OriginalFileName: 'shared' + } + ) + newAttachment.needUpload() + this.PublicationFromMvService.form.Files.push(newAttachment) + + } + console.log('shared base', content.data) + + + } catch (error) { + console.log('error shared filesystem', error) + } + + }) + + } + + async showCroppModal(tracing?: TracingType) { + const modal = await this.modalController.create({ + component: CropImagePage, + componentProps: { + base64ToCroppe: this.capturedImage + }, + cssClass: 'modal modal-desktop' + }); + + modal.onDidDismiss().then((res) => { + if (res) { + + // tracing?.log('crop image', { + // base64: res.data.base64ToCroppe + // }) + this.capturedImage = res.data + this.filecontent = true; + this.photoOrVideo = false; + + const newAttachment = new PublicationAttachmentEntity( + { + base64: res.data.base64ToCroppe, + extension: 'jpeg', + OriginalFileName: "image", + FileType: 'image' + } + ) + + this.PublicationFromMvService.form.Files.push(newAttachment) + } + }, (error) => { + console.log(error) + }); + + await modal.present(); + } + } diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 4b793f994..e60d73235 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -18,6 +18,7 @@ import { NewPublicationPage } from './new-publication/new-publication.page'; import { ChunkService } from 'src/app/services/stream/chunk.service' import { StreamService } from 'src/app/services/stream/stream.service' import { HttpClient, HttpHeaders, HttpEventType } from '@angular/common/http'; +import { PublicationFolderService } from 'src/app/store/publication-folder.service'; // import { ActionModel } from 'src/app/models/beast-orm'; @@ -77,6 +78,7 @@ export class PublicationsPage implements OnInit { private ChunkService: ChunkService, private StreamService:StreamService, private http: HttpClient, + public publicationFolderService: PublicationFolderService, ) { @@ -86,19 +88,25 @@ export class PublicationsPage implements OnInit { console.log('shared recived', this.intent) + window['goToPublicationsList'] = this.goToPublicationsList + + window['updateAction'] = () => { + this.getActions() + } + } checkQueryParameter() { - var urlSearchParams = new URLSearchParams(window.location.search); - var folderId = urlSearchParams.get('folderId'); + // var urlSearchParams = new URLSearchParams(window.location.search); - if (folderId !== null && window["openFolder"]) { - window["openFolder"] = false + // var folderId = urlSearchParams.get('folderId'); + if (this.publicationFolderService.gotoAction) { + const folderId = this.publicationFolderService.gotoAction this.goToPublicationsList(folderId) + this.publicationFolderService.gotoAction = false } else { - console.log('Folder ID::', folderId); } } @@ -110,9 +118,11 @@ export class PublicationsPage implements OnInit { this.router.events.forEach((event) => { if (event instanceof NavigationEnd && event.url == pathname) { + console.log('=================', this.publicationFolderService.gotoAction) this.getActions(); - this.checkQueryParameter() + // this.checkQueryParameter() } + this.intent = window['sharedContent'] }); this.hideRefreshButton(); @@ -174,7 +184,7 @@ export class PublicationsPage implements OnInit { } - getActions() { + getActions = () => { this.showLoader = true this.publications.GetPublicationFolderList().subscribe(async res => { @@ -187,24 +197,6 @@ export class PublicationsPage implements OnInit { this.showLoader = false; - // (async ()=> { - - // const created = await ActionModel.create(folders) - // const stored = await ActionModel.all() - - // const notPresentOnTheRequest: ActionModel[] = stored.filter(e => { - // return !folders.find(b => e.ProcessId == b.ProcessId) - // }) - - // for (let ActionModelToDelete of notPresentOnTheRequest) { - // ActionModelToDelete.delete() - // } - - // // console.log({created, stored, folders, toDeletes}) - - // })() - - }, (error) => { this.showLoader = false; this.getFromDB() @@ -375,12 +367,15 @@ export class PublicationsPage implements OnInit { }); modal.onDidDismiss().then(() => { - this.doRefresh(event); + this.intent = window["sharedContent"] + // this.doRefresh(event); + this.checkQueryParameter(); }); await modal.present(); } - goToPublicationsList(folderId: string) { + goToPublicationsList = (folderId: string) => { + console.log('nice', folderId) if(window["sharedContent"]){ this.AddPublication('2',folderId,window["sharedContent"]) return diff --git a/src/app/pages/publications/view-publications/publication-detail/publication-detail.module.ts b/src/app/pages/publications/view-publications/publication-detail/publication-detail.module.ts index fd560537d..92a211016 100644 --- a/src/app/pages/publications/view-publications/publication-detail/publication-detail.module.ts +++ b/src/app/pages/publications/view-publications/publication-detail/publication-detail.module.ts @@ -7,12 +7,14 @@ import { IonicModule } from '@ionic/angular'; import { PublicationDetailPageRoutingModule } from './publication-detail-routing.module'; import { PublicationDetailPage } from './publication-detail.page'; +import { SwiperPageModule } from 'src/app/shared/swiper/swiper.module'; @NgModule({ imports: [ CommonModule, FormsModule, IonicModule, PublicationDetailPageRoutingModule, + SwiperPageModule ], declarations: [PublicationDetailPage], schemas: [CUSTOM_ELEMENTS_SCHEMA] diff --git a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.html b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.html index e3341a10a..89becd74f 100644 --- a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.html +++ b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.html @@ -22,21 +22,28 @@
-
- +
+ +
+ +
+ + diff --git a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.scss b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.scss index d64009620..ee2d027cf 100644 --- a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.scss +++ b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.scss @@ -56,14 +56,32 @@ ion-toolbar { .post-img { width: 100%; - height: 400px; + height: 100%; + + max-height: 400px; + min-height: 350px; + min-width: 350px; + margin: 0 auto; + border-radius: 0px !important; + overflow: hidden; + + display: flex; + justify-content: center; +} + +.post-video { + width: 100%; + height: 100%; + + max-height: 400px; + min-height: 350px; + min-width: 350px; margin: 0 auto; border-radius: 0px !important; overflow: hidden; display: flex; justify-content: center; - height: 420px; } .post-img img { height: 100%; @@ -76,4 +94,4 @@ ion-toolbar { .font-14-rem { font-size: rem(14) !important; -} \ No newline at end of file +} diff --git a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts index 8abf39b97..0c16f7b1b 100644 --- a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts +++ b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts @@ -1,4 +1,4 @@ -import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; +import { Component, ElementRef, OnInit, ViewChild, OnDestroy } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { ModalController } from '@ionic/angular'; import { Publication } from 'src/app/models/publication'; @@ -13,6 +13,7 @@ import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { PublicationFolderService } from 'src/app/store/publication-folder.service'; import { checkFileTypeService } from 'src/app/services/checkFileType.service'; import { StopvideoService } from "src/app/services/stopvideo.service" +import { PublicationHolderService } from 'src/app/services/publication/publication-holder.service' @Component({ @@ -22,6 +23,8 @@ import { StopvideoService } from "src/app/services/stopvideo.service" }) export class PublicationDetailPage implements OnInit { @ViewChild('videoPlayer', { static: true }) videoPlayer: ElementRef; + @ViewChild('ScrollContainer', { static: true }) ScrollContainer: ElementRef; + showLoader: boolean; DocumentId: string; folderId: string; @@ -34,6 +37,8 @@ export class PublicationDetailPage implements OnInit { dynamicBullets: true } + isComponentIsAlive = true + constructor( private modalController: ModalController, private publications:PublicationsService, @@ -45,7 +50,8 @@ export class PublicationDetailPage implements OnInit { private httpErrorHandle: HttpErrorHandle, public publicationFolderService: PublicationFolderService, public checkFileType: checkFileTypeService, - public StopvideoService: StopvideoService + public StopvideoService: StopvideoService, + public PublicationHolderService: PublicationHolderService ) { } @@ -77,7 +83,19 @@ export class PublicationDetailPage implements OnInit { OriginalFileName: '', FileExtension: '', }; + + window['publicationEdit'] = () => { + if(this.isComponentIsAlive == true) { + this.getPublicationDetail() + } + } + } + + ngOnDestroy() { + this.isComponentIsAlive = false + } + doRefresh(event) { this.getPublicationDetail(); @@ -131,9 +149,6 @@ export class PublicationDetailPage implements OnInit { if(this.isModal) { this.close() } else { - if(window['app-view-publications-page-doRefresh']) { - window['app-view-publications-page-doRefresh']() - } this.RouteService.goBack(); } @@ -167,28 +182,28 @@ export class PublicationDetailPage implements OnInit { } async editPost(publicationType:any) { + if(this.PublicationHolderService.PublicationFormMV.length == 0) { + const modal = await this.modalController.create({ + component: NewPublicationPage, + componentProps:{ + publicationType: publicationType, + publication: this.publication, + folderId: this.folderId + }, + cssClass: 'new-publication modal modal-desktop', + backdropDismiss: false + }); - const modal = await this.modalController.create({ - component: NewPublicationPage, - componentProps:{ - publicationType: publicationType, - publication: this.publication, - folderId: this.folderId - }, - cssClass: 'new-publication modal modal-desktop', - backdropDismiss: false - }); + modal.onDidDismiss().then((data) => { + + }); + + await modal.present(); + } else { + this.toastService._successMessage('já existe uma publicação a ser processado'); + } - modal.onDidDismiss().then((data) => { - if(data.data) { - this.publication = data.data - if(window['app-view-publications-page-doRefresh']) { - window['app-view-publications-page-doRefresh']() - } - } - }); - await modal.present(); } async openPreview(item) { diff --git a/src/app/pages/publications/view-publications/view-publications.module.ts b/src/app/pages/publications/view-publications/view-publications.module.ts index 97e2d16c7..9afc6b9da 100644 --- a/src/app/pages/publications/view-publications/view-publications.module.ts +++ b/src/app/pages/publications/view-publications/view-publications.module.ts @@ -10,7 +10,7 @@ import { ViewPublicationsPage } from './view-publications.page'; import { Attributes, IntersectionObserverHooks, LazyLoadImageModule, LAZYLOAD_IMAGE_HOOKS } from 'ng-lazyload-image'; import { ShowMorePageModule } from 'src/app/shared/publication/view-publications/show-more/show-more.module' -import { VisibilityDirective } from 'src/app/services/directives/visibility1.directive'; +import { SwiperPageModule } from 'src/app/shared/swiper/swiper.module'; export class LazyLoadImageHooks extends IntersectionObserverHooks { setup(attributes: Attributes) { attributes.offset = 10; @@ -30,9 +30,10 @@ setup(attributes: Attributes) { LazyLoadImageModule, //page ShowMorePageModule, + SwiperPageModule ], exports: [ViewPublicationsPage], - declarations: [ViewPublicationsPage, VisibilityDirective], + declarations: [ViewPublicationsPage], providers: [{provide: LAZYLOAD_IMAGE_HOOKS, useClass: LazyLoadImageHooks}], schemas: [CUSTOM_ELEMENTS_SCHEMA] }) diff --git a/src/app/pages/publications/view-publications/view-publications.page.html b/src/app/pages/publications/view-publications/view-publications.page.html index fec91d0e3..7f43e848c 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.html +++ b/src/app/pages/publications/view-publications/view-publications.page.html @@ -42,30 +42,54 @@

{{publicationFolderService.FolderDetails[folderId].Detail}}

- + +
+ +
+ + - + + + + -
+ + +
{{publication.Title}} diff --git a/src/app/pages/publications/view-publications/view-publications.page.scss b/src/app/pages/publications/view-publications/view-publications.page.scss index 1de677633..5db86279e 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.scss +++ b/src/app/pages/publications/view-publications/view-publications.page.scss @@ -164,6 +164,7 @@ video { } .post-content { margin: 0 auto; + margin-top: 20px; margin-bottom: 35px; } .post-title-time { @@ -251,7 +252,7 @@ swiper-slide { text-align: center; font-size: 18px; background: #ffff; - display: flex; + display: inline; justify-content: center; align-items: center; } @@ -275,6 +276,7 @@ swiper-slide img { background: black; } + swiper-slide video { width: 100%; height: 100%; @@ -300,3 +302,25 @@ swiper-slide video { display: none !important; } } + +.dotsSwiper { + height: 10px; + width: 10px; + background-color: gray; + border-radius: 50%; + display: inline-block; +} + +.active-dot { + background-color: black; +} + +.dots-container { + width: 100%; + text-align: center; +} + +.dots-container span { + display: inline-block; /* Display dots in a row */ + margin-right: 5px; +} diff --git a/src/app/pages/publications/view-publications/view-publications.page.ts b/src/app/pages/publications/view-publications/view-publications.page.ts index 1848c564a..a1d76bf95 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.ts +++ b/src/app/pages/publications/view-publications/view-publications.page.ts @@ -20,6 +20,9 @@ import { PublicationVideoManagerService } from "src/app/services/publication/pub import { StopvideoService } from "src/app/services/stopvideo.service" import { Result } from 'neverthrow'; import { App } from '@capacitor/app'; +import { ActiveTabService } from 'src/app/services/active-tab.service'; +import { PublicationHolderService } from 'src/app/services/publication/publication-holder.service' + @Component({ selector: 'app-view-publications', templateUrl: './view-publications.page.html', @@ -40,6 +43,8 @@ export class ViewPublicationsPage implements OnInit { publicationDitails: any; getpublication = []; private videoUrl: any; + swiperIndex: number = 0; + slideOpts = { initialSlide: 0, speed: 400, @@ -51,8 +56,12 @@ export class ViewPublicationsPage implements OnInit { }; swiperModules = [IonicSlides]; + publicationList: any + @ViewChild('VideoManager') VideoManager; @ViewChildren('videoElement') videoElements: QueryList; + @ViewChild('swiper') + swiperRef: ElementRef | undefined; constructor( private modalController: ModalController, @@ -63,13 +72,13 @@ export class ViewPublicationsPage implements OnInit { public ThemeService: ThemeService, private toastService: ToastService, public p: PermissionService, - private httpErroHandle: HttpErrorHandle, private storage: Storage, public publicationFolderService: PublicationFolderService, public checkFileType: checkFileTypeService, - private publicationVideoManagerService: PublicationVideoManagerService, public stopvideoService: StopvideoService, - private platform: Platform,) { + public platform: Platform, + public activeTabService: ActiveTabService, + public PublicationHolderService: PublicationHolderService) { /* this.publicationVideoManagerService.setContainer(this.VideoManager.nativeElement) */ @@ -118,6 +127,13 @@ export class ViewPublicationsPage implements OnInit { }) // console.log(this.publicationFolderService.publicationList[this.folderId]) + + setTimeout(()=> { + + // this.doRefresh({}) + + }, 1500) + } @@ -219,40 +235,9 @@ export class ViewPublicationsPage implements OnInit { this.showLoader = true; const folderId = this.folderId - try { - const publicationIds = await this.publications.GetPublicationsList(folderId).toPromise(); + await this.publicationFolderService.getPublicationsIds(folderId) - this.createPublicationList(folderId) - let loadLater = [] - for (let publicationId of publicationIds) { - - if (!this.publicationIsPresent(publicationId, folderId)) { - await this.loadPublication(publicationId, folderId) - - } else { - loadLater.push(publicationId) - } - } - - for (let publicationId of loadLater) { - await this.loadPublication(publicationId, folderId) - } - - for (let localPublication of this.publicationFolderService.publicationList[folderId]) { - - const apiPublication = publicationIds.includes(localPublication.DocumentId) - if (!apiPublication) { - this.publicationFolderService.deletePost(folderId, localPublication.DocumentId) - } - } - - this.showLoader = false; - - this.storage.set(folderId, this.publicationFolderService.publicationList[folderId]); - this.getpublication = this.publicationFolderService.publicationList[folderId]; - } catch (error) { - this.showLoader = false; - } + this.showLoader = false; } @@ -266,58 +251,29 @@ export class ViewPublicationsPage implements OnInit { return this.publicationFolderService.publicationList[folderId].findIndex(e => e.DocumentId == publicationId) } - async loadPublication(publicationId, folderId) { - let Publication = await this.publications.GetPublicationWithArrayOfFilesById(publicationId).toPromise(); - console.log('Publications with array of file: ', Publication.Files) - this.arrayOfFile = Publication.Files - let publicationDetails: Publication = this.publicationPipe.itemList(Publication) + async AddPublication(publicationType: any, folderId: any) { - const findIndex = this.publicationFindIndex(publicationId, folderId) - const found = this.publicationIsPresent(publicationId, folderId) + if(this.PublicationHolderService.PublicationFormMV.length == 0) { + const modal = await this.modalController.create({ + component: NewPublicationPage, + componentProps: { + publicationType: publicationType, + folderId: this.folderId, + }, + cssClass: 'new-publication modal modal-desktop', + backdropDismiss: false + }); - - - if (!found) { - this.publicationFolderService.publicationList[folderId].push(publicationDetails) - this.publicationFolderService.revertPublicationOrder(folderId) + modal.onDidDismiss().then(() => { + this.doRefresh(event); + }); + await modal.present(); } else { - - - let a: any = Object.assign({}, this.publicationFolderService.publicationList[folderId][findIndex]) - let b: any = Object.assign({}, publicationDetails) - - a.Files = a.Files.length - b.Files = b.Files.length - - if (JSON.stringify(a) != JSON.stringify(b)) { - - // console.log({a, b}) - this.publicationFolderService.publicationList[folderId][findIndex] = publicationDetails - } else { - // console.log({publicationDetails}) - } - + this.toastService._successMessage('já existe uma publicação a ser processado'); } } - async AddPublication(publicationType: any, folderId: any) { - const modal = await this.modalController.create({ - component: NewPublicationPage, - componentProps: { - publicationType: publicationType, - folderId: this.folderId, - }, - cssClass: 'new-publication modal modal-desktop', - backdropDismiss: false - }); - - modal.onDidDismiss().then(() => { - this.doRefresh(event); - }); - await modal.present(); - } - goToPublicationDetail(DocumentId: string, ProcessId: string) { this.stopVideo(); @@ -378,5 +334,16 @@ export class ViewPublicationsPage implements OnInit { return []; } } -} + + //click custom bullet go to slide + goToSlide(index: number) { + this.swiperIndex = this.swiperRef?.nativeElement.swiper.activeIndex; + this.swiperRef?.nativeElement.swiper.slideTo(index); + console.log('index slide', index) + } + + onSlideChange() { + this.swiperIndex = this.swiperRef?.nativeElement.swiper.activeIndex; + } +} diff --git a/src/app/pages/search/search.page.html b/src/app/pages/search/search.page.html index ea982381b..3d477eceb 100644 --- a/src/app/pages/search/search.page.html +++ b/src/app/pages/search/search.page.html @@ -44,7 +44,7 @@ @@ -316,4 +340,4 @@
- \ No newline at end of file + diff --git a/src/app/pages/search/search.page.scss b/src/app/pages/search/search.page.scss index b84f9a735..f15046abd 100644 --- a/src/app/pages/search/search.page.scss +++ b/src/app/pages/search/search.page.scss @@ -185,7 +185,7 @@ ion-slide { margin-left: 10px; .result-name { margin: 0px; - width: 100%; + // width: 100%; font-family: Roboto; font-size: rem(15); color: var(--title-text-color); @@ -201,7 +201,6 @@ ion-slide { background: var(--font-awesome); border-radius: 18px; text-align: center; - display: flex; align-items: center; padding: 0px 5px; color: white; @@ -212,6 +211,9 @@ ion-slide { -moz-border-radius: 18px; -ms-border-radius: 18px; -o-border-radius: 18px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } span.documente-date { } @@ -290,3 +292,33 @@ ion-slide { .swiper-container { width: 100%; } + + +a { + text-decoration: none; + display: inline-block; + padding: 8px 16px; +} + +a:hover { + background-color: #ddd; + color: black; +} + +.previous { + background-color: #f1f1f1; + color: black; +} + +.next { + background-color: #ffb81c; + color: white; +} + +.round { + border-radius: 50%; +} + +.nextAndPreviewDiv { + display:inline-flex +} diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index ec9b21a31..e90e83667 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -17,6 +17,13 @@ import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker'; import { NgxMatDateFormats } from '@angular-material-components/datetime-picker'; import { momentG } from 'src/plugin/momentG'; +import { Cy } from 'cypress/enum' +import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service'; +import { SessionStore } from 'src/app/store/session.service'; +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; +import { isHttpError } from 'src/app/services/http.service'; +import { ToastService } from 'src/app/services/toast.service'; +import { EEventFilterStatus } from 'src/app/module/agenda/data/dto/enums'; const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { parse: { @@ -90,21 +97,30 @@ export class SearchPage implements OnInit { select: boolean = false; showSearchInput = false + eventAgenda = false; checkRoutPublication: boolean; checkDateEnd: boolean; datePickerPlaceholder: string; + pageNumber = 1; + pageSize = 10; + totalPage: number; @ViewChild('picker1') picker1: any; checkAgenda: boolean; + Cy = Cy + constructor(private modalController: ModalController, private search: SearchService, private modalCtrl: ModalController, private navParams: NavParams, public ThemeService: ThemeService, private router: Router, - private httpErrorhandle: HttpErrorHandle) { + private httpErrorhandle: HttpErrorHandle, + private agendaDataRepository: AgendaDataRepositoryService, + private toastService: ToastService, + ) { this.ordinance = "recent"; this.currentPath = window.location.pathname; @@ -114,21 +130,22 @@ export class SearchPage implements OnInit { this.select = this.navParams.get('select'); this.showSearchInput = this.navParams.get('showSearchInput'); + this.eventAgenda = this.navParams.get('eventAgenda') if (this.type == null || this.type == undefined) { if (this.currentPath.includes('/home/agenda')) { this.type = "Agenda" - + } else if (this.currentPath.includes('/home/gabinete-digital')) { this.type = "AccoesPresidenciais & ArquivoDespachoElect" - + } else if (this.currentPath.includes('/home/publications')) { this.type = "AccoesPresidenciais" - + } else { - + } } } @@ -138,8 +155,8 @@ export class SearchPage implements OnInit { } myInterval = setInterval(() => { - document.querySelectorAll('.ngx-mat-timepicker input').forEach((e :any) => { - if(e) { + document.querySelectorAll('.ngx-mat-timepicker input').forEach((e: any) => { + if (e) { e.disabled = true; } }) @@ -154,9 +171,10 @@ export class SearchPage implements OnInit { } async view(item: SearchList) { + console.log('doc item',item) - const ApplicationType = item.ApplicationType.toString() - const Id = item.Id + const ApplicationType = item.applicationId.toString() + const Id = item.docId if (ApplicationType == '8') { @@ -167,12 +185,12 @@ export class SearchPage implements OnInit { componentProps: { trustedUrl: '', file: { - title: item.Assunto, + title: item.subject, url: '', title_link: '', }, applicationId: ApplicationType, - docId: item.Id, + docId: item.docId, }, cssClass: 'modal-width-100-width-background modal' }); @@ -185,12 +203,12 @@ export class SearchPage implements OnInit { componentProps: { trustedUrl: '', file: { - title: item.Assunto, + title: item.subject, url: '', title_link: '', }, applicationId: ApplicationType, - docId: item.Id, + docId: item.docId, }, cssClass: 'modal-width-100-width-background modal' }); @@ -201,7 +219,7 @@ export class SearchPage implements OnInit { ngOnInit() { - if(this.currentPath.includes('/home/publications')) { + if (this.currentPath.includes('/home/publications')) { this.checkRoutPublication = false; this.checkDateEnd = true; this.datePickerPlaceholder = 'Data Inicio*' @@ -270,7 +288,7 @@ export class SearchPage implements OnInit { }, ); // console.log('set visualy') - }, 300) + }, 1000) }); } @@ -351,7 +369,8 @@ export class SearchPage implements OnInit { /** * @description Basic search */ - basicSearch() { + @XTracerAsync({name:'search/basicSearch', bugPrint: true}) + async basicSearch(tracing?: TracingType) { let searchDocumentDate let searchDocumentDateEnd; @@ -370,50 +389,118 @@ export class SearchPage implements OnInit { } if (this.type == "Agenda") { - + this.showLoader = true if (this.searchSubject.trim() == "" && searchDocumentDate == null && searchDocumentDateEnd == null && this.searchSenderId == null && this.searchOrganicEntiryCode == null && this.searchDocTypeId == null) { - this.searchResult = "Campo de pesquisa esta vazio, entre com assunto que deseja pesquisa"; + this.searchResult = "Campo de pesquisa está vazio, entre com assunto que deseja pesquisa"; console.log('enter text'); } else { - this.showLoader = true; - this.search.basicSearch(this.searchSubject, searchDocumentDate,searchDocumentDateEnd, this.searchSenderId - , this.searchOrganicEntiryCode, this.searchDocTypeId, '0').subscribe(res => { - - if (!res.Categories.length) { - this.searchResult = "Não encontramos o que procura"; - } - res.Categories.forEach(e => { - e['Active'] = false; - }); + const searchEvents = await this.agendaDataRepository.searchEvent({ + value: this.searchSubject.trim(), + status: EEventFilterStatus.AllToCommunicate - // bind respose - this.searchCategories = res.Categories; + }, tracing) + if(searchEvents.isOk()) { - this.searchDocuments = this.sortArrayISODate(res.Documents); + this.showDocuments = true; + this.searchDocuments = searchEvents.value - this.reorderList(this.ordinance); + this.searchDocuments = this.sortArrayISODate(this.searchDocuments); + this.reorderList(this.ordinance); - // hide show document - if (this.searchDocuments.length >= 1) { - this.showDocuments = true; - } else { - this.showDocuments = false - } + if (this.searchDocuments.length >= 1) { + this.showDocuments = true; + } else { + this.searchResult = "Registo não encontrado" + this.showDocuments = false + } - this.showLoader = false; - this.loadWordCloud(); + this.loadWordCloud(); + tracing.setAttribute('outcome', 'success'); + } else { - }, error => { - this.showLoader = false; - // this.searchResult = "Registo não encontrado" - this.httpErrorhandle.httpStatusHandle(error) - // console.log(error) - }); + this.loadWordCloud(); + this.showDocuments = true; + + if(!isHttpError(searchEvents.error)) { + this.toastService._badRequest('Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico.') + + } else if (isHttpError(searchEvents.error)) { + this.httpErrorhandle.httpStatusHandle(searchEvents.error) + } + + tracing.setAttribute('outcome', 'failed'); + console.log('create event error: ', searchEvents.error) + } + + // this.showLoader = true; + // this.search.basicSearch(this.searchSubject, searchDocumentDate, searchDocumentDateEnd, this.searchSenderId + // , this.searchOrganicEntiryCode, this.searchDocTypeId, '0').subscribe(res => { + // console.log(res) + + // if (!res.Categories.length) { + // this.searchResult = "Não encontramos o que procura"; + // } + + // res.Categories.forEach(e => { + // e['Active'] = false; + // }); + + // // bind respose + // this.searchCategories = res.Categories; + + // this.searchDocuments = this.sortArrayISODate(res.Documents); + + // this.reorderList(this.ordinance); + + // // hide show document + // if (this.searchDocuments.length >= 1) { + // this.showDocuments = true; + // } else { + // this.showDocuments = false + // } + + // this.showLoader = false; + // this.loadWordCloud(); + + // }, error => { + // this.showLoader = false; + // // this.searchResult = "Registo não encontrado" + // this.httpErrorhandle.httpStatusHandle(error) + // // console.log(error) + // }); } + + this.showLoader = false + } + else if (this.type == "AccoesPresidenciais & ArquivoDespachoElect" && this.eventAgenda == true) { + this.showLoader = true; + this.agendaDataRepository.getDocumentAttachments(361, SessionStore.user.UserId, this.searchSubject, this.pageNumber, this.pageSize).subscribe((values) => { + this.totalPage = values.data.total / this.pageSize; + this.totalPage = Math.round(this.totalPage) + console.log(values.data.result) + this.searchDocuments = this.sortArrayISODate(values.data.result); + this.reorderList(this.ordinance); + + // hide show document + if (this.searchDocuments.length >= 1) { + this.showDocuments = true; + } else { + this.showDocuments = false + } + + this.showLoader = false; + this.loadWordCloud(); + }, error => { + this.showLoader = false; + // this.searchResult = "Registo não encontrado" + this.httpErrorhandle.httpStatusHandle(error) + // console.log(error) + }) + } else if (this.type == "AccoesPresidenciais & ArquivoDespachoElect") { @@ -429,7 +516,7 @@ export class SearchPage implements OnInit { console.log('enter text'); } else { - + this.search.searchForDoc(this.searchSubject, searchDocumentDate, this.searchSenderId , this.searchOrganicEntiryCode, this.searchDocTypeId, '8').subscribe(res => { this.showLoader = true; @@ -533,7 +620,7 @@ export class SearchPage implements OnInit { } else { this.showLoader = true; - this.search.basicSearch(this.searchSubject, searchDocumentDate,searchDocumentDateEnd, this.searchSenderId + this.search.basicSearch(this.searchSubject, searchDocumentDate, searchDocumentDateEnd, this.searchSenderId , this.searchOrganicEntiryCode, this.searchDocTypeId, '8').subscribe(res => { if (!res.Categories.length) { this.searchResult = "Não encontramos o que procura"; @@ -576,7 +663,7 @@ export class SearchPage implements OnInit { } }); } - if (this.searchSubject.trim() == "" && searchDocumentDate == null&& searchDocumentDateEnd == null && this.searchSenderId == null && this.searchOrganicEntiryCode == null && this.searchDocTypeId == null) { + if (this.searchSubject.trim() == "" && searchDocumentDate == null && searchDocumentDateEnd == null && this.searchSenderId == null && this.searchOrganicEntiryCode == null && this.searchDocTypeId == null) { this.searchResult = "Campo de pesquisa esta vazio, entre com assunto que deseja pesquisa"; console.log('enter text'); @@ -790,13 +877,13 @@ export class SearchPage implements OnInit { // }); - if (this.searchSubject.trim() == "" && searchDocumentDate == null && searchDocumentDateEnd == null && this.searchSenderId == null && this.searchOrganicEntiryCode == null && this.searchDocTypeId == null) { + if (this.searchSubject.trim() == "" && searchDocumentDate == null && searchDocumentDateEnd == null && this.searchSenderId == null && this.searchOrganicEntiryCode == null && this.searchDocTypeId == null) { this.searchResult = "Campo de pesquisa esta vazio, entre com assunto que deseja pesquisa"; console.log('enter text'); } else { this.showLoader = true; - this.search.basicSearchPublication(this.searchSubject, searchDocumentDate,searchDocumentDateEnd, this.searchSenderId + this.search.basicSearchPublication(this.searchSubject, searchDocumentDate, searchDocumentDateEnd, this.searchSenderId , this.searchOrganicEntiryCode, this.searchDocTypeId, '386').subscribe(res => { if (!res.Categories.length) { this.searchResult = "Não encontramos o que procura"; @@ -1010,9 +1097,9 @@ export class SearchPage implements OnInit { async viewDetail(searchDocument: SearchList) { - const ApplicationType = searchDocument.ApplicationType.toString() + const ApplicationType = searchDocument?.ApplicationType?.toString() const Id = searchDocument.Id - const CalendarId = searchDocument.ApplicationName.split(':')[1] + const CalendarId = searchDocument?.ApplicationName?.split(':')[1] const DocTypeDesc = searchDocument.DocTypeDesc if (this.select == false) { @@ -1133,4 +1220,18 @@ export class SearchPage implements OnInit { await modal.present(); } + nextButton(event) { + event.preventDefault(); + this.pageNumber++; + this.basicSearch() + } + + previeweButton(event) { + event.preventDefault(); + if (this.pageNumber > 1) { + this.pageNumber--; + this.basicSearch() + } + } + } diff --git a/src/app/services/Repositorys/contacts/DTO/contactsCombined.ts b/src/app/services/Repositorys/contacts/DTO/contactsCombined.ts new file mode 100644 index 000000000..5b54b3d81 --- /dev/null +++ b/src/app/services/Repositorys/contacts/DTO/contactsCombined.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +export const EventListOutputDTOSchema = z.object({ + wxUserId: z.number(), + fullName: z.string(), + email: z.string(), + role: z.any(), + roleId: z.number(), + entity: z.string(), + userType: z.string(), +}) + +export const EventListDataOutputDTOSchema = z.object({ + success: z.boolean(), + message: z.string(), + data: z.array(EventListOutputDTOSchema), +}).nullable(); + +export type ContactCombinedOutputDTO = z.infer; diff --git a/src/app/services/Repositorys/contacts/DTO/userListOutput.ts b/src/app/services/Repositorys/contacts/DTO/userListOutput.ts new file mode 100644 index 000000000..742a505a1 --- /dev/null +++ b/src/app/services/Repositorys/contacts/DTO/userListOutput.ts @@ -0,0 +1,18 @@ + +export interface UserContacts { + wxUserId: number; + wxFullName: string; + wxeMail: string | null; + userPhoto: string | null; +} + +export interface UserListResult { + total: number, + result: UserContacts[] +} + +export interface UserListOutOutDTO { + success: boolean; + message: string; + data: UserListResult; +} diff --git a/src/app/services/Repositorys/contacts/data-source/contacts-data-source.service.ts b/src/app/services/Repositorys/contacts/data-source/contacts-data-source.service.ts new file mode 100644 index 000000000..1067c0b71 --- /dev/null +++ b/src/app/services/Repositorys/contacts/data-source/contacts-data-source.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@angular/core'; +import { HttpService } from 'src/app/services/http.service'; +import { UserListOutOutDTO } from '../DTO/userListOutput'; +import { ContactCombinedOutputDTO, EventListDataOutputDTOSchema } from '../DTO/contactsCombined'; +import { APIReturn } from 'src/app/services/decorator/api-validate-schema.decorator'; + +@Injectable({ + providedIn: 'root' +}) +export class ContactsDataSourceService { + + private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2'; // Your base URL + + constructor(private httpService: HttpService) {} + + + + @APIReturn(EventListDataOutputDTOSchema, '/Contacts/Combined') + async getCombinedList() { + return await this.httpService.get(`${this.baseUrl}/Contacts/Combined`); + } + + async getUsers() { + return await this.httpService.get(`${this.baseUrl}/Users`); + } +} diff --git a/src/app/services/Repositorys/contacts/mapper/contactCombinedMapper.ts b/src/app/services/Repositorys/contacts/mapper/contactCombinedMapper.ts new file mode 100644 index 000000000..b6476b09c --- /dev/null +++ b/src/app/services/Repositorys/contacts/mapper/contactCombinedMapper.ts @@ -0,0 +1,28 @@ +import { RoleIdService } from "src/app/services/role-id.service"; +import { ContactCombinedOutputDTO } from "../DTO/contactsCombined"; +import { UserList } from "src/app/models/entiry/agenda/contact"; + + +const roles = new RoleIdService() + +export class ListEventMapper { + // @XTracer({name:'ListEventMapper/toDomain', log: false, bugPrint: false}) + static toDomain(dto: ContactCombinedOutputDTO): UserList { + + return dto.data.map((e) => { + + return { + Id: e.wxUserId, + EmailAddress: e.email, + Name: e.fullName, + UserType: e.userType, + Entity: e.entity, + IsPR: e.roleId == roles.PRES, + RoleId: e.roleId, + IsRequired: false + } + }) + } + + static toDTO() {} +} diff --git a/src/app/services/Repositorys/contacts/repository/contacts-repository.service.ts b/src/app/services/Repositorys/contacts/repository/contacts-repository.service.ts new file mode 100644 index 000000000..408f56e3f --- /dev/null +++ b/src/app/services/Repositorys/contacts/repository/contacts-repository.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@angular/core'; +import { ContactsDataSourceService } from '../data-source/contacts-data-source.service'; +import { ListEventMapper } from '../mapper/contactCombinedMapper'; + + +@Injectable({ + providedIn: 'root' +}) +export class ContactRepositoryService { + + constructor( + private constactsDataSourceService: ContactsDataSourceService, + ) {} + + async getUsersMap() { + const result = await this.constactsDataSourceService.getCombinedList(); + return result.map((result) => { + return ListEventMapper.toDomain(result).filter(e => e.EmailAddress != null) + }); + } + + async getUsers() { + const result = await this.constactsDataSourceService.getUsers(); + return result; + } +} diff --git a/src/app/services/Repositorys/notification/notification-repository.service.spec.ts b/src/app/services/Repositorys/notification/notification-repository.service.spec.ts new file mode 100644 index 000000000..4b12a2a12 --- /dev/null +++ b/src/app/services/Repositorys/notification/notification-repository.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { NotificationRepositoryService } from './notification-repository.service'; + +describe('NotificationRepositoryService', () => { + let service: NotificationRepositoryService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(NotificationRepositoryService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/Repositorys/notification/notification-repository.service.ts b/src/app/services/Repositorys/notification/notification-repository.service.ts new file mode 100644 index 000000000..416d21b31 --- /dev/null +++ b/src/app/services/Repositorys/notification/notification-repository.service.ts @@ -0,0 +1,9 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class NotificationRepositoryService { + + constructor() { } +} diff --git a/src/app/services/active-tab.service.ts b/src/app/services/active-tab.service.ts index bba6b7c8e..ec712de96 100644 --- a/src/app/services/active-tab.service.ts +++ b/src/app/services/active-tab.service.ts @@ -1,5 +1,6 @@ import { Injectable } from '@angular/core'; import { Router } from '@angular/router'; +import { HeaderSettingsService } from './header-settings.service'; @Injectable({ providedIn: 'root' @@ -11,13 +12,18 @@ export class ActiveTabService { agenda: false, publication: false, home: false, - gabinete: false + gabinete: false, + gabineteDetails: false } - constructor(private router: Router) { + updatePublications = () => {} + + constructor( + private router: Router, + public HeaderSettingsService: HeaderSettingsService) { this.detectActiveTab() - + this.router.events.subscribe((val) => { this.detectActiveTab() }); @@ -27,15 +33,29 @@ export class ActiveTabService { detectActiveTab() { this.setFalseToAllPage(); const pathName = window.location.pathname - + + this.HeaderSettingsService.hideHeader = false + if(pathName.startsWith('/home/agenda')) { this.pages.agenda = true } else if (pathName.startsWith('/home/events')) { this.pages.home = true } else if (pathName.startsWith('/home/gabinete-digital')) { this.pages.gabinete = true + + if (pathName.endsWith('gabinete-digital')) { + this.pages.gabineteDetails = true + } + } else if (pathName.startsWith('/home/publications')) { this.pages.publication = true + if(pathName.includes("/publications/")) { + if(this.updatePublications) { + this.updatePublications() + } + + } + } else if (pathName.startsWith('/home/chat')) { this.pages.chat = true } @@ -44,6 +64,6 @@ export class ActiveTabService { setFalseToAllPage() { for( const page in this.pages) { this.pages[page] = false - } + } } } diff --git a/src/app/services/agenda/list-box.service.ts b/src/app/services/agenda/list-box.service.ts index 47151f290..ca2d7b57f 100644 --- a/src/app/services/agenda/list-box.service.ts +++ b/src/app/services/agenda/list-box.service.ts @@ -2,6 +2,7 @@ import { Injectable } from '@angular/core'; import { CustomCalendarEvent, EventListStore } from 'src/app/models/agenda/AgendaEventList'; import { DateService } from '../date.service'; import { momentG } from 'src/plugin/momentG'; +import { NativeNotificationService } from 'src/app/services/native-notification.service'; @Injectable({ providedIn: 'root' @@ -12,7 +13,7 @@ export class ListBoxService { constructor( - private dateService: DateService + private dateService: DateService, ){} @@ -37,6 +38,7 @@ export class ListBoxService { daysBetween(){ } + list(eventSource: EventListStore[], profile: 'md' | 'pr' | 'all', rangeStartDate, randEndDate, {segment = 'Combinado', selectedDate= null}): Year[] { // // filter range @@ -67,8 +69,6 @@ export class ListBoxService { // object[momentG(new Date(e.start), 'MMMM yyyy')].push(e) // } - // console.log({object}) - // const daysStringNum = Object.keys(object).reverse() // const daysObject = {} @@ -77,12 +77,10 @@ export class ListBoxService { // daysObject[day] = object[day] // } - // console.log({daysObject}) + // console.log('newStracture', newStracture) - - return this.display(newStracture, selectedDate).year - - // console.log({daysObject}) + const data = this.display(newStracture, selectedDate) + return data.year // const daysStringNum = Object.keys(daysObject) @@ -105,6 +103,7 @@ export class ListBoxService { } display(list: CustomCalendarEvent[], selectedDate) { + let days = {}; const year: Year[] = [] @@ -122,7 +121,6 @@ export class ListBoxService { event['manyDays'] = !this.dateService.isSameDate(event.start, event.end) event['todayOnly'] = this.dateService.isSameDate(event.start, event.end) - if(!days.hasOwnProperty(day)) { days[day] = [] } @@ -136,66 +134,70 @@ export class ListBoxService { cloneSelectedDate.setMinutes(0) cloneSelectedDate.setSeconds(0) - if (diffDays <= 150 ) { - if (diffDays >= 1) { + if (diffDays >= 1) { - const StartEvent = this.transForm(event, {startMany: true, endMany: false, middle: false}) + const StartEvent = this.transForm(event, {startMany: true, endMany: false, middle: false, hasMany: true}) - if(this.CanPush(event, selectedDate) && (new Date(event.start)).getTime() >= cloneSelectedDate.getTime()) { - days[day].push(StartEvent); this.push(StartEvent, year) + if(this.CanPush(event, selectedDate) && (new Date(event.start)).getTime() >= cloneSelectedDate.getTime()) { + days[day].push(StartEvent); this.push(StartEvent, year) + } + + let i = 1; + + //create event between date + while (startDate.getFullYear() != endDate.getFullYear() || + startDate.getMonth() != endDate.getMonth() || + startDate.getDate() != endDate.getDate()) { + + const newDate = startDate.setDate(startDate.getDate()+ i) + let otherDays = this.dateService.getDay(newDate) + + const cloneEvent = {...event} + cloneEvent['other'] = true + + cloneEvent.start = new Date(startDate) + + if(!days.hasOwnProperty(otherDays)) { + days[otherDays] = [] } - let i = 1; + if (!(startDate.getFullYear() != endDate.getFullYear() || + startDate.getMonth() != endDate.getMonth() || + startDate.getDate() != endDate.getDate())) { + // last push + const EndEvent = this.transForm(cloneEvent, {startMany: false, endMany: true, middle: false, hasMany: true}) + if(this.CanPush(cloneEvent, selectedDate) && cloneEvent.start.getTime() >= cloneSelectedDate.getTime()) { + days[otherDays].push(EndEvent) ; this.push(EndEvent, year) + } - //create event between date - while (startDate.getFullYear() != endDate.getFullYear() || - startDate.getMonth() != endDate.getMonth() || - startDate.getDate() != endDate.getDate()) { + } else { - const newDate = startDate.setDate(startDate.getDate()+ i) - let otherDays = this.dateService.getDay(newDate) - - const cloneEvent = {...event} - cloneEvent['other'] = true - - cloneEvent.start = new Date(startDate) - - if(!days.hasOwnProperty(otherDays)) { - days[otherDays] = [] - } - - if (!(startDate.getFullYear() != endDate.getFullYear() || - startDate.getMonth() != endDate.getMonth() || - startDate.getDate() != endDate.getDate())) { - // last push - const EndEvent = this.transForm(cloneEvent, {startMany: false, endMany: true, middle: false}) - if(this.CanPush(cloneEvent, selectedDate) && cloneEvent.start.getTime() >= cloneSelectedDate.getTime()) { - days[otherDays].push(EndEvent) ; this.push(cloneEvent, year) + const EndEvent = this.transForm(cloneEvent, {startMany: false,endMany: false, middle: true, hasMany: true}) + if(this.CanPush(cloneEvent, selectedDate) && cloneEvent.start.getTime() >= cloneSelectedDate.getTime()) { + days[otherDays].push(EndEvent) ; this.push(EndEvent, year) + } else { + if( cloneEvent.start.getFullYear() == cloneSelectedDate.getFullYear() && cloneEvent.start.getDate() == cloneSelectedDate.getDate() && cloneEvent.start.getMonth() == cloneSelectedDate.getMonth()) { + // console.log("00_00") + days[otherDays].push(EndEvent) ; this.push(EndEvent, year) + } else { + // console.log('0000000000000000000000000',cloneEvent.start.getTime(), cloneSelectedDate.getTime()) + // console.log('0000000000000000000000000',cloneEvent.start, cloneSelectedDate) } + } - } else { + } - const EndEvent = this.transForm(cloneEvent, {startMany: false,endMany: true, middle: true}) - if(this.CanPush(cloneEvent, selectedDate) && cloneEvent.start.getTime() >= cloneSelectedDate.getTime()) { - days[otherDays].push(EndEvent) ; this.push(cloneEvent, year) - } + days[otherDays] = days[otherDays].reverse() - } + } - days[otherDays] = days[otherDays].reverse() + } else { + if(this.CanPush(event, selectedDate)) { days[day].push(event) ; this.push(event, year) } + } - } - - } else { - - - if(this.CanPush(event, selectedDate)) { days[day].push(event) ; this.push(event, year) } - } - } else { - if(this.CanPush(event, selectedDate)) { days[day].push(event) ; this.push(event, year) } - } } else { + event['sameDay'] = true if(this.CanPush(event, selectedDate) && diffDays != 2) { days[day].push(event) ; this.push(event, year) } } @@ -306,7 +308,11 @@ export class ListBoxService { return events; } - transForm(event: CustomCalendarEvent, {startMany, endMany, middle}) { + transForm(event: CustomCalendarEvent, {startMany, endMany, middle, hasMany = false}) { + + let daysLeft = this.daysToEndWithJS(event.start, event.end); + let eventTotalDuration = this.daysToEndWithJS(event.event.StartDate, event.event.EndDate); + return Object.assign({}, { start: event.start, end: event.end, @@ -319,8 +325,13 @@ export class ListBoxService { Location: event.event.Location, EventId: event.event.EventId, CalendarName: event.event.CalendarName, - CalendarId: event.event.CalendarId + CalendarId: event.event.CalendarId, + daysLeft }, + eventTotalDuration, + hasMany, + duration: this.duration(event.start, event.event.EndDate), + daysLeft, Subject: event.event.Subject, startMany: startMany, endMany: endMany, @@ -330,6 +341,48 @@ export class ListBoxService { + + daysToEndWithJS(startDateStr: any, endDateStr: any) { + // Define the start and end dates + const startDate: any = new Date(startDateStr); + const endDate: any = new Date(endDateStr); + + startDate.setHours(0, 0, 0, 0); // Set hours, minutes, seconds, and milliseconds to 0 + endDate.setHours(0, 0, 0, 0); // Set hours, minutes, seconds, and milliseconds to 0 + // Calculate the difference in milliseconds between the two dates + const differenceMs = Math.abs(endDate - startDate); + + // Convert milliseconds to days + const millisecondsPerDay = 1000 * 60 * 60 * 24; + const differenceDays = Math.ceil(differenceMs / millisecondsPerDay); + + // console.log(`Number of days between the dates: ${differenceDays}`); + + return differenceDays + + } + + + + duration(date1Str, date2Str) { + + // Convert string dates to Date objects + const date1: any = new Date(date1Str); + const date2: any = new Date(date2Str); + + // Calculate the difference in milliseconds + const timeDifferenceMs = date2 - date1; + + // Convert difference to days, hours, and minutes + const totalMinutes = Math.floor(timeDifferenceMs / (1000 * 60)); + const days = Math.floor(totalMinutes / (60 * 24)); + const hours = Math.floor((totalMinutes % (60 * 24)) / 60); + const minutes = totalMinutes % 60; + + return `${days}d` + } + + transformObjectKeyOrder(originalObject, keyOrder) { const transformedObject = {}; diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index d46be8058..a9357580d 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -183,13 +183,15 @@ export class AuthService { setTimeout(() => { if (SessionStore.user.ChatData?.data) { + this.RochetChatConnectorService.logout(); this.RochetChatConnectorService.connect(); this.RochetChatConnectorService.login().then((message: any) => { - console.log('Chat login', message) + // console.log('Chat login', message) SessionStore.user.RochetChatUserId = message.result.id SessionStore.save() + this.ChatSystemService.loadChat() this.RochetChatConnectorService.setStatus('online') window['RochetChatConnectorService'] = this.RochetChatConnectorService setTimeout(() => { @@ -199,7 +201,14 @@ export class AuthService { }).catch((error) => { - // console.error(SessionStore.user.ChatData, 'web socket login',error) + console.error(SessionStore.user.ChatData, 'web socket login', error) + + if(window.location.pathname.includes('/home/')) { + setTimeout(() => { + this.loginToChatWs(); + }, 4000) + } + }) } @@ -224,6 +233,7 @@ export class AuthService { window['e'] = e console.error('BeforesendAtachment', e) message.uploadingFile = false + this.httpErroHandle.httpStatusHandleUploadFile(e); return false } @@ -244,6 +254,7 @@ export class AuthService { window['e'] = e console.error('BeforesendAtachment', e) message.uploadingFile = false + this.httpErroHandle.httpStatusHandleUploadFile(e); return false } } @@ -333,7 +344,7 @@ export class AuthService { } refreshToken() { - + return this.http .put(environment.apiURL + "UserAuthentication/RefreshToken", { refreshToken: SessionStore.user.RefreshToken, diff --git a/src/app/services/background.service.ts b/src/app/services/background.service.ts index c557c0d1f..f5bed2847 100644 --- a/src/app/services/background.service.ts +++ b/src/app/services/background.service.ts @@ -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 } diff --git a/src/app/services/cache-service.service.spec.ts b/src/app/services/cache-service.service.spec.ts new file mode 100644 index 000000000..8856eceeb --- /dev/null +++ b/src/app/services/cache-service.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { CacheServiceService } from './cache-service.service'; + +describe('CacheServiceService', () => { + let service: CacheServiceService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(CacheServiceService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/cache-service.service.ts b/src/app/services/cache-service.service.ts new file mode 100644 index 000000000..96a026ec4 --- /dev/null +++ b/src/app/services/cache-service.service.ts @@ -0,0 +1,39 @@ +import { Injectable } from '@angular/core'; +import { BehaviorSubject } from 'rxjs'; + +@Injectable({ + providedIn: 'root' +}) +export class CacheService { + // A HashMap to store the cache. The key is the page and the value is the data. + private cache = new Map(); + // BehaviorSubject that will contain the updated cache data. + public cache$ = new BehaviorSubject(null); + + // The 'set' method for storing data in the cache. + set(key: string, data: any[]): void { + // We check if data already exists for this key. + if (this.cache.has(key)) { + // If it already exists, we throw an exception to prevent overwriting the data. + throw new Error(`Data already exists for key '${key}'. Use a different key or delete the existing one first.`); + } + // If there is no data for this key, we store it in the cache and update the BehaviorSubject. + this.cache.set(key, data); + this.cache$.next(this.cache.get(key)); + } + + // The 'get' method for retrieving data from the cache. + get(key: string): any[] { + // We retrieve the data from the cache and update the BehaviorSubject. + const data = this.cache.get(key); + this.cache$.next(data); + return data; + } + + // The 'clear' method to clear data from the cache. + clear(key: string): void { + // We remove the data from the cache and update the BehaviorSubject. + this.cache.delete(key); + this.cache$.next(null); + } +} \ No newline at end of file diff --git a/src/app/services/chat.service.ts b/src/app/services/chat.service.ts index 792716595..5d8072ddb 100644 --- a/src/app/services/chat.service.ts +++ b/src/app/services/chat.service.ts @@ -392,61 +392,6 @@ export class ChatService { async refreshtoken() { - if(this.headers && SessionStore.user.ChatData) { - this.headers = this.headers.set('Authorization', 'Bearer ' + SessionStore.user.Authorization); - let options = { - headers: this.headers - }; - - try { - let res = await this.http.get(environment.apiURL + 'UserAuthentication/RegenereChatToken', options).toPromise(); - - let data = { - status: res['status'], - data: { - userId: res['data'].userId, - authToken: res['data'].authToken - } - } - SessionStore.user.ChatData = data - SessionStore.save() - this.setheader() - this.timerEventTriggerDateLastUpdate = new Date(); - } catch (error) { - - if(this.NetworkServiceService.getCurrentNetworkStatus() == ConnectionStatus.Offline) { - this.RochetChatConnectorService.registerCallback({ - requestId: 'refreshtoken', - type: 'reConnect', - funx: async () => { - - this.resetTimer(); - await this.refreshtoken(); - - return true - } - }) - } else { - - if(SessionStore.user.Authorization != '') { - setTimeout(async () => { - this.resetTimer(); - await this.refreshtoken(); - }, 60000) - } - - - } - - } - - } else if(!SessionStore.user.ChatData) { - // do nothing - } else if (!this.headers) { - this.setheader() - this.refreshtoken() - } - } diff --git a/src/app/services/chat/chat-system.service.ts b/src/app/services/chat/chat-system.service.ts index 175a72db1..06276dc92 100644 --- a/src/app/services/chat/chat-system.service.ts +++ b/src/app/services/chat/chat-system.service.ts @@ -6,14 +6,13 @@ import { SessionStore } from 'src/app/store/session.service'; import { capitalizeTxt } from 'src/plugin/text'; import { Update as room } from 'src/app/models/chatMethod'; import { Storage } from '@ionic/storage'; -import { Platform } from '@ionic/angular'; +import { ModalController, NavController, Platform } from '@ionic/angular'; import { SqliteService } from 'src/app/services/sqlite.service'; import { ChatService } from 'src/app/services/chat.service'; import { NativeNotificationService } from 'src/app/services/native-notification.service'; import { SortService } from '../functions/sort.service'; import { chatUser } from 'src/app/models/chatMethod'; import { NfService } from 'src/app/services/chat/nf.service' -import { ChangeProfileService } from '../change-profile.service'; import { ChatMethodsService } from './chat-methods.service'; import { AESEncrypt } from '../aesencrypt.service' import { AttachmentsService } from 'src/app/services/attachments.service'; @@ -48,6 +47,7 @@ export class ChatSystemService { loadingUsers = false onRoomsLoad = new Subscribe({ execute: false, deleteOnExecute: true }) + private mainChangeDetector: Function = () => {} constructor( @@ -59,14 +59,15 @@ export class ChatSystemService { private sortService: SortService, private ChatService: ChatService, private NfService: NfService, - private changeProfileService: ChangeProfileService, private chatService: ChatService, private ChatMethodsService: ChatMethodsService, private AESEncrypt: AESEncrypt, private AttachmentsService: AttachmentsService, private NetworkServiceService: NetworkServiceService, private ViewedMessageService: ViewedMessageService, - private notificationService: NotificationsService + private notificationService: NotificationsService, + private modalController: ModalController, + private navController: NavController ) { @@ -148,9 +149,6 @@ export class ChatSystemService { }); } } catch(error) {} - - - } loadChat() { @@ -484,7 +482,7 @@ export class ChatSystemService { if (setData.name != 'Rocket Cat' && setData.name != 'general' && chat == false) { // create room if (!this.roomExist(roomId)) { - let room: RoomService = new RoomService(this.RochetChatConnectorService, new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this, this.notificationService), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this, this.ViewedMessageService, this.notificationService) + let room: RoomService = new RoomService(this.RochetChatConnectorService, new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this, this.notificationService), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this, this.ViewedMessageService, this.notificationService,this.modalController,this.navController) room.setData(setData) room.receiveMessage() room.getAllUsers = this.getUsers diff --git a/src/app/services/chat/message.service.ts b/src/app/services/chat/message.service.ts index 3a3cf1f4b..80077e5b7 100644 --- a/src/app/services/chat/message.service.ts +++ b/src/app/services/chat/message.service.ts @@ -446,16 +446,24 @@ export class MessageService { this.downloadLoader = true; let downloadFile = ""; + let downloadUrl = ""; + this.AttachmentsService.downloadFile(this.file.guid).subscribe(async (event) => { + console.log('download file',event) + if (event.type === HttpEventType.DownloadProgress) { } else if (event.type === HttpEventType.Response) { if (this.file.type == "application/img") { downloadFile = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '')); } else if (this.file.type != "application/img") { - - downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''); + + + downloadFile = btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '')); + downloadUrl = event.url + console.log('downloaded file', downloadFile) + console.log('event body downloaded file', event.url) } @@ -465,7 +473,8 @@ export class MessageService { title: this.attachments[0].title, title_link: downloadFile, title_link_download: this.attachments[0].title_link_download, - ts: this.attachments[0].ts + ts: this.attachments[0].ts, + attachmentsUrl: downloadUrl } // save the changes to the storage diff --git a/src/app/services/chat/room.service.ts b/src/app/services/chat/room.service.ts index 8b9f60be1..711e05fc5 100644 --- a/src/app/services/chat/room.service.ts +++ b/src/app/services/chat/room.service.ts @@ -4,7 +4,7 @@ import { MessageService, MessageServiceDateLabel } from 'src/app/services/chat/m import { showDateDuration } from 'src/plugin/showDateDuration'; import { chatHistory } from 'src/app/models/chatMethod'; import { Storage } from '@ionic/storage'; -import { Platform } from '@ionic/angular'; +import { ModalController, NavController, Platform } from '@ionic/angular'; import { SqliteService } from 'src/app/services/sqlite.service'; import { NativeNotificationService } from 'src/app/services/native-notification.service'; import { SessionStore } from 'src/app/store/session.service'; @@ -101,7 +101,9 @@ export class RoomService { private NetworkServiceService: NetworkServiceService, private ChatSystemService: ChatSystemService, private ViewedMessageService: ViewedMessageService, - private notificationService: NotificationsService + private notificationService: NotificationsService, + private modalController: ModalController, + private navController: NavController ) { /* this.NativeNotificationService.askForPermission() */ @@ -219,6 +221,9 @@ export class RoomService { if (difference < 0) { this.deleteRoom(); + if(this.chatOpen && window.location.pathname.includes('chat')) { + this.closeModal() + } } else { setTimeout(() => { @@ -372,8 +377,6 @@ export class RoomService { } this.messageUnread = true - - // this.sortRoomList() setTimeout(() => { this.scrollDown() }, 50) @@ -386,6 +389,8 @@ export class RoomService { this.name = ChatMessage.msg } + this.sortRoomList() + // this.changeDetector() setTimeout(() => { done() }, 5) @@ -1287,4 +1292,8 @@ export class RoomService { this.members = members this.membersExcludeMe = users } + + async closeModal() { + await this.modalController.dismiss(); + } } diff --git a/src/app/services/checkFileType.service.ts b/src/app/services/checkFileType.service.ts index a8038130c..e0168d542 100644 --- a/src/app/services/checkFileType.service.ts +++ b/src/app/services/checkFileType.service.ts @@ -18,7 +18,7 @@ export class checkFileTypeService { const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp','tiff','tif', 'image/jpg', 'image/jpeg', 'image/png', 'image/gif', 'image/bmp','image/tiff','image/tif', 'image/*']; // Add more if needed const videoExtensions = ['mp4', 'webm', 'mpg', 'mpeg', 'ogg', - 'video/mp4', 'video/webm', 'video/mpg', 'video/mpeg', 'video/ogg','video/quicktime', 'video/*']; // Add more if needed + 'video/mp4', 'video/webm', 'video/mpg', 'video/mpeg', 'video/ogg','video/quicktime','MOV','mov', 'video/*']; // Add more if needed // Check if it's an image if (imageExtensions.includes(lowerCaseType)) { diff --git a/src/app/services/clear-store.service.ts b/src/app/services/clear-store.service.ts index 21e195e39..0519024d4 100644 --- a/src/app/services/clear-store.service.ts +++ b/src/app/services/clear-store.service.ts @@ -10,13 +10,15 @@ import { DeplomasStore } from '../store/deplomas.service'; import { CalendarStore } from 'src/app/store/calendar.service'; import { ToDayEventStorage } from '../store/to-day-event-storage.service'; import { TotalDocumentStore } from 'src/app/store/total-document.service'; - +import { PublicationFolderService } from 'src/app/store/publication-folder.service' @Injectable({ providedIn: 'root' }) export class ClearStoreService { - constructor() { } + constructor( + private PublicationFolderService: PublicationFolderService + ) { } clear() { @@ -37,6 +39,7 @@ export class ClearStoreService { CalendarStore.ResetList([]) ToDayEventStorage.reset([]) TotalDocumentStore.resetCount(0) + this.PublicationFolderService.clear() } } diff --git a/src/app/services/date.service.ts b/src/app/services/date.service.ts index f08209a47..588180b36 100644 --- a/src/app/services/date.service.ts +++ b/src/app/services/date.service.ts @@ -44,7 +44,7 @@ export class DateService { } - fixDate(res: EventList) { + fixDate(res: EventList): any { if(res.IsAllDayEvent && this.deferenceBetweenDays(new Date(res.StartDate), new Date(res.EndDate)) >= 1) { const date = new Date(res.EndDate); @@ -55,7 +55,7 @@ export class DateService { const month = String(date.getMonth() + 1).padStart(2,'0'); const fullYear = date.getFullYear(); const formattedDate = `${fullYear}-${month}-${_date} 23:59`; - res.EndDate = formattedDate + res.EndDate = new Date(formattedDate).toISOString(); } diff --git a/src/app/services/decorator/api-validate-schema.decorator.ts b/src/app/services/decorator/api-validate-schema.decorator.ts new file mode 100644 index 000000000..75cc726b8 --- /dev/null +++ b/src/app/services/decorator/api-validate-schema.decorator.ts @@ -0,0 +1,94 @@ +import { HttpErrorResponse } from '@angular/common/http'; +import { Result, err } from 'neverthrow'; +import { z, ZodError } from 'zod'; +import * as Sentry from '@sentry/capacitor'; +import { TracingType } from '../monitoring/opentelemetry/tracer'; + +export function APIReturn(schema: z.ZodTypeAny, path: string) { + return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) { + const originalMethod = descriptor.value; + + descriptor.value = async function (...args: any[]) { + const result: Result = await originalMethod.apply(this, args); + + const tracing: TracingType = args[args.length - 1]; + + if(result.isOk()) { + try { + // Validate the result using the provided schema + schema.parse(result.value); + + } 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); + console.log(result.value) + + tracing?.setAttribute?.('APIReturn.error', 'true') + + let i = 0; + for(const schema of error.errors) { + tracing?.setAttribute?.('map.error.schema-'+i, JSON.stringify(schema)) + } + + tracing.log('API return '+ path, { + data: result?.value, + issues: error?.errors + }) + + } else { + // Throw any other unexpected errors + // throw error; + console.log(error) + } + } + } else { + // console.log() + // result.error. + } + + return result; + } + return descriptor; + } +} + + +export function APINODReturn(schema: z.ZodTypeAny, data , path: string, tracing?: TracingType) { + + try { + // Validate the result using the provided schema + schema.parse(data); + + } 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); + console.log(data) + + tracing?.setAttribute('APIReturn.error', 'true') + tracing?.setAttribute('path', path) + + let i = 0; + for(const schema of error.errors) { + tracing?.setAttribute('map.error.schema-'+i, JSON.stringify(schema)) + } + + tracing.log('API return '+ path, { + data, + issues: error?.errors + }) + + } else { + console.log(error) + // Throw any other unexpected errors + // throw error; + } + } + +} diff --git a/src/app/services/events.service.ts b/src/app/services/events.service.ts index 1011c14d8..c08e33ac3 100644 --- a/src/app/services/events.service.ts +++ b/src/app/services/events.service.ts @@ -1,13 +1,11 @@ import { Injectable } from '@angular/core'; -import { Event, EventToApproveEdit, } from '../models/event.model'; +import { Event } from '../models/event.model'; import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; -import { Observable, from } from 'rxjs'; +import { Observable } from 'rxjs'; import { environment } from 'src/environments/environment'; import { AuthService } from '../services/auth.service'; -import { EventList } from '../models/agenda/AgendaEventList'; import { ChangeProfileService } from './change-profile.service'; import { OfflineManagerService } from 'src/app/services/offline-manager.service'; -import { catchError } from "rxjs/operators"; import { SessionStore } from '../store/session.service'; import { calendarInterface } from '../models/user.model'; import { Subscribe } from './subcribe'; @@ -133,47 +131,51 @@ export class EventsService { if (SessionStore.user) { if (SessionStore.user.Profile == 'MDGPR') { - for (let calendar of SessionStore.user.OwnerCalendars) { - this.hasAnyCalendar = true + if(SessionStore?.user?.OwnerCalendars) { + for (let calendar of SessionStore?.user?.OwnerCalendars) { + this.hasAnyCalendar = true - if (calendar.CalendarName == 'Oficial') { + if (calendar.CalendarName == 'Oficial') { - this.hasOwnOficial = true + this.hasOwnOficial = true - this.headersMdOficial = this.headersMdOficial.set('Authorization', 'Bearer ' + SessionStore.user.Authorization); - this.headersMdOficial = this.headersMdOficial.set('CalendarId', calendar.CalendarId); - this.headersMdOficial = this.headersMdOficial.set('CalendarRoleId', calendar.CalendarRoleId); - } - else if (calendar.CalendarName == 'Pessoal') { + this.headersMdOficial = this.headersMdOficial.set('Authorization', 'Bearer ' + SessionStore.user.Authorization); + this.headersMdOficial = this.headersMdOficial.set('CalendarId', calendar.CalendarId); + this.headersMdOficial = this.headersMdOficial.set('CalendarRoleId', calendar.CalendarRoleId); + } + else if (calendar.CalendarName == 'Pessoal') { - this.hasOwnPessoal = true + this.hasOwnPessoal = true - this.headersMdPessoal = this.headersMdPessoal.set('Authorization', 'Bearer ' + SessionStore.user.Authorization); - this.headersMdPessoal = this.headersMdPessoal.set('CalendarId', calendar.CalendarId); - this.headersMdPessoal = this.headersMdPessoal.set('CalendarRoleId', calendar.CalendarRoleId); + this.headersMdPessoal = this.headersMdPessoal.set('Authorization', 'Bearer ' + SessionStore.user.Authorization); + this.headersMdPessoal = this.headersMdPessoal.set('CalendarId', calendar.CalendarId); + this.headersMdPessoal = this.headersMdPessoal.set('CalendarRoleId', calendar.CalendarRoleId); + } } } - for (let sharedCalendar of SessionStore.user.SharedCalendars) { - this.hasAnyCalendar = true + if(SessionStore?.user?.SharedCalendars) { + for (let sharedCalendar of SessionStore.user.SharedCalendars) { + this.hasAnyCalendar = true - if (sharedCalendar.CalendarName == 'Oficial') { + if (sharedCalendar.CalendarName == 'Oficial') { - this.hasSharedOficial = true + this.hasSharedOficial = true - this.headersSharedOficial = this.headersSharedOficial.set('Authorization', 'Bearer ' + SessionStore.user.Authorization); - this.headersSharedOficial = this.headersSharedOficial.set('CalendarId', sharedCalendar.CalendarId); - this.headersSharedOficial = this.headersSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId); - } - else if (sharedCalendar.CalendarName == 'Pessoal') { + this.headersSharedOficial = this.headersSharedOficial.set('Authorization', 'Bearer ' + SessionStore.user.Authorization); + this.headersSharedOficial = this.headersSharedOficial.set('CalendarId', sharedCalendar.CalendarId); + this.headersSharedOficial = this.headersSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId); + } + else if (sharedCalendar.CalendarName == 'Pessoal') { - this.hasSharedPessoal = true + this.hasSharedPessoal = true - this.headersSharedPessoal = this.headersSharedPessoal.set('Authorization', 'Bearer ' + SessionStore.user.Authorization); - this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarId', sharedCalendar.CalendarId); - this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId); + this.headersSharedPessoal = this.headersSharedPessoal.set('Authorization', 'Bearer ' + SessionStore.user.Authorization); + this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarId', sharedCalendar.CalendarId); + this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId); + } } } @@ -181,7 +183,7 @@ export class EventsService { else if (SessionStore.user.Profile == 'PR') { - for (let calendar of SessionStore.user.OwnerCalendars) { + for (let calendar of SessionStore?.user?.OwnerCalendars) { this.hasAnyCalendar = true if (calendar.CalendarName == 'Oficial') { @@ -204,7 +206,7 @@ export class EventsService { } - for (let calendar of SessionStore.user.OwnerCalendars) { + for (let calendar of SessionStore?.user?.OwnerCalendars) { this.hasAnyCalendar = true if(!this.usersCalendarIds.includes(calendar.OwnerUserId)) { this.usersCalendarIds.push(calendar.OwnerUserId) @@ -236,7 +238,7 @@ export class EventsService { } } - for (let sharedCalendar of SessionStore.user.SharedCalendars) { + for (let sharedCalendar of SessionStore?.user?.SharedCalendars) { this.hasAnyCalendar = true if(!this.usersCalendarIds.includes(sharedCalendar.OwnerUserId)) { @@ -269,7 +271,7 @@ export class EventsService { } - for (let OwnerCalendar of SessionStore.user.OwnerCalendars) { + for (let OwnerCalendar of SessionStore?.user?.OwnerCalendars) { this.hasAnyCalendar = true this.calendarNames[OwnerCalendar.CalendarId] = 'Meu calendario' @@ -281,11 +283,12 @@ export class EventsService { } this.calendarNamesType['Meu calendario'][OwnerCalendar.CalendarName] = true - this.calendarNamesType['Meu calendario'][OwnerCalendar.CalendarName+'Id'] = OwnerCalendar.CalendarId + this.calendarNamesType['Meu calendario'][OwnerCalendar.CalendarName+'Id'] = OwnerCalendar.OwnerUserId || SessionStore.user.UserId this.calendarNamesType['Meu calendario']['RoleId'] = OwnerCalendar.CalendarRoleId this.calendarNamesType['Meu calendario']['OwnerId'] = OwnerCalendar.OwnerUserId || SessionStore.user.UserId + this.calendarNamesType['Meu calendario']['FullName'] = SessionStore.user.FullName } - for (let sharedCalendar of SessionStore.user.SharedCalendars) { + for (let sharedCalendar of SessionStore?.user?.SharedCalendars) { this.hasAnyCalendar = true if(sharedCalendar?.OwnerUserId) { const e = await this.GetCalendarName(sharedCalendar.OwnerUserId).toPromise() @@ -315,9 +318,10 @@ export class EventsService { } this.calendarNamesType[e.FullName][sharedCalendar.CalendarName] = true - this.calendarNamesType[e.FullName][sharedCalendar.CalendarName+'Id'] = sharedCalendar.CalendarId + this.calendarNamesType[e.FullName][sharedCalendar.CalendarName+'Id'] = sharedCalendar.OwnerUserId this.calendarNamesType[e.FullName]['RoleId'] = sharedCalendar.CalendarRoleId this.calendarNamesType[e.FullName]['OwnerId'] = sharedCalendar.OwnerUserId + this.calendarNamesType[e.FullName]['Shared'] = sharedCalendar.OwnerUserId } } @@ -339,7 +343,7 @@ export class EventsService { }) - if(SessionStore.user.OwnerCalendars.length == 0 && SessionStore.user.SharedCalendars.length == 0) { + if(SessionStore.user?.OwnerCalendars.length == 0 && SessionStore.user.SharedCalendars.length == 0) { this.hasAnyCalendar = false } else { this.hasAnyCalendar = true @@ -353,7 +357,7 @@ export class EventsService { (() => { const keys = {} - for (let e of SessionStore.user.OwnerCalendars) { + for (let e of SessionStore.user?.OwnerCalendars) { if(!keys[e.CalendarId]) { keys[e.CalendarId] = e.CalendarId } else { @@ -416,19 +420,8 @@ export class EventsService { isMyEvent(event: any) { - for (let calendar of SessionStore.user.OwnerCalendars) { - if(event.CalendarId == calendar.CalendarId) { - return true - } - } - - for (let sharedCalendar of SessionStore.user.SharedCalendars) { - if(event.CalendarId == sharedCalendar.CalendarId) { - return false - } - } - - return false + const data: any = event + return data.owner.wxUserId == SessionStore.user.UserId } @@ -451,79 +444,79 @@ export class EventsService { } - getAllPrOficialEvents(startdate: string, enddate: string): Observable { - let geturl = environment.apiURL + 'calendar/pr'; - geturl = geturl.replace('/V4/', '/V5/') + // getAllPrOficialEvents(startdate: string, enddate: string): Observable { + // let geturl = environment.apiURL + 'calendar/pr'; + // geturl = geturl.replace('/V4/', '/V5/') - let params = new HttpParams(); + // let params = new HttpParams(); - params = params.set("Start", startdate); - params = params.set("End", enddate); + // params = params.set("Start", startdate); + // params = params.set("End", enddate); - let options = { - headers: this.headersPrOficial, - params: params - }; - return this.http.get(`${geturl}`, options); - } + // let options = { + // headers: this.headersPrOficial, + // params: params + // }; + // return this.http.get(`${geturl}`, options); + // } - getAllPrPessoalEvents(startdate: string, enddate: string): Observable { - let geturl = environment.apiURL + 'calendar/pr'; - geturl = geturl.replace('/V4/', '/V5/') + // getAllPrPessoalEvents(startdate: string, enddate: string): Observable { + // let geturl = environment.apiURL + 'calendar/pr'; + // geturl = geturl.replace('/V4/', '/V5/') - let params = new HttpParams(); + // let params = new HttpParams(); - params = params.set("Start", startdate); - params = params.set("End", enddate); + // params = params.set("Start", startdate); + // params = params.set("End", enddate); - let options = { - headers: this.headersPrPessoal, - params: params - }; - return this.http.get(`${geturl}`, options); - } + // let options = { + // headers: this.headersPrPessoal, + // params: params + // }; + // return this.http.get(`${geturl}`, options); + // } - async getAllPrEvents(startdate: string, enddate: string): Promise { + // async getAllPrEvents(startdate: string, enddate: string): Promise { - let prO = [], prP = []; + // let prO = [], prP = []; - prO = await this.getAllPrOficialEvents(startdate, enddate).toPromise(); - prP = await this.getAllPrPessoalEvents(startdate, enddate).toPromise(); - const resFinal = prO.concat(prP); - return new Promise(resolve => { - return resolve(resFinal) - }) - } + // prO = await this.getAllPrOficialEvents(startdate, enddate).toPromise(); + // prP = await this.getAllPrPessoalEvents(startdate, enddate).toPromise(); + // const resFinal = prO.concat(prP); + // return new Promise(resolve => { + // return resolve(resFinal) + // }) + // } - getAllMdOficialEvents(startdate: string, enddate: string): Observable { - let geturl = environment.apiURL + 'calendar/md'; + // getAllMdOficialEvents(startdate: string, enddate: string): Observable { + // let geturl = environment.apiURL + 'calendar/md'; - let params = new HttpParams(); + // let params = new HttpParams(); - params = params.set("Start", startdate); - params = params.set("End", enddate); + // params = params.set("Start", startdate); + // params = params.set("End", enddate); - let options = { - headers: this.headersMdOficial, - params: params - }; - return this.http.get(`${geturl}`, options); - } + // let options = { + // headers: this.headersMdOficial, + // params: params + // }; + // return this.http.get(`${geturl}`, options); + // } - getAllMdPessoalEvents(startdate: string, enddate: string): any { - let geturl = environment.apiURL + 'calendar/md'; + // getAllMdPessoalEvents(startdate: string, enddate: string): any { + // let geturl = environment.apiURL + 'calendar/md'; - let params = new HttpParams(); + // let params = new HttpParams(); - params = params.set("Start", startdate); - params = params.set("End", enddate); + // params = params.set("Start", startdate); + // params = params.set("End", enddate); - let options = { - headers: this.headersMdPessoal, - params: params - }; - return this.http.get(`${geturl}`, options) - } + // let options = { + // headers: this.headersMdPessoal, + // params: params + // }; + // return this.http.get(`${geturl}`, options) + // } GetCalendarName(userid:string) { @@ -542,271 +535,271 @@ export class EventsService { return this.http.get(`${geturl}`, options) } - async getAllMdEvents(startdate: string, enddate: string) { + // async getAllMdEvents(startdate: string, enddate: string) { - let prO = [], prP = []; + // let prO = [], prP = []; - for (let calendar of SessionStore.user.OwnerCalendars) { - if (calendar.CalendarName == 'Oficial') { - prO = await this.getAllMdOficialEvents(startdate, enddate).toPromise(); - if(!Array.isArray(prO)) { - prO = [] - } - } - if(calendar.CalendarName == 'Pessoal') { - prP = await this.getAllMdPessoalEvents(startdate, enddate).toPromise(); - if(!Array.isArray(prP)) { - prP = [] - } - } - } + // for (let calendar of SessionStore.user.OwnerCalendars) { + // if (calendar.CalendarName == 'Oficial') { + // prO = await this.getAllMdOficialEvents(startdate, enddate).toPromise(); + // if(!Array.isArray(prO)) { + // prO = [] + // } + // } + // if(calendar.CalendarName == 'Pessoal') { + // prP = await this.getAllMdPessoalEvents(startdate, enddate).toPromise(); + // if(!Array.isArray(prP)) { + // prP = [] + // } + // } + // } - const resFinal = prO.concat(prP); - return new Promise(resolve => { - return resolve(resFinal) - }); - } + // const resFinal = prO.concat(prP); + // return new Promise(resolve => { + // return resolve(resFinal) + // }); + // } - async getAllOwnEvents(startdate: string, enddate: string) { + // async getAllOwnEvents(startdate: string, enddate: string) { - let ownO = [], ownP = []; + // let ownO = [], ownP = []; - if(this.hasOwnOficial) { - ownO = await this.getAllOwnOficialEvents(startdate, enddate).toPromise(); - if(!Array.isArray(ownO)) { - ownO = [] - } - } + // if(this.hasOwnOficial) { + // ownO = await this.getAllOwnOficialEvents(startdate, enddate).toPromise(); + // if(!Array.isArray(ownO)) { + // ownO = [] + // } + // } - if(this.hasOwnPessoal) { - ownP = await this.getAllOwnPessoalEvents(startdate, enddate).toPromise(); - if(!Array.isArray(ownP)) { - ownP = [] - } - } + // if(this.hasOwnPessoal) { + // ownP = await this.getAllOwnPessoalEvents(startdate, enddate).toPromise(); + // if(!Array.isArray(ownP)) { + // ownP = [] + // } + // } - const resFinal = ownO.concat(ownP); - return new Promise(resolve => { - return resolve(resFinal) - }); - } + // const resFinal = ownO.concat(ownP); + // return new Promise(resolve => { + // return resolve(resFinal) + // }); + // } - getAllOwnOficialEvents(startdate: string, enddate: string): Observable { - let geturl = environment.apiURL + 'calendar/GetEvents'; + // getAllOwnOficialEvents(startdate: string, enddate: string): Observable { + // let geturl = environment.apiURL + 'calendar/GetEvents'; - let params = new HttpParams(); + // let params = new HttpParams(); - params = params.set("StartDate", startdate); - params = params.set("EndDate", enddate); + // params = params.set("StartDate", startdate); + // params = params.set("EndDate", enddate); - let options = { - headers: this.headerOwnOficial, - params: params - }; - return this.http.get(`${geturl}`, options); - } + // let options = { + // headers: this.headerOwnOficial, + // params: params + // }; + // return this.http.get(`${geturl}`, options); + // } - getAllOwnPessoalEvents(startdate: string, enddate: string): any { - let geturl = environment.apiURL + 'calendar/GetEvents'; + // getAllOwnPessoalEvents(startdate: string, enddate: string): any { + // let geturl = environment.apiURL + 'calendar/GetEvents'; - let params = new HttpParams(); + // let params = new HttpParams(); - params = params.set("StartDate", startdate); - params = params.set("EndDate", enddate); + // params = params.set("StartDate", startdate); + // params = params.set("EndDate", enddate); - let options = { - headers: this.headerOwnPessoal, - params: params - }; - return this.http.get(`${geturl}`, options) - } + // let options = { + // headers: this.headerOwnPessoal, + // params: params + // }; + // return this.http.get(`${geturl}`, options) + // } - private deferenceBetweenDays(start: any, end: any) { - const diffTime = Math.abs(end - start); - return Math.ceil(diffTime / (1000 * 60 * 60 * 24)); - } + // private deferenceBetweenDays(start: any, end: any) { + // const diffTime = Math.abs(end - start); + // return Math.ceil(diffTime / (1000 * 60 * 60 * 24)); + // } - async getEventsByCalendarId( startdate: string, enddate: string, calendarId: any) { - const calendars = SessionStore.user.OwnerCalendars.concat(SessionStore.user.SharedCalendars) - const agendasCalendars = calendars.filter( e => e.CalendarId == calendarId) + // async getEventsByCalendarId( startdate: string, enddate: string, calendarId: any) { + // const calendars = SessionStore.user.OwnerCalendars.concat(SessionStore.user.SharedCalendars) + // const agendasCalendars = calendars.filter( e => e.CalendarId == calendarId) - let result = [] + // let result = [] - for(let agendasCalendar of agendasCalendars) { - var header = new HttpHeaders();; - header = header.set('Authorization', 'Bearer ' + SessionStore.user.Authorization); - header = header.set('CalendarId', agendasCalendar.CalendarId); - header = header.set('CalendarRoleId', agendasCalendar.CalendarRoleId); - header = header.set('CalendarName', agendasCalendar.CalendarName); + // for(let agendasCalendar of agendasCalendars) { + // var header = new HttpHeaders();; + // header = header.set('Authorization', 'Bearer ' + SessionStore.user.Authorization); + // header = header.set('CalendarId', agendasCalendar.CalendarId); + // header = header.set('CalendarRoleId', agendasCalendar.CalendarRoleId); + // header = header.set('CalendarName', agendasCalendar.CalendarName); - let geturl = environment.apiURL + 'calendar/GetEvents'; + // let geturl = environment.apiURL + 'calendar/GetEvents'; - let params = new HttpParams(); + // let params = new HttpParams(); - params = params.set("StartDate", startdate); - params = params.set("EndDate", enddate); + // params = params.set("StartDate", startdate); + // params = params.set("EndDate", enddate); - let options = { - headers: header, - params: params - }; + // let options = { + // headers: header, + // params: params + // }; - let calendar = await this.http.get(`${geturl}`, options).toPromise() + // let calendar = await this.http.get(`${geturl}`, options).toPromise() - calendar = calendar.map(e => { - if(e.IsAllDayEvent && this.deferenceBetweenDays(new Date(e.StartDate), new Date(e.EndDate)) >= 1) { + // calendar = calendar.map(e => { + // if(e.IsAllDayEvent && this.deferenceBetweenDays(new Date(e.StartDate), new Date(e.EndDate)) >= 1) { - const date = new Date(e.EndDate); + // const date = new Date(e.EndDate); - date.setDate(date.getDate() -1); + // date.setDate(date.getDate() -1); - const _date = String(date.getDate()).padStart(2,'0'); - const month = String(date.getMonth() + 1).padStart(2,'0'); - const fullYear = date.getFullYear(); + // const _date = String(date.getDate()).padStart(2,'0'); + // const month = String(date.getMonth() + 1).padStart(2,'0'); + // const fullYear = date.getFullYear(); - console.log({_date, month}) - const formattedDate = `${fullYear}-${month}-${_date} 23:59`; - e.EndDate = formattedDate - } + // console.log({_date, month}) + // const formattedDate = `${fullYear}-${month}-${_date} 23:59`; + // e.EndDate = formattedDate + // } - return e - }) - result = result.concat(calendar) - } + // return e + // }) + // result = result.concat(calendar) + // } - return result - } + // return result + // } - async genericGetAllSharedEvents(startdate: string, enddate: string) { + // async genericGetAllSharedEvents(startdate: string, enddate: string) { - let result = [] + // let result = [] - for (let sharedCalendar of SessionStore.user.SharedCalendars) { + // for (let sharedCalendar of SessionStore.user.SharedCalendars) { - var header = new HttpHeaders();; - header = header.set('Authorization', 'Bearer ' + SessionStore.user.Authorization); - header = header.set('CalendarId', sharedCalendar.CalendarId); - header = header.set('CalendarRoleId', sharedCalendar.CalendarRoleId); - header = header.set('CalendarName', sharedCalendar.CalendarName); + // var header = new HttpHeaders();; + // header = header.set('Authorization', 'Bearer ' + SessionStore.user.Authorization); + // header = header.set('CalendarId', sharedCalendar.CalendarId); + // header = header.set('CalendarRoleId', sharedCalendar.CalendarRoleId); + // header = header.set('CalendarName', sharedCalendar.CalendarName); - let geturl = environment.apiURL + 'calendar/GetEvents'; + // let geturl = environment.apiURL + 'calendar/GetEvents'; - let params = new HttpParams(); + // let params = new HttpParams(); - params = params.set("StartDate", startdate); - params = params.set("EndDate", enddate); + // params = params.set("StartDate", startdate); + // params = params.set("EndDate", enddate); - let options = { - headers: header, - params: params - }; + // let options = { + // headers: header, + // params: params + // }; - const calendar = await this.http.get(`${geturl}`, options).toPromise() + // const calendar = await this.http.get(`${geturl}`, options).toPromise() - result = result.concat(calendar) + // result = result.concat(calendar) - } + // } - return new Promise(resolve => { - return resolve(result) - }); - } + // return new Promise(resolve => { + // return resolve(result) + // }); + // } - genericGetAllSharedOficialEvents(startdate: string, enddate: string): Observable { - let geturl = environment.apiURL + 'calendar/GetEvents'; - geturl = geturl.replace('/V4/', '/V5/') + // genericGetAllSharedOficialEvents(startdate: string, enddate: string): Observable { + // let geturl = environment.apiURL + 'calendar/GetEvents'; + // geturl = geturl.replace('/V4/', '/V5/') - let params = new HttpParams(); + // let params = new HttpParams(); - params = params.set("StartDate", startdate); - params = params.set("EndDate", enddate); + // params = params.set("StartDate", startdate); + // params = params.set("EndDate", enddate); - let options = { - headers: this.headerSharedOficial, - params: params - }; + // let options = { + // headers: this.headerSharedOficial, + // params: params + // }; - return this.http.get(`${geturl}`, options); - } + // return this.http.get(`${geturl}`, options); + // } - genericGetAllSharedPessoalEvents(startdate: string, enddate: string): Observable { - let geturl = environment.apiURL + 'calendar/GetEvents'; - geturl = geturl.replace('/V4/', '/V5/') + // genericGetAllSharedPessoalEvents(startdate: string, enddate: string): Observable { + // let geturl = environment.apiURL + 'calendar/GetEvents'; + // geturl = geturl.replace('/V4/', '/V5/') - let params = new HttpParams(); + // let params = new HttpParams(); - params = params.set("StartDate", startdate); - params = params.set("EndDate", enddate); + // params = params.set("StartDate", startdate); + // params = params.set("EndDate", enddate); - let options = { - headers: this.headerSharedPessoal, - params: params - }; - return this.http.get(`${geturl}`, options); - } + // let options = { + // headers: this.headerSharedPessoal, + // params: params + // }; + // return this.http.get(`${geturl}`, options); + // } - async getAllSharedEvents(startdate: string, enddate: string) { + // async getAllSharedEvents(startdate: string, enddate: string) { - let prO = [], prP = []; + // let prO = [], prP = []; - for(let calendar of SessionStore.user.SharedCalendars) { - if (calendar.CalendarName == 'Oficial') { - prO = await this.getAllSharedOficialEvents(startdate, enddate).toPromise(); - } - if(calendar.CalendarName == 'Pessoal') { - prP = await this.getAllSharedPessoalEvents(startdate, enddate).toPromise(); - } + // for(let calendar of SessionStore.user.SharedCalendars) { + // if (calendar.CalendarName == 'Oficial') { + // prO = await this.getAllSharedOficialEvents(startdate, enddate).toPromise(); + // } + // if(calendar.CalendarName == 'Pessoal') { + // prP = await this.getAllSharedPessoalEvents(startdate, enddate).toPromise(); + // } - } + // } - const resFinal = prO.concat(prP); + // const resFinal = prO.concat(prP); - return new Promise(resolve => { - return resolve(resFinal) - }); - } + // return new Promise(resolve => { + // return resolve(resFinal) + // }); + // } - getAllSharedOficialEvents(startdate: string, enddate: string): Observable { - let geturl = environment.apiURL + 'calendar/pr'; - geturl = geturl.replace('/V4/', '/V5/') + // getAllSharedOficialEvents(startdate: string, enddate: string): Observable { + // let geturl = environment.apiURL + 'calendar/pr'; + // geturl = geturl.replace('/V4/', '/V5/') - let params = new HttpParams(); + // let params = new HttpParams(); - params = params.set("Start", startdate); - params = params.set("End", enddate); + // params = params.set("Start", startdate); + // params = params.set("End", enddate); - let options = { - headers: this.headersSharedOficial, - params: params - }; + // let options = { + // headers: this.headersSharedOficial, + // params: params + // }; - return this.http.get(`${geturl}`, options); - } + // return this.http.get(`${geturl}`, options); + // } - getAllSharedPessoalEvents(startdate: string, enddate: string): Observable { - let geturl = environment.apiURL + 'calendar/pr'; - geturl = geturl.replace('/V4/', '/V5/') + // getAllSharedPessoalEvents(startdate: string, enddate: string): Observable { + // let geturl = environment.apiURL + 'calendar/pr'; + // geturl = geturl.replace('/V4/', '/V5/') - let params = new HttpParams(); + // let params = new HttpParams(); - params = params.set("Start", startdate); - params = params.set("End", enddate); + // params = params.set("Start", startdate); + // params = params.set("End", enddate); - let options = { - headers: this.headersSharedPessoal, - params: params - }; - return this.http.get(`${geturl}`, options); - } + // let options = { + // headers: this.headersSharedPessoal, + // params: params + // }; + // return this.http.get(`${geturl}`, options); + // } getRecurrenceTypes(): any { @@ -818,20 +811,20 @@ export class EventsService { } - getEvents(calendarname: string, startdate: string, enddate: string): Observable { - const geturl = environment.apiURL + 'calendar/GetEvents'; - let params = new HttpParams(); + // getEvents(calendarname: string, startdate: string, enddate: string): Observable { + // const geturl = environment.apiURL + 'calendar/GetEvents'; + // let params = new HttpParams(); - params = params.set("CalendarName", calendarname); - params = params.set("StartDate", startdate); - params = params.set("EndDate", enddate); + // params = params.set("CalendarName", calendarname); + // params = params.set("StartDate", startdate); + // params = params.set("EndDate", enddate); - let options = { - headers: this.headers, - params: params - }; - return this.http.get(`${geturl}`, options); - } + // let options = { + // headers: this.headers, + // params: params + // }; + // return this.http.get(`${geturl}`, options); + // } getEvent(eventid: string): Observable { let geturl = environment.apiURL + 'calendar/GetEvent'; @@ -870,112 +863,147 @@ export class EventsService { throw('error') } - putEvent(event: Event, conflictResolutionMode: number, sendInvitationsOrCancellationsMode: number, sharedagenda: string): Observable { - const puturl = environment.apiURL + 'calendar/' + ((sharedagenda != '') ? sharedagenda : 'PutEvent'); + // putEvent(event: Event, conflictResolutionMode: number, sendInvitationsOrCancellationsMode: number, sharedagenda: string): Observable { + // const puturl = environment.apiURL + 'calendar/' + ((sharedagenda != '') ? sharedagenda : 'PutEvent'); - let params = new HttpParams(); + // let params = new HttpParams(); - params = params.set("conflictResolutionMode", conflictResolutionMode.toString()); - params = params.set("sendInvitationsOrCancellationsMode", sendInvitationsOrCancellationsMode.toString()); + // params = params.set("conflictResolutionMode", conflictResolutionMode.toString()); + // params = params.set("sendInvitationsOrCancellationsMode", sendInvitationsOrCancellationsMode.toString()); - let options = { - headers: this.headers, - params: params - }; + // let options = { + // headers: this.headers, + // params: params + // }; - return this.http.put(`${puturl}`, event, options) - } + // return this.http.put(`${puturl}`, event, options) + // } - editEvent(event: Event, conflictResolutionMode: number, sendInvitationsOrCancellationsMode: number, CalendarId? ): Observable { - let arrayReq = []; - arrayReq.push(event); - const puturl = environment.apiURL + 'calendar/PutEvent'; - let params = new HttpParams(); + // editEvent(event: Event, conflictResolutionMode: number, sendInvitationsOrCancellationsMode: number, CalendarId ): Observable { + // let arrayReq = []; + // arrayReq.push(event); + // const puturl = environment.apiURL + 'calendar/PutEvent'; + // let params = new HttpParams(); - // event.Organizer = { - // "Id": SessionStore.user.UserId, - // "EmailAddress": SessionStore.user.Email, - // "Name": SessionStore.user.UserName, - // "IsRequired": true, - // "UserType": "GD" - // } - // params = params.set("notifyUsers", true) + // // event.Organizer = { + // // "Id": SessionStore.user.UserId, + // // "EmailAddress": SessionStore.user.Email, + // // "Name": SessionStore.user.UserName, + // // "IsRequired": true, + // // "UserType": "GD" + // // } + // // params = params.set("notifyUsers", true) - params = params.set("conflictResolutionMode", conflictResolutionMode.toString()); - params = params.set("sendInvitationsOrCancellationsMode", sendInvitationsOrCancellationsMode.toString()); - params.set('CalendarId', event.CalendarId) - params.set('CalendarName', event.CalendarName) - this.headers['CalendarId'] = event.CalendarId - this.headers['CalendarName'] = event.CalendarName - //params = params.set("CalendarName", event.CalendarName); + // params = params.set("conflictResolutionMode", conflictResolutionMode.toString()); + // params = params.set("sendInvitationsOrCancellationsMode", sendInvitationsOrCancellationsMode.toString()); + // params.set('CalendarId', event.CalendarId) + // params.set('CalendarName', event.CalendarName) + // this.headers['CalendarId'] = event.CalendarId + // this.headers['CalendarName'] = event.CalendarName + // //params = params.set("CalendarName", event.CalendarName); - if (event.CalendarName == 'Oficial') { - if (SessionStore.user.Profile == 'MDGPR') { - this.headers = this.headersMdOficial; - } - else if (SessionStore.user.Profile == 'PR') { - this.headers = this.headersPrOficial; - } else { - - const headers = [ - this.headerSharedOficial, - this.headerSharedPessoal, - this.headerOwnPessoal, - this.headerOwnOficial - ] - - const header = headers.find((header)=> { - return header?.get('CalendarId')?.includes(CalendarId) - }) - - this.headers = header - } - } - else { - if (SessionStore.user.Profile == 'MDGPR') { - this.headers = this.headersMdPessoal; - } - else if (SessionStore.user.Profile == 'PR') { - this.headers = this.headersPrPessoal; - } - else { - const headers = [ - this.headerSharedOficial, - this.headerSharedPessoal, - this.headerOwnPessoal, - this.headerOwnOficial - ] - - const header = headers.find((header)=> { - return header?.get('CalendarId')?.includes(CalendarId) - }) - - this.headers = header - } - } - - let options = { - headers: this.headers, - params: params - }; - - return this.http.put(`${puturl}`, event, options).pipe( - catchError(err => { - - this.offlinemanager.storeRequestData('eventEdit', arrayReq); - throw new Error(err); - }) - ) - } + // if (event.CalendarName == 'Oficial') { + // if (SessionStore.user.Profile == 'MDGPR') { + // this.headers = this.headersMdOficial; + // } + // else if (SessionStore.user.Profile == 'PR') { + // this.headers = this.headersPrOficial; + // } else { - changeAgenda(body: any) { - const puturl = environment.apiURL + 'Calendar/MoveEvent'; - let options = { - headers: this.headers, - }; - return this.http.post(`${puturl}`, body, options); - } + // if(CalendarId) { + + // const headers = [ + // this.headerSharedOficial, + // this.headerSharedPessoal, + // this.headerOwnPessoal, + // this.headerOwnOficial + // ] + + // const calendar = this.DetectCalendars(CalendarId) + // const header = this.makeHeader(calendar) + + // this.headers = header + // } else { + // const headers = [ + // this.headerSharedOficial, + // this.headerSharedPessoal, + // this.headerOwnPessoal, + // this.headerOwnOficial + // ] + + // const header = headers.find((header)=> { + // return header?.get('CalendarId')?.includes(CalendarId) + // }) + + // this.headers = header + // } + + // } + // } + // else { + // if (SessionStore.user.Profile == 'MDGPR') { + // this.headers = this.headersMdPessoal; + // } + // else if (SessionStore.user.Profile == 'PR') { + // this.headers = this.headersPrPessoal; + // } + // else { + + + + // if(CalendarId) { + + // const headers = [ + // this.headerSharedOficial, + // this.headerSharedPessoal, + // this.headerOwnPessoal, + // this.headerOwnOficial + // ] + + // const calendar = this.DetectCalendars(CalendarId) + // const header = this.makeHeader(calendar) + + // this.headers = header + // } else { + // const headers = [ + // this.headerSharedOficial, + // this.headerSharedPessoal, + // this.headerOwnPessoal, + // this.headerOwnOficial + // ] + + // const header = headers.find((header)=> { + // return header?.get('CalendarId')?.includes(CalendarId) + // }) + + // this.headers = header + // } + // } + // } + + // let options = { + // headers: this.headers, + // params: params + // }; + + // return this.http.put(`${puturl}`, event, options).pipe( + // catchError(err => { + + // this.offlinemanager.storeRequestData('eventEdit', arrayReq); + // throw new Error(err); + // }) + // ) + // } + + + // changeAgenda(body: any) { + // const puturl = environment.apiURL + 'Calendar/MoveEvent'; + // let options = { + // headers: this.headers, + // }; + // return this.http.post(`${puturl}`, body, options); + // } postEventMd(event: Event, calendarName: string) { const puturl = environment.apiURL + 'calendar/md'; @@ -1123,142 +1151,148 @@ export class EventsService { break; } - return this.http.delete(`${puturl}`, options).pipe( - catchError(err => { - - this.offlinemanager.storeRequestData('eventDelete', arrayReq); - throw new Error(err); - }) - ) + return this.http.delete(`${puturl}`, options) } - genericDeleteEvent(eventid: string, eventDeleteType: number, calendarName: string, calendarId: string) { - let arrayReq = []; - let Object = { - eventid: eventid, - eventDeleteType: eventDeleteType, - calendarName: calendarName - } - arrayReq.push(Object) - const puturl = environment.apiURL + 'calendar/DeleteEvent'; - let params = new HttpParams(); + // genericDeleteEvent(eventid: string, eventDeleteType: number, calendarName: string, calendarId: string) { + // let arrayReq = []; + // let Object = { + // eventid: eventid, + // eventDeleteType: eventDeleteType, + // calendarName: calendarName + // } + // arrayReq.push(Object) + // const puturl = environment.apiURL + 'calendar/DeleteEvent'; + // let params = new HttpParams(); - params = params.set("EventId", eventid); - // 0 for occurence and 1 for serie (delete all events) - params = params.set("eventDeleteType", eventDeleteType.toString()); + // params = params.set("EventId", eventid); + // // 0 for occurence and 1 for serie (delete all events) + // params = params.set("eventDeleteType", eventDeleteType.toString()); - let options; + // let options; - if(SessionStore.user.Profile == 'MDGPR') { - if (calendarName == 'Pessoal') { - options = { - headers: this.headersMdPessoal, - params: params - }; - } - else if (calendarName == 'Oficial') { - options = { - headers: this.headersMdOficial, - params: params - }; - } - } - else if (SessionStore.user.Profile == 'PR') { - if (calendarName == 'Pessoal') { - options = { - headers: this.headersPrPessoal, - params: params - }; - } - else if (calendarName == 'Oficial') { - options = { - headers: this.headersPrOficial, - params: params - }; - } - } - else { - const headers = [ - this.headerSharedOficial, - this.headerSharedPessoal, - this.headerOwnPessoal, - this.headerOwnOficial - ] + // if(SessionStore.user.Profile == 'MDGPR') { + // if (calendarName == 'Pessoal') { + // options = { + // headers: this.headersMdPessoal, + // params: params + // }; + // } + // else if (calendarName == 'Oficial') { + // options = { + // headers: this.headersMdOficial, + // params: params + // }; + // } + // } + // else if (SessionStore.user.Profile == 'PR') { + // if (calendarName == 'Pessoal') { + // options = { + // headers: this.headersPrPessoal, + // params: params + // }; + // } + // else if (calendarName == 'Oficial') { + // options = { + // headers: this.headersPrOficial, + // params: params + // }; + // } + // } + // else { + // const headers = [ + // this.headerSharedOficial, + // this.headerSharedPessoal, + // this.headerOwnPessoal, + // this.headerOwnOficial + // ] - const header = headers.find((header)=> { - return header?.get('CalendarId')?.includes(calendarId) - }) + // const header = headers.find((header)=> { + // return header?.get('CalendarId')?.includes(calendarId) + // }) - if (header) { + // if (header) { - options = { - headers: header, - params: params - }; + // options = { + // headers: header, + // params: params + // }; - return this.http.delete(`${puturl}`, options).pipe( - catchError(err => { + // return this.http.delete(`${puturl}`, options).pipe( + // catchError(err => { - this.offlinemanager.storeRequestData('eventDelete', arrayReq); - throw new Error(err); - }) - ) - } else { + // this.offlinemanager.storeRequestData('eventDelete', arrayReq); + // throw new Error(err); + // }) + // ) + // } else { + // const calendar = this.DetectCalendars(calendarId) + // const header = this.makeHeader(calendar) - } + // options = { + // headers: header, + // params: params + // }; - throw('header not found') + // return this.http.delete(`${puturl}`, options).pipe( + // catchError(err => { - } + // this.offlinemanager.storeRequestData('eventDelete', arrayReq); + // throw new Error(err); + // }) + // ) + // } + + // } - } + // } - postExpedientEvent(docId: any, body: any, sharedagenda: string, serialNumber: any, applicationID: any) { - const geturl = environment.apiURL + 'calendar/' + ((sharedagenda != '') ? sharedagenda : 'CreateEventExpediente') + '/event'; - let params = new HttpParams(); - let options; + // postExpedientEvent(docId: any, body: any, sharedagenda: string, serialNumber: any, applicationID: any) { + // const geturl = environment.apiURL + 'calendar/' + ((sharedagenda != '') ? sharedagenda : 'CreateEventExpediente') + '/event'; + // let params = new HttpParams(); + // let options; - params = params.set("DocId", docId); - params = params.set("SerialNumber", serialNumber); - params = params.set("applicationID", applicationID); - params = params.set("notifyUsers", true) + // params = params.set("DocId", docId); + // params = params.set("SerialNumber", serialNumber); + // params = params.set("applicationID", applicationID); + // params = params.set("notifyUsers", true) - switch (SessionStore.user.Profile) { - case 'MDGPR': - if (body.CalendarName == 'Pessoal') { - options = { - headers: this.headersMdPessoal, - params: params - }; - } - else if (body.CalendarName == 'Oficial') { - options = { - headers: this.headersMdOficial, - params: params - }; - } - break; - case 'PR': - if (body.CalendarName == 'Pessoal') { - options = { - headers: this.headersPrPessoal, - params: params - }; - } - else if (body.CalendarName == 'Oficial') { - options = { - headers: this.headersPrOficial, - params: params - }; - } - break; - } - return this.http.post(`${geturl}`, body, options) - } + // switch (SessionStore.user.Profile) { + // case 'MDGPR': + // if (body.CalendarName == 'Pessoal') { + // options = { + // headers: this.headersMdPessoal, + // params: params + // }; + // } + // else if (body.CalendarName == 'Oficial') { + // options = { + // headers: this.headersMdOficial, + // params: params + // }; + // } + // break; + // case 'PR': + // if (body.CalendarName == 'Pessoal') { + // options = { + // headers: this.headersPrPessoal, + // params: params + // }; + // } + // else if (body.CalendarName == 'Oficial') { + // options = { + // headers: this.headersPrOficial, + // params: params + // }; + // } + // break; + // } + // return this.http.post(`${geturl}`, body, options) + // } genericPostExpedientEvent(docId: any, body: any, sharedagenda: string, serialNumber: any, applicationID: any, CalendarId) { const geturl = environment.apiURL + 'calendar/expediente'; @@ -1279,48 +1313,48 @@ export class EventsService { return this.http.post(`${geturl}`, body, options) } - createTaskEvent(folderId: any, body: any, sharedagenda: string, serialNumber: any, applicationID: any) { - const geturl = environment.apiURL + 'calendar/' + ((sharedagenda != '') ? sharedagenda : 'CreateEventExpediente') + '/dispatch'; - let params = new HttpParams(); - let options; + // createTaskEvent(folderId: any, body: any, sharedagenda: string, serialNumber: any, applicationID: any) { + // const geturl = environment.apiURL + 'calendar/' + ((sharedagenda != '') ? sharedagenda : 'CreateEventExpediente') + '/dispatch'; + // let params = new HttpParams(); + // let options; - params = params.set("FolderId", folderId); - params = params.set("SerialNumber", serialNumber); - params = params.set("applicationID", applicationID); + // params = params.set("FolderId", folderId); + // params = params.set("SerialNumber", serialNumber); + // params = params.set("applicationID", applicationID); - switch (SessionStore.user.Profile) { - case 'MDGPR': - if (body.CalendarName == 'Pessoal') { - options = { - headers: this.headersMdPessoal, - params: params - }; - } - else if (body.CalendarName == 'Oficial') { - options = { - headers: this.headersMdOficial, - params: params - }; - } - break; - case 'PR': - if (body.CalendarName == 'Pessoal') { - options = { - headers: this.headersPrPessoal, - params: params - }; - } - else if (body.CalendarName == 'Oficial') { - options = { - headers: this.headersPrOficial, - params: params - }; - } - break; - } + // switch (SessionStore.user.Profile) { + // case 'MDGPR': + // if (body.CalendarName == 'Pessoal') { + // options = { + // headers: this.headersMdPessoal, + // params: params + // }; + // } + // else if (body.CalendarName == 'Oficial') { + // options = { + // headers: this.headersMdOficial, + // params: params + // }; + // } + // break; + // case 'PR': + // if (body.CalendarName == 'Pessoal') { + // options = { + // headers: this.headersPrPessoal, + // params: params + // }; + // } + // else if (body.CalendarName == 'Oficial') { + // options = { + // headers: this.headersPrOficial, + // params: params + // }; + // } + // break; + // } - return this.http.post(`${geturl}`, body, options) - } + // return this.http.post(`${geturl}`, body, options) + // } @@ -1335,7 +1369,18 @@ export class EventsService { params = params.set("notifyUsers", true) const calendar = this.DetectCalendars(CalendarId) - const header = this.makeHeader(calendar) + let header; + console.log('calendar') + + try { + + header = this.makeHeader(calendar) + + + } catch (error) {} + + + console.log('header') options = { headers: header, @@ -1348,15 +1393,15 @@ export class EventsService { - postEventToApproveEdit(body: EventToApproveEdit) { - const geturl = environment.apiURL + 'Tasks/EditEventTask'; + // postEventToApproveEdit(body: EventToApproveEdit) { + // const geturl = environment.apiURL + 'Tasks/EditEventTask'; - let options = { - headers: this.headers, - }; + // let options = { + // headers: this.headers, + // }; - return this.http.post(`${geturl}`, body, options) - } + // return this.http.post(`${geturl}`, body, options) + // } } const token = { diff --git a/src/app/services/events/attachments/attachments.module.ts b/src/app/services/events/attachments/attachments.module.ts deleted file mode 100644 index 95c52664a..000000000 --- a/src/app/services/events/attachments/attachments.module.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; - -import { IonicModule } from '@ionic/angular'; - -import { AttachmentsPageRoutingModule } from './attachments-routing.module'; - -import { AttachmentsPage } from './attachments.page'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - AttachmentsPageRoutingModule - ], - declarations: [AttachmentsPage] -}) -export class AttachmentsPageModule {} diff --git a/src/app/services/events/attachments/attachments.page.html b/src/app/services/events/attachments/attachments.page.html deleted file mode 100644 index 93a33398e..000000000 --- a/src/app/services/events/attachments/attachments.page.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - Anexos do evento - - - -
- - - - - -

{{ att.SourceName }}

-

{{ att.Description }}

-

{{ att.CreateDate }}

-

{{ att.Stakeholders }}

-
-
-
-
-
- -
- - - - - - -

- -

-

- -

-

- -

-
-
- - - - - -

- -

-

- -

-

- -

-
-
-
-
-
diff --git a/src/app/services/events/attachments/attachments.page.scss b/src/app/services/events/attachments/attachments.page.scss deleted file mode 100644 index 7285fe589..000000000 --- a/src/app/services/events/attachments/attachments.page.scss +++ /dev/null @@ -1,57 +0,0 @@ -ion-back-button { - display: block; -} - -/* CONTENT */ -ion-content{ - --background: #f2f2f2; -} -.div-attach-results{ - background: none; -} -ion-list, ion-item-sliding{ - background: none; - -} -.item-list-small{ - font-size: rem(14); - overflow: auto; - } - .ion-item-class{ - padding: 0; - - } - .label-text{ - width: 100%; - padding: 0; - margin: 0; - } - -//DIV -.main-item{ - margin: 15px; - /* border: 1px solid #ccc; */ - border-radius: 5px; - box-shadow: 0 4px 8px 0 #ccc, 0 6px 20px 0 #f2f2f2; -} - .div-content-attachment{ - margin:0; - padding: 10px; - } - .div-content-attachment h3{ - font-size: rem(18); - font-weight: 700; - padding-bottom: 5px; - } - ion-item ion-icon{ - --border-color: red; - } - - /* Custom Skeleton Line Height and Margin */ -.custom-skeleton ion-skeleton-text { - line-height: 13px; -} - -.custom-skeleton ion-skeleton-text:last-child { - margin-bottom: 5px; -} \ No newline at end of file diff --git a/src/app/services/events/attachments/attachments.page.spec.ts b/src/app/services/events/attachments/attachments.page.spec.ts deleted file mode 100644 index 881e11b1a..000000000 --- a/src/app/services/events/attachments/attachments.page.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; - -import { AttachmentsPage } from './attachments.page'; - -describe('AttachmentsPage', () => { - let component: AttachmentsPage; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ AttachmentsPage ], - imports: [IonicModule.forRoot()] - }).compileComponents(); - - fixture = TestBed.createComponent(AttachmentsPage); - component = fixture.componentInstance; - fixture.detectChanges(); - })); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/services/events/attachments/attachments.page.ts b/src/app/services/events/attachments/attachments.page.ts deleted file mode 100644 index f5debd1a8..000000000 --- a/src/app/services/events/attachments/attachments.page.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { AttachmentsService } from 'src/app/services/attachments.service'; -import { Attachment } from 'src/app/models/attachment.model'; -import { ActivatedRoute, Router } from '@angular/router'; -import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; -import { ModalController, NavParams } from '@ionic/angular'; - -@Component({ - selector: 'app-attachments', - templateUrl: './attachments.page.html', - styleUrls: ['./attachments.page.scss'], -}) -export class AttachmentsPage implements OnInit { - - loadedEventAttachments: Attachment[]; - pageId: string; - - constructor( - private attachamentsService: AttachmentsService, - private iab: InAppBrowser, - private modalCtrl: ModalController, - private navParams: NavParams) { } - - ngOnInit() { - this.loadAttachments(this.navParams.get('eventId')); - } - - loadAttachments(eventid:string) - { - this.attachamentsService.getAttachmentsById(eventid).subscribe(attachments => { - this.loadedEventAttachments = attachments; - this.pageId = eventid; - },((erro) => { - console.error('loadAttchament', erro) - })); - } - - async viewDocument(documenturl:string) - { - const url: string = documenturl.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1"); - const browser = this.iab.create(url,"_blank"); - browser.show(); - } - close(){ - this.modalCtrl.dismiss(null); - } - - -} diff --git a/src/app/services/events/attendees/attendees-routing.module.ts b/src/app/services/events/attendees/attendees-routing.module.ts deleted file mode 100644 index 00f6f262b..000000000 --- a/src/app/services/events/attendees/attendees-routing.module.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; - -import { AttendeesPageModal } from './attendees.page'; - -const routes: Routes = [ - { - path: '', - component: AttendeesPageModal - } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule], -}) -export class AttendeesPageRoutingModule {} diff --git a/src/app/services/events/attendees/attendees.page.html b/src/app/services/events/attendees/attendees.page.html deleted file mode 100644 index fdb4748e0..000000000 --- a/src/app/services/events/attendees/attendees.page.html +++ /dev/null @@ -1,94 +0,0 @@ - - - Pesquisar contactos - - - - - - - - - - -
- -
- - - -
- -

{{ attendee.Name }}

-

{{ attendee.EmailAddress }}

-
-
- -
-
-
- -
-
-
- - -
Destinatário
- - -
- - - -
- -

{{ attendee.Name }}

-

{{ attendee.EmailAddress }}

-
-
- -
-
-
-
- -
Destinatário
- - - -
- - - -
- -

{{ attendee.Name }}

-

{{ attendee.EmailAddress }}

-
-
- -
-
-
-
-
- -
- - - - - - - - - - - - diff --git a/src/app/services/events/attendees/attendees.page.scss b/src/app/services/events/attendees/attendees.page.scss deleted file mode 100644 index 7cb035cfa..000000000 --- a/src/app/services/events/attendees/attendees.page.scss +++ /dev/null @@ -1,3 +0,0 @@ -ion-item{ - border-bottom:1px solid #ccc; -} diff --git a/src/app/services/events/attendees/attendees.page.spec.ts b/src/app/services/events/attendees/attendees.page.spec.ts deleted file mode 100644 index f8fb83e19..000000000 --- a/src/app/services/events/attendees/attendees.page.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; - -import { AttendeesPageModal } from './attendees.page'; - -describe('AttendeesPage', () => { - let component: AttendeesPageModal; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ AttendeesPageModal ], - imports: [IonicModule.forRoot()] - }).compileComponents(); - - fixture = TestBed.createComponent(AttendeesPageModal); - component = fixture.componentInstance; - fixture.detectChanges(); - })); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/services/events/attendees/attendees.page.ts b/src/app/services/events/attendees/attendees.page.ts deleted file mode 100644 index 1d79c6b31..000000000 --- a/src/app/services/events/attendees/attendees.page.ts +++ /dev/null @@ -1,177 +0,0 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { EventPerson } from 'src/app/models/eventperson.model'; -import { ModalController, NavParams } from '@ionic/angular'; -import { ContactsService } from 'src/app/services/contacts.service'; -import { ThemeService } from 'src/app/services/theme.service' -import { LoginUserRespose } from 'src/app/models/user.model'; -import { SessionStore } from 'src/app/store/session.service'; -import { Router } from '@angular/router'; - -@Component({ - selector: 'app-attendees', - templateUrl: './attendees.page.html', - styleUrls: ['./attendees.page.scss'], -}) -export class AttendeesPageModal implements OnInit { - - // Defined by the API - contacts: EventPerson[]; - showLoader: boolean = false; - selectedContact: EventPerson[] =[]; - eventPersons: EventPerson[]; - adding: "intervenient" | "CC"; - currentPath = window.location.pathname; - - taskParticipants:EventPerson[] = []; - taskParticipantsCc:EventPerson[] = []; - loggeduser: LoginUserRespose; - @Input() loggedAttendSon: boolean; - @Input() hideExternalDomain = true; - taskType: any; - - - constructor( - private modalCtrl: ModalController, - private contactsService: ContactsService, - private navParams: NavParams, - private modalController: ModalController, - public ThemeService: ThemeService, - private router: Router,) { - - this.adding = this.navParams.get('adding'); - this.taskParticipants = this.navParams.get('taskParticipants'); - this.taskParticipantsCc = this.navParams.get('taskParticipantsCc'); - this.taskType = this.navParams.get('taskType'); - this.loggeduser = SessionStore.user; - - } - - ngOnInit() { - console.log('Pesquisa de contactos current path2',this.router.url) - this.fetchContacts(""); - - if(this.taskParticipants == null || this.taskParticipants == undefined){ - this.taskParticipants = []; - } - - if(this.taskParticipantsCc == null || this.taskParticipantsCc == undefined){ - this.taskParticipantsCc = []; - } - - } - - ngOnChanges(event) {} - - save(){ - - this.modalController.dismiss({ - 'taskParticipants': this.taskParticipants, - 'taskParticipantsCc': this.taskParticipantsCc - }); - } - - close() { - this.modalController.dismiss(false); - } - - onChange(evt: any) { - this.fetchContacts(evt.detail.value); - } - - filterSearchList(itm: EventPerson): boolean { - - const result = this.taskParticipants.concat( this.taskParticipantsCc).find((contact, index)=>{ - - if(contact.Name.toLocaleLowerCase() == itm.Name.toLocaleLowerCase() && contact.EmailAddress.toLocaleLowerCase() == itm.EmailAddress.toLocaleLowerCase()){ - index = index; - return contact; - } - - }) - - return undefined == result; - - } - - remove(itm: EventPerson){ - - if(this.adding == "intervenient"){ - - this.taskParticipants = this.taskParticipants.filter((contact, index) =>{ - - if(contact.Name.toLocaleLowerCase() != itm.Name.toLocaleLowerCase() && contact.EmailAddress.toLocaleLowerCase() != itm.EmailAddress.toLocaleLowerCase()){ - return contact; - } - return false; - - }); - - } else if (this.adding == "CC") { - - this.taskParticipantsCc = this.taskParticipantsCc.filter((contact, index) =>{ - - if(contact.Name.toLocaleLowerCase() != itm.Name.toLocaleLowerCase() && contact.EmailAddress.toLocaleLowerCase() != itm.EmailAddress.toLocaleLowerCase()){ - return contact; - } - return false; - - }); - } - - } - - async selectContact(itm: EventPerson){ - if(this.adding == "intervenient"){ - itm.IsRequired = true; - this.taskParticipants.push(itm); - - } else if (this.adding == "CC") { - itm.IsRequired = false; - this.taskParticipantsCc.push(itm); - } - } - - async fetchContacts(filter: string) { - this.showLoader = true; - - this.contactsService.getContacts(filter).subscribe(_result => - { - - let result - if(this.hideExternalDomain) { - result = _result.filter( e => e.UserType == 'GD') - } else { - result = _result - } - - - if (this.eventPersons != null) - { - this.eventPersons.forEach(attendee => { - const index: number = result.findIndex((cont) => { - return cont.EmailAddress.toLocaleLowerCase() == attendee.EmailAddress.toLocaleLowerCase() - }); - - result.splice(index, 1); - }); - } - - if(this.loggedAttendSon) { - this.contacts = result; - this.showLoader = false; - } else { - this.contacts = result; - // console.log('Attendes Email',this.loggeduser.Email) - let filterLoggedUserEmail = this.contacts.filter(item => item.EmailAddress.toLocaleLowerCase() != this.loggeduser.Email.toLocaleLowerCase()) - // console.log('Attendes Email', filterLoggedUserEmail) - let filterEmptyEmail = filterLoggedUserEmail.filter(item => item.EmailAddress.toLocaleLowerCase() != "") - this.contacts = filterEmptyEmail; - // console.log('Attendes Email', this.contacts) - this.showLoader = false; - - } - } - ); - } - -} diff --git a/src/app/services/events/edit-event/edit-event-routing.module.ts b/src/app/services/events/edit-event/edit-event-routing.module.ts deleted file mode 100644 index 3616b2106..000000000 --- a/src/app/services/events/edit-event/edit-event-routing.module.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; - -import { EditEventPage } from './edit-event.page'; - -const routes: Routes = [ - { - path: '', - component: EditEventPage - } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule], -}) -export class EditEventPageRoutingModule {} diff --git a/src/app/services/events/edit-event/edit-event.module.ts b/src/app/services/events/edit-event/edit-event.module.ts deleted file mode 100644 index bcd1dc3e4..000000000 --- a/src/app/services/events/edit-event/edit-event.module.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; - -import { IonicModule } from '@ionic/angular'; - -import { EditEventPageRoutingModule } from './edit-event-routing.module'; - -import { EditEventPage } from './edit-event.page'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - EditEventPageRoutingModule - ], - declarations: [EditEventPage], - exports: [EditEventPage] -}) -export class EditEventPageModule {} diff --git a/src/app/services/events/edit-event/edit-event.page.html b/src/app/services/events/edit-event/edit-event.page.html deleted file mode 100644 index 00931590b..000000000 --- a/src/app/services/events/edit-event/edit-event.page.html +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - Visualizar Evento - - - - - - - -
- - - - Assunto - - - - - Campo obrigatório - - - Descrição - - - - Localização - - - - Calendário - - Pessoal - Oficial - - - - Tipo do evento - - Reunião - Viagem - Conferência - Encontro - - - - Data Início - - - - Data Fim - - - -
- - - Editar - - Intervenientes - -
-
-
- - - - {{attendee.Name}} - - -
- -
-
- -
-
-
-
- - - Editar - - Anexos - -
-
-
- - - - - -

{{ att.Description }}

-

{{ att.CreateDate }}

-
-
-
-
-
-
- -
-
- - - - Sem anexos - - - -
-
-
-
- -
-
- - - - - -
- - - - - - - - - - - - -

- -

-

- -

-

- -

-
-
- - - - - -

- -

-

- -

-

- -

-
-
- - - -

- -

-

- -

-

- -

-
-
-
-
- -
- - -
- -
-
-
- diff --git a/src/app/services/events/edit-event/edit-event.page.scss b/src/app/services/events/edit-event/edit-event.page.scss deleted file mode 100644 index caaf95436..000000000 --- a/src/app/services/events/edit-event/edit-event.page.scss +++ /dev/null @@ -1,166 +0,0 @@ -@import '~src/function.scss'; -.content{ - padding: 30px 20px 0 20px !important; - margin: 0; - float: left; - border-left: 1px solid #d8d8d8 !important; - } - .main-header{ - font-family: Roboto; - background-color: #fff; - overflow:hidden; - color:#000; - transform: translate3d(0, 1px, 0); - - .title-content{ - margin: 0px auto; - overflow: auto; - padding: 0 !important; - background: #fff; - .middle{ - padding: 0!important; - float: left; - } - } - - .title{ - font-size: rem(25); - } - - } - .ion-item-container{ - margin: rem(15) auto; - border: 1px solid #ebebeb; - border-radius: 5px; - padding-left: 10px; - } - .ion-item-container-no-border{ - width: 100%; - margin: 0px auto; - padding: 0 !important; - overflow: auto; - } - .container-div{ - margin-bottom: 15px; - float: left; - overflow: auto; - } - .ion-item-class-2{ - margin: 0px auto; - } - .ion-icon-class{ - width: rem(45); - height: rem(45); - float: left; - padding: 10px; - font-size: rem(25); - } - ion-select{ - padding-left: 5px; - margin-left: 0; - } - .ion-input-class{ - width: calc(100% - 45px); - height: rem(45); - border: 1px solid #ebebeb; - border-radius: 5px; - padding-left: 5px; - padding-right: 10px; - float: left; - } - .ion-input-class-no-height{ - border: 1px solid #ebebeb; - border-radius: 5px; - overflow: auto; - } - .list-people{ - //width: 256px; - float: left; - - } - .add-people{ - width: rem(45); - float: right; - overflow: auto; - font-size: rem(25); - height: rem(45); - display: flex; - } - .list-people-title{ - /* font-size: rem(13); */ - color: #797979; - } - .attach-document{ - font-size: rem(15); - color: var(--title-text-color); - margin: 5px 5px 5px 10px; - padding: 5px; - float: left; - } - .attach-icon{ - width: 37px; - font-size: rem(35); - float: left; - } - .attach-title-item{ - width: 100%; - font-size: rem(15); - color:var(--title-text-color); - } - /* SPAN */ - .span-left{ - float: left; - font-size: rem(15); - } - .span-right{ - text-align: right; - float: right; - font-size: rem(13); - } - .container-footer{ - margin:0 auto; - overflow: auto; - } - .button-cancel { - width: rem(170); - height: rem(44); - border-radius: 22.5px; - --background: #e0e9ee; - --color: #061b52; - margin:10px; - } - .button-save { - width: rem(170); - height: rem(44); - border-radius: 22.5px; - --background: #42b9fe; - --color:#ffffff; - margin:10px; - } - - .text-input{ - width: 100%; - border: 1px solid #ebebeb; - margin: 0px 15px 15px 0px; - padding: 0 !important; - border-radius: 5px; - } - - /* Error Messages */ - .error{ - color:red; - font-size: rem(12); - font-weight: bold; - padding-bottom: 20px; - } - .span-color{ - color:red; - } - - - .buttons{ - display: flex; - justify-content: space-between; - padding: 20px; - overflow: auto; - } \ No newline at end of file diff --git a/src/app/services/events/edit-event/edit-event.page.spec.ts b/src/app/services/events/edit-event/edit-event.page.spec.ts deleted file mode 100644 index f63e92e8d..000000000 --- a/src/app/services/events/edit-event/edit-event.page.spec.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { HttpClientModule } from '@angular/common/http'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; - -import { EditEventPage } from './edit-event.page'; - -describe('EditEventPage', () => { - let component: EditEventPage; - let fixture: ComponentFixture; - - beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ - declarations: [ EditEventPage ], - imports: [ - IonicModule.forRoot(), - HttpClientModule - ] - }).compileComponents(); - - fixture = TestBed.createComponent(EditEventPage); - component = fixture.componentInstance; - fixture.detectChanges(); - })); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/services/events/edit-event/edit-event.page.ts b/src/app/services/events/edit-event/edit-event.page.ts deleted file mode 100644 index 4ac7b984e..000000000 --- a/src/app/services/events/edit-event/edit-event.page.ts +++ /dev/null @@ -1,246 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { EventsService } from 'src/app/services/events.service'; -import { Router } from '@angular/router'; -import { Event } from '../../../models/event.model'; -import { EventBody } from 'src/app/models/eventbody.model'; -import { AlertController, ModalController } from '@ionic/angular'; -import { EventPerson } from 'src/app/models/eventperson.model'; -import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page'; -import { Attachment } from 'src/app/models/attachment.model'; -import { AttachmentsService } from 'src/app/services/attachments.service'; -import { FormGroup, FormBuilder, Validators } from "@angular/forms"; -import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; -import { AttachmentsPage } from '../attachments/attachments.page'; - -@Component({ - selector: 'app-edit-event', - templateUrl: './edit-event.page.html', - styleUrls: ['./edit-event.page.scss'], -}) - -export class EditEventPage implements OnInit { - - loadedEvent: Event; - loadedEventAttachments: Attachment[]; - pageId: string; - showLoader: boolean; - backURL: string; - ionicForm: FormGroup; - isSubmitted = false; - - minDate: Date; - - profile:string; - - constructor( - public formBuilder: FormBuilder, - public alertController: AlertController, - private router: Router, - private activatedRoute: ActivatedRoute, - private eventsService: EventsService, - private modalCtrl: ModalController, - private attachamentsService: AttachmentsService, - private route: Router, - private iab: InAppBrowser) { - this.loadedEvent = new Event(); - this.loadedEvent.Body = new EventBody(); - - } - - ngOnInit() { - this.loadEvent(); - this.loadAttachments(); - this.ionicForm = this.formBuilder.group({ - subject: ['', [Validators.required]] - }) - } - - get errorControl() { - return this.ionicForm.controls; - } - - loadEvent(){ - let eventid: string; - this.activatedRoute.paramMap.subscribe(paramMap => - { - if (!paramMap.has("eventId")){ - return; - } - else{ - this.pageId = paramMap.get('eventId'); - eventid = paramMap.get('eventId'); - - - } - if (paramMap.has("caller")){ - this.backURL = "/home/" + paramMap.get('caller'); - } - } - ); - this.eventsService.getEvent(eventid).subscribe(response => { - this.loadedEvent = response; - }); - } - - async openAttendees(){ - const modal = await this.modalCtrl.create({ - component: AttendeesPageModal, - componentProps: { - eventAttendees: this.loadedEvent.Attendees - }, - cssClass: 'attendee modal-desktop', - backdropDismiss: false - }); - - await modal.present(); - - modal.onDidDismiss().then((data) => { - if (data['data'] != null) - { - let newattendees: EventPerson[] = data['data']; - this.loadedEvent.Attendees = newattendees; - } - }); - } - - getEventAttendees(): EventPerson[] - { - return this.loadedEvent.Attendees; - } - - setEventAttendees(newattendes: EventPerson[]) - { - this.loadedEvent.Attendees = newattendes; - } - - async deleteConfirm() - { - const alert = await this.alertController.create({ - cssClass: 'my-custom-class', - header: 'Apagar evento!', - message: 'Deseja apagar o evento da agenda ' + this.loadedEvent.CalendarName + '?', - buttons: [ - { - text: 'Não', - role: 'cancel', - cssClass: 'secondary', - handler: () => { } - }, { - text: 'Sim', - handler: () => { - this.Delete(); - } - } - ] - }); - - await alert.present(); - } - - Delete() - { - this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => - { - const alert = await this.alertController.create({ - cssClass: 'my-custom-class', - header: 'Evento removido', - buttons: ['OK'] - }); - - setTimeout(()=>{ - alert.dismiss(); - }, 1500); - - this.router.navigate(['/home/events']); - }); - } - - Save() - { - if (this.ionicForm.valid){ - - this.activatedRoute.paramMap.subscribe(paramMap =>{ - if (paramMap.has("profile")){ - - - } - }); - - this.eventsService.editEvent(this.loadedEvent, 2, 3).subscribe(async () => - { - const alert = await this.alertController.create({ - cssClass: 'my-custom-class', - header: 'Evento actualizado', - buttons: ['OK'] - }); - - setTimeout(()=>{ - alert.dismiss(); - }, 1500); - }); - } - } - - loadAttachments() - { - - this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => { - this.loadedEventAttachments = res; - - - },((erro) => { - console.error('loadAttchament', erro) - })); - } - async viewDocument(documenturl:string) - { - const url: string = documenturl.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1"); - const browser = this.iab.create(url,"_blank"); - browser.show(); - } - - back() - { - //this.back(); - } - doRefresh(event){ - /* this.RefreshEvents(); */ - try { - event?.target?.complete(); -} catch(error) {} - setTimeout(() => { - try { - event?.target?.complete(); -} catch(error) {} - }, 2000); - - } - navigateTo(ev){ - this.route.navigate(['/home/events',ev]); - } - async openAttachments(){ - const modal = await this.modalCtrl.create({ - component: AttachmentsPage, - componentProps: { - eventId: this.pageId, - attachments: this.loadedEventAttachments - }, - cssClass: 'attachments', - backdropDismiss: false - }); - - - - modal.onDidDismiss().then((data) => { - if (data['data'] != null) - { - let newattendees: EventPerson[] = data['data']; - this.loadedEvent.Attendees = newattendees; - } - }); - - await modal.present(); - - } -} diff --git a/src/app/services/events/event-detail-modal/event-detail-modal-routing.module.ts b/src/app/services/events/event-detail-modal/event-detail-modal-routing.module.ts deleted file mode 100644 index bebfe4ea1..000000000 --- a/src/app/services/events/event-detail-modal/event-detail-modal-routing.module.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; - -import { EventDetailModalPage } from './event-detail-modal.page'; - -const routes: Routes = [ - { - path: '', - component: EventDetailModalPage - } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule], -}) -export class EventDetailModalPageRoutingModule {} diff --git a/src/app/services/events/event-detail-modal/event-detail-modal.module.ts b/src/app/services/events/event-detail-modal/event-detail-modal.module.ts deleted file mode 100644 index 5472c8c36..000000000 --- a/src/app/services/events/event-detail-modal/event-detail-modal.module.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; - -import { IonicModule } from '@ionic/angular'; - -import { EventDetailModalPageRoutingModule } from './event-detail-modal-routing.module'; - -import { EventDetailModalPage } from './event-detail-modal.page'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - EventDetailModalPageRoutingModule - ], - declarations: [EventDetailModalPage] -}) -export class EventDetailModalPageModule {} diff --git a/src/app/services/events/event-detail-modal/event-detail-modal.page.html b/src/app/services/events/event-detail-modal/event-detail-modal.page.html deleted file mode 100644 index 92a252fae..000000000 --- a/src/app/services/events/event-detail-modal/event-detail-modal.page.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - Visualizar Evento - - - - - - - -
- - - - - Descrição - - - - Localização - - - - Calendário - - Pessoal - Oficial - - - - Tipo do evento - - Reunião - Viagem - Conferência - Encontro - - - - Data Início - - - - Data Fim - - - -
- - - Editar - - Intervenientes - -
-
-
- - - - {{attendee.Name}} - - -
- -
-
- -
-
-
-
- - - Editar - - Anexos - -
-
-
- - - - - -

{{ att.Description }}

-

{{ att.CreateDate }}

-
-
-
-
-
-
- -
-
- - - - - -

-

-
-
-
- - - - - Sem anexos - - - -
-
-
-
- -
-
- - - - - -
- - - - - - - - - - - - -

- -

-

- -

-

- -

-
-
- - - - - -

- -

-

- -

-

- -

-
-
- - - -

- -

-

- -

-

- -

-
-
-
-
- -
- - -
- Enviar -
-
-
- diff --git a/src/app/services/events/event-detail-modal/event-detail-modal.page.scss b/src/app/services/events/event-detail-modal/event-detail-modal.page.scss deleted file mode 100644 index cbc68cc6b..000000000 --- a/src/app/services/events/event-detail-modal/event-detail-modal.page.scss +++ /dev/null @@ -1,95 +0,0 @@ -ion-item-group{ - margin: 15px; -} -.div-item{ - width: 100%; - overflow: auto; - border-bottom: 1px solid #ccc; - margin: 10px 0 5px 0; -} -.div-up{ - width: 100%; - overflow: auto; -} -.div-up h3{ - margin: 0; - padding: 0; - font-size: rem(17); - width: 100%; -} -.div-icon{ - width: 10%; - font-size: rem(22); - float: left; - color: #808080; -} -.div-icon ion-icon{ - display: block; - margin: 0 auto; - -} -.div-content-attachment{ - width: 85%; - float: left; - padding: 0 0 0 12px; -} -.ion-icon-attach{ - color: #666666; - font-size: rem(20); -} - -.btn-attach{ - margin: 15px 0 0 0; - --color: #333; - --border-color:#333; -} -.div-card-button{ - width: 100%; - overflow: auto; - padding: 0 !important; -} -ion-card{ - margin: 2.5% !important; - width: 45%; - float: left; -} -.center{ - text-align: center; - float: center; -} - -/* FFOTER */ -.event-detail-buttons{ - width: 90%; - margin: 10px auto; -} -.event-detail-buttons ion-button{ - width: 90%; - margin: 0 auto; - display: block; - margin-bottom: 25px; -} -.ion-icon-delete{ - font-size: rem(22); - color: red; - background-color: white; - padding-right: 5px; -} -.error{ - color:red; - font-size: rem(12); - font-weight: bold; - padding-bottom: 20px; -} -/* .event-detail-buttons{ - margin-bottom: 80px; - margin-top: 10px; -} */ -.attendees-icon{ - font-size: rem(14); -} -.see-more-button{ - text-transform: initial; - font-size: rem(16); -} - diff --git a/src/app/services/events/event-detail-modal/event-detail-modal.page.spec.ts b/src/app/services/events/event-detail-modal/event-detail-modal.page.spec.ts deleted file mode 100644 index 76c8032a4..000000000 --- a/src/app/services/events/event-detail-modal/event-detail-modal.page.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; - -import { EventDetailModalPage } from './event-detail-modal.page'; - -describe('EventDetailModalPage', () => { - let component: EventDetailModalPage; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ EventDetailModalPage ], - imports: [IonicModule.forRoot()] - }).compileComponents(); - - fixture = TestBed.createComponent(EventDetailModalPage); - component = fixture.componentInstance; - fixture.detectChanges(); - })); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/services/events/event-detail-modal/event-detail-modal.page.ts b/src/app/services/events/event-detail-modal/event-detail-modal.page.ts deleted file mode 100644 index 7ddf885a0..000000000 --- a/src/app/services/events/event-detail-modal/event-detail-modal.page.ts +++ /dev/null @@ -1,246 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { ActivatedRoute, Router } from '@angular/router'; -import { AlertController, ModalController, NavParams } from '@ionic/angular'; -import { Attachment } from 'src/app/models/attachment.model'; -import { Event } from 'src/app/models/event.model'; -import { EventBody } from 'src/app/models/eventbody.model'; -import { EventPerson } from 'src/app/models/eventperson.model'; -import { AttachmentsService } from 'src/app/services/attachments.service'; -import { EventsService } from 'src/app/services/events.service'; -import { AttachmentsPage } from '../attachments/attachments.page'; -import { AttendeesPageModal } from '../attendees/attendees.page'; - -@Component({ - selector: 'app-event-detail-modal', - templateUrl: './event-detail-modal.page.html', - styleUrls: ['./event-detail-modal.page.scss'], -}) -export class EventDetailModalPage implements OnInit { - - loadedEvent: Event; - loadedEventAttachments: Attachment[]; - pageId: string; - showLoader: boolean; - backURL: string; - ionicForm: FormGroup; - isSubmitted = false; - - minDate: Date; - - profile:string; - - constructor( - public formBuilder: FormBuilder, - public alertController: AlertController, - private router: Router, - private activatedRoute: ActivatedRoute, - private eventsService: EventsService, - private modalCtrl: ModalController, - private attachamentsService: AttachmentsService, - private route: Router,) { - this.loadedEvent = new Event(); - this.loadedEvent.Body = new EventBody(); - } - - ngOnInit() { - this.loadEvent(); - this.loadAttachments(); - this.ionicForm = this.formBuilder.group({ - subject: ['', [Validators.required]] - }) - - // this.setDefaultTime() - } - - // setDefaultTime() { - // this.loadedEvent.StartDate = new Date() - // this.loadedEvent.EndDate = (new Date(new Date().getTime() + 15 * 60000)) - // } - - get errorControl() { - return this.ionicForm.controls; - } - - loadEvent(){ - let eventid: string; - this.activatedRoute.paramMap.subscribe(paramMap => - { - if (!paramMap.has("eventId")){ - return; - } - else{ - this.pageId = paramMap.get('eventId'); - eventid = paramMap.get('eventId'); - - - } - if (paramMap.has("caller")){ - this.backURL = "/home/" + paramMap.get('caller'); - } - } - ); - this.eventsService.getEvent(eventid).subscribe(response => { - this.loadedEvent = response; - }); - } - - async openAttendees(){ - const modal = await this.modalCtrl.create({ - component: AttendeesPageModal, - componentProps: { - eventAttendees: this.loadedEvent.Attendees - }, - cssClass: 'attendee modal-desktop', - backdropDismiss: false - }); - - - - modal.onDidDismiss().then((data) => { - if (data['data'] != null) - { - let newattendees: EventPerson[] = data['data']; - this.loadedEvent.Attendees = newattendees; - } - }); - - await modal.present(); -} - - getEventAttendees(): EventPerson[] - { - return this.loadedEvent.Attendees; - } - - setEventAttendees(newattendes: EventPerson[]) - { - this.loadedEvent.Attendees = newattendes; - } - - async deleteConfirm() - { - const alert = await this.alertController.create({ - cssClass: 'my-custom-class', - header: 'Apagar evento!', - message: 'Deseja apagar o evento da agenda ' + this.loadedEvent.CalendarName + '?', - buttons: [ - { - text: 'Não', - role: 'cancel', - cssClass: 'secondary', - handler: () => { } - }, { - text: 'Sim', - handler: () => { - this.Delete(); - } - } - ] - }); - - await alert.present(); - } - - Delete() - { - this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => - { - const alert = await this.alertController.create({ - cssClass: 'my-custom-class', - header: 'Evento removido', - buttons: ['OK'] - }); - - setTimeout(()=>{ - alert.dismiss(); - }, 1500); - - this.router.navigate(['/home/events']); - }); - } - - Save() - { - if (this.ionicForm.valid) - { - - this.eventsService.putEvent(this.loadedEvent, 2, 3, "md").subscribe(async () => - { - const alert = await this.alertController.create({ - cssClass: 'my-custom-class', - header: 'Evento actualizado', - buttons: ['OK'] - }); - - setTimeout(()=>{ - alert.dismiss(); - }, 1500); - }); - } - } - - loadAttachments() - { - /* this.attachamentsService.getEventAttachments(this.pageId).subscribe(attachments => { - this.loadedEventAttachments = attachments; - }); */ - this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => { - - - },((erro) => { - console.error('loadAttchament', erro) - })); - } - async viewDocument(documenturl:string) - { - const url: string = documenturl.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1"); - /* const browser = this.iab.create(url,"_blank"); - browser.show(); */ - } - - back() - { - //this.back(); - } - doRefresh(event){ - /* this.RefreshEvents(); */ - try { - event?.target?.complete(); -} catch(error) {} - setTimeout(() => { - try { - event?.target?.complete(); -} catch(error) {} - }, 2000); - - } - navigateTo(ev){ - this.route.navigate(['/home/events',ev]); - } - async openAttachments() { - const modal = await this.modalCtrl.create({ - component: AttachmentsPage, - componentProps: { - eventId: this.pageId, - attachments: this.loadedEventAttachments - }, - cssClass: 'attachments', - backdropDismiss: false - }); - - - - modal.onDidDismiss().then((data) => { - if (data['data'] != null) - { - let newattendees: EventPerson[] = data['data']; - this.loadedEvent.Attendees = newattendees; - } - }); - - await modal.present(); - - } - -} diff --git a/src/app/services/events/event-detail/event-detail-routing.module.ts b/src/app/services/events/event-detail/event-detail-routing.module.ts deleted file mode 100644 index a2b625fd8..000000000 --- a/src/app/services/events/event-detail/event-detail-routing.module.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; - -import { EventDetailPage } from './event-detail.page'; - -const routes: Routes = [ - { - path: '', - component: EventDetailPage - } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule], -}) -export class EventDetailPageRoutingModule {} diff --git a/src/app/services/events/event-detail/event-detail.module.ts b/src/app/services/events/event-detail/event-detail.module.ts deleted file mode 100644 index 96baa24e9..000000000 --- a/src/app/services/events/event-detail/event-detail.module.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; - -import { IonicModule } from '@ionic/angular'; - -import { EventDetailPageRoutingModule } from './event-detail-routing.module'; - -import { EventDetailPage } from './event-detail.page'; - - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - ReactiveFormsModule, - EventDetailPageRoutingModule - ], - declarations: [EventDetailPage] -}) -export class EventDetailPageModule {} diff --git a/src/app/services/events/event-detail/event-detail.page.html b/src/app/services/events/event-detail/event-detail.page.html deleted file mode 100644 index 9957a8d82..000000000 --- a/src/app/services/events/event-detail/event-detail.page.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - Visualizar Evento - - - - - - - -
- - -
- - Assunto - - - - - Campo obrigatório - -
- - Descrição - - - - Localização - - - - Calendário - - Pessoal - Oficial - - - - Tipo do evento - - Reunião - Viagem - Conferência - Encontro - - - - Data Início - - - - Data Fim - - - -
- - - Editar - - Intervenientes - -
-
-
- - - - {{attendee.Name}} - - -
- -
-
- -
-
-
-
- - - Editar - - Anexos - -
-
-
- - - - - -

{{ att.Description }}

-

{{ att.CreateDate }}

-
-
-
-
-
-
- -
-
- - - - - - - Sem anexos - - - -
-
-
-
- -
-
- - - - - -
- - - - - - - - - - - - -

- -

-

- -

-

- -

-
-
- - - - - -

- -

-

- -

-

- -

-
-
- - - -

- -

-

- -

-

- -

-
-
-
-
- -
- - -
- -
-
-
- diff --git a/src/app/services/events/event-detail/event-detail.page.scss b/src/app/services/events/event-detail/event-detail.page.scss deleted file mode 100644 index 65ee76935..000000000 --- a/src/app/services/events/event-detail/event-detail.page.scss +++ /dev/null @@ -1,117 +0,0 @@ -ion-item-group{ - margin: 15px; -} -.div-item{ - width: 100%; - overflow: auto; - border-bottom: 1px solid #ccc; - margin: 10px 0 5px 0; -} -.div-up{ - width: 100%; - overflow: auto; -} -.div-up h3{ - margin: 0; - padding: 0; - font-size: rem(17); - width: 100%; -} -.div-icon{ - width: 10%; - font-size: rem(22); - float: left; - color: #808080; -} -.div-icon ion-icon{ - display: block; - margin: 0 auto; - -} -.div-content-attachment{ - width: 85%; - float: left; - padding: 0 0 0 12px; -} -.ion-icon-attach{ - color: #666666; - font-size: rem(20); -} - -.btn-attach{ - margin: 15px 0 0 0; - --color: #333; - --border-color:#333; -} -.div-card-button{ - width: 100%; - overflow: auto; - padding: 0 !important; -} -ion-card{ - margin: 2.5% !important; - width: 45%; - float: left; -} -.center{ - text-align: center; - float: center; -} - -/* FFOTER */ -.event-detail-buttons{ - width: 90%; - margin: 10px auto; -} -.event-detail-buttons ion-button{ - width: 90%; - margin: 0 auto; - display: block; - margin-bottom: 25px; -} -.ion-icon-delete{ - font-size: rem(22); - color: red; - background-color: white; - padding-right: 5px; -} -.error{ - color:red; - font-size: rem(12); - font-weight: bold; - padding-bottom: 20px; -} -/* .event-detail-buttons{ - margin-bottom: 80px; - margin-top: 10px; -} */ -.attendees-icon{ - font-size: 14px; -} -.see-more-button{ - text-transform: initial; - font-size: rem(16); -} - -.header-content{ - overflow: auto; - margin: 0 auto; - padding-top: 25px; -} -.header-icon-left{ - width: 36px; - font-size: rem(33); - color: #42b9fe; - float: left; - border: 1px solid red; -} -.header-title{ - width: 300px; - font-family: Roboto; - font-size: rem(25); - margin: 0 5px 0 5px; - padding: 0; - color:#000; - float: left; -} - diff --git a/src/app/services/events/event-detail/event-detail.page.spec.ts b/src/app/services/events/event-detail/event-detail.page.spec.ts deleted file mode 100644 index a3f346841..000000000 --- a/src/app/services/events/event-detail/event-detail.page.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; - -import { EventDetailPage } from './event-detail.page'; - -describe('EventDetailPage', () => { - let component: EventDetailPage; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ EventDetailPage ], - imports: [IonicModule.forRoot()] - }).compileComponents(); - - fixture = TestBed.createComponent(EventDetailPage); - component = fixture.componentInstance; - fixture.detectChanges(); - })); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/services/events/event-detail/event-detail.page.ts b/src/app/services/events/event-detail/event-detail.page.ts deleted file mode 100644 index d5afa0596..000000000 --- a/src/app/services/events/event-detail/event-detail.page.ts +++ /dev/null @@ -1,246 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { EventsService } from 'src/app/services/events.service'; -import { Router } from '@angular/router'; -import { Event } from '../../../models/event.model'; -import { EventBody } from 'src/app/models/eventbody.model'; -import { AlertController, ModalController } from '@ionic/angular'; -import { EventPerson } from 'src/app/models/eventperson.model'; -import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page'; -import { Attachment } from 'src/app/models/attachment.model'; -import { AttachmentsService } from 'src/app/services/attachments.service'; -import { FormGroup, FormBuilder, Validators } from "@angular/forms"; -import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; -import { AttachmentsPage } from '../attachments/attachments.page'; - - -@Component({ - selector: 'app-event-detail', - templateUrl: './event-detail.page.html', - styleUrls: ['./event-detail.page.scss'], -}) -export class EventDetailPage implements OnInit { - - loadedEvent: Event; - loadedEventAttachments: Attachment[]; - pageId: string; - showLoader: boolean; - backURL: string; - ionicForm: FormGroup; - isSubmitted = false; - - minDate: Date; - - profile:string; - - - constructor( - public formBuilder: FormBuilder, - public alertController: AlertController, - private router: Router, - private activatedRoute: ActivatedRoute, - private eventsService: EventsService, - private modalCtrl: ModalController, - private attachamentsService: AttachmentsService, - private route: Router, - private iab: InAppBrowser) { - this.loadedEvent = new Event(); - this.loadedEvent.Body = new EventBody(); - } - - ngOnInit() { - this.loadEvent(); - this.loadAttachments(); - this.ionicForm = this.formBuilder.group({ - subject: ['', [Validators.required]] - }) - } - - get errorControl() { - return this.ionicForm.controls; - } - - loadEvent(){ - let eventid: string; - this.activatedRoute.paramMap.subscribe(paramMap => - { - if (!paramMap.has("eventId")){ - return; - } - else{ - this.pageId = paramMap.get('eventId'); - eventid = paramMap.get('eventId'); - - - } - if (paramMap.has("caller")){ - this.backURL = "/home/" + paramMap.get('caller'); - } - } - ); - this.eventsService.getEvent(eventid).subscribe(response => { - this.loadedEvent = response; - }); - } - - async openAttendees(){ - const modal = await this.modalCtrl.create({ - component: AttendeesPageModal, - componentProps: { - eventAttendees: this.loadedEvent.Attendees - }, - cssClass: 'attendee modal-desktop', - backdropDismiss: false - }); - - - - modal.onDidDismiss().then((data) => { - if (data['data'] != null) - { - let newattendees: EventPerson[] = data['data']; - this.loadedEvent.Attendees = newattendees; - } - }); - - await modal.present(); -} - - getEventAttendees(): EventPerson[] - { - return this.loadedEvent.Attendees; - } - - setEventAttendees(newattendes: EventPerson[]) - { - this.loadedEvent.Attendees = newattendes; - } - - async deleteConfirm() - { - const alert = await this.alertController.create({ - cssClass: 'my-custom-class', - header: 'Apagar evento!', - message: 'Deseja apagar o evento da agenda ' + this.loadedEvent.CalendarName + '?', - buttons: [ - { - text: 'Não', - role: 'cancel', - cssClass: 'secondary', - handler: () => { } - }, { - text: 'Sim', - handler: () => { - this.Delete(); - } - } - ] - }); - - await alert.present(); - } - - Delete() - { - this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => - { - /* const alert = await this.alertController.create({ - cssClass: 'my-custom-class', - header: 'Evento removido', - buttons: ['OK'] - }); - - await alert.present(); */ - - this.router.navigate(['/home/events']); - }); - } - - Save() - { - if (this.ionicForm.valid){ - - this.activatedRoute.paramMap.subscribe(paramMap =>{ - if (paramMap.has("profile")){ - - - } - }); - - this.eventsService.editEvent(this.loadedEvent, 2, 3).subscribe(async () => - { - const alert = await this.alertController.create({ - cssClass: 'my-custom-class', - header: 'Evento actualizado', - buttons: ['OK'] - }); - - setTimeout(()=>{ - alert.dismiss(); - }, 1500); - }); - } - } - - loadAttachments() - { - - this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => { - this.loadedEventAttachments = res; - - - },((erro) => { - console.error('loadAttchament', erro) - })); - } - async viewDocument(documenturl:string) - { - const url: string = documenturl.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1"); - const browser = this.iab.create(url,"_blank"); - browser.show(); - } - - back() - { - //this.back(); - } - doRefresh(event){ - /* this.RefreshEvents(); */ - try { - event?.target?.complete(); -} catch(error) {} - setTimeout(() => { - try { - event?.target?.complete(); -} catch(error) {} - }, 2000); - - } - navigateTo(ev){ - this.route.navigate(['/home/events',ev]); - } - async openAttachments(){ - const modal = await this.modalCtrl.create({ - component: AttachmentsPage, - componentProps: { - eventId: this.pageId, - attachments: this.loadedEventAttachments - }, - cssClass: 'attachments', - backdropDismiss: false - }); - - - modal.onDidDismiss().then((data) => { - if (data['data'] != null) - { - let newattendees: EventPerson[] = data['data']; - this.loadedEvent.Attendees = newattendees; - } - }); - - await modal.present(); - - } - -} diff --git a/src/app/services/events/events-routing.module.ts b/src/app/services/events/events-routing.module.ts deleted file mode 100644 index 5b2cbdb3c..000000000 --- a/src/app/services/events/events-routing.module.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; - -import { EventsPage } from './events.page'; - -const routes: Routes = [ - { - path: '', - component: EventsPage - }, - { - path: 'event-detail', - loadChildren: () => import('./event-detail/event-detail.module').then( m => m.EventDetailPageModule) - }, - { - path: 'attachments', - loadChildren: () => import('./attachments/attachments.module').then( m => m.AttachmentsPageModule) - }, - { - path: 'attendees', - loadChildren: () => import('./attendees/attendees.module').then( m => m.AttendeesPageModule) - }, - { - path: 'event-detail-modal', - loadChildren: () => import('./event-detail-modal/event-detail-modal.module').then( m => m.EventDetailModalPageModule) - }, - { - path: 'edit-event', - loadChildren: () => import('./edit-event/edit-event.module').then( m => m.EditEventPageModule) - } - - -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule], -}) -export class EventsPageRoutingModule {} diff --git a/src/app/services/events/events.module.ts b/src/app/services/events/events.module.ts deleted file mode 100644 index 79a44a790..000000000 --- a/src/app/services/events/events.module.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; -import { IonicModule } from '@ionic/angular'; -import { EventsPageRoutingModule } from './events-routing.module'; -import { EventsPage } from './events.page'; -@NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - EventsPageRoutingModule, - // - ], - declarations: [EventsPage], - schemas: [CUSTOM_ELEMENTS_SCHEMA] -}) -export class EventsPageModule {} diff --git a/src/app/services/events/events.page.html b/src/app/services/events/events.page.html deleted file mode 100644 index 53fb13c1a..000000000 --- a/src/app/services/events/events.page.html +++ /dev/null @@ -1,120 +0,0 @@ - - -

{{customDate}}

-
- -

{{totalEvent}} evento agendado para hoje

-

{{totalEvent}} eventos agendados para hoje

-
-
-
{{currentHoursMinutes | date: 'HH:mm'}}
-
"{{currentEvent}}"
-
- -
- - - - - - - - - - - -
-
-
-
- -
A sua Agenda
-
- -
-
- - - - - -
- -
-
{{event.StartDate | date: 'HH:mm'}}
-
{{event.EndDate | date: 'HH:mm'}}
- -
Todo
-
o dia
-
-
-
-
{{event.Location}}
-
-

{{event.Subject}}

-
-
-
-
- -
- -
-
- -
-
-
- -
Correspondência por ler
-
- -
-
- - -
-
-
{{task.TaskStartDate | date: 'dd-MM-yyyy'}}
-
{{task.TaskStartDate | date: 'HH:mm'}}
-
-
-
{{ task.Subject }}
-
{{ task.Senders }}
-
-
-
- -
-
-
-
- -
diff --git a/src/app/services/events/events.page.scss b/src/app/services/events/events.page.scss deleted file mode 100644 index f1cd8a967..000000000 --- a/src/app/services/events/events.page.scss +++ /dev/null @@ -1,526 +0,0 @@ -@import '~src/function.scss'; - -/* HEADER */ -.bg-blue{ - --background:#0782c9; - background:#0782c9; - --background-color:#0782c9; - background-color:#0782c9; - color: #ffffff; - --color: #ffffff; -} -ion-toolbar{ - --background: white; -} -.ion-text-header-top{ - width: 100%; - --background: transparent; - text-align: center; - padding-top: 15px; - color: #ffffff; - - /* border: 1px solid red; */ - } - .div-top-header{ - width: 400px; - margin: 0 auto; - background-color: #0782c9; - overflow: auto; - padding-top: 15px; - border: 0!important; - - .div-search{ - font-size: rem(45); - float: left; - margin: 0 0 0 10px - } - .div-logo{ - background: transparent; - width: 140px; - margin: 5px 0 0px 71px; - float: left; - } - .div-logo img{ - width: 100%; - } - .div-profile{ - font-size: rem(45); - float: right; - margin-right: 10px; - } - } - .ion-text-header-top p{ - --background: transparent; - color: #ffffff; - } - .ion-text-right{ - --background: transparent; - color: #ffffff; - } - .header-large{ - font-family: Arial, Helvetica, sans-serif; - font-size: rem(17); - /* font-weight: 600; */ - background: transparent; - color: #ffffff; - } - .header-xsmall{ - font-family: Arial, Helvetica, sans-serif; - font-size: rem(13); - font-weight: bold; - padding-bottom: 3.5px; - margin-bottom: 3.5px; - border-bottom: 1px solid #ccc; - background: transparent; - } - .header-medium{ - font-size: rem(16); - text-align: left; - font-family: roboto; - background: transparent; - margin-right: 5px; - line-height: rem(25); - } - - .p-small{ - font-size: rem(17); - margin-top: 13px; - color:#000; - margin-right: 25px !important; - text-align: right; - /* color: #ffffff; */ - } - - /* CONTENT */ - .item-list-small{ - font-size: rem(14); - overflow: auto; - } - .ion-item-class{ - padding: 0; - - } - .label-text{ - width: 100%; - padding: 0; - margin: 0; - } - - //DIV - .div-item-Oficial{ - width: 100%; - overflow: auto; - /* border-bottom: 1px solid #ccc; */ - margin: 10px 0 5px 0; - background: #cab0dc; - border-radius: 20px; - padding: 10px; - /* box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); */ - } - .div-item-Pessoal{ - width: 100%; - overflow: auto; - /* border-bottom: 1px solid #ccc; */ - margin: 10px 0 5px 0; - background: #cbeecb; - border-radius: 20px; - padding: 10px; - /* box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); */ - } - .div-up{ - width: 100%; - overflow: auto; - } - .div-up h3{ - margin: 0; - padding: 0; - font-size: rem(17); - width: 100%; - } - .div-icon{ - width: 10%; - font-size: rem(22); - float: left; - color: #808080; - } - .div-icon ion-icon{ - display: block; - margin: 0 auto; - - } - .div-content-Oficial{ - width: 85%; - float: left; - border-left: 4px solid #cab0dc; - padding: 0 0 0 12px; - } - .div-content-Pessoal{ - width: 85%; - float: left; - border-left: 4px solid #cbeecb; - padding: 0 0 0 12px; - } - .div-content-Oficial h3, .div-content-Pessoal h3{ - font-size: rem(19); - /* border: 1px solid red; */ - } - .div-content-Oficial p, .div-content-Pessoal p{ - font-size: rem(16); - color: rgb(94, 92, 92); - padding: 0 !important; - margin: 0 !important; - } - .div-botton{ - width: 100%; - overflow: auto; - margin: 10px 0 5px 0; - } - .div-botton-left{ - width: 10%; - float: left; - } - .ion-icon-location{ - text-align: center; - display: block; - color: #000; - font-size: rem(16); - margin: 0 auto; - } - .div-botton-middle{ - width: 75%; - float: left; - margin-top: 0.5px; - } - .div-botton-middle p{ - padding: 0; - margin: 0; - } - .div-botton-right{ - width: 10%; - float: left; - margin: 0; - padding: 0; - } - .ion-icon-attach{ - color: #666666; - font-size: rem(20); - } - /* NEW CSS FOR TOGGLE BUTTON */ - .toggleBox{ - margin:20px 20px 0 0; - } - input[type="checkbox"]{ - position: relative; - width: 96px; - height: 34px; - background: #ffffff; - -webkit-appearance: none; - border-radius: 20px; - outline: none; - transition: .4s; - /* box-shadow: inset 0 0 5px rgba(0,0,0,0.2); */ - cursor: pointer; - border:1px solid #e16817; - } - input:checked[type="checkbox"]{ - background: #e16817; - } - input[type="checkbox"]::before{ - z-index: 2; - position: absolute; - content: ""; - left: 0; - width: rem(30); - height: 30px; - background: #fff; - border-radius: 50%; - /* transform: scale(1.1); */ - box-shadow: inset 0 2px 5px rgba(0,0,0,0.2); - border:1px solid #e16817; - } - input:checked[type="checkbox"]::before{ - left: 65px; - - } - .toggle{ - position: relative; - display: inline; - font-family: 'Montserrat', sans-serif; - display: grid; - text-align: center; - } - label{ - position: absolute; - color: #fff; - font-weight: 600; - font-size: rem(12); - pointer-events: none; - } - .onbtn{ - top:10px; - bottom: 15px; - left: 15px; - /* padding-top: 10px; - border: 1px solid red; */ - } - .ofbtn{ - top:10px; - bottom: 15px; - right: 14px; - color: #e16817; - } - - - -// new -.main{ - padding: 0px em(20px); -} - -.event-number{ - color: white; - font-family: Roboto; - font-size: rem(15); - color: var(--white); - - bold{ - font-family: Roboto; - font-size: rem(25); - text-align: right; - color: var(--white); - } -} -.time{ - font-family: Roboto; - font-size: rem(30); - text-align: center; - color: var(--white); - line-height: unset; - margin-top: 10px; -} - -.next-meeting{ - display: flex; - justify-content: center; - margin: 0px 20px; - margin-top: 15px; - - .meeting-time { - font-size: em(25); - font-family: Roboto; - font-weight: 300; - color: var(--white); - margin-right: 7px; - } - - .meeting-description { - margin-top: 2px; - font-family: Roboto; - font-size: rem(15); - color: var(--white); - } -} - -.conteiner-box { - display: flex; - flex-wrap: wrap; - justify-content: center; - padding-bottom: 20px; -} -.schedule { - max-width: 400px; - font-family: Roboto; - background-color: white; - box-shadow: 0 0 10px 0 rgb(0 0 0 / 7%); - border: solid 1px #e9e9e9; - margin-bottom: 20px; - border-radius: 25px; - display: flex; - flex-direction: column; - max-height: 100%; - overflow: auto; - padding-bottom: 25px; - - .schedule-header{ - display: flex; - margin-bottom: 20px; - justify-content: space-between; - padding: 20px 20px 0px 20px; - - .title { - display: flex; - align-items: center; - - .icon{ - color: #e8e8e8; - height: rem(35); - width: rem(35); - margin-right: 10px; - } - .text{ - font-family: Roboto; - font-size: rem(20); - color: black; - } - } - .icon-next { - color: #e8e8e8; - height: rem(35); - width: rem(35); - font-size: rem(35); - font-size: rem(35); - } - } - .content{ - //padding: 0px 20px 20px 20px; - overflow: auto; - - .item-exp{ - overflow: auto; - //padding-top: 5px; - //padding-bottom: 5px; - padding: 5px 20px 5px 20px; - background-color: transparent !important; - } - ion-list{ - padding: 0px; - margin: 0px; - .d-flex{ - width: 100%; - display: flex; - justify-content: space-between; - align-items: center; - } - ion-item{ - padding-bottom: 5px; - margin-top: 5px; - border-bottom: 1px solid #ebebeb; - display: flex; - justify-content: space-between; - align-items: center; - --background: transparent !important; - - .schedule-time{ - margin-right: 10px; - .time-start{ - color: #797979 !important; - font-family: Roboto; - font-size: rem(13); - } - .time-end{ - color: #797979 !important; - font-family: Roboto; - font-size: rem(13); - } - } - .schedule-date{ - margin-right: 10px; - width: 22%; - color: #797979 !important; - font-size: rem(13); - } - .schedule-details{ - display: flex; - flex-wrap: wrap; - align-items: center; - width: 78%; - .location{ - font-family: Roboto; - font-size: rem(13); - color: black; - width: 100%; - - } - .description{ - width: 100%; - font-family: Roboto; - font-size: rem(15); - font-weight: bold; - color: #0d89d1; - } - .description p{ - white-space: nowrap; - overflow: hidden !important; - text-overflow: ellipsis !important; - } - } - .color{ - width: 5px; - height: rem(40); - border-top-right-radius: 5px; - border-bottom-right-radius: 5px; - background-color: #f05d5e; - } - } - ion-item:last-child{ - border-bottom: unset !important; - padding-bottom: unset !important; - } - } - - } - - .resume{ - .title{ - font-family: Roboto; - font-size: rem(15); - font-weight: 500; - color: #797979; - margin-bottom: 5px; - margin-top: 10px; - } - .event-num, .first-event-time{ - font-family: Roboto; - font-size: rem(15); - display: block; - color: black; - } - } - -} - -.d-flex { - display: flex; -} - -.pointer{ - cursor: pointer; -} - - - - -@media only screen and (max-width: 856px) { - - .content, .conteiner-box{ - height: unset !important; - max-height: unset !important; - } - -} - - -@media only screen and (min-width: 804px) { - - .schedule:first-child { - margin-right: 2%; - - } -} - -@media only screen and (min-width: 478px) { - .schedule{ - width: 400px; - } -} - - -@media only screen and (max-width: 478px) { - .schedule{ - width: 360px; - } -} -ion-title{ - border: 1px solid red; - text-overflow: ellipsis; -} diff --git a/src/app/services/events/events.page.spec.ts b/src/app/services/events/events.page.spec.ts deleted file mode 100644 index d9ee95a07..000000000 --- a/src/app/services/events/events.page.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; - -import { EventsPage } from './events.page'; - -describe('EventsPage', () => { - let component: EventsPage; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ EventsPage ], - imports: [IonicModule.forRoot()] - }).compileComponents(); - - fixture = TestBed.createComponent(EventsPage); - component = fixture.componentInstance; - fixture.detectChanges(); - })); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/services/events/events.page.ts b/src/app/services/events/events.page.ts deleted file mode 100644 index 29c7d2455..000000000 --- a/src/app/services/events/events.page.ts +++ /dev/null @@ -1,388 +0,0 @@ -import { Component, OnInit, EventEmitter, Output } from '@angular/core'; - -import { Event } from '../../models/event.model'; -import { EventsService } from 'src/app/services/events.service'; -import { NavigationExtras, Router } from '@angular/router'; -import { ActivatedRoute, NavigationEnd } from '@angular/router'; -import { ModalController, Platform } from '@ionic/angular'; -import { EventDetailPage } from './event-detail/event-detail.page'; -import { ProcessesService } from '../../services/processes.service'; -import { DailyWorkTask } from '../../models/dailyworktask.model'; -import { LoginUserRespose } from 'src/app/models/user.model'; -import { ToDayEventStorage } from 'src/app/store/to-day-event-storage.service'; -import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx'; -import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe'; -import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service'; -import { SessionStore } from 'src/app/store/session.service'; -import { ThemeService } from 'src/app/services/theme.service'; - -@Component({ - selector: 'app-events', - templateUrl: './events.page.html', - styleUrls: ['./events.page.scss'], -}) -export class EventsPage implements OnInit { - /* Get current system date */ - today = new Date(); - - months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"]; - days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"]; - - customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); - - /* Setting appropriate greeting according to the time */ - grettings = ["Bom dia", "Boa tarde", "Boa noite"]; - greetting=''; - - timeDate = this.today.getHours() + ":" + this.today.getMinutes(); - /* Set segment variable */ - segment:string; - public profile:string; - currentEvent: any; - - eventsList: Event[]; - maxSubjectLength = 30; - officialeventsList: Event[]; - personaleventsList: Event[]; - - prEventList: Event[]; - mdEventList: Event[]; - - combinedEvents: Event[]; - - customText = false; - totalEvent=0; - currentHoursMinutes: Date | string; - - showLoader: boolean; - - taskslist:DailyWorkTask[] = []; - expedientList:any; - hideSearchBtn: boolean=false; - - // shared data - toDayEventStorage = ToDayEventStorage - expedienteGdStore = ExpedienteGdStore - - expedienteTaskPipe = new ExpedienteTaskPipe() - - @Output() openExpedientListPage:EventEmitter = new EventEmitter(); - - loggeduser: LoginUserRespose; - - existingScreenOrientation: string; - - constructor( - private eventService: EventsService, - private router: Router, - public activatedRoute: ActivatedRoute, - private processes:ProcessesService, - /* private gabineteService: GabineteDigitalPage, */ - private modalController:ModalController, - private screenOrientation: ScreenOrientation, - public platform: Platform, - public ThemeService: ThemeService, - ) { - this.existingScreenOrientation = this.screenOrientation.type; - - - this.loggeduser = SessionStore.user; - - this.prEventList = null; - - this.platform.resize.subscribe(async () => { - // - // - - }); - - } - - ngOnInit() { - - this.segment = "Combinada"; - this.profile = "mdgpr"; - - this.showGreeting(); - - this.router.events.forEach((event) => { - if(event instanceof NavigationEnd && event.url == '/home/events') { - this.RefreshEvents(); - this.LoadList(); - } - }); - this.hideSearch(); - - //this.checkScreenOrientation(); - } - - hideSearch(){ - if(this.router.url == '/home/events'){ - this.hideSearchBtn = true; - } - } - - doRefresh(event) { - this.RefreshEvents(); - this.LoadList(); - try { - event?.target?.complete(); -} catch(error) {} - } - - onSegmentChange() { - this.RefreshEvents(); - } - - // Lock to portrait - lockToPortrait(){ - this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT); - - } - - // Lock to landscape - lockToLandscape(){ - this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE); - } - - // Unlock screen orientation - unlockScreenOrientation(){ - this.screenOrientation.unlock(); - } - - checkScreenOrientation(){ - if( window.innerWidth < 701) { - this.lockToPortrait(); - - - } - else{ - this.unlockScreenOrientation(); - } - } - - async RefreshEvents() { - this.currentEvent = ""; - this.showLoader = true; - - let date = new Date(); - date.setMonth(date.getMonth() + 1); - let start = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds(); - let end = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" 23:59:59"; - - - if(this.loggeduser.Profile == 'MDGPR') { - - let mdOficialEvents = await this.eventService.getAllMdOficialEvents(start, end).toPromise(); - let mdPessoalEvents = await this.eventService.getAllMdPessoalEvents(start, end).toPromise(); - - const list = mdOficialEvents.concat(mdPessoalEvents); - - this.toDayEventStorage.reset(list) - - if(this.toDayEventStorage.eventsList.length > 0){ - this.currentEvent = this.toDayEventStorage.eventsList[0].Subject; - this.currentHoursMinutes = this.toDayEventStorage.eventsList[0].StartDate; - } - - this.totalEvent = this.toDayEventStorage.eventsList.length; - this.showLoader = false; - - } - else if (this.loggeduser.Profile == 'PR') { - - let prOficialEvents= await this.eventService.getAllPrOficialEvents(start, end).toPromise(); - let prPessoalEvents= await this.eventService.getAllPrPessoalEvents(start, end).toPromise(); - - const list = prOficialEvents.concat(prPessoalEvents); - - this.toDayEventStorage.reset(list) - - if(this.toDayEventStorage.eventsList.length > 0) { - this.currentEvent = this.toDayEventStorage.eventsList[0].Subject; - this.currentHoursMinutes = this.toDayEventStorage.eventsList[0].StartDate; - } - - this.totalEvent = this.toDayEventStorage.eventsList.length; - this.showLoader = false; - - } - - - /* switch (this.segment) - { - case "Combinada": - if(this.loggeduser.Profile == 'MDGPR'){ - - let mdOficialEvents = await this.eventService.getAllMdOficialEvents(start, end).toPromise(); - let mdPessoalEvents = await this.eventService.getAllMdPessoalEvents(start, end).toPromise(); - - this.eventsList = mdOficialEvents.concat(mdPessoalEvents); - - if(this.eventsList.length > 0){ - this.currentEvent = this.eventsList[0].Subject; - this.currentHoursMinutes = this.eventsList[0].StartDate; - } - - this.totalEvent = this.eventsList.length; - this.showLoader = false; - - } - else{ - - let prOficialEvents= await this.eventService.getAllPrOficialEvents(start, end).toPromise(); - let prPessoalEvents= await this.eventService.getAllPrPessoalEvents(start, end).toPromise(); - this.eventsList = prOficialEvents.concat(prPessoalEvents); - - - - if(this.eventsList.length > 0){ - this.currentEvent = this.eventsList[0].Subject; - this.currentHoursMinutes = this.eventsList[0].StartDate; - } - - this.totalEvent = this.eventsList.length; - this.showLoader = false; - - } - - break; - case "Pessoal": - if(this.loggeduser.Profile == 'MDGPR'){ - this.eventService.getAllMdPessoalEvents(start, end).subscribe(res => { - this.personaleventsList = res.filter(data => data.CalendarName == "Pessoal"); - this.showLoader = false; - }); - } - else{ - this.eventService.getAllPrPessoalEvents(start, end).subscribe(res => { - this.personaleventsList = res.filter(data => data.CalendarName == "Pessoal"); - this.showLoader = false; - }); - } - - break; - case "Oficial": - if(this.loggeduser.Profile == 'MDGPR'){ - this.eventService.getAllMdOficialEvents(start, end).subscribe(res => { - this.officialeventsList = res.filter(data => data.CalendarName == "Oficial");; - this.showLoader = false; - }); - } - else{ - this.eventService.getAllPrOficialEvents(start, end).subscribe(res => { - this.officialeventsList = res.filter(data => data.CalendarName == "Oficial");; - this.showLoader = false; - }); - } - break; - } */ - } - - showGreeting(){ - if(this.today.getHours() >= 6 && this.today.getHours() < 12){ - this.greetting = this.grettings[0]; - } - else if(this.today.getHours() >= 12 && this.today.getHours() < 18){ - this.greetting = this.grettings[1]; - } - else /* if(this.today.getHours() < 6 && this.today.getHours() >= 18) */{ - this.greetting = this.grettings[2]; - } - } - - gotTo(){ - this.router.navigate(['/home/events']); - } - - changeProfile(){ - if(this.profile == "mdgpr"){ - - this.profile ="pr"; - this.RefreshEvents(); - } - else{ - - this.profile ="mdgpr"; - this.RefreshEvents(); - } - } - - logout() - { - - SessionStore.user.BasicAuthKey = "" - this.router.navigate(['/home/login']); - } - - async openEventDetail1(id:any){ - - - const modal = await this.modalController.create({ - component: EventDetailPage, - componentProps: { - eventId: id, - }, - cssClass: 'event-detail', - backdropDismiss: false - }); - - modal.onDidDismiss(); - await modal.present(); - - } - - LoadList() { - this.processes.GetTaskListExpediente(false).subscribe(result => { - - - const ExpedienteTask = result.map( e=> this.expedienteTaskPipe.transform(e)) - - this.expedienteGdStore.reset(ExpedienteTask) - }); - } - - sortArrayISODate(myArray: any){ - return myArray.sort(function(a, b) { - return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0); - }); - } - - goToEvent(eventId:any){ - this.router.navigate(['/home/events', eventId, 'events']); - } - - goToExpediente(SerialNumber:any) { - this.router.navigate(['/home/events/expediente', SerialNumber, 'events']); - /* if(this.loggeduser.Profile == 'MDGPR'){ - this.router.navigate(['/home/events/expediente', SerialNumber, 'events']); - } - else if(this.loggeduser.Profile == 'PR'){ - this.router.navigate(['/home/events/expedientes-pr', SerialNumber, 'events']); - } */ - } - - viewExpedientListPage(){ - if(this.loggeduser.Profile == 'MDGPR'){ - if( window.innerWidth < 801){ - this.router.navigate(['/home/gabinete-digital/expediente']); - } - else{ - let navigationExtras: NavigationExtras = { queryParams: {"expedientes": true,} }; - this.router.navigate(['/home/gabinete-digital'], navigationExtras); - } - } - else if(this.loggeduser.Profile == 'PR'){ - if( window.innerWidth < 801){ - this.router.navigate(['/home/gabinete-digital/expedientes-pr']); - } - else{ - let navigationExtras: NavigationExtras = { queryParams: {"expedientes-pr": true,} }; - this.router.navigate(['/home/gabinete-digital'], navigationExtras); - } - } - } - - -} - diff --git a/src/app/services/first-enter.service.ts b/src/app/services/first-enter.service.ts index 55acf2dca..718420092 100644 --- a/src/app/services/first-enter.service.ts +++ b/src/app/services/first-enter.service.ts @@ -18,7 +18,7 @@ export class FirstEnterService { enter( ) { if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){ //When user has got access to Agenda but does not have their own calendar, goes to Agenda - if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0){ + if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user?.OwnerCalendars?.length == 0){ this.router.navigate(['/home/agenda']); } else{ diff --git a/src/app/services/functions/file.service.ts b/src/app/services/functions/file.service.ts index 6c2c22a11..d7295d49e 100644 --- a/src/app/services/functions/file.service.ts +++ b/src/app/services/functions/file.service.ts @@ -263,5 +263,17 @@ export class FileService { return new File([u8arr], filename, {type:mime}); } + base64toBlobIos(base64Data, contentType) { + contentType = contentType || ''; + const byteCharacters = atob(base64Data); + const byteArray = new Uint8Array(byteCharacters.length); + + for (let i = 0; i < byteCharacters.length; i++) { + byteArray[i] = byteCharacters.charCodeAt(i); + } + + return new Blob([byteArray], { type: contentType }); + } + } diff --git a/src/app/services/functions/sort.service.ts b/src/app/services/functions/sort.service.ts index d8ee507ea..402887680 100644 --- a/src/app/services/functions/sort.service.ts +++ b/src/app/services/functions/sort.service.ts @@ -35,7 +35,7 @@ export class SortService { if(!Array.isArray(array)) { array = [] } - + return array.sort( (a,b)=> { return (new Date(this.ObjectService.deepFind(a, path)) < new Date(this.ObjectService.deepFind(b, path))) ? -1 : ((new Date(this.ObjectService.deepFind(a, path)) > new Date(this.ObjectService.deepFind(b, path))) ? 1 : 0); diff --git a/src/app/services/hardware-go-back.service.spec.ts b/src/app/services/hardware-go-back.service.spec.ts new file mode 100644 index 000000000..e4b1f2ea9 --- /dev/null +++ b/src/app/services/hardware-go-back.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { HardwareGoBackService } from './hardware-go-back.service'; + +describe('HardwareGoBackService', () => { + let service: HardwareGoBackService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(HardwareGoBackService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/shared/publication/upload/publication-form-mv.service.ts b/src/app/services/hardware-go-back.service.ts similarity index 72% rename from src/app/shared/publication/upload/publication-form-mv.service.ts rename to src/app/services/hardware-go-back.service.ts index 7fbeee014..a0a533693 100644 --- a/src/app/shared/publication/upload/publication-form-mv.service.ts +++ b/src/app/services/hardware-go-back.service.ts @@ -3,7 +3,7 @@ import { Injectable } from '@angular/core'; @Injectable({ providedIn: 'root' }) -export class PublicationFormMVService { +export class HardwareGoBackService { constructor() { } } diff --git a/src/app/services/http-error-handle.service.ts b/src/app/services/http-error-handle.service.ts index b3bab58fd..3d6b0e318 100644 --- a/src/app/services/http-error-handle.service.ts +++ b/src/app/services/http-error-handle.service.ts @@ -50,6 +50,17 @@ export class HttpErrorHandle { } } + async httpStatusHandleUploadFile(error) { + switch (error.status + ) { + case 403: + this.toastService._badRequest('O ficheiro que tentou enviar contém possível script malicioso') + break; + default: + break; + } + } + async loginHttpStatusHandle(error) { switch (error.status ) { @@ -223,7 +234,9 @@ export class HttpErrorHandle { case 'new event to aprove': this.toastService._successMessage('Enviado para os eventos para aprovação!'); break; - + case 'sessonExpired': + this.toastService._successMessage('Sessão expirada, por favor efectuar login novamente!'); + break; default: this.toastService._successMessage('Processo efetuado!') break; diff --git a/src/app/services/http.service.ts b/src/app/services/http.service.ts index 70da0d27c..d27f93c88 100644 --- a/src/app/services/http.service.ts +++ b/src/app/services/http.service.ts @@ -1,6 +1,13 @@ -import { HttpClient, HttpHeaderResponse, HttpHeaders } from '@angular/common/http'; +import { HttpClient, HttpErrorResponse, HttpHeaders, HttpResponse } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { environment } from 'src/environments/environment'; +import { ok, err, Result } from 'neverthrow'; +import { HttpParams } from '@angular/common/http'; +import { TracingType } from './monitoring/opentelemetry/tracer'; + + +export type HTTPOptions = { + headers?: HttpHeaders +} @Injectable({ providedIn: 'root' @@ -9,18 +16,116 @@ export class HttpService { constructor(private http:HttpClient) { } - post(serviceName:string, data:any){ - const headers = new HttpHeaders();; - const options = {header: headers, withCredentials: false}; - const url = environment.apiChatUrl+serviceName; - const body = {"user": "admin","password": "tabteste@006"}; + async post(url: string, body: any, options:HTTPOptions ={}, tracing?: TracingType): Promise> { - return this.http.post(url, /* JSON.stringify( */data/* ), options */) + try { + const result = await this.http.post(url, body, options).toPromise() + return ok (result as T) + } catch (e) { + tracing?.setAttribute('url', url) + if(isHttpError(e)) { + tracing?.setAttribute('status.code', e.status.toString()) + if (e.status == 400) { + tracing?.log("bad request "+url, { + requestPath: url, + requestBody: body, + requestStatusCode: e.status.toString() + }) + + } + } + tracing?.setAttribute('outcome', 'failed') + return err(e as HttpErrorResponse) + } } - get(serviceName:string, options:any){ - const url = environment.apiChatUrl+serviceName; - return this.http.get(url, options); + async get(url: string, httpParamsObj = {}, tracing?: TracingType): Promise> { + try { + + let httpParams = new HttpParams(); + + // Convert params object to HttpParams + if (httpParamsObj) { + Object.keys(httpParamsObj).forEach(key => { + httpParams = httpParams.set(key, httpParamsObj[key]); + }) + } + + let opts = { + params : httpParams + } + const result = await this.http.get(url, opts).toPromise() + + return ok (result as T) + } catch (e) { + tracing?.setAttribute('url', url) + if(isHttpError(e)) { + tracing?.setAttribute('status.code', e.status.toString()) + if (e.status == 400) { + tracing?.log("bad request "+url, { + requestPath: url, + queryParameter: httpParamsObj, + requestStatusCode: e.status.toString() + }) + } + } else { + //tracing?.setAttribute('map.error', 'true') + //tracing?.setAttribute('map.error.context', JSON.stringify(e)) + //tracing?.setAttribute('outcome', 'failed') + } + tracing?.setAttribute('outcome', 'failed') + return err(e as HttpErrorResponse) + } + } + + async put(url: string, body: any): Promise> { + + try { + const result = await this.http.put(url, body).toPromise() + return ok (result as T) + } catch (e) { + return err(e as HttpErrorResponse) + } + + } + + async delete(url: string, httpParamsObj = {}): Promise> { + + let httpParams = new HttpParams(); + + // Convert params object to HttpParams + if (httpParamsObj) { + Object.keys(httpParamsObj).forEach(key => { + httpParams = httpParams.set(key, httpParamsObj[key]); + }) + } + + let opts = { + params : httpParams + } + + try { + const result = await this.http.delete(url, opts).toPromise() + return ok (result as T) + } catch (e) { + return err(e as HttpErrorResponse) + } + } + + + async patch(url: string, body ={}): Promise> { + try { + const result = await this.http.patch(url, body).toPromise(); + return ok(result as T); + } catch (e) { + return err(e as HttpErrorResponse); + } } } + + +export const isHttpError = (e: any): e is HttpResponse => { + return Number.isInteger((e as HttpResponse).status); +} + diff --git a/src/app/services/logger/colored/service.ts b/src/app/services/logger/colored/service.ts new file mode 100644 index 000000000..67c36c990 --- /dev/null +++ b/src/app/services/logger/colored/service.ts @@ -0,0 +1,64 @@ + + + +// function getCurrentTime() { +// const now = new Date(); +// const hours = String(now.getHours()).padStart(2, '0'); +// const minutes = String(now.getMinutes()).padStart(2, '0'); +// const seconds = String(now.getSeconds()).padStart(2, '0'); +// const milliseconds = String(now.getMilliseconds()).padStart(3, '0'); +// return `${hours}:${minutes}:${seconds}.${milliseconds}`; +// } + + +// export class Logger { +// private app!: string; + +// constructor() {} + +// static log(message: string): void { +// console.log( +// `[${getCurrentTime()}] %cINFO : `, // Console Message +// 'color: #00897B', // CSS Style +// message +// ); +// } + +// static debug({ message, context, obj = {} }: MessageType): void { +// console.info( +// `[${getCurrentTime()}] %cINFO : `, // Console Message +// 'color: #039BE5', // CSS Style +// Object.assign(obj, { context, createdAt: DateUtils.getISODateString(), message }) +// ); +// } + +// static info({ message, context, obj = {} }: MessageType): void { +// console.info( +// `[${getCurrentTime()}] %cINFO : `, // Console Message +// 'color: #039BE5', // CSS Style +// Object.assign(obj, { context, createdAt: DateUtils.getISODateString(), message }) +// ); +// } + +// static warn({ message, context, obj = {} }: MessageType): void { +// console.warn( +// `[${getCurrentTime()}] %cWARN : `, // Console Message +// 'color: #FB8C00', // CSS Style +// Object.assign(obj, { context, createdAt: DateUtils.getISODateString(), message }) +// ); +// } + +// static error(error: any = "", message?: string, context = ""): void { + +// console.error( +// `[${getCurrentTime()}] %cERROR : `, // Console Message +// 'color: #E53935', // CSS Style +// message+', '+ context, +// '\n', +// error, +// '\n', +// ); +// } + +// fatal(error?: ErrorType, message?: string, context?: string): void {} +// } diff --git a/src/app/services/logger/log4js/logging.service.ts b/src/app/services/logger/log4js/logging.service.ts new file mode 100644 index 000000000..22a6066cb --- /dev/null +++ b/src/app/services/logger/log4js/logging.service.ts @@ -0,0 +1,46 @@ +// import { Injectable } from '@angular/core'; +// import * as log4js from 'log4js'; + +// @Injectable({ +// providedIn: 'root' +// }) +// export class LoggingService { +// private logger; + +// constructor() { +// log4js.configure({ +// appenders: { +// graylog: { +// type: '@log4js-node/gelf', +// host: 'localhost', // Replace with your Graylog server hostname or IP +// port: 1514, // GELF TCP port configured in Graylog Docker Compose +// hostname: 'angular-app', // Optional: Name of your application or hostname +// facility: 'angular-app', // Optional: Facility for categorizing logs +// customFields: { // Optional: Additional fields you want to include +// app: 'AngularApp', +// env: 'development' +// } +// } +// }, +// categories: { +// default: { appenders: ['graylog'], level: 'debug' } +// } +// }); + +// this.logger = log4js.getLogger(); + +// this.log("teste-123s") +// } + +// log(message: string) { +// this.logger.info(message); +// } + +// error(message: string) { +// this.logger.error(message); +// } + +// debug(message: string) { +// this.logger.debug(message); +// } +// } diff --git a/src/app/services/monitoring/capture-log/capture-log.service.spec.ts b/src/app/services/monitoring/capture-log/capture-log.service.spec.ts new file mode 100644 index 000000000..ee36a2092 --- /dev/null +++ b/src/app/services/monitoring/capture-log/capture-log.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { CaptureLogService } from './capture-log.service'; + +describe('CaptureLogService', () => { + let service: CaptureLogService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(CaptureLogService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/monitoring/capture-log/capture-log.service.ts b/src/app/services/monitoring/capture-log/capture-log.service.ts new file mode 100644 index 000000000..afd4a1080 --- /dev/null +++ b/src/app/services/monitoring/capture-log/capture-log.service.ts @@ -0,0 +1,133 @@ +import { Injectable } from '@angular/core'; +import { Device } from '@capacitor/device'; +// import { SocketLog } from './worker.worker'; +import { FCM } from '@capacitor-community/fcm'; +import { ActionPerformed, PushNotificationSchema, PushNotifications, Token, } from '@capacitor/push-notifications'; +import { AlertController, Platform } from '@ionic/angular'; +import { AngularFireMessaging } from '@angular/fire/messaging'; + +@Injectable({ + providedIn: 'root' +}) +export class CaptureLogService { + + deviceName = '' + + constructor( + // public socket: SocketLog, + private platform: Platform, + private afMessaging: AngularFireMessaging, + ) { + + // this.interceptLogs() + + Device.getInfo().then(e => { + this.deviceName = e.name + }); + + // Create a new + const worker = new Worker(new URL('./worker.worker', import.meta.url)); + worker.onmessage = ({ data }) => { + console.log(`page got message: ${data}`); + }; + worker.postMessage('hello'); + + } + + setToken() { + + } + + interceptLogs() { + (() => { + const originalConsoleLog = console.log; + const originalConsoleError = console.error; + const originalConsoleWarn = console.warn; + const originalConsoleInfo = console.info; + + console.log = function(...args) { + //sendLogToServer(args.join(' ')); + this.socket.sendMessage({ + type:'sendLog', + payload: { + logType: 'log', + args + } + }) + originalConsoleLog.apply(console, args); + }; + + console.error = function(...args) { + // sendLogToServer('ERROR: ' + args.join(' ')); + + this.socket.sendMessage({ + type:'sendLog', + payload: { + logType: 'error', + args + } + }) + originalConsoleError.apply(console, args); + }; + + console.warn = function(...args) { + this.socket.sendMessage({ + type:'sendLog', + payload: { + logType: 'warn', + args + } + }) + originalConsoleWarn.apply(console, args); + }; + + console.info = function(...args) { + this.socket.sendMessage({ + type:'sendLog', + payload: { + logType: 'info', + args + } + }) + originalConsoleInfo.apply(console, args); + }; + })(); + } + + + async getDeviceToken() { + + return new Promise((resolve, reject) => { + + if (this.platform.is('mobile')) { + if (this.platform.is('ios')) { + FCM.getToken() + .then(r => { + resolve(r.token) + }) + .catch(err => console.log(err)); + } else { + + PushNotifications.addListener('registration', + (token: Token) => { + resolve(token.value) + } + ); + } + + } else { + this.afMessaging.requestToken.subscribe( + (token) => { + resolve(token) + }, + (error) => { + console.error('Permission denied:', error); + } + ); + } + }) + + + } + +} diff --git a/src/app/services/monitoring/capture-log/worker.worker.ts b/src/app/services/monitoring/capture-log/worker.worker.ts new file mode 100644 index 000000000..4465de50d --- /dev/null +++ b/src/app/services/monitoring/capture-log/worker.worker.ts @@ -0,0 +1,142 @@ +/// +import { Observable, Subject, BehaviorSubject } from 'rxjs'; +import { webSocket, WebSocketSubject } from 'rxjs/webSocket'; +import { catchError, retryWhen, tap, delay } from 'rxjs/operators'; + +interface WebSocketMessage { + type: string; + payload: any; +} + +class SocketLog { + private socket$: WebSocketSubject; + private messageSubject$: Subject; + private connectionStatus$: BehaviorSubject; + private reconnectAttempts = 0; + private readonly maxReconnectAttempts = 5; + + constructor() { + this.messageSubject$ = new Subject(); + this.connectionStatus$ = new BehaviorSubject(false); + this.setupVisibilityChangeHandler(); + // this.connect('https://185-229-224-75.cloud-xip.com:85/ws/') + //console.log('connect1') + } + + public connect(url: string) { + this.socket$ = webSocket(url); + + this.socket$.pipe( + tap({ + error: () => { + this.connectionStatus$.next(false); + } + }), + retryWhen(errors => errors.pipe( + tap(() => { + this.reconnectAttempts++; + if (this.reconnectAttempts >= this.maxReconnectAttempts) { + throw new Error('Max reconnect attempts reached'); + } + }), + delay(1000) + )) + ).subscribe( + (message) => { + this.messageSubject$.next(message); + this.connectionStatus$.next(true); + this.reconnectAttempts = 0; + + // console.log({message}) + }, + (err) => { + // console.error('WebSocket connection error:', err); + }, + () => { + // console.log('WebSocket connection closed'); + this.connectionStatus$.next(false); + } + ); + } + + public sendMessage(message: WebSocketMessage): Observable { + return new Observable(observer => { + this.socket$.next(message); + observer.next(); + observer.complete(); + }).pipe( + catchError(err => { + console.error('Send message error:', err); + return new Observable(observer => { + observer.error({ type: 'SEND_ERROR', error: err }); + }); + }) + ); + } + + public get messages$(): Observable { + return this.messageSubject$.asObservable(); + } + + public get connectionStatus(): Observable { + return this.connectionStatus$.asObservable(); + } + + private setupVisibilityChangeHandler() { + if (typeof document !== 'undefined' && typeof document.addEventListener === 'function') { + document.addEventListener('visibilitychange', () => { + if (document.visibilityState === 'visible') { + this.reconnect(); + } + }); + } + } + + private reconnect() { + if (this.socket$) { + const url = (this.socket$ as any)._config.url; + this.establishNewConnection(url); + } + } + + private establishNewConnection(url: string) { + const newSocket$ = webSocket(url); + + newSocket$.pipe( + tap({ + error: () => { + console.error('New WebSocket connection error'); + } + }), + retryWhen(errors => errors.pipe( + tap(() => { + this.reconnectAttempts++; + if (this.reconnectAttempts >= this.maxReconnectAttempts) { + throw new Error('Max reconnect attempts reached'); + } + }), + delay(1000) + )) + ).subscribe( + (message) => { + this.messageSubject$.next(message); + this.connectionStatus$.next(true); + this.reconnectAttempts = 0; + + // Close the old socket and replace it with the new one + this.socket$.complete(); + this.socket$ = newSocket$; + }, + (err) => { + console.error('New WebSocket connection error:', err); + }, + () => { + console.log('New WebSocket connection closed'); + this.connectionStatus$.next(false); + } + ); + } +} + + +let _ = new SocketLog() diff --git a/src/app/services/monitoring/opentelemetry/logging.ts b/src/app/services/monitoring/opentelemetry/logging.ts new file mode 100644 index 000000000..ed242dc0f --- /dev/null +++ b/src/app/services/monitoring/opentelemetry/logging.ts @@ -0,0 +1,31 @@ +import { Injectable } from "@angular/core"; +import { v4 as uuidv4 } from 'uuid'; +import { WebSocketGraylogService } from "../socket/socket"; +import { Span } from "@opentelemetry/sdk-trace-web"; +import { environment } from "src/environments/environment"; + + +export class OpenTelemetryLogging { + + socket = new WebSocketGraylogService() + + constructor() { + + if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') { + this.socket.start() + } + + } + + send(data: Object & { type: string; payload: any, spanContext:any }): void { + this.socket.send({ + type: data.type, + payload: data.payload, + requestId: uuidv4(), + spanContext: data.spanContext + }); + } + +} + +export const openTelemetryLogging = new OpenTelemetryLogging() diff --git a/src/app/services/monitoring/opentelemetry/matrix.ts b/src/app/services/monitoring/opentelemetry/matrix.ts new file mode 100644 index 000000000..8be55bcc7 --- /dev/null +++ b/src/app/services/monitoring/opentelemetry/matrix.ts @@ -0,0 +1,48 @@ +import { metrics } from '@opentelemetry/api'; +import { OTLPMetricExporter } from '@opentelemetry/exporter-metrics-otlp-http'; +import { MeterProvider, PeriodicExportingMetricReader } from '@opentelemetry/sdk-metrics'; +import { Subject } from 'rxjs'; +import { throttleTime } from 'rxjs/operators'; +import { environment } from 'src/environments/environment'; + +// Initialize OpenTelemetry metrics +const meterProvider = new MeterProvider(); +metrics.setGlobalMeterProvider(meterProvider); + +if (window.location.protocol !== 'https:' && environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') { + const metricReader = new PeriodicExportingMetricReader({ + exporter: new OTLPMetricExporter({ + //url: 'https://5-180-182-151.cloud-xip.com:85/collector2/v1/metrics', + url: 'https://185-229-224-75.cloud-xip.com:85/collector2/v1/metrics', + //url: 'http://5-180-182-151.cloud-xip.com:4318/v1/metrics', + //url: 'http://185-229-224-75.cloud-xip.com:4318/v1/metrics' + // headers: { + // 'Authorization': 'Basic ' + btoa('tabteste@006:tabteste@006'), + // } + }), + exportIntervalMillis: 30000, + }); + + meterProvider.addMetricReader(metricReader); + + const subject = new Subject() + + subject + .pipe( + throttleTime(5000) // 5000 milliseconds = 5 seconds + ) + .subscribe(() => { + metricReader.forceFlush().then(() => { + console.log('Metrics exported'); + }); + }); + +} +export const meter = meterProvider.getMeter('example-exporter-collector'); +export const RequestCounter = meter.createCounter('post_requests', { + description: 'Example of a Counter', +}); + +export const UseCaseCounter = meter.createCounter('use_case', { + description: 'use case counter', +}); diff --git a/src/app/services/monitoring/opentelemetry/opentelemetry.ts b/src/app/services/monitoring/opentelemetry/opentelemetry.ts new file mode 100644 index 000000000..eab85fd4d --- /dev/null +++ b/src/app/services/monitoring/opentelemetry/opentelemetry.ts @@ -0,0 +1,97 @@ +import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base'; +import { WebTracerProvider } from '@opentelemetry/sdk-trace-web'; +import { ZipkinExporter } from '@opentelemetry/exporter-zipkin'; +import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions' +import { Resource } from '@opentelemetry/resources'; +//import { OTLPTraceExporter } from '@opentelemetry/exporter-otlp-http'; +import { context, trace, propagation } from '@opentelemetry/api'; +import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http'; +// const { OTLPTraceExporter: OTLPTraceExporterProto } = require("@opentelemetry/exporter-trace-otlp-proto"); + + +function createProvider(serviceName) { + const provider = new WebTracerProvider({ + resource: new Resource({ + [SemanticResourceAttributes.SERVICE_NAME]: serviceName, + }), + }); + + // provider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter())); + // provider.addSpanProcessor(new SimpleSpanProcessor(new ZipkinExporter({ + // //url: 'https://5-180-182-151.cloud-xip.com:85/zipkin-endpoint/api/v2/spans', + // url: 'https://185-229-224-75.cloud-xip.com:85/zipkin-endpoint/api/v2/spans', + // serviceName: serviceName, + // getExportRequestHeaders: () => { + // return { + // 'Authorization': 'Basic ' + btoa('tabteste@006:tabteste@006'), + // }; + // } + // }))); + + provider.addSpanProcessor(new SimpleSpanProcessor(new OTLPTraceExporter({ + url: 'https://185-229-224-75.cloud-xip.com:85/collector2/v1/traces', + }))); + + provider.register(); + return provider; +} + +// Example usage: +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'); +export const OpentelemetryOtherProvider = createProvider('FO-other-service'); + +export const OpentelemetryLogging = createProvider('logging'); + +const tracerInstance = OpentelemetryAgendaProvider.getTracer('example-tracer-hole', '111', {}) + + +function parentSpanExample() { + // Create a tracer instance + const tracer = trace.getTracer('FO-chat-service'); + + // Start a parent span + const parentSpan = tracer.startSpan('parent-span'); + parentSpan.setAttribute('key', 'value') + + const traceId = parentSpan.spanContext().traceId; + const spanId = parentSpan.spanContext().spanId; + parentSpan.end(); // End the parent span + + const spanContext = { + traceId: traceId, + spanId: spanId, + traceFlags: 1 // 1 means the trace is sampled + }; + + // Create a new context with the parent span + const parentContext = trace.setSpan(context.active(), parentSpan); + const parentContext1 = trace.setSpan(context.active(), trace.wrapSpanContext(spanContext)); + + // Start a new child span + const childSpan = tracer.startSpan('child-span1', {root: false}, parentContext1); + childSpan.end(); + + // Simulate some work + setTimeout(() => { + childSpanExample(parentContext); // Pass the context to child span + + }, 500); +} + + +function childSpanExample(parentContext) { + // Create a new child span with the parent context + const tracer = trace.getTracer('FO-chat-service'); + const childSpan = tracer.startSpan('child-span', undefined, parentContext); + + // Simulate some work + setTimeout(() => { + childSpan.end(); // End the child span + }, 500); +} + +// parentSpanExample() diff --git a/src/app/services/monitoring/opentelemetry/tracer.ts b/src/app/services/monitoring/opentelemetry/tracer.ts new file mode 100644 index 000000000..39612e4c4 --- /dev/null +++ b/src/app/services/monitoring/opentelemetry/tracer.ts @@ -0,0 +1,284 @@ +import { v4 as uuidv4 } from 'uuid'; +import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; +import { Tracer, Span } from '@opentelemetry/sdk-trace-base'; +import { OpentelemetryAgendaProvider, OpentelemetryInterceptorProvider, OpentelemetryLogging, OpentelemetryNotificationProvider } from './opentelemetry'; +import { Device, DeviceInfo } from '@capacitor/device'; +import { SessionStore } from 'src/app/store/session.service'; +import { environment } from 'src/environments/environment'; +import { UseCaseCounter } from './matrix'; +import { openTelemetryLogging } from './logging'; +// import { context, propagation } from '@opentelemetry/api'; +import { + SpanStatus, SpanStatusCode +} from '@opentelemetry/api'; +const tracerInstance = OpentelemetryAgendaProvider.getTracer('example-tracer-hole', '111', {}) +const tracerNotificationInstance = OpentelemetryNotificationProvider.getTracer('example-tracer-hole', '111', {}) +// const logger: ILoggerAdapter = new ColoredLoggerService() + +let device: DeviceInfo; + +Device.getInfo().then(e => { + device = e +}); + +function convertAttributesToString(obj) { + const result = {}; + + for (const key in obj) { + if (obj.hasOwnProperty(key)) { + if (typeof obj[key] === 'object' && obj[key] !== null) { + // Convert only the object attribute to string + result[key] = JSON.stringify(obj[key], null, 2); + } else { + // Convert primitive values to string + result[key] = obj[key]; + } + } + } + + return result; +} + + +const createTracingInstance = ({bugPrint, name, module, autoFinish}): TracingType => { + const requestId = uuidv4() + + let _tracerInstance:Tracer + + if(module == 'notification') { + _tracerInstance = tracerNotificationInstance + } else { + _tracerInstance = tracerInstance + } + + const span = _tracerInstance.startSpan(name); + let finish = false + + const data = { + event: {}, + tags: {}, + status: {} as any, + logs:[] + } + + const returnObject = { + span: span as any, + tracer: tracerInstance, + tracerId: requestId, + attributes: SemanticAttributes, + setStatus: (status: SpanStatus) => { + span.setStatus(status); + }, + addEvent: (context: string, message?: any, obj?: any) => { + + data.event[context] = message; + + const value = [JSON.stringify(message)] as any + span.addEvent(context, value); + }, + LocalLogEvent:(context: string, message: any, obj: any) => { + data.tags[context] = message; + }, + setAttribute: (key: string, value: string) => { + data.tags[key] = value; + span.setAttribute(key, value); + + if(key =='outcome' && value == 'failed') { + returnObject.hasError('error') + if(!autoFinish) { + returnObject.finish() + } + } else if (key =='outcome' && value == 'success') { + span.setStatus({code: SpanStatusCode.OK, message:name}) + if(!autoFinish) { + returnObject.finish() + } + } + }, + log(message: string, dataObject: Object) { + const spanId = span.spanContext().spanId; + const _tracer = OpentelemetryLogging.getTracer('logging') + const spanContext = _tracer.startSpan(name) + + dataObject = convertAttributesToString(dataObject) + + if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') { + openTelemetryLogging.send({ + type: 'graylog', + spanContext, + payload: { + message: message, + object: { + ...dataObject, + spanId, + name, + user: SessionStore?.user?.FullName, + device_name: device?.name || device?.model, + commit_date: environment.version.lastCommitTime, + } + } + }) + } + + data.logs.push(dataObject) + + }, + getAttribute: (key: string) => { + return data.tags[key] + }, + finish: () => { + if(finish) return + + if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') { + span.end(); + UseCaseCounter.add(1, {user: SessionStore?.user?.FullName, outcome:data.tags['outcome'] || data.status?.code , usecase: name}) + } + + if(bugPrint && (data.tags['outcome'] == 'failed' || data.status?.code == SpanStatusCode.ERROR)) { + console.error(name, data) + } + + finish = true + }, + hasError:(message: string) => { + if(data.status?.code != SpanStatusCode.ERROR) { + data.status = {code: SpanStatusCode.ERROR, message} + span.setStatus({code: SpanStatusCode.ERROR, message}) + span.setAttribute('outcome','failed') + } + }, + createSpan: (name, parent?: any) => { + return tracerInstance.startSpan(name, { root: false }, parent) as Span; + } + } + return returnObject +} + +export function XTracerAsync({ name, bugPrint, module = null, autoFinish = true, daley =0 }) { + return ( + target: unknown, + propertyKey: string, + descriptor: PropertyDescriptor, + ) => { + const originalMethod = descriptor.value; + descriptor.value = async function (...args: unknown[]) { + + + const tracing = createTracingInstance({bugPrint, name, module, autoFinish}) + + tracing.setAttribute('User', SessionStore?.user?.FullName); + tracing.setAttribute('current.page', window.location.pathname); + tracing.setAttribute('device.name', device?.name || device?.model) + tracing.setAttribute('commit.date', environment.version.lastCommitTime) + tracing.setAttribute('commit.branch', environment.version.branch) + + + args.push(tracing) + + try { + const result = await originalMethod.apply(this, args); + + if(autoFinish ) { + setTimeout(tracing.finish , daley) + } + + return result + } catch (e) { + tracing.setAttribute('catch', 'true') + + if(autoFinish) { + setTimeout(tracing.finish , daley) + } + console.error(e); + return false + } + }; + }; +} + + +export function XTracer({ name, bugPrint, module, autoFinish = true, daley =0 }) { + return ( + target: unknown, + propertyKey: string, + descriptor: PropertyDescriptor, + ) => { + const originalMethod = descriptor.value; + descriptor.value = function (...args: unknown[]) { + + const tracing = createTracingInstance({bugPrint, name, module, autoFinish}) + + tracing.setAttribute('User', SessionStore?.user?.FullName); + tracing.setAttribute('current.page', window.location.pathname); + tracing.setAttribute('device.name', device?.name || device?.model) + tracing.setAttribute('commit.date', environment.version.lastCommitTime) + tracing.setAttribute('commit.branch', environment.version.branch) + + args.push(tracing) + + try { + const result = originalMethod.apply(this, args); + + + if(autoFinish) { + setTimeout(tracing.finish , daley) + } + return result + } catch (e) { + + tracing.setAttribute('catch', 'true') + + if(autoFinish) { + setTimeout(tracing.finish , daley) + } + console.error(e); + return false + } + }; + }; +} + +export type TracingType = { + span: Span; + tracer: Tracer; + tracerId: string; + attributes: typeof SemanticAttributes; + // axios: (config?: AxiosRequestConfig) => AxiosInstance; + setStatus: (status: any) => void; + log: (message: string, data: Object) => void; + addEvent: (context: string, message?: any, obj?: any) => void; + setAttribute: (key: string, value: string) => void; + getAttribute: (key: string) => string; + LocalLogEvent: (name: string, attributesOrStartTime: any, obj?:any) => void; + finish: () => void; + hasError:(message: string) => void; + createSpan:(name, parent?: any) => Span; +}; + +export interface UserInteraction { + readonly params: any; + readonly tracing: TracingType; + readonly user: Pick; + readonly headers: Headers & { authorization: string }; +} + +export type InteractionTrancingInput = Pick; + +export const getPathWithoutUUID = (path: string) => + path.replace( + /[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/, + 'uuid', + ); + + + + + + + + + + + + + diff --git a/src/app/services/monitoring/socket/socket.ts b/src/app/services/monitoring/socket/socket.ts new file mode 100644 index 000000000..c252da365 --- /dev/null +++ b/src/app/services/monitoring/socket/socket.ts @@ -0,0 +1,60 @@ + +import { Injectable } from '@angular/core'; +import { v4 as uuidv4 } from 'uuid'; + +@Injectable({ + providedIn: 'root' +}) +export class WebSocketGraylogService { + private adminSocketGlobal!: WebSocket; + connected = false + + constructor() { } + + connect(): void { + // this.adminSocketGlobal = new WebSocket('wss://5-180-182-151.cloud-xip.com:85/ws/'); + this.adminSocketGlobal = new WebSocket('wss://185-229-224-75.cloud-xip.com:85/ws/'); + + this.adminSocketGlobal.onopen = () => { + console.log('Admin WebSocket is open now.'); + this.adminSocketGlobal.send("uuid"); + this.connected = true + }; + + this.adminSocketGlobal.onmessage = async (event: MessageEvent) => { + // Handle incoming messages here + }; + + this.adminSocketGlobal.onclose = () => { + console.log('Admin WebSocket is closed now.'); + this.connect(); + }; + + this.adminSocketGlobal.onerror = (error: Event) => { + console.error('Admin WebSocket error:', error); + }; + } + + send(data: Object & { type: string; payload: Object , requestId: string, spanContext:any }): void { + if (this.adminSocketGlobal.readyState === WebSocket.OPEN) { + + this.adminSocketGlobal.send(JSON.stringify({ + type: data.type , + payload: data.payload, + requestId: data.requestId, + parentSpan: { + traceId: data.spanContext.spanContext().traceId, + spanId: data.spanContext.spanContext().spanId, + } + })); + + // data.spanContext.end() + } else { + console.warn('WebSocket is not open. Message not sent.'); + } + } + + start(): void { + this.connect(); + } +} diff --git a/src/app/services/native-notification.service.ts b/src/app/services/native-notification.service.ts index 6a2c447a0..484592ea1 100644 --- a/src/app/services/native-notification.service.ts +++ b/src/app/services/native-notification.service.ts @@ -1,36 +1,28 @@ import { Injectable } from '@angular/core'; import { Platform } from '@ionic/angular'; -import { CapacitorConfig } from '@capacitor/cli'; -/* import { LocalNotifications, LocalNotificationSchema } from '@capacitor/local-notifications'; */ - +//import { LocalNotifications } from '@capacitor/local-notifications'; +import { v4 as uuidv4 } from 'uuid' @Injectable({ providedIn: 'root' }) export class NativeNotificationService { - constructor(private platform: Platform,) { + private scheduledEventIds: number[] = []; + + constructor( + private platform: Platform,) { this.askForPermission() - } - askForPermission() { - - /* LocalNotifications.requestPermissions() - - LocalNotifications.checkPermissions().then((data)=>{ - // - }).catch((data)=>{ - // - }) */ + window['send'] = () => { + this.eventNotification({eventId:uuidv4()}) + } } - foregroundNotification() { + askForPermission() {} - /* LocalNotifications.addListener('localNotificationReceived', (notification) => { - - }) */ - } + foregroundNotification() {} backgroundNotification() { /* LocalNotifications.addListener('localNotificationActionPerformed', (action) => { @@ -53,6 +45,142 @@ export class NativeNotificationService { } + uuidTo32BitInt(uuid) { + // Remove hyphens and convert to a 16-byte hex string + const hex = uuid.replace(/-/g, ''); + + // Get the least significant 8 bytes (16 hex characters) + const leastSignificantBytes = hex.slice(-16); + + // Convert to a 64-bit integer + const bigInt = BigInt('0x' + leastSignificantBytes); + + // Convert to a 32-bit integer and ensure it fits within the int32 range + const int32 = Number(bigInt % BigInt(2 ** 32)); + + // Adjust to fit within the signed 32-bit range + return int32 >= 2 ** 31 ? int32 - 2 ** 32 : int32; + } + + async cancelNotification(eventId: number) { + //await LocalNotifications.cancel({ notifications: [{ id: eventId }] }); + //console.log(`Notification with event ID ${eventId} canceled.`); + } + + didEventHappenToday(eventTime) { + const eventDate = new Date(eventTime); + const today = new Date(); + return eventDate.toDateString() === today.toDateString(); + } + + + async cancelAllNotification() { + // try { + // await LocalNotifications.cancel({ + // notifications: [] + // }); + // console.log('All notifications cancelled'); + // } catch (error) { + // console.error('Error cancelling notifications:', error); + // } + } + + async scheduleNotifications(events: any) { + const notifications = []; + + + console.log({events}); + + events = events + .filter(e => new Date().getTime() <= new Date(e.start).getTime()) + .filter(e => this.didEventHappenToday(e.start)) + + // console.log('notify', events) + + + await this.cancelAllNotification(); + + // for (const event of events) { + + // const eventTime = new Date(event.start).getTime(); + // const now = new Date().getTime(); + + // // Schedule notifications for 1 hour before and 15 minutes before the event + // const oneHourBefore = eventTime - 60 * 60 * 1000; + // const fifteenMinutesBefore = eventTime - 15 * 60 * 1000; + + // const timeDifference = eventTime - now; + // const oneHour = 60 * 60 * 1000; // 1 hour in milliseconds + // const fifteenMinutes = 15 * 60 * 1000; // 15 minutes in milliseconds + + // console.log('notification to notify object', event) + // // if (timeDifference <= fifteenMinutes) { + + // // console.log({notification: event, e: '15 minutes'}) + // // notifications.push({ + // // title: 'Event Reminder', + // // body: `Reminder: ${event.Subject} starts in ${this.duration(event.start, new Date())} minutes.£`, + // // id: this.uuidTo32BitInt(event.event.id) + // // }); + // // } else if (timeDifference <= oneHour) { + + // // console.log({notification: event, e: '1 hour.'}) + // // notifications.push({ + // // title: 'Event Reminder', + // // body: `Reminder: ${event.Subject} starts in ${this.duration(event.start, new Date())} hour.£`, + // // id: this.uuidTo32BitInt(event.id) + // // }); + // // } else { + // // console.log("Event is more than 1 hour away.") + + + // if (timeDifference >= fifteenMinutes) { + // notifications.push({ + // title: 'Event Reminder', + // body: `Reminder: ${event.event.Subject} 15 minutes`, + // id: this.uuidTo32BitInt(event.id)+1, + // schedule: { at: new Date(fifteenMinutesBefore) }, + // }); + // console.log('15m', new Date(fifteenMinutesBefore)) + + // } + + // if (timeDifference >= oneHour) { + // notifications.push({ + // title: 'Event Reminder', + // body: `Reminder: ${event.event.Subject} 1 hour`, + // id: this.uuidTo32BitInt(event.id)+2, + // schedule: { at: new Date(oneHourBefore) }, + // }); + // console.log('1h', new Date(oneHourBefore)) + // } + + // // } + + // } + + // await LocalNotifications.schedule({ notifications }); + } + + async eventNotification({eventId}) { + // await LocalNotifications.schedule({ + // notifications: [ + // { + // title: 'Test Notification 6', + // body: 'This is a test notification. 6', + // id: this.uuidTo32BitInt(eventId), // Unique ID for the notification + // schedule: { at: new Date(Date.now() + 1000 * 10) }, // Schedule to show in 5 seconds + // sound: null, + // attachments: null, + // actionTypeId: '', + // extra: null, + // }, + // ], + // }); + + // console.log('send notificatino') + } + isDesktop() { if (this.platform.is('desktop') || this.platform.is('mobileweb')) { return true @@ -62,4 +190,21 @@ export class NativeNotificationService { } } + duration(date1Str, date2Str) { + + // Convert string dates to Date objects + const date1: any = new Date(date1Str); + const date2: any = new Date(date2Str); + + // Calculate the difference in milliseconds + const timeDifferenceMs = date2 - date1; + + // Convert difference to days, hours, and minutes + const totalMinutes = Math.floor(timeDifferenceMs / (1000 * 60)); + const days = Math.floor(totalMinutes / (60 * 24)); + const hours = Math.floor((totalMinutes % (60 * 24)) / 60); + const minutes = totalMinutes % 60; + + return `${days}d ${hours}h ${minutes}m`.replace('0d', '') + } } diff --git a/src/app/services/notification/notification-holder.service.ts b/src/app/services/notification/notification-holder.service.ts index 1e950eded..409e0eadd 100644 --- a/src/app/services/notification/notification-holder.service.ts +++ b/src/app/services/notification/notification-holder.service.ts @@ -36,64 +36,61 @@ export class NotificationHolderService { const element = notification const i = this.notificationList.length + 1 + console.log({notification}) + let notificationObject; if (element.notification) { - notificationObject = { - index: i, - title: element.notification.title, - Service: element.data.Service, - Object: element.data.Object, - IdObject: element.data.IdObject, - FolderId: element.data.FolderId, - body: element.notification.body, - dateInit: this.getFormatedTime(element.data.dateInit), - dateEnd: this.getFormatedTime(element.data.dateEnd), - Location: element.data.Location, - TypeAgenda: element.data.TypeAgenda, - Role: element.data.Role, - Status: element.data.Status, - read: false, + index: i, + title: element.notification.title, + Service: element.data.Service || element.data.service , + Object: element.data.Object || element.data.object , + IdObject: element.data.IdObject || element.data.idObject , + FolderId: element.data.FolderId || element.data.folderId , + body: element.notification.body, + dateInit: this.getFormatedTime(element.data.dateInit), + dateEnd: this.getFormatedTime(element.data.dateEnd), + Location: element.data.Location || element.data.location , + TypeAgenda: element.data.TypeAgenda || element.data.typeAgenda , + Role: element.data.Role || element.data.role , + Status: element.data.Status || element.data.status , + read: false, } - - } else if (element.data) { + } else if (element.data) { notificationObject = { - index: i, - title: element.title, - Service: element.data.Service, - Object: element.data.Object, - IdObject: element.data.IdObject, - FolderId: element.data.FolderId, - body: element.body, - dateInit: this.getFormatedTime(element.data.dateInit), - dateEnd: this.getFormatedTime(element.data.dateEnd), - Location: element.data.Location, - TypeAgenda: element.data.TypeAgenda, - Role: element.data.Role, - Status: element.data.Status, - read: false, + index: i, + title: element.title, + Service: element.data.Service || element.data.service , + Object: element.data.Object || element.data.object , + IdObject: element.data.IdObject || element.data.idObject , + FolderId: element.data.FolderId || element.data.folderId , + body: element.body, + dateInit: this.getFormatedTime(element.data.dateInit), + dateEnd: this.getFormatedTime(element.data.dateEnd), + Location: element.data.Location || element.data.location , + TypeAgenda: element.data.TypeAgenda || element.data.typeAgenda , + Role: element.data.Role || element.data.role , + Status: element.data.Status || element.data.status , + read: false, } - - } else { - { - notificationObject = { - FolderId: element.FolderId, - IdObject: element.IdObject, - Location: element.Location, - Object: element.Object, - Role: element.Role, - Service: element.Service, - Status: element.Status, - TypeAgenda: element.TypeAgenda, + } else { + notificationObject = { + FolderId: element.FolderId || element.folderId , + IdObject: element.IdObject || element.idObject , + Location: element.Location || element.location , + Object: element.Object || element.object , + Role: element.Role || element.role , + Service: element.Service || element.service , + Status: element.Status || element.status , + TypeAgenda: element.TypeAgenda || element.typeAgenda , body: element.body, dateEnd: element.dateEnd, dateInit: element.dateInit, index: element.index, title: element.title, read: false, - } } - } + } this.notificationList.push(notificationObject) this.save() diff --git a/src/app/services/notification/notifications.service.ts b/src/app/services/notification/notifications.service.ts index b4090923b..0be6326a3 100644 --- a/src/app/services/notification/notifications.service.ts +++ b/src/app/services/notification/notifications.service.ts @@ -1,11 +1,12 @@ import { Injectable, NgZone } from '@angular/core'; -import { AlertController, Platform } from '@ionic/angular'; +import { Platform } from '@ionic/angular'; import { Capacitor } from '@capacitor/core'; import { ActionPerformed, PushNotificationSchema, PushNotifications, Token, } from '@capacitor/push-notifications'; -import { environment } from 'src/environments/environment'; import { NotificationsEndsPointsService } from './notifications-ends-points.service' import { AngularFireMessaging } from '@angular/fire/messaging'; import { NavigationExtras, Router } from '@angular/router'; +import { NotificationRepositoryService } from 'src/app/module/notification/data/notification-repository.service' + @Injectable({ providedIn: 'root' }) @@ -20,6 +21,7 @@ export class NotificationsService { private afMessaging: AngularFireMessaging, private router: Router, private zone: NgZone, + private NotificationRepositoryService: NotificationRepositoryService ) { } @@ -143,7 +145,7 @@ export class NotificationsService { ); } else { navigator.serviceWorker.onmessage = (event) => { - console.log('Mensagem recebida do Service Worker:', event.data.data); + console.log('Mensagem recebida do Service Worker:', event.data); let object = { notification: event.data } @@ -173,7 +175,7 @@ export class NotificationsService { notificatinsRoutes = (notification) => { - console.log('BACK BACK',notification) + console.log('BACK BACK 32',notification) if (notification.notification.data.Service === "agenda" && notification.notification.data.IdObject.length > 10) { diff --git a/src/app/services/notifications.service.ts b/src/app/services/notifications.service.ts index bdb56be30..a8a64e141 100644 --- a/src/app/services/notifications.service.ts +++ b/src/app/services/notifications.service.ts @@ -14,9 +14,23 @@ import { notificationObject } from '../models/notifications'; import { Capacitor } from '@capacitor/core'; import { AngularFireMessaging } from '@angular/fire/messaging'; import { NotificationHolderService } from 'src/app/store/notification-holder.service'; - import { FCM } from '@capacitor-community/fcm'; +import {ChatController} from 'src/app/controller/chat' +import { TracingType, XTracer, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; +import { z } from 'zod'; +import { NotificationRepositoryService } from 'src/app/module/notification/data/notification-repository.service' +const notificationDataSchema = z.object({ + Service: z.string(), + IdObject: z.string().optional(), + Object: z.string().optional(), + FolderId: z.string().optional(), +}); +const notificationSchema = z.object({ + notification: z.object({ + data: notificationDataSchema, + }), +}); @Injectable({ providedIn: 'root' @@ -42,9 +56,10 @@ export class NotificationsService { notificationReceived: EventEmitter = new EventEmitter(); token = '' + ChatController = ChatController + constructor( private http: HttpClient, - private storageService: StorageService, public modalCtrl: AlertController, private platform: Platform, private router: Router, @@ -53,7 +68,7 @@ export class NotificationsService { private afMessaging: AngularFireMessaging, public NotificationHolderService: NotificationHolderService) { - this.onReciveForeground(); + // this.onReciveForeground(); this.onReciveBackground(); } @@ -65,6 +80,7 @@ export class NotificationsService { } requestPermissions() { + console.log('init notificaton permission') if (this.platform.is('mobile')) { if (!this.isPushNotificationsAvailable) { @@ -72,17 +88,22 @@ export class NotificationsService { } PushNotifications.requestPermissions().then(async (result) => { if (result.receive === 'granted') { + console.log('permission granted') // Register with Apple / Google to receive push via APNS/FCM try { - PushNotifications.register().catch((error) => { - console.log("Register device", error) + PushNotifications.register().then((value) => { + console.log("Register device", value) + this.getAndpostToken("") + }) .catch((error) => { + console.log("Register device error", error) }) - this.getAndpostToken("") + } catch (error) { console.log("Granted permission error", error) } } else { // Show some error + console.log('permission notification erro') } }); } else { @@ -90,41 +111,57 @@ export class NotificationsService { } } - private getAndpostToken(username) { + @XTracerAsync({name:'Notification/getAndpostToken', bugPrint: true, module:'notification', autoFinish: false}) + private getAndpostToken(username, tracing?: TracingType) { const geturl = environment.apiURL + 'notifications/token'; if (this.platform.is('mobile')) { if (!this.isPushNotificationsAvailable) { + tracing.setAttribute('notification.available', 'false') + tracing.setAttribute('outcome', 'failed') return false } if (this.platform.is('ios')) { FCM.getToken() .then(r => { - this.postToken(r.token, geturl) + tracing.setAttribute('notification.token', 'true') + this.postToken(r.token, geturl, tracing) this.token = r.token // alert(this.token) }) - .catch(err => console.log(err)); + .catch(err => { + console.log(err) + tracing.setAttribute('notification.token', 'false') + tracing.setAttribute('outcome', 'failed') + }); } else { PushNotifications.addListener('registration', (token: Token) => { - this.postToken(token.value, geturl) + + tracing.setAttribute('notification.token', 'true') + this.postToken(token.value, geturl, tracing) this.token = token.value + } ); } } else { + tracing.setAttribute('notification.request', 'true') this.afMessaging.requestToken.subscribe( (token) => { // Save the token to your server for sending notifications console.log('Permission granted! Token:', token); - this.postToken(token, geturl) + this.postToken(token, geturl, tracing) this.token = token + tracing.setAttribute('notification.token', 'true') + tracing.setAttribute('outcome', 'success') }, (error) => { console.error('Permission denied:', error); + tracing.setAttribute('notification.token', 'false') + tracing.setAttribute('outcome', 'failed') } ); } @@ -137,7 +174,7 @@ export class NotificationsService { this.DeleteToken(geturl) } - postToken(token, geturl) { + postToken(token, geturl, tracing: TracingType) { const headers = { 'Authorization': SessionStore.user.BasicAuthKey }; const body = { UserId: SessionStore.user.UserId, @@ -145,10 +182,16 @@ export class NotificationsService { Status: 1, Service: 1 }; + + tracing.setAttribute('token.data', token) this.http.post(`${geturl}`, body, { headers }).subscribe(data => { this.active = true + tracing.setAttribute('outcome','success') + tracing.finish() }, (error) => { - + tracing.setAttribute('postToken','failed') + tracing.setAttribute('outcome','failed') + tracing.finish() }) } @@ -193,13 +236,12 @@ export class NotificationsService { this.active = true console.log('NOtification Listener', notification) this.storenotification(notification) - - } ); } else { this.afMessaging.messages.subscribe((notification) => { + console.log(notification) this.storenotification(notification) this.notificationReceived.emit(); this.eventtrigger.publishSomeData({ @@ -242,7 +284,7 @@ export class NotificationsService { try { navigator.serviceWorker.onmessage = (event) => { - console.log('Mensagem recebida do Service Worker:', event.data.data); + console.log('Mensagem recebida do Service Worker:', event.data); let object = { notification: event.data } @@ -316,69 +358,156 @@ export class NotificationsService { } - notificatinsRoutes = (notification) => { + @XTracer({name:'phone-notification/notificationRoutes', bugPrint: true, module:'notification'}) + notificatinsRoutes (notification, tracing?: TracingType) { - console.log('BACK BACK', notification) + try { - if (notification.notification.data.Service === "agenda" && notification.notification.data.IdObject.length > 10) { + console.log('BACK BACK 12', notification) - this.zone.run(() => this.router.navigate(['/home/agenda', notification.notification.data.IdObject, 'agenda'])); - } - else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expedientes") { - this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente', notification.notification.data.IdObject, 'gabinete-digital'])); - } - else if (notification.notification.data.Service === "agenda" && notification.notification.data.Object === "event-list") { - //this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',IdObject, 'agenda'])); - this.zone.run(() => this.router.navigate(['/home/agenda/event-list/approve-event', notification.notification.data.IdObject, 'agenda'])); + if (notification.notification.data.service === "agenda" ) { + const data = JSON.parse(notification.notification.data.item) + if(data.status == 1) { + this.zone.run(() => this.router.navigate(['/home/agenda/event-list/approve-event', notification.notification.data.idObject, 'agenda'])); + } else { + this.zone.run(() => this.router.navigate(['/home/agenda', notification.notification.data.idObject, 'agenda'])); + } - } else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos") { + this.zone.run(() => this.router.navigate(['/home/agenda', notification.notification.data.idObject, 'agenda'])); + } + else if (notification.notification.data.service === "gabinete-digital" && notification.notification.data.object === "expedientes") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente', notification.notification.data.idObject, 'gabinete-digital'])); + } + else if (notification.notification.data.service === "agenda" && notification.notification.data.object === "event-list") { + //this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',IdObject, 'agenda'])); + this.zone.run(() => this.router.navigate(['/home/agenda/event-list/approve-event', notification.notification.data.idObject, 'agenda'])); - this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos', notification.notification.data.IdObject, 'gabinete-digital'], { replaceUrl: true })); - } - else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "parecer") { + } else if (notification.notification.data.service === "gabinete-digital" && notification.notification.data.object === "despachos") { - this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital'])); - } - else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "deferimento") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos', notification.notification.data.idObject, 'gabinete-digital'], { replaceUrl: true })); + } + else if (notification.notification.data.service === "gabinete-digital" && notification.notification.data.object === "parecer") { - this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital'])); - } - else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos-pr") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.idObject, 'gabinete-digital'])); + } + else if (notification.notification.data.service === "gabinete-digital" && notification.notification.data.object === "deferimento") { - this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos-pr', notification.notification.data.IdObject, 'gabinete-digital'])); - } - else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "accao") { - this.zone.run(() => this.router.navigate(['/home/publications', notification.notification.data.IdObject])); - } - else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "publicacao") { - this.zone.run(() => this.router.navigate(['/home/publications/view-publications', notification.notification.data.FolderId, notification.data.IdObject])); - } - else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas") { - this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas', notification.notification.data.IdObject, 'gabinete-digital'])); - } - else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas-assinar") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.idObject, 'gabinete-digital'])); + } + else if (notification.notification.data.service === "gabinete-digital" && notification.notification.data.object === "despachos-pr") { - this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas-assinar', notification.notification.data.IdObject, 'gabinete-digital'])); - } + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos-pr', notification.notification.data.idObject, 'gabinete-digital'])); + } + else if (notification.notification.data.service === "accoes" && notification.notification.data.object === "accao") { + this.zone.run(() => this.router.navigate(['/home/publications', notification.notification.data.idObject])); + } + else if (notification.notification.data.service === "accoes" && notification.notification.data.object === "publicacao") { + this.zone.run(() => this.router.navigate(['/home/publications/view-publications', notification.notification.data.FolderId, notification.data.IdObject])); + } + else if (notification.notification.data.service === "gabinete-digital" && notification.notification.data.object === "diplomas") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas', notification.notification.data.idObject, 'gabinete-digital'])); + } + else if (notification.notification.data.service === "gabinete-digital" && notification.notification.data.object === "diplomas-assinar") { - else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diploma-revisao") { - - this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas', notification.notification.data.IdObject, 'gabinete-digital'])); - } - - else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expedientes-pr") { - this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', notification.notification.data.IdObject, 'gabinete-digital'])); - } else if (notification.notification.data.Service === "chat") { - - let navigationExtras: NavigationExtras = { queryParams: { "roomId": notification.notification.data.IdObject, } }; - - if (window.location.search.includes("roomId")) { - this.zone.run(() => this.router.navigate(['/home/chat'])); + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas-assinar', notification.notification.data.idObject, 'gabinete-digital'])); } - setTimeout(() => { - this.zone.run(() => this.router.navigate(['/home/chat'], navigationExtras)); - }, 200); + else if (notification.notification.data.service === "gabinete-digital" && notification.notification.data.object === "diploma-revisao") { + + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas', notification.notification.data.idObject, 'gabinete-digital'])); + } + + else if (notification.notification.data.service === "gabinete-digital" && notification.notification.data.object === "expedientes-pr") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', notification.notification.data.idObject, 'gabinete-digital'])); + } else if (notification.notification.data.service === "chat") { + + let navigationExtras: NavigationExtras = { queryParams: { "roomId": notification.notification.data.idObject, } }; + + if (window.location.search.includes("roomId")) { + this.zone.run(() => this.router.navigate(['/home/chat'])); + } + + setTimeout(() => { + this.zone.run(() => this.router.navigate(['/home/chat'], navigationExtras)); + }, 200); + } // ================================================================================================================= + else if (notification.notification.data.Service === "agenda" && notification.notification.data.IdObject.length > 10) { + + this.zone.run(() => this.router.navigate(['/home/agenda', notification.notification.data.IdObject, 'agenda'])); + } + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expedientes") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente', notification.notification.data.IdObject, 'gabinete-digital'])); + } + else if (notification.notification.data.Service === "agenda" && notification.notification.data.Object === "event-list") { + //this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',IdObject, 'agenda'])); + this.zone.run(() => this.router.navigate(['/home/agenda/event-list/approve-event', notification.notification.data.IdObject, 'agenda'])); + + } else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos") { + + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos', notification.notification.data.IdObject, 'gabinete-digital'], { replaceUrl: true })); + } + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "parecer") { + + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital'])); + } + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "deferimento") { + + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital'])); + } + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos-pr") { + + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos-pr', notification.notification.data.IdObject, 'gabinete-digital'])); + } + else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "accao") { + this.zone.run(() => this.router.navigate(['/home/publications', notification.notification.data.IdObject])); + } + else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "publicacao") { + this.zone.run(() => this.router.navigate(['/home/publications/view-publications', notification.notification.data.FolderId, notification.data.IdObject])); + } + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas', notification.notification.data.IdObject, 'gabinete-digital'])); + } + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas-assinar") { + + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas-assinar', notification.notification.data.IdObject, 'gabinete-digital'])); + } + + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diploma-revisao") { + + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas', notification.notification.data.IdObject, 'gabinete-digital'])); + } + + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expedientes-pr") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', notification.notification.data.IdObject, 'gabinete-digital'])); + } else if (notification.notification.data.Service === "chat") { + + let navigationExtras: NavigationExtras = { queryParams: { "roomId": notification.notification.data.IdObject, } }; + + if (window.location.search.includes("roomId")) { + this.zone.run(() => this.router.navigate(['/home/chat'])); + } + + setTimeout(() => { + this.zone.run(() => this.router.navigate(['/home/chat'], navigationExtras)); + }, 200); + } else { + tracing.setAttribute('notification.route', 'false') + tracing.setAttribute('outcome', 'failed') + tracing.setAttribute('parameters', JSON.stringify(notification)) + } + } catch (error) { + + const validationError = notificationSchema.safeParse(notification) + + if(!validationError.success) { + const errors: z.ZodError = (validationError as any).error; + console.log("Validation errors:", errors.issues); + tracing.setAttribute('validation.errors', JSON.stringify(errors.issues)) + } + + tracing.setAttribute('outcome', 'failed') + tracing.setAttribute('parameters', JSON.stringify(notification)) + tracing.setAttribute('error', JSON.stringify(error)) } @@ -387,4 +516,5 @@ export class NotificationsService { // })() } + } diff --git a/src/app/services/permission.service.ts b/src/app/services/permission.service.ts index 71d144a56..945425d21 100644 --- a/src/app/services/permission.service.ts +++ b/src/app/services/permission.service.ts @@ -51,7 +51,7 @@ export class PermissionService { let count = 0 - for(let permission of this.SessionStore.user.UserPermissions ) { + for(let permission of this.SessionStore.user?.UserPermissions || [] ) { if (args.includes(permission)) { count++; } diff --git a/src/app/services/processes.service.ts b/src/app/services/processes.service.ts index 397e75ce2..c6293cdaa 100644 --- a/src/app/services/processes.service.ts +++ b/src/app/services/processes.service.ts @@ -51,7 +51,6 @@ export class ProcessesService { this.headers2 = new HttpHeaders();; this.headers2 = this.headers2.set('Authorization', 'Bearer ' + SessionStore.user.Authorization); - } uploadFile(formData: any) { @@ -84,21 +83,21 @@ export class ProcessesService { return this.http.get(`${geturl}`, options); } - eventsToApprove(userid, caller) { - const geturl = environment.apiURL + 'tasks/events-to-approve'; - let params = new HttpParams(); + // eventsToApprove(userid, caller) { + // const geturl = environment.apiURL + 'tasks/events-to-approve'; + // let params = new HttpParams(); - params = params.set("pageNum", 1); - params = params.set("pageSize", 500); - params = params.set("userid", userid); + // params = params.set("pageNum", 1); + // params = params.set("pageSize", 500); + // params = params.set("userid", userid); - let options = { - headers: this.headers, - params: params - }; + // let options = { + // headers: this.headers, + // params: params + // }; - return this.http.get(`${geturl}`, options); - } + // return this.http.get(`${geturl}`, options); + // } GetTaskListExpediente(onlycount1): Observable { const processname = "Expediente" diff --git a/src/app/services/publication/holder.service.spec.ts b/src/app/services/publication/holder.service.spec.ts new file mode 100644 index 000000000..6faab2556 --- /dev/null +++ b/src/app/services/publication/holder.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { HolderService } from './holder.service'; + +describe('HolderService', () => { + let service: HolderService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(HolderService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/publication/holder.service.ts b/src/app/services/publication/holder.service.ts new file mode 100644 index 000000000..302c7873d --- /dev/null +++ b/src/app/services/publication/holder.service.ts @@ -0,0 +1,9 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class HolderService { + + constructor() { } +} diff --git a/src/app/services/publication/publication-holder.service.spec.ts b/src/app/services/publication/publication-holder.service.spec.ts new file mode 100644 index 000000000..e89d9e0ec --- /dev/null +++ b/src/app/services/publication/publication-holder.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { PublicationHolderService } from './publication-holder.service'; + +describe('PublicationHolderService', () => { + let service: PublicationHolderService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(PublicationHolderService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/publication/publication-holder.service.ts b/src/app/services/publication/publication-holder.service.ts new file mode 100644 index 000000000..1fe3c830a --- /dev/null +++ b/src/app/services/publication/publication-holder.service.ts @@ -0,0 +1,98 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class PublicationHolderService { + + count = 0 + PublicationFormMV: { + id: string, + percentage: number, + retry: boolean, + retryFunction: Function + }[] = [] + + constructor() { + + window['upload-header-set-percentage'] = (id: string, percentage: number) => { + this.PublicationFormMV = this.PublicationFormMV.map((e)=> { + if(e.id == id) { + console.log("percentage", percentage) + e.percentage = percentage + } + return e + }) + + + this.uploadPercentage() + } + + window['upload-header-set-add'] = (id: string, percentage: number, save: Function) => { + this.remove(id) + this.PublicationFormMV.push({id, percentage, retry: false, retryFunction: save}) + this.uploadPercentage() + } + + + window['upload-header-set-remove'] = (id: string) => { + this.remove(id) + } + + + window['upload-header-set-retry'] = (id: string) => { + + this.PublicationFormMV = this.PublicationFormMV.map((e)=> { + if(e.id == id) { + e.retry = true + } + return e + }) + + this.uploadPercentage() + } + + window['upload-header-remove-retry'] = (id: string) => { + this.uploadPercentage() + + this.PublicationFormMV = this.PublicationFormMV.map((e)=> { + if(e.id == id) { + e.retry = false + } + return e + }) + + + this.uploadPercentage() + + } + + } + + remove(id: string) { + this.PublicationFormMV = this.PublicationFormMV.filter((e)=> e.id != id) + this.uploadPercentage() + } + + hasPublication() { + return this.PublicationFormMV.length >= 1 + } + + + uploadPercentage = () => { + + const percentageArray = this.PublicationFormMV.map((e) => e.percentage) + + // Check if the array is not empty + if (percentageArray.length === 0) { + this.count = 0 + } else { + let sum = percentageArray.reduce((acc, percentage) => acc + percentage, 0); + + // Calculate the average percentage + let averagePercentage = sum / percentageArray.length; + + this.count = Math.ceil(averagePercentage) + } + } +} diff --git a/src/app/services/publications.service.ts b/src/app/services/publications.service.ts index 786524fbc..30182c8d1 100644 --- a/src/app/services/publications.service.ts +++ b/src/app/services/publications.service.ts @@ -246,7 +246,7 @@ GetIdsPublicationNext(id:any){ body.Files = body.Files.map( e => ({ FileBase64: e.FileBase64, FileExtension: e.FileExtension, - OriginalFileName: 'foto' + OriginalFileName: e.OriginalFileName || 'foto' })) return this.http.put(`${geturl}`, body, options) diff --git a/src/app/services/role-id.service.ts b/src/app/services/role-id.service.ts index 3d34116ad..4465f316a 100644 --- a/src/app/services/role-id.service.ts +++ b/src/app/services/role-id.service.ts @@ -11,6 +11,7 @@ export class RoleIdService { * @description President role id */ PV: number = 100000011 + MD: number = 100000011 /** * @description Vice president role id */ diff --git a/src/app/services/socket-connection-mcr.service.ts b/src/app/services/socket-connection-mcr.service.ts index 0490b2406..2ace6a853 100644 --- a/src/app/services/socket-connection-mcr.service.ts +++ b/src/app/services/socket-connection-mcr.service.ts @@ -5,7 +5,8 @@ import { v4 as uuidv4 } from 'uuid' import { HttpClient, HttpHeaders, HttpEventType } from '@angular/common/http'; import { CMAPIService } from '../shared/repository/CMAPI/cmapi.service'; import { HubConnectionBuilder } from '@microsoft/signalr'; -import { ok, err, Result } from 'neverthrow'; +import { ok, err as Err, Result } from 'neverthrow'; +import { environment } from 'src/environments/environment'; @Injectable({ providedIn: 'root' }) @@ -90,7 +91,7 @@ class ReconnectingWebSocketSignalR { } this.connection = new signalR.HubConnectionBuilder() - .withUrl('https://gdcmapi-dev.dyndns.info/FileHub', { + .withUrl( environment.fileHub, { transport: signalR.HttpTransportType.LongPolling, accessTokenFactory: () => SessionStore.user.Authorization }) @@ -139,7 +140,7 @@ class ReconnectingWebSocketSignalR { if (!this.stop && (!error || error.message !== "Connection stopped by client.")) { setTimeout(() => { this.connect(); - }, 1000); // Ajuste o atraso conforme necessário + }, 3000); // Ajuste o atraso conforme necessário } @@ -147,14 +148,32 @@ class ReconnectingWebSocketSignalR { } commit(path): Promise> { + console.log('committing') return new Promise((resolve, reject) => { - this.connection.invoke("CommitUpload", path).then((e) => { - console.log("commit message", e) - resolve(ok(true)) - }).catch(err => { - resolve(err(false)) - console.error(err.toString()) - }); + if(this.isOpen) { + console.log('open') + try { + console.log('this.connection.invoke', this.connection) + this.connection.invoke("CommitUpload", path).then((e) => { + console.log("commit message", e) + resolve(ok(true)) + }).catch(err => { + console.error('upload catch commit error') + resolve(Err(false)) + console.error(err.toString()) + }); + } catch(error) { + resolve(Err(false)) + console.error('upload commit error') + console.error(error) + } + + } else { + console.log('wait') + this.onConnect.push(()=> { + resolve(this.commit(path)) + }) + } }) } @@ -391,31 +410,16 @@ export class ObjectMergeNotification{ constructor() { this.socket.onDisconnectCallback(()=> { - console.log("run watch") + //console.log("run watch") this.runWatch = true - this.watch() + //this.watch() }) - this.socket.onConnectCallback(()=> { - + this.socket.onConnectCallback(() => { console.log("open trigger") this.runWatch = false }) - this.socket.subscribe((data: socketResponse) => { - if(data.IsCompleted == true) { - console.log("==================!!!====================") - try { - this.callbacks[data.Guid](data) - delete this.callbacks[data.Guid] - } catch (error) {} - } else { - console.log("else", data) - } - }) - - this.socket.connect(); - this.watch() } connect() { @@ -430,33 +434,33 @@ export class ObjectMergeNotification{ async watch() { - // this.watchCount = 0; + this.watchCount = 0; - // if(this.runWatch) { - // setTimeout(async () => { - // for(const [key, funx] of Object.entries(this.callbacks)) { + if(this.runWatch) { + setTimeout(async () => { + for(const [key, funx] of Object.entries(this.callbacks)) { - // const request = await this.CMAPIService.getVideoHeader(key) + const request = await this.CMAPIService.getVideoHeader(key) - // if(request.isOk()) { - // funx() - // delete this.callbacks[key] - // } - // } + if(request.isOk()) { + funx() + delete this.callbacks[key] + } + } - // this.watchCount++ - // if(this.watchCount <= 15) { - // this.watch() - // } else { - // this.runWatch = false - // } + this.watchCount++ + if(this.watchCount <= 15) { + this.watch() + } else { + this.runWatch = false + } - // }, 1000) + }, 1000) - // } else { - // console.log("end loop============================") - // } + } else { + console.log("end loop============================") + } } subscribe(GUID, callback:Function) { diff --git a/src/app/services/task.service.ts b/src/app/services/task.service.ts index d4971285b..9dd10185d 100644 --- a/src/app/services/task.service.ts +++ b/src/app/services/task.service.ts @@ -19,7 +19,10 @@ import { Router } from '@angular/router'; import { v4 as uuidv4 } from 'uuid' import { ChangeProfileService } from './change-profile.service'; import { PermissionService } from './permission.service'; - +import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service'; +import { SortService } from './functions/sort.service'; +import { TracingType, XTracerAsync } from './monitoring/opentelemetry/tracer'; +import { EEventFilterStatus } from '../module/agenda/data/dto/enums'; @Injectable({ providedIn: 'root' }) @@ -44,7 +47,6 @@ export class TaskService { SessionStore = SessionStore AllProcess = [] - showLoader: boolean = false showLoaderNum: number = 0 loadCount = false loadNum = 0 @@ -67,6 +69,8 @@ export class TaskService { private router: Router, private changeProfileService: ChangeProfileService, public p: PermissionService, + public AgendaDataRepositoryService: AgendaDataRepositoryService, + private sortService: SortService, ) { this.changeProfileService.registerCallback(() => { @@ -197,7 +201,6 @@ export class TaskService { async LoadTask() { - this.showLoader = true try { await this.loadExpedientes() @@ -220,16 +223,19 @@ export class TaskService { await this.loadEventosParaAprovacao() this.loadCount = true - this.showLoader = false; } async loadDespachos() { this.showLoaderNum++ - let despachos = await this.despachoRule.getList({ updateStore: true }) - if (despachos) { - this.despachoStore.reset(despachos) - } + try { + + let despachos = await this.despachoRule.getList({ updateStore: true }) + if (despachos) { + this.despachoStore.reset(despachos) + } + + } catch(error) {} this.showLoaderNum-- } @@ -262,7 +268,6 @@ export class TaskService { } async loadPedidos() { - this.showLoader = true this.showLoaderNum++ try { @@ -308,37 +313,36 @@ export class TaskService { } - async loadEventosParaAprovacao() { + @XTracerAsync({name:'taskService/loadEventToAprove', bugPrint: true}) + async loadEventosParaAprovacao(tracing?: TracingType) { this.showLoaderNum++ console.log('PR') // PR dont have event to approve /* if(this.SessionStore.user.Profile != 'PR') { */ try { - for(let calendar of this.eventService.calendarNamesAry) { - if(calendar == 'Meu calendario') { - // color - let genericEvents = await this.processesbackend.eventsToApprove(SessionStore.user.UserId, false).toPromise(); - let eventsList - try { - eventsList = genericEvents - } catch (error) { - eventsList = []; + + const list = await this.AgendaDataRepositoryService.geCalendars() + + for(let calendar of list) { + + let allEvents = await this.AgendaDataRepositoryService.eventToApproveList({ + userId: calendar.wxUserId, + status: EEventFilterStatus.Pending + }, tracing) + + if(allEvents.isOk()) { + tracing.setAttribute('outcome', 'success') + + let eventsList = [] + if(allEvents.value.length >= 1) { + eventsList = this.sortService.sortArrayByDate(allEvents.value).reverse(); + this.eventoaprovacaostore.save(calendar.wxUserId as any, eventsList) + } else { + this.eventoaprovacaostore.save(calendar.wxUserId as any, []) } - - console.log(calendar, eventsList) - this.eventoaprovacaostore.save(calendar, eventsList) - } else { - let allEvents = await this.processesbackend.eventsToApprove(calendar.OwnerUserId, 'againete page').toPromise() - let eventsList - try { - eventsList = allEvents - } catch(error) { - eventsList = [] - } - console.log(calendar, eventsList) - this.eventoaprovacaostore.save(calendar.OwnerUserId, eventsList) + tracing.setAttribute('outcome', 'failed') } } } catch (error) { @@ -495,4 +499,29 @@ export class TaskService { } } + + taskCleaner(serialNumber: string) { + const taskData = { + serialNumber: serialNumber, + action: "Conhecimento", + ActionTypeId: 104, + dataFields: { + ReviewUserComment: "ii" + }, + AttachmentList: { + ProcessInstanceID: "", + Attachments: [] + } + }; + + this.processesbackend.CompleteTask(taskData).subscribe( + response => { + console.log('Task completed successfully:', response); + }, + error => { + console.error('Error completing task:', error); + } + ); + } + } diff --git a/src/app/services/toast.service.ts b/src/app/services/toast.service.ts index 8c5ad408a..aa2906818 100644 --- a/src/app/services/toast.service.ts +++ b/src/app/services/toast.service.ts @@ -57,6 +57,23 @@ export class ToastService { } + removeBeforeHash(text) { + const hashIndex = text.indexOf('#'); + if (hashIndex !== -1) { + return text.substring(hashIndex); + } + return text; + } + + getEverythingBeforeHash(text) { + const hashIndex = text.indexOf('#'); + if (hashIndex !== -1) { + return text.substring(0, hashIndex).trim(); + } + return text; + } + + async _badRequest(message?: string, callback?) { let notification = document.createElement('div') @@ -73,9 +90,9 @@ export class ToastService { ` notification.style.animationName = 'notification-top' - + console.error(this.removeBeforeHash(message)) document.body.append(notification) - notification.querySelector('.text').innerHTML = message || 'Processo não efetuado' + notification.querySelector('.text').innerHTML = this.getEverythingBeforeHash(message) || 'Processo não efetuado' setTimeout(()=>{ if (callback) { callback() diff --git a/src/app/services/videoconvert.service.ts b/src/app/services/videoconvert.service.ts index d4ef617ae..51ffdaadc 100644 --- a/src/app/services/videoconvert.service.ts +++ b/src/app/services/videoconvert.service.ts @@ -1,5 +1,7 @@ import { Injectable } from '@angular/core'; import { FFMpeg } from '@awesome-cordova-plugins/ffmpeg/ngx'; +import { FFmpeg } from '@ffmpeg/ffmpeg'; +import { fetchFile, toBlobURL } from '@ffmpeg/util'; @Injectable({ providedIn: 'root' @@ -7,14 +9,59 @@ import { FFMpeg } from '@awesome-cordova-plugins/ffmpeg/ngx'; export class VideoconvertService { constructor( - private ffmpeg: FFMpeg + private ffmpeg: FFMpeg, + private ffmpegWeb: FFmpeg ) { } - async convertVideo(inputPath, outputPath, formart) { - const ffmpegCommand = `-i "${inputPath}" -c:v copy -c:a aac -strict experimental "${outputPath}output.${formart}"`; + async convertVideo(inputPath, outputPath, filename, formart) { + try { + const ffmpegCommand = `-i "${inputPath}" -c:v copy -c:a aac -strict experimental "${outputPath}${filename}.${formart}"`; - const result = await this.ffmpeg.exec(ffmpegCommand) + const result = await this.ffmpeg.exec(ffmpegCommand) - console.log('Convert returns ', `${outputPath}output.${formart}`); + console.log('Convert returns ', `${outputPath}${filename}.${formart}`); + } catch (error) { + console.error('Error during conversion:', error); + throw error; // Re-throwing the error for handling in the component + } } + + async convertVideoWeb(inputPath, outputPath, filename, format) { + try { + console.log('Conversion started...'); + + const baseURL = 'https://unpkg.com/@ffmpeg/core@0.12.6/dist/umd'; + const coreURL = await toBlobURL(`${baseURL}/ffmpeg-core.js`, 'text/javascript'); + const wasmURL = await toBlobURL(`${baseURL}/ffmpeg-core.wasm`, 'application/wasm'); + + await this.ffmpegWeb.load(); + + const inputType = inputPath.type.split('/').pop(); + console.log(inputType) + await this.ffmpegWeb.writeFile(`input.${inputType}`, await fetchFile(inputPath)); + + await this.ffmpegWeb.exec(['-i', `input.${inputType}`, 'output.mp4']); + + const outputData: any = await this.ffmpegWeb.readFile('output.mp4'); + const outputBlob = new Blob([outputData.buffer], { type: 'video/mp4' }); + const outputFile = new File([outputBlob], `${filename}.mp4`, { type: 'video/mp4' }); + + console.log('Conversion completed.'); + return outputFile; + } catch (error) { + console.error('Error during conversion:', error); + throw error; + } +} + + + removeTextBeforeSlash(inputString, mark) { + if (inputString.includes(mark)) { + const parts = inputString.split(mark); + return parts.length > 1 ? parts[1] : inputString; + } else { + return inputString; + } + } + } diff --git a/src/app/shared/agenda/approve-event/approve-event.page.html b/src/app/shared/agenda/approve-event/approve-event.page.html index f235afeb1..05fa4aae7 100644 --- a/src/app/shared/agenda/approve-event/approve-event.page.html +++ b/src/app/shared/agenda/approve-event/approve-event.page.html @@ -26,7 +26,7 @@
-
+
+ +
- +
@@ -131,9 +132,10 @@
- - - - + + + +
diff --git a/src/app/shared/agenda/approve-event/approve-event.page.ts b/src/app/shared/agenda/approve-event/approve-event.page.ts index e152e85a0..513ef7120 100644 --- a/src/app/shared/agenda/approve-event/approve-event.page.ts +++ b/src/app/shared/agenda/approve-event/approve-event.page.ts @@ -11,7 +11,12 @@ import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.pag import { ThemeService } from 'src/app/services/theme.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { TaskService } from 'src/app/services/task.service' - +import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service'; +import { EventToApproveDetails } from 'src/app/models/entiry/agenda/eventToApproveDetails'; +import { EventsService } from 'src/app/services/events.service'; +import { isHttpError } from 'src/app/services/http.service'; +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; +import { PermissionService } from 'src/app/services/permission.service'; @Component({ selector: 'app-approve-event', @@ -21,20 +26,20 @@ import { TaskService } from 'src/app/services/task.service' export class ApproveEventPage implements OnInit { event: Event; - @Input() loadedEvent:any; - loadedAttachments:any; - customDate:any; - today:any; + @Input() loadedEvent: EventToApproveDetails; + loadedAttachments: any; + customDate: any; + today: any; show: boolean = false; months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"]; days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"]; - @Input() serialNumber:string; - @Input() showComponent:string; + @Input() serialNumber: string; + @Input() showComponent: string; @Input() componentTransparent: any - @Input() InstanceId:string; - @Input() showAside:boolean; + @Input() InstanceId: string; + @Input() showAside: boolean; @Output() approveEventDismiss = new EventEmitter(); @Output() closeEventToApprove = new EventEmitter(); @@ -45,18 +50,20 @@ export class ApproveEventPage implements OnInit { constructor( private router: Router, private modalController: ModalController, - private processes: ProcessesService, - private attachmentsService: AttachmentsService, private popoverController: PopoverController, private toastService: ToastService, public ThemeService: ThemeService, private httpErroHandle: HttpErrorHandle, - public TaskService: TaskService + public TaskService: TaskService, + private agendaDataRepository: AgendaDataRepositoryService, + public EventsService: EventsService, + private httpErrorHandle: HttpErrorHandle, + public p: PermissionService, ) { // Event to approve list - window['edit-approve-event-desktop'] = ()=> { + window['edit-approve-event-desktop'] = () => { this.getTask() } } @@ -67,7 +74,6 @@ export class ApproveEventPage implements OnInit { ngOnInit() { this.getTask(); - this.getAttachments(); } @@ -76,68 +82,85 @@ export class ApproveEventPage implements OnInit { this.modalController.dismiss(); } - getTask() { - this.processes.GetTask(this.serialNumber).subscribe(res => { - - this.loadedEvent = res; - this.today = new Date(res.workflowInstanceDataFields.StartDate); - // - this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); + @XTracerAsync({name:'ApproveEventPage/getTask', bugPrint: true}) + async getTask(tracing?: TracingType) { + + const res = await this.agendaDataRepository.getEventToApproveById(this.serialNumber, tracing) + + if (res.isOk()) { + this.loadedEvent = res.value; + this.loadedAttachments = this.loadedEvent.Attachments + this.today = new Date(res.value.workflowInstanceDataFields.StartDate); + // + this.customDate = this.days[this.today.getDay()] + ", " + this.today.getDate() + " de " + (this.months[this.today.getMonth()]); + tracing.setAttribute('outcome', 'success') + } else { + tracing.setAttribute('eventId', this.serialNumber) + + if(!isHttpError(res.error)) { + this.toastService._badRequest('Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico. #133') + console.log(res.error) + } else if (isHttpError(res.error)) { + + if(res.error.status == 404) { + this.toastService._badRequest('Este evento já não existe') + } else { + this.httpErrorHandle.httpStatusHandle(res.error) + } + + } + } - }) } - async approveTask(serialNumber:string) { + async approveTask(serialNumber: string) { let body = { "serialNumber": serialNumber, "action": "Aprovar" } const loader = this.toastService.loading() - try { - await this.processes.PostTaskAction(body).toPromise() + const result = await this.agendaDataRepository.approveEvent(serialNumber)// .subscribe((value) => { + if(result.isOk()) { + + console.log(result.value) this.modalController.dismiss(serialNumber); this.httpErroHandle.httpsSucessMessagge('Aprovar') this.TaskService.loadEventosParaAprovacao(); - } catch (error) { - this.httpErroHandle.httpStatusHandle(error) - } finally { - this.close() - loader.remove() + } else { + + console.log('aprove event error: ', result.error) + this.httpErroHandle.httpStatusHandle(result.error) } + this.close() + loader.remove() + + } - async rejectTask(serialNumber:string) { + async rejectTask(serialNumber: string) { let body = { "serialNumber": serialNumber, "action": "Rejeitar" } - + const loader = this.toastService.loading() + const result = await this.agendaDataRepository.deleteEvent(serialNumber, true)//.subscribe((value) => { - try { - await this.processes.PostTaskAction(body).toPromise() - this.httpErroHandle.httpsSucessMessagge('Rejeitar'); + if(result.isOk()) { + this.httpErroHandle.httpsSucessMessagge('delete event'); this.TaskService.loadEventosParaAprovacao(); - } catch (error) { - this.httpErroHandle.httpStatusHandle(error) - - } finally { - loader.remove() + this.close() + } else { + + console.log('reject event error: ', result.error) + this.httpErroHandle.httpStatusHandle(result.error) } + loader.remove() } - async getAttachments() { - try { - this.loadedAttachments = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise(); - } catch (error) { - console.error('getAttchaments',error) - } - - } - - async viewDocument(DocId:string, Document) { + async viewDocument(DocId: string, Document) { const modal = await this.modalController.create({ component: ViewDocumentPage, @@ -151,7 +174,7 @@ export class ApproveEventPage implements OnInit { Document, applicationId: Document.ApplicationId, docId: Document.DocId || Document.SourceId, - folderId: this.loadedEvent.FolderId, + // folderId: this.loadedEvent.FolderId, task: this.loadedEvent }, cssClass: 'modal modal-desktop' @@ -160,7 +183,7 @@ export class ApproveEventPage implements OnInit { } - async openOptions(ev:any) { + async openOptions(ev: any) { const popover = await this.popoverController.create({ component: EventActionsPopoverPage, componentProps: { @@ -170,7 +193,7 @@ export class ApproveEventPage implements OnInit { event: ev, translucent: true }); - return await popover.present().then(() =>{ + return await popover.present().then(() => { this.TaskService.loadEventosParaAprovacao() this.getTask() }, (error) => { @@ -178,11 +201,11 @@ export class ApproveEventPage implements OnInit { }) } - async emendTask(serialNumber:string) { - + async emendTask(serialNumber: string) { + const modal = await this.modalController.create({ component: EmendMessageModalPage, - componentProps:{ + componentProps: { }, cssClass: 'emend-message-modal', backdropDismiss: false @@ -191,46 +214,50 @@ export class ApproveEventPage implements OnInit { modal.onDidDismiss() - .then( async (res) => { + .then(async (res) => { - if(res.data.option == 'save') { + if (res.data.option == 'save') { - - let body = { "serialNumber": serialNumber, - "action": "Emendar", + + let body = { + "serialNumber": serialNumber, + "action": "Emendar", "dataFields": { - "ReviewUserComment": res.data, + "ReviewUserComment": res.data, + } } - } - - const loader = this.toastService.loading(); - try { - await this.processes.PostTaskAction(body).toPromise(); - this.httpErroHandle.httpsSucessMessagge('Rever') - this.TaskService.loadEventosParaAprovacao(); - this.close(); - } catch (error) { - this.httpErroHandle.httpStatusHandle(error) - } finally { - loader.remove() + const loader = this.toastService.loading(); + /* await this.processes.PostTaskAction(body).toPromise(); */ + const result = await this.agendaDataRepository.eventToaprovalStatus(serialNumber, 'Revision', res.data.note)// .subscribe((value) => { + if(result.isOk()) { + this.httpErroHandle.httpsSucessMessagge('Rever') + this.TaskService.loadEventosParaAprovacao(); + this.close(); + } else { + + console.log('send event to revision error: ', result.error) + this.httpErroHandle.httpStatusHandle(result.error) + } + + loader.remove() + + + } else { + } - - } else { - - } - - }, (error) => { - console.log(error) - }); + + }, (error) => { + console.log(error) + }); await modal.present(); } goToEventsToApprove() { - if(window.location.pathname.startsWith('/home/agenda')) { + if (window.location.pathname.startsWith('/home/agenda')) { this.close() } else { let navigationExtras: NavigationExtras = { diff --git a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html index 252b4559c..18183f7b2 100644 --- a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html +++ b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html @@ -111,13 +111,13 @@ - + Reunião - + Viagem - + Conferência @@ -131,6 +131,16 @@
+ +
+
+ + Todo dia + + +
+
+
@@ -152,6 +162,7 @@ displayFormat="D MMM YYYY H:mm" minuteValues="0,5,10,15,20,25,30,35,40,45,50,55" monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez" + (ngModelChange)="onDateChange($event)" > @@ -160,6 +171,7 @@ placeholder="Choose a date" [(ngModel)]="eventProcess.workflowInstanceDataFields.StartDate" [disabled]="disabled" + (ngModelChange)="onDateChange($event)" >
--> -
@@ -270,7 +282,7 @@
-
+
-->
@@ -350,17 +362,17 @@
- +

- {{document.SourceName}} - Correspondencia - AccoesPresidenciais - ArquivoDespachoElect + {{document.subject || document.Description || document.SourceName || document.sourceName || 'Sem título'}} + Correspondencia + AccoesPresidenciais + ArquivoDespachoElect

-

{{document.Stakeholders}} {{document.CreateDate }}

+

{{document.Stakeholders}} {{document.dateEntry }}

diff --git a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts index 68ad62714..0951ca44f 100644 --- a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts +++ b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts @@ -15,8 +15,9 @@ import { removeDuplicate } from 'src/plugin/removeDuplicate.js' import { EventToApproveEdit } from 'src/app/models/event.model'; import { ThemeService } from 'src/app/services/theme.service' import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; -import { DomSanitizerService } from 'src/app/services/DomSanitizer.service'; - +import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service'; +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; +import { AttendeesLIstChangeDetector } from 'src/app/module/agenda/data/async/change/attendeesLIstChangeDetector'; const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { parse: { @@ -53,13 +54,13 @@ export class EditEventToApprovePage implements OnInit { recurringTypes: any; selectedRecurringType: any; - showLoader = false + showLoader = false; - get dateStart () { + get dateStart() { return this.dateControlStart.value } - get dateEnd () { + get dateEnd() { return this.dateControlEnd.value } @@ -68,12 +69,14 @@ export class EditEventToApprovePage implements OnInit { @ViewChild('inicio') inicio: any; @ViewChild('picker1') picker1: any; - loadedAttachments: Attachment[]= [] + loadedAttachments: any[] = [] eventProcess = { + Attachments: [], serialNumber: "", taskStartDate: "", - workflowInstanceDataFields:{ + activityInstanceName: "", + workflowInstanceDataFields: { Body: "", OccurrenceType: '', Category: '', @@ -96,9 +99,9 @@ export class EditEventToApprovePage implements OnInit { } show = false - isRecurring:string; + isRecurring: string; isEventEdited: boolean; - profile:string; + profile: string; eventAttendees: EventPerson[]; loadedEventAttachments: Attachment[]; @@ -110,6 +113,8 @@ export class EditEventToApprovePage implements OnInit { Form: FormGroup; validateFrom = false + addedAttachmentsList = []; + deletedAttachmentsList = []; @Output() openAttendeesComponent = new EventEmitter(); @Output() clearContact = new EventEmitter(); @@ -117,7 +122,7 @@ export class EditEventToApprovePage implements OnInit { @Output() setIntervenientCC = new EventEmitter(); @Output() closeComponent = new EventEmitter(); @Output() closeEventToApprove = new EventEmitter(); - @Output() approveEventDismiss = new EventEmitter(); + @Output() approveEventDismiss = new EventEmitter(); @Input() saveData: any; @Input() serialNumber: string @@ -129,18 +134,19 @@ export class EditEventToApprovePage implements OnInit { private eventsService: EventsService, public alertController: AlertController, private attachmentsService: AttachmentsService, - private processes:ProcessesService, + private processes: ProcessesService, private toastService: ToastService, public ThemeService: ThemeService, public httpErrorHandler: HttpErrorHandle, - private domSanitizeService: DomSanitizerService + private agendaDataRepository: AgendaDataRepositoryService, + private httpErroHalde: HttpErrorHandle, ) { this.isEventEdited = false; } ngOnInit() { - - if(this.restoreTemporaryData()){ + console.log('here!!!') + if (this.restoreTemporaryData()) { this.setOtherData() } else { this.getTask(); @@ -150,62 +156,77 @@ export class EditEventToApprovePage implements OnInit { } - async getTask() { - this.processes.GetTask(this.serialNumber).subscribe( (result) => { - this.eventProcess = result + @XTracerAsync({name:'edit-event-approve/getTask', bugPrint: true}) + async getTask(tracing?: TracingType) { + + const res = await this.agendaDataRepository.getEventToApproveById(this.serialNumber) + if(res.isOk()) { + console.log('evento to apro to edit', res.value) + this.eventProcess = res.value as any; this.eventProcess.workflowInstanceDataFields.LastOccurrence = new Date(this.eventProcess.workflowInstanceDataFields.LastOccurrence) this.restoreDatepickerData() // description - let body : any =this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '') - this.eventProcess.workflowInstanceDataFields.Body = body - this.eventProcess.workflowInstanceDataFields.Category = this.eventProcess.workflowInstanceDataFields.EventType + try { + let body: any = this.eventProcess.workflowInstanceDataFields?.Body?.replace(/<[^>]+>/g, '') + this.eventProcess.workflowInstanceDataFields.Body = body + + } catch (error) {} + + this.eventProcess.workflowInstanceDataFields.Category = this.setEventType(this.eventProcess.workflowInstanceDataFields.EventType) this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId - this.getAttachments() + this.loadedAttachments = res.value.Attachments; + console.log(this.loadedAttachments) this.setOtherData() this.saveTemporaryData() - }) + tracing.setAttribute('outcome', 'success') + + } else { + tracing.setAttribute('outcome', 'failed') + this.httpErroHalde.httpStatusHandle(res.error) + } + } getRecurrenceTypes() { - this.eventsService.getRecurrenceTypes().subscribe(res=>{ - + this.eventsService.getRecurrenceTypes().subscribe(res => { + this.recurringTypes = res; }); } - onSelectedRecurringChanged(ev:any) { + onSelectedRecurringChanged(ev: any) { this.calculetedLastOccurrence(ev); - if(ev.length > 1) { - + if (ev.length > 1) { + this.eventProcess.workflowInstanceDataFields.OccurrenceType = ev.filter(data => data != '-1'); } - if(ev.length == 0) { + if (ev.length == 0) { this.eventProcess.workflowInstanceDataFields.OccurrenceType = "-1"; } } - calculetedLastOccurrence(type:number){ - var valor; + calculetedLastOccurrence(type: number) { + var valor; var opcao: boolean; if (type == 0) { valor = 7; opcao = true; - } else if(type == 1){ + } else if (type == 1) { valor = 30; opcao = true; - } else if(type == 2){ + } else if (type == 2) { valor = 1; opcao = false; - }else if(type == 3){ + } else if (type == 3) { valor = 5; opcao = false; } @@ -213,28 +234,42 @@ export class EditEventToApprovePage implements OnInit { } - defineLastOccurrence(valor:number, opcao:boolean){ + onDateChange(e) { + + const cloneDateStartDate = new Date(this.eventProcess.workflowInstanceDataFields.StartDate); + const cloneDateEndDate = new Date(this.eventProcess.workflowInstanceDataFields.EndDate); + + if(cloneDateStartDate.getTime() >= cloneDateEndDate.getTime()) { + cloneDateStartDate.setHours(cloneDateStartDate.getHours() + 1); + this.eventProcess.workflowInstanceDataFields.EndDate = cloneDateStartDate as any + } + + } + + + defineLastOccurrence(valor: number, opcao: boolean) { var time = new Date(this.eventProcess.workflowInstanceDataFields.EndDate); if (opcao == true) { time.setDate(time.getDate() + valor); this.eventProcess.workflowInstanceDataFields.LastOccurrence = time; } else { time = new Date( - time.getFullYear() + valor, - time.getMonth(), - time.getDate(), - time.getHours(), + time.getFullYear() + valor, + time.getMonth(), + time.getDate(), + time.getHours(), time.getMinutes() ); this.eventProcess.workflowInstanceDataFields.LastOccurrence = time; } - + } setOtherData() { - if(this.eventProcess.workflowInstanceDataFields.ParticipantsList) { + if (this.eventProcess.workflowInstanceDataFields.ParticipantsList) { this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => { - if(e.IsRequired) { + console.log('intervenientes ', e) + if (e.IsRequired) { this.taskParticipants.push(e); } else { this.taskParticipantsCc.push(e); @@ -242,10 +277,10 @@ export class EditEventToApprovePage implements OnInit { }) } - this.taskParticipants = removeDuplicate(this.taskParticipants) - this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc) + this.taskParticipants = removeDuplicate(this.taskParticipants) + this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc) - if(this.eventProcess.workflowInstanceDataFields.IsRecurring == false) { + if (this.eventProcess.workflowInstanceDataFields.IsRecurring == false) { this.isRecurring = "Não se repete"; } else { @@ -254,7 +289,7 @@ export class EditEventToApprovePage implements OnInit { this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId - this.getAttachments() + /* this.getAttachments() */ } close() { @@ -276,7 +311,7 @@ export class EditEventToApprovePage implements OnInit { runValidation() { - this.validateFrom = true + this.validateFrom = true } injectValidation() { @@ -309,20 +344,20 @@ export class EditEventToApprovePage implements OnInit { }) } - async save() { + @XTracerAsync({name:'desktop/edit-event', bugPrint: true, daley: 4000}) + async save(tracing?: TracingType) { this.injectValidation() this.runValidation() - if(this.Form.invalid) return false + if (this.Form.invalid) return false + + const serverCurrentList = this.eventProcess.workflowInstanceDataFields.ParticipantsList - // set dates to eventProcess object this.dateControlStart = new FormControl(moment(new Date(this.eventProcess.workflowInstanceDataFields.StartDate)).add(1, 'hours')); this.dateControlEnd = new FormControl(moment(new Date(this.eventProcess.workflowInstanceDataFields.EndDate)).add(1, 'hours')); - // this.restoreDatepickerData() - // this.getDatepickerData() - this.taskParticipantsCc.forEach( e => { + this.taskParticipantsCc.forEach(e => { e.IsRequired = false }) @@ -332,14 +367,13 @@ export class EditEventToApprovePage implements OnInit { this.eventProcess.workflowInstanceDataFields.ParticipantsList = this.taskParticipants.concat(this.taskParticipantsCc) - this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e=>{ + this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => { - if(e.hasOwnProperty('$type')) { + if (e.hasOwnProperty('$type')) { delete e.$type } }) - const event: EventToApproveEdit = { SerialNumber: this.eventProcess.serialNumber, Body: this.eventProcess.workflowInstanceDataFields.Body, @@ -365,45 +399,167 @@ export class EditEventToApprovePage implements OnInit { } try { - await this.eventsService.postEventToApproveEdit(event).toPromise() - - this.close() + const calendar = await this.agendaDataRepository.getCalendarByUserId((this.eventProcess as any).owner.wxUserId) + if(calendar.isOk()) { - this.httpErrorHandler.httpsSucessMessagge('Editar evento'); + const value = await this.agendaDataRepository.updateEvent(this.eventProcess.serialNumber, event, true, calendar.value, tracing) - } catch(e) { + if(value.isOk()) { + console.log(value) + + tracing.setAttribute('outcome', 'success') + + } else { + console.log('edit event error: ', value.error) + tracing.setAttribute('outcome', 'failed') + } + + console.log({serverCurrentList, list: this.eventProcess.workflowInstanceDataFields.ParticipantsList, e: this.eventProcess}) + + const { insert, remove } = AttendeesLIstChangeDetector(serverCurrentList as any, this.eventProcess.workflowInstanceDataFields.ParticipantsList as any) + + console.log({insert, remove}) + + if(insert.length >= 1) { + try { + await this.agendaDataRepository.addEventAttendee(this.eventProcess.serialNumber, insert, tracing).toPromise() + } catch (error) { + console.log('add Attendee error: ', error) + tracing.setAttribute('failed.attendees', 'true') + } + + // this.agendaDataRepository.addEventAttendee(this.eventProcess.serialNumber, insert, tracing).subscribe((value) => { + // console.log(value) + // }, ((error) => { + // console.log('add Attendee error: ', error) + // tracing.setAttribute('failed.attendees', 'true') + // })); + } + + + if(remove.length >= 1) { + + try { + await this.agendaDataRepository.removeEventAttendee(this.eventProcess.serialNumber, remove).toPromise() + } catch (error) { + console.log('add Attendee error: ', error) + tracing.setAttribute('failed.attendees', 'true') + } + + // this.agendaDataRepository.removeEventAttendee(this.eventProcess.serialNumber, remove).subscribe((value) => { + + // }, ((error) => { + // console.log('add Attendee error: ', error) + // tracing.setAttribute('failed.attendees', 'true') + // })); + } + + + if (this.addedAttachmentsList.length > 0) { + try { + await this.agendaDataRepository.addEventAttachment(this.eventProcess.serialNumber, this.loadedAttachments, tracing).toPromise(); + } catch (error) { + this.showLoader = false + console.log('add attachment error: ', error) + tracing.setAttribute('failed.add.attachment', 'true') + } + + // this.agendaDataRepository.addEventAttachment(this.eventProcess.serialNumber, this.loadedAttachments, tracing).subscribe((value) => { + // console.log(value) + // }, ((error) => { + // this.showLoader = false + // console.log('add attachment error: ', error) + // tracing.setAttribute('failed.add.attachment', 'true') + // })); + } + + if (this.deletedAttachmentsList.length > 0) { + + try { + await this.agendaDataRepository.removeEventAttachment(this.eventProcess.serialNumber, { attachments: this.deletedAttachmentsList }).toPromise() + } catch (error) { + this.showLoader = false + console.log('remove attachment error: ', error) + tracing.setAttribute('failed.remove.attachment', 'true') + } + + // this.agendaDataRepository.removeEventAttachment(this.eventProcess.serialNumber, { attachments: this.deletedAttachmentsList }).subscribe((value) => { + // console.log(value) + // }, ((error) => { + // this.showLoader = false + // console.log('remove attachment error: ', error) + // tracing.setAttribute('failed.remove.attachment', 'true') + // })); + } + + this.close() + this.httpErrorHandler.httpsSucessMessagge('Editar evento'); + + } + + } catch (e) { this.httpErrorHandler.httpStatusHandle(e); this.toastService._badRequest('Evento não editado'); } - - this.loadedAttachments.forEach((document:any)=>{ - if(document['action'] == 'add') { - delete document.action - this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{ - window['edit-approve-event-desktop']() - }, error =>{ - this.toastService.badRequest(); - }); - } else if(document['action'] == 'delete') { - delete document.action - this.attachmentsService.deleteEventAttachmentById(document.Id).subscribe( res=>{ - window['edit-approve-event-desktop']() - }, error =>{ - this.toastService.badRequest() - }) - } - }) + // this.loadedAttachments.forEach((document: any) => { + // if (document['action'] == 'add') { + // delete document.action + // this.attachmentsService.setEventAttachmentById(document).subscribe(() => { + // window['edit-approve-event-desktop']() + // }, error => { + // this.toastService.badRequest(); + // }); + // } else if (document['action'] == 'delete') { + // delete document.action + // this.attachmentsService.deleteEventAttachmentById(document.Id).subscribe(res => { + // window['edit-approve-event-desktop']() + // }, error => { + // this.toastService.badRequest() + // }) + // } + + // }) } - async gravasAction() { - - await this.save(); + documentAdded(documents: any[]) { + console.log('document added', documents) + return documents.map((element) => { + return { + docId: parseInt(element.SourceId), + sourceName: element.SourceName, + description: "", + applicationId: parseInt(element.ApplicationId) + }; + }); - if(this.eventProcess['activityInstanceName'] == 'Editar Evento') { - this.reenviar(); + } + + atendeesSeletedType(type) { + var selectedType = { + 'true': 1, + 'false': 2, + 'other': 3, } + return selectedType[type]; + } + + attendeesAdded(taskParticipants: any[]) { + return taskParticipants.map((e) => { + return { + name: e.Name, + emailAddress: e.EmailAddress, + attendeeType: this.atendeesSeletedType(JSON.stringify(e.IsRequired)), + wxUserId: e.wxUserId, + } + }); + } + + async gravasAction() { + + await this.save(); + this.reenviar(); } @@ -411,11 +567,11 @@ export class EditEventToApprovePage implements OnInit { let body = { serialNumber: this.eventProcess.serialNumber, action: "Reenviar", - dataFields: { + dataFields: { ReviewUserComment: "", } } - + const loader = this.toastService.loading(); try { @@ -423,13 +579,13 @@ export class EditEventToApprovePage implements OnInit { this.toastService._successMessage(); this.goToApproveEventList(); } catch (error) { - if(error.status == 0) { + if (error.status == 0) { this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão') } else { - + this.toastService._badRequest(); } - } finally { + } finally { loader.remove() } } @@ -439,16 +595,65 @@ export class EditEventToApprovePage implements OnInit { this.modalController.dismiss(); } - dynamicSetIntervenient({taskParticipants, taskParticipantsCc}) { - this.taskParticipants = removeDuplicate(taskParticipants) ; - this.taskParticipantsCc = removeDuplicate(taskParticipantsCc) ; + dynamicSetIntervenient({ taskParticipants, taskParticipantsCc }) { + this.taskParticipants = removeDuplicate(taskParticipants); + this.taskParticipantsCc = removeDuplicate(taskParticipantsCc); } + onCheckboxChange(event: any) { + + if (this.eventProcess.workflowInstanceDataFields.IsAllDayEvent) { + this.eventProcess.workflowInstanceDataFields.StartDate = this.setAlldayTime(this.eventProcess.workflowInstanceDataFields.StartDate) + this.eventProcess.workflowInstanceDataFields.EndDate = this.setAlldayTimeEndDate(this.eventProcess.workflowInstanceDataFields.EndDate) + + console.log('Recurso ativado!!'); + } else { + this.eventProcess.workflowInstanceDataFields.IsAllDayEvent = this.eventProcess.workflowInstanceDataFields.IsAllDayEvent; + this.eventProcess.workflowInstanceDataFields.EndDate = this.setAlldayTimeEndDateNotAlday(this.eventProcess.workflowInstanceDataFields.EndDate) + console.log('Recurso desativado'); + + } + } + + setAlldayTime(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(0) + date.setMinutes(0) + date.setSeconds(0); + + + return date + } + + + setAlldayTimeEndDate(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(23) + date.setMinutes(59) + date.setSeconds(0); + + + return date + } + + setAlldayTimeEndDateNotAlday(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(23) + date.setMinutes(0) + date.setSeconds(0); + + + return date + } + async addParticipants() { //this.saveTemporaryData(); - + this.openAttendeesComponent.emit({ type: "intervenient" }); @@ -471,17 +676,19 @@ export class EditEventToApprovePage implements OnInit { this.getDatepickerData() window['temp.path:/shared/agenda/edit-event-to-approve.ts'] = { - eventProcess: this.eventProcess + eventProcess: this.eventProcess, + attachment: this.loadedAttachments } } restoreTemporaryData(): boolean { - const restoredData = window['temp.path:/shared/agenda/edit-event-to-approve.ts'] + const restoredData = window['temp.path:/shared/agenda/edit-event-to-approve.ts'] - if(JSON.stringify(restoredData) != "{}" && undefined != restoredData) { - this.eventProcess = restoredData.eventProcess + if (JSON.stringify(restoredData) != "{}" && undefined != restoredData) { + this.eventProcess = restoredData.eventProcess, + this.loadedAttachments = restoredData.attachment // restore dater for date and hours picker this.restoreDatepickerData() @@ -498,21 +705,28 @@ export class EditEventToApprovePage implements OnInit { try { result = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise(); } catch (error) { - console.error('getAttachment',error) + console.error('getAttachment', error) } - - result.forEach((e)=>{ + + result.forEach((e) => { e.action = false }) this.loadedAttachments = result - // + // } deleteAttachment(attachment: Attachment, index) { + const id: any = this.loadedAttachments[index].id + console.log(this.loadedAttachments) + let update = this.removeItemById(this.loadedAttachments, id) + this.loadedAttachments = update; + this.deletedAttachmentsList.push(id) + } - this.loadedAttachments[index]['action'] = 'delete' + removeItemById(array, id) { + return array.filter(item => item.id !== id); } async getDoc() { @@ -522,16 +736,17 @@ export class EditEventToApprovePage implements OnInit { componentProps: { type: 'AccoesPresidenciais & ArquivoDespachoElect', showSearchInput: true, + eventAgenda: true, select: true, } }); await modal.present(); - modal.onDidDismiss().then( async (res)=>{ - if(res){ + modal.onDidDismiss().then(async (res) => { + if (res) { const data: SearchList = res.data.selected; - - const DocumentToSave: any = { + console.log(data) + /* const DocumentToSave: any = { SourceTitle: data.Assunto, ParentId: this.InstanceId, Source: '1', @@ -546,11 +761,12 @@ export class EditEventToApprovePage implements OnInit { Description: data.DocTypeDesc, SourceName: data.Assunto, Stakeholders: data.EntidadeOrganicaNome, - }; + }; */ - this.loadedAttachments.push(DocumentToSave) - + this.loadedAttachments.push(data) + this.addedAttachmentsList.push(data) + // await this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe(()=>{ // this.getAttachments(); @@ -572,4 +788,14 @@ export class EditEventToApprovePage implements OnInit { } + setEventType(eventType) { + var selectedEventType = { + 1: 'Meeting', + 2: 'Travel', + 3: 'Conference', + 4: 'Encontro' + } + return selectedEventType[eventType]; + } + } diff --git a/src/app/shared/agenda/edit-event/edit-event.page.html b/src/app/shared/agenda/edit-event/edit-event.page.html index 30eec93b3..39f34fbf4 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.html +++ b/src/app/shared/agenda/edit-event/edit-event.page.html @@ -47,21 +47,40 @@
- +
@@ -82,7 +101,7 @@
- + Agenda {{ calendars }} @@ -104,13 +123,13 @@ - + Reunião - + Viagem - + Conferência @@ -124,6 +143,87 @@
+
+ + Todo dia + + +
+
+ + +
+
+
+ +
+
+ + + + + + Nunca + + + Diário + + + Semanalmente + + + Mensal + + + Anual + + + +
+
+
+ + + +
+
+
+ +
+ +
+ + + + + + + + +
+
+
+ +
@@ -132,10 +232,12 @@ + [(ngModel)]="_postEvent.StartDate" [max]="maxDate" [disabled]="disabled" + (ngModelChange)="onDateChange($event)" + > + [stepHour]="stepHour" [stepMinute]="stepMinute" [stepSecond]="stepSecond" [touchUi]="touchUi" [hideTime]="true"> @@ -143,7 +245,47 @@
-
+
+
+
+ +
+
+ + + + + + + + +
+
+
+ +
+
+
+ +
+
+ + + + + + + + +
+
+
+ +
@@ -155,7 +297,7 @@ [max]="maxDate" [disabled]="disabled" [min]="_postEvent.StartDate"> + [stepHour]="stepHour" [stepMinute]="stepMinute" [stepSecond]="stepSecond" [hideTime]="false"> @@ -163,29 +305,6 @@
-
@@ -296,16 +415,15 @@

- {{document.SourceName}} - Correspondencia - AccoesPresidenciais - ArquivoDespachoElect + {{document.subject || document.sourceName || document.SourceName || 'Sem título'}} + Correspondencia + AccoesPresidenciais + ArquivoDespachoElect

-

{{document.Stakeholders}} {{document.CreateDate | - date: 'dd-MM-yyyy HH:mm'}}

+

{{document.Stakeholders}} {{ document.dateEntry }}

@@ -316,7 +434,7 @@ - diff --git a/src/app/shared/agenda/edit-event/edit-event.page.scss b/src/app/shared/agenda/edit-event/edit-event.page.scss index 652879fc7..6a81b00d1 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.scss +++ b/src/app/shared/agenda/edit-event/edit-event.page.scss @@ -17,7 +17,7 @@ ion-content{ padding: 30px 20px 0px 20px; color:#000; transform: translate3d(0, 1px, 0); - + .title-content{ margin: 0px auto; padding: 0 !important; @@ -90,7 +90,7 @@ ion-content{ .list-people{ float: left; - + } .add-people{ width: rem(45); @@ -149,7 +149,7 @@ ion-content{ --color:#ffffff; margin:10px; } - + .text-input{ width: 100%; border: 1px solid #ebebeb; @@ -157,7 +157,7 @@ ion-content{ padding: 0 !important; border-radius: 5px; } - + /* Error Messages */ .error{ color:red; @@ -171,7 +171,7 @@ ion-content{ } - + .app-name{ background: var(--title-text-color); border-radius: 18px; @@ -211,4 +211,23 @@ ion-content{ .materia-top { padding-top: 7px; -} \ No newline at end of file +} + + +.days-to-select{ + width: 40px; + height: 40px; + display: flex; + align-items: center; + justify-content: center; + background: #ebebeb; + border-radius: 50px; + box-shadow: 0px 0px 10px #f9f9f9; + border: 1px solid #d1d1d1; + cursor: pointer; + user-select: none; + -webkit-border-radius: 50px; + -moz-border-radius: 50px; + -ms-border-radius: 50px; + -o-border-radius: 50px; +} diff --git a/src/app/shared/agenda/edit-event/edit-event.page.ts b/src/app/shared/agenda/edit-event/edit-event.page.ts index f1b0a3e2a..24b4ed20e 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.ts +++ b/src/app/shared/agenda/edit-event/edit-event.page.ts @@ -7,16 +7,21 @@ import { Event } from 'src/app/models/event.model'; import { AlertController } from '@ionic/angular'; import { removeDuplicate } from 'src/plugin/removeDuplicate.js' import { SearchPage } from 'src/app/pages/search/search.page'; -import { AttachmentsService } from 'src/app/services/attachments.service'; -import { Attachment } from 'src/app/models/attachment.model'; import { FormControl, FormGroup, Validators } from '@angular/forms'; import { ParticipantsPipe } from 'src/app/pipes/participants.pipe'; import { ThemeService } from 'src/app/services/theme.service' import { SessionStore } from 'src/app/store/session.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { ContactsService } from 'src/app/services/contacts.service' -import { DomSanitizerService } from 'src/app/services/DomSanitizer.service'; - +import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service'; +import { SearchList_v2 } from 'src/app/models/search-document'; +import { Utils } from 'src/app/module/agenda/utils'; +import { Observable } from 'rxjs'; +import { TableSharedCalendar } from 'src/app/module/agenda/data/data-source/agenda-local-data-source.service'; +import { RoleIdService } from 'src/app/services/role-id.service' +import { XTracerAsync, TracingType } from 'src/app/services/monitoring/opentelemetry/tracer'; +import { AttendeesLIstChangeDetector } from 'src/app/module/agenda/data/async/change/attendeesLIstChangeDetector'; +import { EventRecurrenceComponentReturn, EventRecurrencePage } from 'src/app/modals/event-recurrence/event-recurrence.page'; @Component({ selector: 'app-edit-event', templateUrl: './edit-event.page.html', @@ -26,17 +31,17 @@ import { DomSanitizerService } from 'src/app/services/DomSanitizer.service'; export class EditEventPage implements OnInit { stEvent: Event; - isRecurring:string; + isRecurring: string; isEventEdited: boolean; loadedEvent: Event; initCalendarName: string; eventBody: EventBody; - segment:string = "true"; + segment: string = "true"; eventAttendees: EventPerson[]; // minDate: string; - loadedEventAttachments: Attachment[]=[]; - recurringTypes = []; + loadedEventAttachments: any[] = []; selectedRecurringType: any; + deletedAttachmentsList = []; public date: any; public disabled = false; @@ -44,8 +49,8 @@ export class EditEventPage implements OnInit { public showSeconds = false; public touchUi = false; public enableMeridian = false; - public minDate = new Date().toISOString().slice(0,10) - public endMinDate = new Date(new Date().getTime() + 15 * 60000).toISOString().slice(0,10) + public minDate = new Date().toISOString().slice(0, 10) + public endMinDate = new Date(new Date().getTime() + 15 * 60000).toISOString().slice(0, 10) public maxDate: any; public stepHour = 1; public stepMinute = 15; @@ -56,7 +61,7 @@ export class EditEventPage implements OnInit { @Input() taskParticipants: EventPerson[]; @Input() taskParticipantsCc: EventPerson[]; - @Input() profile:string; + @Input() profile: string; @Input() selectedSegment: string; @Input() postEvent: Event; @Output() clearContact = new EventEmitter(); @@ -88,33 +93,71 @@ export class EditEventPage implements OnInit { public stepMinutes = [1, 5, 10, 15, 20, 25]; public stepSeconds = [1, 5, 10, 15, 20, 25]; - private participantsPipe = new ParticipantsPipe() - sesseionStora = SessionStore + private participantsPipe = new ParticipantsPipe() + SessionStore= SessionStore CalendarNameOwnerName = '' - CalendarNamesOptions = [] + allDayCheck: boolean = false; + addedAttachmentsList = []; + + sharedCalendar: Observable + hasChangeCalendar = false + selectedUserCalendar:any; + CalendarNamesOptions = ['Oficial', 'Pessoal'] + + dateDifference = 0 + editAllEvent = false constructor( private modalController: ModalController, private eventsService: EventsService, public alertController: AlertController, - private attachmentsService: AttachmentsService, public ThemeService: ThemeService, private httpErrorHandle: HttpErrorHandle, private contactsService: ContactsService, - private domSanitizeService: DomSanitizerService - ) {} + private agendaDataRepository: AgendaDataRepositoryService, + private utils: Utils, + public RoleIdService: RoleIdService, + ) { + this.sharedCalendar = this.agendaDataRepository.getShareCalendarItemsLiveWithOrder() + + + } + + hasPrCalendar(data: TableSharedCalendar[]) { + for(const e of data) { + if(e.roleId == this.RoleIdService.PRES) { + return true + } + } + + return false + } + changeSegmentCalendar() { + this.hasChangeCalendar = true + } ngOnInit() { + + this.selectedUserCalendar = this.postEvent.owner.wxUserId + this.loadedEventAttachments = this.postEvent.Attachments + this._postEvent = this.postEvent - this.postEvent.StartDate = new Date(this.ajustMinuts(this.postEvent.StartDate)) - this.postEvent.EndDate = new Date(this.ajustMinuts(this.postEvent.EndDate)) - if(!this.restoreTemporaryData()) { + this._postEvent.Category = this.setEventType(this._postEvent.Category) + if (!this._postEvent.IsRecurring) { + this._postEvent.EventRecurrence.frequency = 'never'; + } else { + this._postEvent.EventRecurrence.frequency = this.utils.recurenceTypeSeleted(this.postEvent.EventRecurrence.frequency) + } + + this.allDayCheck = this.postEvent.IsAllDayEvent; + if (!this.restoreTemporaryData()) { + this.validationEditAllEvent() // clear - if(this._postEvent) { - if( this._postEvent.Body){ - if(typeof(this._postEvent.Body.Text) == 'string'){ + if (this._postEvent) { + if (this._postEvent.Body) { + if (typeof (this._postEvent.Body.Text) == 'string') { this._postEvent.Body.Text = this._postEvent.Body.Text.replace(/<[^>]+>/g, ''); } } @@ -122,18 +165,18 @@ export class EditEventPage implements OnInit { - for(const index in this._postEvent.Attendees) { - const user = this._postEvent.Attendees[index] + for (const index in this._postEvent.Attendees) { + const user = this._postEvent.Attendees[index] + + const userData = this.contactsService.constacts.find(e => user.EmailAddress == e.EmailAddress) + if (userData) { + this._postEvent.Attendees[index].UserType = userData.UserType + } else { + console.log('user not set') + } - const userData = this.contactsService.constacts.find(e => user.EmailAddress == e.EmailAddress) - if(userData) { - this._postEvent.Attendees[index].UserType = userData.UserType - } else { - console.log('user not set') } - } - if (this._postEvent.Attendees != null) { const result = this.participantsPipe.transform(this._postEvent.Attendees) this.taskParticipants = result.taskParticipants @@ -149,7 +192,6 @@ export class EditEventPage implements OnInit { this.initCalendarName = this._postEvent.CalendarName; - this.getRecurrenceTypes(); setTimeout(() => { this._postEvent.EventRecurrence.Type = this._postEvent.EventRecurrence.Type.toString(); @@ -160,8 +202,6 @@ export class EditEventPage implements OnInit { this.CalendarNameOwnerName = this.eventsService.detectCalendarNameByCalendarId(this._postEvent.CalendarId) this.changeAgenda() - - } @@ -170,8 +210,8 @@ export class EditEventPage implements OnInit { } myInterval = setInterval(() => { - document.querySelectorAll('.ngx-mat-timepicker input').forEach((e :any) => { - if(e) { + document.querySelectorAll('.ngx-mat-timepicker input').forEach((e: any) => { + if (e) { e.disabled = true; } }) @@ -190,21 +230,15 @@ export class EditEventPage implements OnInit { this.deleteTemporaryData(); } - getRecurrenceTypes() { - this.eventsService.getRecurrenceTypes().subscribe(res=>{ - - this.recurringTypes = res; - }); - } runValidation() { - this.validateFrom = true + this.validateFrom = true } injectValidation() { - if (typeof(this._postEvent.EventRecurrence.Type) == 'number') { + if (typeof (this._postEvent.EventRecurrence.Type) == 'number') { const str: any = this._postEvent.EventRecurrence.Type.toString() this._postEvent.EventRecurrence.Type = str } @@ -221,13 +255,13 @@ export class EditEventPage implements OnInit { Categories: new FormControl(this._postEvent.Category, [ Validators.required ]), - dateOccurrence: new FormControl(this._postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok']: this._postEvent.EventRecurrence.LastOccurrence && new Date(this._postEvent.EventRecurrence.LastOccurrence).getTime() > new Date(this._postEvent.EndDate).getTime() ? 'ok': null, [ + dateOccurrence: new FormControl(this._postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok'] : this._postEvent.EventRecurrence.LastOccurrence && new Date(this._postEvent.EventRecurrence.LastOccurrence).getTime() > new Date(this._postEvent.EndDate).getTime() ? 'ok' : null, [ Validators.required ]), participantes: new FormControl(this.taskParticipants, [ // Validators.required ]), - Date: new FormControl( true,[ + Date: new FormControl(true, [ Validators.required ]), @@ -237,7 +271,7 @@ export class EditEventPage implements OnInit { openInicio() { let input: any = document.querySelector('#new-inicio') - if(input) { + if (input) { input.click() } @@ -245,14 +279,14 @@ export class EditEventPage implements OnInit { openFim() { let input: any = document.querySelector('#new-fim') - if(input) { + if (input) { input.click() } } openLastOccurrence() { let input: any = document.querySelector('#last-occurrence') - if(input) { + if (input) { input.click() } } @@ -262,7 +296,7 @@ export class EditEventPage implements OnInit { const minutes = date.getMinutes(); date.setSeconds(0); - if(minutes % 15 != 0) { + if (minutes % 15 != 0) { if (minutes > 45) { date.setMinutes(60) @@ -279,39 +313,39 @@ export class EditEventPage implements OnInit { return date } - roundTimeQuarterHourPlus15(date:Date) { + roundTimeQuarterHourPlus15(date: Date) { const _date = new Date(date); - const minutes = _date .getMinutes(); - _date .setMinutes(minutes + 15) + const minutes = _date.getMinutes(); + _date.setMinutes(minutes + 15) return _date } - onSelectedRecurringChanged(ev:any){ + onSelectedRecurringChanged(ev: any) { this.calculetedLastOccurrence(ev); - if(ev.length > 1){ + if (ev.length > 1) { this._postEvent.EventRecurrence.Type = ev.filter(data => data != '-1'); } - if(ev.length == 0){ + if (ev.length == 0) { this._postEvent.EventRecurrence.Type = "-1"; } } - calculetedLastOccurrence(type:number){ + calculetedLastOccurrence(type: number) { var valor; var opcao: boolean; if (type == 0) { valor = 7; opcao = true; - } else if(type == 1){ + } else if (type == 1) { valor = 30; opcao = true; - } else if(type == 2){ + } else if (type == 2) { valor = 1; opcao = false; - }else if(type == 3){ + } else if (type == 3) { valor = 5; opcao = false; } @@ -319,7 +353,7 @@ export class EditEventPage implements OnInit { } - defineLastOccurrence(valor:number, opcao:boolean){ + defineLastOccurrence(valor: number, opcao: boolean) { var time = new Date(this._postEvent.EndDate); if (opcao == true) { time.setDate(time.getDate() + valor); @@ -337,113 +371,161 @@ export class EditEventPage implements OnInit { } + async validationEditAllEvent() { - async save() { + if (this.postEvent.IsRecurring ) { + const modal = await this.modalController.create({ + component: EventRecurrencePage, + componentProps: {}, + cssClass: 'event-recurrence-modal', + }); + + modal.onDidDismiss().then((res) => { + + const data: EventRecurrenceComponentReturn = res.data + if(data =='EditAll') { + this.editAllEvent = true + } else if (data == 'EditOne') { + this.editAllEvent = false + } else if(data == 'Cancel') { + this.close() + } else { + this.close() + } + }); + + await modal.present(); + } + + } + + @XTracerAsync({name:'desktop/edit-event', bugPrint: true, daley: 4000}) + async save_v2(tracing?: TracingType) { this.injectValidation() this.runValidation() - if(this.Form.invalid) { + if (this.Form.invalid) { return false } + const serverCurrentList = this._postEvent.Attendees + this._postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); - this._postEvent.Subject = /* this.domSanitizeService.sanitizeInput( */this._postEvent.Subject/* ) */; - this._postEvent.Location = /* this.domSanitizeService.sanitizeInput( */this._postEvent.Location/* ) */; - this._postEvent.Body.Text = /* this.domSanitizeService.sanitizeInput( */this._postEvent.Body.Text/* ) */; - if(!this._postEvent.EventRecurrence.hasOwnProperty('Type')) { - this._postEvent.EventRecurrence.Type = '-1' - } else { - - } - - if(this._postEvent.EventRecurrence.Type == undefined) { - this._postEvent.EventRecurrence.Type = '-1' - } - - this.showLoader = true; try { - if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') { - await this.eventsService.editEvent(this._postEvent, 2, 3).toPromise() - if(this.initCalendarName != this._postEvent.CalendarName) { - let body = { - "EventId": this._postEvent.EventId, - "CalendarDestinationName": this._postEvent.CalendarName, + + const calendar = await this.agendaDataRepository.getCalendarByUserId(this.selectedUserCalendar) + + if(calendar.isOk()) { + this.showLoader = true; + const value = await this.agendaDataRepository.updateEvent(this._postEvent.EventId, this._postEvent, this.editAllEvent, calendar.value, tracing) + + if(value.isOk()) { + console.log(value.value) + + this.httpErrorHandle.httpsSucessMessagge('Editar evento') + this.clearPostEvent.emit(); + this.deleteTemporaryData(); + this.showLoader = false; + + tracing + } else { + console.log('edit event error: ', value.error) + tracing.setAttribute('outcome', 'failed') + } + + + const { insert, remove } = AttendeesLIstChangeDetector(serverCurrentList as any, this._postEvent.Attendees as any) + + console.log({ insert, remove }); + + if(insert.length >= 1) { + try { + await this.agendaDataRepository.addEventAttendee(this._postEvent.EventId, insert, tracing).toPromise() + } catch (error) { + tracing.setAttribute('failed.attendees', 'true') + console.log('add Attendee error: ', error) } + // let a = this.agendaDataRepository.addEventAttendee(this._postEvent.EventId, insert, tracing).subscribe((value) => { + // console.log(value) + // }, ((error) => { + // tracing.setAttribute('failed.attendees', 'true') + // console.log('add Attendee error: ', error) + // })); + + } + + if(remove.length >= 1) { try { - await this.eventsService.changeAgenda(body).toPromise(); - } catch (e) {} + await this.agendaDataRepository.removeEventAttendee(this._postEvent.EventId, remove).toPromise() + } catch (error) { + tracing.setAttribute('failed.attendees', 'true') + console.log('add Attendee error: ', error) + } + + // this.agendaDataRepository.removeEventAttendee(this._postEvent.EventId, remove).subscribe((value) => { + // console.log(value) + // }, ((error) => { + // tracing.setAttribute('failed.attendees', 'true') + // console.log('add Attendee error: ', error) + // })); + } - this.showLoader = false; - this.httpErrorHandle.httpsSucessMessagge('Editar evento') + + + if (this.addedAttachmentsList.length >= 1) { + try { + await this.agendaDataRepository.addEventAttachment(this._postEvent.EventId, this.loadedEventAttachments, tracing).toPromise() + } catch (error) { + this.showLoader = false + tracing.setAttribute('failed.add.attachment', 'true') + console.log('add attachment error: ', error) + } + + // this.agendaDataRepository.addEventAttachment(this._postEvent.EventId, this.loadedEventAttachments, tracing).subscribe((value) => { + // console.log(value) + // }, ((error) => { + // this.showLoader = false + // tracing.setAttribute('failed.add.attachment', 'true') + // console.log('add attachment error: ', error) + // })); + } + + if (this.deletedAttachmentsList.length >= 1) { + try { + await this.agendaDataRepository.removeEventAttachment(this._postEvent.EventId, { attachments: this.deletedAttachmentsList }).toPromise() + } catch (error) { + this.showLoader = false + console.log('remove attachment error: ', error) + } + + // this.agendaDataRepository.removeEventAttachment(this._postEvent.EventId, { attachments: this.deletedAttachmentsList }).subscribe((value) => { + // console.log(value) + // }, ((error) => { + // this.showLoader = false + // console.log('remove attachment error: ', error) + // })); + } + + this.close(); } else { - await this.eventsService.editEvent(this._postEvent, 2, 3, this._postEvent.CalendarId).toPromise() - if(this.initCalendarName != this._postEvent.CalendarName) { - let body = { - "EventId": this._postEvent.EventId, - "CalendarDestinationName": this._postEvent.CalendarName, - } - - try { - await this.eventsService.changeAgenda(body).toPromise(); - } catch (e) {} - } - this.showLoader = false; - this.httpErrorHandle.httpsSucessMessagge('Editar evento') + console.log('this.selectedUserCalendar', this.selectedUserCalendar) + console.log(calendar.error) } - } catch(error) { - this.showLoader = false - this.httpErrorHandle.httpStatusHandle(error) - } - this.clearPostEvent.emit(); - this.deleteTemporaryData(); - - await this.saveDocument() - - this.close(); - } - - - async saveDocument() { - - - try { - - for( let e of this.loadedEventAttachments) { - const id: any = e.Id - const remove = e['remove'] - - if ( id == 'add') { - //data.selected - const DocumentToSave = { - SourceTitle: e.SourceName, - ParentId: this._postEvent.EventId, - Source: '1', - SourceId: e.SourceId, - ApplicationId: e.ApplicationId.toString(), - Id: '0', - Link: '', - SerialNumber: '', - }; - - // await this.attachmentsService.setEventAttachmentById(DocumentToSave).toPromise(); - - } else if(remove) { - await this.attachmentsService.deleteEventAttachmentById(e.Id).toPromise() - } - } } catch (error) { - + this.httpErrorHandle.httpStatusHandle(error) + console.log('edit: ', error) } } + async addParticipants() { this.saveTemporaryData(); @@ -466,6 +548,17 @@ export class EditEventPage implements OnInit { this.clearContact.emit(); } + onDateChange(e) { + + const cloneDateStartDate = new Date(this._postEvent.StartDate); + const cloneDateEndDate = new Date(this._postEvent.EndDate); + + if(cloneDateStartDate.getTime() >= cloneDateEndDate.getTime()) { + cloneDateStartDate.setHours(cloneDateStartDate.getHours() + 1); + this._postEvent.EndDate = cloneDateStartDate + } + + } saveTemporaryData() { @@ -473,15 +566,15 @@ export class EditEventPage implements OnInit { postEvent: this._postEvent, eventBody: this.eventBody, segment: this.segment, - loadedEventAttachments: this.loadedEventAttachments + loadedEventAttachments: this.loadedEventAttachments, } } restoreTemporaryData(): boolean { - const restoredData = window['temp.path:/home/agenda/edit-event.component.ts'] + const restoredData = window['temp.path:/home/agenda/edit-event.component.ts'] - if(JSON.stringify(restoredData) != "{}" && undefined != restoredData){ + if (JSON.stringify(restoredData) != "{}" && undefined != restoredData) { this._postEvent = restoredData.postEvent this.eventBody = restoredData.eventBody this.segment = restoredData.segment @@ -494,34 +587,22 @@ export class EditEventPage implements OnInit { } - deleteTemporaryData(){ + deleteTemporaryData() { window['temp.path:/home/agenda/edit-event.component.ts'] = {} } - async getAttachments(eventId: string){ - if(this._postEvent.HasAttachments) { - let rest: any; - try { - rest = this.attachmentsService.getAttachmentsById(eventId).toPromise() - } catch (error) { - console.error('getAttchment', error) - } - this.loadedEventAttachments = rest; - } - } - deleteAttachment(attachmentID: string, index) { + const indexToRemove = index; // Assuming you already know the index you want to remove - const id: any = this.loadedEventAttachments[index].Id - - if(id == 'add') { - this.loadedEventAttachments = this.loadedEventAttachments.filter((e,i)=> i!=index) - } else { - this.loadedEventAttachments[index]['remove'] = true + const DocumentId: any = this.loadedEventAttachments[index].Id + if (indexToRemove > -1 && indexToRemove < this.loadedEventAttachments.length) { + this.loadedEventAttachments.splice(indexToRemove, 1); } + this.deletedAttachmentsList.push(DocumentId) } + async getDoc() { const modal = await this.modalController.create({ @@ -529,20 +610,22 @@ export class EditEventPage implements OnInit { cssClass: 'modal-width-100-width-background modal', componentProps: { type: 'AccoesPresidenciais & ArquivoDespachoElect', + eventAgenda: true, showSearchInput: true, select: true, } }); - modal.onDidDismiss().then( async (res) => { - if(res) { + modal.onDidDismiss().then(async (res) => { + if (res) { const data = res.data; + console.log('Get Doc', data.selected) - const ApplicationIdDocumentToSave: any = { + /* const ApplicationIdDocumentToSave: any = { SourceName: data.selected.Assunto, ParentId: this._postEvent.EventId, SourceId: data.selected.Id, - Stakeholders: data.selected.Stakeholders | data.selected.EntidadeOrganicaNome, + Stakeholders: data.selected.EntidadeOrganicaNome | data.selected.Stakeholders, ApplicationId: data.selected.ApplicationType.toString(), CreateDate: data.selected.Data, Id: 'add', @@ -550,9 +633,26 @@ export class EditEventPage implements OnInit { Source: '1', Link: '', SerialNumber: '', + }*/ + + console.log({data}) + + let newDocObject: SearchList_v2 & {ApplicationId: any} = { + docId: data.selected.docId, + sourceName: data.selected.sourceName, + description: data.selected.description, + applicationId: data.selected.applicationId, + classificator: data.selected.classificator, + dateEntry: data.selected.dateEntry, + docNumber: data.selected.docNumber, + subject: data.selected.subject, + userId: data.selected.userId, + ApplicationId: data.selected.applicationId + } - this.loadedEventAttachments.push(ApplicationIdDocumentToSave) + this.loadedEventAttachments.push(data.selected) + this.addedAttachmentsList.push(data.selected) } }); @@ -561,39 +661,87 @@ export class EditEventPage implements OnInit { } - changeAgenda() { + async changeAgenda() { - setTimeout(() => { + const result = await this.agendaDataRepository.geCalendars() - if(this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Oficial'] && this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Pessoal']) { + const selectedCalendar = result.find(e => e.wxUserId == this.selectedUserCalendar) - this.CalendarNamesOptions = ['Oficial', 'Pessoal'] - - } else if (this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Oficial']) { + if(selectedCalendar) { + if(selectedCalendar.shareType == 1) { this.CalendarNamesOptions = ['Oficial'] - this._postEvent.CalendarName = 'Oficial' - - } else if (this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Pessoal']) { + } else if(selectedCalendar.shareType == 2) { this.CalendarNamesOptions = ['Pessoal'] - this._postEvent.CalendarName = 'Pessoal' - - } else { + } else if (selectedCalendar.shareType == 3) { this.CalendarNamesOptions = ['Oficial', 'Pessoal'] } - }, 50) + } } - ajustMinuts(string) { - var partes = string.split(' '); - var horaMinuto = partes[1].split(':'); - if (horaMinuto[1] === '59') { - horaMinuto[1] = '00'; - var novaString = partes[0] + ' ' + horaMinuto.join(':'); + onCheckboxChange(event: any) { + console.log(this.postEvent.CalendarId) + if (this.allDayCheck) { + this.postEvent.IsAllDayEvent = this.allDayCheck; + this.postEvent.StartDate = this.setAlldayTime(this.postEvent.StartDate) + this.postEvent.EndDate = this.setAlldayTimeEndDate(this.postEvent.EndDate) - return novaString; + console.log('Recurso ativado!!'); + } else { + this.postEvent.IsAllDayEvent = this.allDayCheck; + this.postEvent.EndDate = this.setAlldayTimeEndDateNotAlday(this.postEvent.EndDate) + console.log('Recurso desativado'); + + } } - return string; + + setAlldayTime(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(0) + date.setMinutes(0) + date.setSeconds(0); + + + return date + } + + setAlldayTimeEndDate(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(23) + date.setMinutes(59) + date.setSeconds(0); + + + return date + } + + setAlldayTimeEndDateNotAlday(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(23) + date.setMinutes(0) + date.setSeconds(0); + + + return date + } + + setEventType(eventType) { + + if(typeof eventType == 'number') { + var selectedEventType = { + 1: 'Meeting', + 2: 'Travel', + 3: 'Conference', + 4: 'Encontro' + } + return selectedEventType[eventType]; + } else { + return this._postEvent.Category + } + } } diff --git a/src/app/shared/agenda/event-list/event-list.page.html b/src/app/shared/agenda/event-list/event-list.page.html index 53506cdc8..fd1c5f3f3 100644 --- a/src/app/shared/agenda/event-list/event-list.page.html +++ b/src/app/shared/agenda/event-list/event-list.page.html @@ -1,41 +1,35 @@
-
Eventos para Aprovação
+
Eventos para aprovação
- - - - -
- - Minha agenda + + + +
+
AGENDA DO PR
+
AGENDA DO MDGPR
+
Agenda {{calendars.wxFullName}}
+
+ Minha agenda +
+
+ +
+
{{ environment.agendaPR}}
+
{{ environment.agendaVP}}
+
Agenda {{calendars.wxFullName}}
+
+ Minha agenda +
-
{{ environment.agendaPR}}
-
{{ environment.agendaVP}}
-
Agenda do {{calendars.Fullname}}
- -
Minha agenda
-
{{ environment.agendaPR}}
-
{{ environment.agendaVP}}
-
Agenda do {{calendars.Fullname}}
-
- - -
Minha agenda
-
{{ environment.agendaPR}}
-
{{ environment.agendaVP}}
-
Agenda do {{calendars.Fullname}}
-
@@ -54,29 +48,33 @@
-
+

{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}

{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}

+
+

Todo

+

o dia

+

{{event.workflowInstanceDataFields.Subject}}

{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}

{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}

- +
{{ event.activityInstanceName }}
-
+
- + diff --git a/src/app/shared/agenda/event-list/event-list.page.ts b/src/app/shared/agenda/event-list/event-list.page.ts index 345422ef7..8131f0752 100644 --- a/src/app/shared/agenda/event-list/event-list.page.ts +++ b/src/app/shared/agenda/event-list/event-list.page.ts @@ -9,7 +9,16 @@ import { SessionStore } from 'src/app/store/session.service'; import { EventsService } from 'src/app/services/events.service'; import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service'; import { environment } from 'src/environments/environment'; - +import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service'; +import { EventToApproveList } from 'src/app/models/entiry/agenda/eventToApproveList'; +import { RoleIdService } from 'src/app/services/role-id.service' +import { map } from 'rxjs/operators'; +import { Observable } from 'rxjs'; +import { TableSharedCalendar } from 'src/app/module/agenda/data/data-source/agenda-local-data-source.service'; +import { EEventFilterStatus } from 'src/app/module/agenda/data/dto/enums'; +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; +import { isHttpError } from 'src/app/services/http.service'; +import { ToastService } from 'src/app/services/toast.service'; @Component({ selector: 'app-event-list', templateUrl: './event-list.page.html', @@ -19,7 +28,7 @@ export class EventListPage implements OnInit { // [desktop] event list to approve showLoader: boolean; - eventsList: any = [] + eventsList: EventToApproveList = [] eventPerson: EventPerson; eventBody: EventBody; @@ -36,35 +45,54 @@ export class EventListPage implements OnInit { @Input() showComponent:string; @Output() cloneAllmobileComponent = new EventEmitter(); @Output() approveEventDismiss = new EventEmitter(); - + sharedCalendar: Observable + selectedUserCalendar:any; constructor( private processes:ProcessesService, private router: Router, private sortService: SortService, public eventService: EventsService, + public AgendaDataRepositoryService: AgendaDataRepositoryService, + public RoleIdService: RoleIdService, + private toastService: ToastService, ) { this.loggeduser = SessionStore.user; + + // Define the role priorities + const rolePriorities: { [key: number]: number } = { + 100000014: 1, // Presidente da República + 100000011: 2, // Vice Presidente (example role ID) + // Add other roles with their priorities here + }; + + this.sharedCalendar = this.AgendaDataRepositoryService.getShareCalendarItemsLive().pipe( + map(data => data.sort((a, b) => { + console.log('Raw data:', data); // Debug line + const priorityA = rolePriorities[a.roleId] || Infinity; + const priorityB = rolePriorities[b.roleId] || Infinity; + return priorityA - priorityB; + })) + ) + + this.setCalendarByDefault() + } - ngAfterViewInit(): void { - this.eventService.onCalendarFinishLoad.subscribe(() => { - if(!this.segment) { - if(this.eventService.calendarNamesAry.includes('Meu calendario')) { - this.segment = 'Meu calendario'; - } else { - this.segment = this.eventService.calendarNamesAry[0].OwnerUserId - } - - // select pr by default - const pr = this.eventService.calendarNamesAry.find( e => e.Role == 'Presidente da República') - if(pr) { - this.segment = pr.OwnerUserId - } - } - }) + async setCalendarByDefault() { + const data = await this.AgendaDataRepositoryService.geCalendars() + + const prObject = data.find(e => e?.roleId == 100000014) + + if(prObject) { + this.selectedUserCalendar = prObject.wxUserId + } else { + this.selectedUserCalendar = SessionStore.user.UserId + } } + ngAfterViewInit(): void {} + ngOnInit() { const pathname = window.location.pathname @@ -91,61 +119,68 @@ export class EventListPage implements OnInit { return new Date(e).toDateString() } + @XTracerAsync({name:'EventListPageShared/LoadToApproveEvents', bugPrint: true}) + async LoadToApproveEvents(tracing?: TracingType) { - - async LoadToApproveEvents() { - - - /* if(SessionStore.user.Profile == 'PR') { - return false - } */ - this.showLoader = true; + const segment = this.selectedUserCalendar - const segment: any = this.segment - if(this.segment == 'Meu calendario') { + let userId; + + if(this.selectedUserCalendar == SessionStore.user.UserId) { // color - if(SessionStore.user.Profile == 'PR') { this.color = 'pr' } else { this.color = 'mdgpr' } + userId = SessionStore.user.UserId - let genericEvents = await this.processes.eventsToApprove(SessionStore.user.UserId,'mobile agenda').toPromise() - try { - this.eventsList = this.sortService.sortArrayByDate(genericEvents).reverse(); - } catch (error) { - this.eventsList = []; - this.showLoader = false; - } - - this.eventoaprovacaostore.save(segment, this.eventsList) - } else if(segment) { - // console.log('segment', segment) - this.color = 'pr' - let allEvents = await this.processes.eventsToApprove(segment,'agenda desktop').toPromise() - try { - this.eventsList = this.sortService.sortArrayByDate(allEvents).reverse(); - } catch(error) { - this.eventsList = [] - this.showLoader = false; - } - - this.eventsList = this.eventsList - this.eventsList = this.eventsList - this.eventoaprovacaostore.save(segment, this.eventsList) + userId = this.selectedUserCalendar } - this.showLoader = false; + if(userId) { + let allEvents = await this.AgendaDataRepositoryService.eventToApproveList({ + userId, + status: EEventFilterStatus.Pending + }, tracing) + if(allEvents.isOk()) { + + tracing.setAttribute('outcome', 'success') + + if(allEvents.value.length >= 1) { + this.eventsList = this.sortService.sortArrayByDate(allEvents.value).reverse(); + this.eventoaprovacaostore.save(this.selectedUserCalendar, this.eventsList) + } else { + this.eventoaprovacaostore.save(this.selectedUserCalendar, []) + } + } else { + + tracing.setAttribute('outcome', 'failed') + + if(!isHttpError(allEvents.error)) { + this.toastService._badRequest('Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico. #3') + console.log(allEvents.error) + } + + this.eventsList = []; + } + + this.showLoader = false; + } else { + tracing.setAttribute('run', 'to early') + console.warn('calling to early eventlistpageshared/loadtoapproveevents') + } + + } async LoadToApproveEventsNoLoader() { - + this.LoadToApproveEvents() } @@ -165,7 +200,7 @@ export class EventListPage implements OnInit { doRefresh(event) { this.LoadToApproveEvents(); - + setTimeout(() => { try { event?.target?.complete(); @@ -174,7 +209,7 @@ export class EventListPage implements OnInit { } close() { - + this.cloneAllmobileComponent.emit(); } diff --git a/src/app/shared/agenda/new-event/new-event.page.html b/src/app/shared/agenda/new-event/new-event.page.html index a0c124df4..04bf3c6e0 100644 --- a/src/app/shared/agenda/new-event/new-event.page.html +++ b/src/app/shared/agenda/new-event/new-event.page.html @@ -30,7 +30,7 @@
-
+
@@ -38,19 +38,23 @@
- +
PR
+
+ Minha agenda +
- - -
{{ environment.agendaPR}}
-
{{ environment.agendaVP}}
-
Agenda do {{calendars.Fullname}}
-
Minha agenda
+ + + + +
PR
+
AGENDA DO MDGPR
+
Agenda do {{calendars.wxFullName}}
+
+ Minha agenda +
+
@@ -104,13 +108,13 @@ - + Reunião - + Viagem - + Conferência @@ -124,6 +128,77 @@
+
+ + Todo dia + + +
+
+ +
+
+
+ +
+
+ + + + + + Nunca + + + Diário + + + Semanalmente + + + Mensal + + + Anual + + + + +
+
+
+ +
+
+
+ +
+ +
+ + + + + + + + +
+
+
+ +
@@ -136,6 +211,7 @@ placeholder="Data Inicio*" [(ngModel)]="postEvent.StartDate" [disabled]="disabled" + (ngModelChange)="onDateChange($event)" > @@ -152,7 +229,38 @@
-
+
+
+
+ +
+ +
+ + + + + + + + +
+
+
+ +
@@ -175,6 +283,39 @@ [showSeconds]="showSeconds" [stepHour]="stepHour" [stepMinute]="stepMinute" [stepSecond]="stepSecond" + [hideTime]="true" + > + + + +
+
+
+ +
+
+
+ +
+ +
+ + + + + @@ -207,7 +348,7 @@
--> -
+
@@ -317,14 +458,15 @@

- {{document.Assunto}} - {{ TaskService.attachmentAppName(document)}} - {{document.appName}} + {{document.subject}} + Correspondência + Acções Presidenciais + Arquivo Despacho Electrónico

-

{{(document.EntidadeOrganicaNome || document.Sender)}} {{(document.Data || document.DocDate) | date: 'dd-MM-yyyy HH:mm'}}

+

{{(document.EntidadeOrganicaNome || document.Sender)}} {{(document.dateEntry) | date: 'dd-MM-yyyy HH:mm'}}

@@ -336,16 +478,16 @@
-
+ - diff --git a/src/app/shared/agenda/new-event/new-event.page.ts b/src/app/shared/agenda/new-event/new-event.page.ts index 0a8cefb74..bd23e7db9 100644 --- a/src/app/shared/agenda/new-event/new-event.page.ts +++ b/src/app/shared/agenda/new-event/new-event.page.ts @@ -2,41 +2,37 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; import { EventBody } from 'src/app/models/eventbody.model'; import { EventPerson } from 'src/app/models/eventperson.model'; import { EventsService } from 'src/app/services/events.service'; -import { AttachmentsService } from 'src/app/services/attachments.service'; import { Event } from 'src/app/models/event.model'; import { ModalController } from '@ionic/angular'; import { removeDuplicate } from 'src/plugin/removeDuplicate.js' import { SearchPage } from 'src/app/pages/search/search.page'; -import { SearchList } from "src/app/models/search-document"; -import { EventAttachment } from 'src/app/models/attachment.model'; - +import { SearchList_v2 } from "src/app/models/search-document"; import { ToastService } from 'src/app/services/toast.service'; import { LoginUserRespose } from 'src/app/models/user.model'; - import { DateAdapter } from '@angular/material/core'; import * as _moment from 'moment'; import * as _rollupMoment from 'moment'; import { FormControl } from '@angular/forms'; import { NgxMatDateFormats } from '@angular-material-components/datetime-picker'; import { ThemePalette } from '@angular/material/core'; - import { ViewChild } from '@angular/core'; import { FormGroup, Validators } from '@angular/forms'; import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker'; import { ThemeService } from 'src/app/services/theme.service' -import { ChatMethodsService } from 'src/app/services/chat/chat-methods.service'; -import { ServerConnectionService } from 'src/app/services/server-connection.service'; import { SessionStore } from 'src/app/store/session.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { environment } from 'src/environments/environment'; import { EventToAprove } from 'src/app/models/eventToAprove.model'; -import { ProcessesService } from 'src/app/services/processes.service'; -import { Subject } from 'rxjs'; - +import { Observable } from 'rxjs'; import { TaskService } from 'src/app/services/task.service' -import { ContactsService } from 'src/app/services/contacts.service'; -import { DomSanitizerService } from 'src/app/services/DomSanitizer.service'; import { ChangeProfileService } from 'src/app/services/change-profile.service'; +import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service'; +import { RoleIdService } from 'src/app/services/role-id.service' +import { TableSharedCalendar } from 'src/app/module/agenda/data/data-source/agenda-local-data-source.service'; +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; +import { ContactRepositoryService } from 'src/app/services/Repositorys/contacts/repository/contacts-repository.service'; +import { UserList } from 'src/app/models/entiry/agenda/contact'; + const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { parse: { @@ -80,6 +76,7 @@ export class NewEventPage implements OnInit { selectedRecurringType: any; loggedAttendDad: boolean = true; mostrarModal = false; + eventRecurence = 'never' @Input() attendees: [] @Input() profile: string; @@ -87,7 +84,7 @@ export class NewEventPage implements OnInit { @Input() selectedSegment: string; @Input() selectedDate: Date; @Input() CalendarDate: Date; - @Input() taskParticipants: EventPerson[] = []; + @Input() taskParticipants: UserList = []; @Input() taskParticipantsCc: any = []; @Output() setIntervenient = new EventEmitter(); @@ -102,7 +99,7 @@ export class NewEventPage implements OnInit { @Output() cloneAllmobileComponent = new EventEmitter(); @Output() backToChat = new EventEmitter(); - documents: SearchList[] = []; + documents: SearchList_v2[] = []; loggeduser: LoginUserRespose; @ViewChild('picker') picker: any; @@ -133,48 +130,74 @@ export class NewEventPage implements OnInit { CalendarNamesOptions = ['Oficial', 'Pessoal'] environment = environment - eventPersons: EventPerson[]; - contacts: EventPerson[] = []; + eventPersons: UserList; + contacts: UserList = []; + allDayCheck: boolean = false; + + sharedCalendar: Observable + selectedUserCalendar:any; + SessionStore = SessionStore + hasChangeCalendar = false constructor( private modalController: ModalController, public eventService: EventsService, - private attachmentsService: AttachmentsService, private toastService: ToastService, private dateAdapter: DateAdapter, public ThemeService: ThemeService, - private chatMethodService: ChatMethodsService, private hhtpErrorHandle: HttpErrorHandle, - private processeService: ProcessesService, public TaskService: TaskService, - private contactsService: ContactsService, - private domSanitazerService: DomSanitizerService, private changeProfileService: ChangeProfileService, + private agendaDataRepository: AgendaDataRepositoryService, + public RoleIdService: RoleIdService, + private ContactRepositoryService: ContactRepositoryService ) { this.dateAdapter.setLocale('pt'); this.loggeduser = SessionStore.user; this.postEvent = new Event(); + this.sharedCalendar = this.agendaDataRepository.getShareCalendarItemsLiveWithOrder() + + } + + + hasPrCalendar(data: TableSharedCalendar[]) { + for(const e of data) { + if(e.roleId == this.RoleIdService.PRES) { + return true + } + } + + return false + } + + async setCalendarByDefault(force) { + if (!this.selectedUserCalendar || force) { + + const data = await this.agendaDataRepository.geCalendars() + + const prObject = data.find(e => e?.roleId == 100000014) + if(prObject) { + this.selectedUserCalendar = prObject.wxUserId + } else { + this.selectedUserCalendar = SessionStore.user.UserId + } + + this.changeAgenda() + + } } ngOnInit() { - console.log(' INTERVENIENTES',this.taskParticipants) this.changeProfileService.registerCallback(() => { this.initializeData() }) - if (!this.CalendarName) { - if (this.eventService.calendarNamesAry.includes('Meu calendario')) { - this.CalendarName = 'Meu calendario'; - } else { - this.CalendarName = this.eventService.calendarNamesAry[0] - } - } - this.getRecurrenceTypes(); if (!this.restoreTemporaryData()) { // clear + this.setCalendarByDefault(true) this.eventBody = { BodyType: "1", Text: "" }; this.postEvent.Body = this.eventBody; @@ -183,13 +206,13 @@ export class NewEventPage implements OnInit { if (this.postEvent.Attendees != null) { this.postEvent.Attendees.forEach(e => { if (e.IsRequired) { - this.taskParticipants.push(e); + this.taskParticipants.push(e as any); } else { this.taskParticipantsCc.push(e); } }) } - console.log('Attendes',this.taskParticipants) + console.log('Attendes', this.taskParticipants) this.taskParticipants = removeDuplicate(this.taskParticipants); this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc); @@ -226,9 +249,12 @@ export class NewEventPage implements OnInit { AppointmentState: 0, TimeZone: '', Organizer: '', - Category: 'Reunião', + Category: 'Meeting', HasAttachments: false, - EventRecurrence: { Type: '-1', LastOccurrence: this.autoEndTime }, + EventRecurrence: { + frequency: this.eventRecurence, until: "", + Type: '' + }, }; } else { @@ -248,9 +274,10 @@ export class NewEventPage implements OnInit { AppointmentState: 0, TimeZone: '', Organizer: '', - Category: 'Reunião', + Category: 'Meeting', HasAttachments: false, - EventRecurrence: { Type: '-1', LastOccurrence: this.autoEndTime }, + EventRecurrence: { frequency: this.eventRecurence, until: "", + Type: '' }, } } } @@ -324,10 +351,10 @@ export class NewEventPage implements OnInit { injectValidation() { - if (typeof (this.postEvent.EventRecurrence.Type) == 'number') { + /* if (typeof (this.postEvent.EventRecurrence.Type) == 'number') { const str: any = this.postEvent.EventRecurrence.Type.toString() this.postEvent.EventRecurrence.Type = str - } + } */ this.Form = new FormGroup({ Subject: new FormControl(this.postEvent.Subject, [ @@ -347,11 +374,11 @@ export class NewEventPage implements OnInit { dateEnd: new FormControl(this.postEvent.EndDate, [ Validators.required ]), - dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok'] : this.postEvent.EventRecurrence.LastOccurrence && new Date(this.postEvent.EventRecurrence.LastOccurrence).getTime() > new Date(this.postEvent.EndDate).getTime() ? 'ok' : null, [ + /* dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok'] : this.postEvent.EventRecurrence.LastOccurrence && new Date(this.postEvent.EventRecurrence.LastOccurrence).getTime() > new Date(this.postEvent.EndDate).getTime() ? 'ok' : null, [ Validators.required - ]), + ]), */ participantes: new FormControl(this.taskParticipants, [ - // Validators.required + Validators.required ]), Date: new FormControl(new Date(this.postEvent.StartDate).getTime() < new Date(this.postEvent.EndDate).getTime() ? 'ok' : null, [ Validators.required @@ -376,34 +403,28 @@ export class NewEventPage implements OnInit { } } - changeAgenda() { + + changeSegmentCalendar() { + this.hasChangeCalendar = true + } + + async changeAgenda() { this.CalendarNameShow = false - setTimeout(() => { + const result = await this.agendaDataRepository.geCalendars() - this.CalendarNameShow = true + const selectedCalendar = result.find(e => e.wxUserId == this.selectedUserCalendar) - if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) { - - this.CalendarNamesOptions = ['Oficial', 'Pessoal'] - console.log(this.postEvent.CalendarName) - - } else if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial']) { + if(selectedCalendar) { + if(selectedCalendar.shareType == 1) { this.CalendarNamesOptions = ['Oficial'] - this.postEvent.CalendarName = 'Oficial' - console.log(this.postEvent.CalendarName) - - } else if (this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) { + } else if(selectedCalendar.shareType == 2) { this.CalendarNamesOptions = ['Pessoal'] - this.postEvent.CalendarName = 'Pessoal' - console.log(this.postEvent.CalendarName) - - } else { + } else if (selectedCalendar.shareType == 3) { this.CalendarNamesOptions = ['Oficial', 'Pessoal'] - console.log(this.postEvent.CalendarName) } - }, 50) + } } @@ -420,6 +441,7 @@ export class NewEventPage implements OnInit { cssClass: 'modal-width-100-width-background modal', componentProps: { type: 'AccoesPresidenciais & ArquivoDespachoElect', + eventAgenda: true, showSearchInput: true, select: true } @@ -428,7 +450,15 @@ export class NewEventPage implements OnInit { modal.onDidDismiss().then((res) => { if (res) { const data = res.data; + /* let newDocObject: SearchList_v2 = { + docId: parseInt(data.selected.Id), + sourceName: data.selected.Assunto, + description: "", + applicationId: data.selected.ApplicationType + } */ + console.log('get doc', data) this.documents.push(data.selected); + console.log('pushed') } }); @@ -506,407 +536,49 @@ export class NewEventPage implements OnInit { } - async save() { - + @XTracerAsync({name:'desktop/create-event', bugPrint: true}) + async save_v2(tracing?: TracingType) { this.injectValidation() this.runValidation() if (this.Form.invalid) { - if(new Date(this.postEvent.StartDate).getTime() < new Date(this.postEvent.EndDate).getTime()) { + if (new Date(this.postEvent.StartDate).getTime() < new Date(this.postEvent.EndDate).getTime()) { this.toastService._badRequest("Data de inicio menor que a data de fim") } return false } - this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); - this.postEvent.Subject = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Subject/* ); */ - this.postEvent.Location = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Location/* ); */ - this.postEvent.Body.Text = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Body.Text/* ); */ + let loader = this.toastService.loading(); + this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc) as any + this.postEvent.IsAllDayEvent = this.allDayCheck; + const calendar = await this.agendaDataRepository.getCalendarByUserId(this.selectedUserCalendar) + if(calendar.isOk()) { + const value = await this.agendaDataRepository.createEvent(this.postEvent, this.documents, calendar.value, tracing) - if (this.documents.length > 0) { - this.postEvent.HasAttachments = true; - } - - if (this.postEvent.EventRecurrence.Type == undefined) { - this.postEvent.EventRecurrence.Type = '-1' - } - - - if (this.loggeduser.Profile == 'MDGPR') { - const CalendarId = this.selectedCalendarId() - this.showLoader = true; - this.postEvent.CalendarId = CalendarId - - let loader = this.toastService.loading(); - - this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe( - async (id) => { - loader.remove() - this.showLoader = false - const eventId: any = id; - const DocumentToSave: EventAttachment[] = this.documents.map((e) => { - return { - SourceTitle: e.Assunto, - ParentId: eventId, - Source: '1', - SourceId: e.Id, - ApplicationId: e.ApplicationType.toString(), - Id: '', - Link: '', - SerialNumber: '' - }; - }); - await DocumentToSave.forEach((attachments, i) => { - this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => { - if (DocumentToSave.length == (i + 1)) { - this.afterSave(); - } - }); - }); - if (DocumentToSave.length == 0) { - this.afterSave(); - } - this.hhtpErrorHandle.httpsSucessMessagge('new event') - let data = { - "subject": this.postEvent.Subject, - "start": this.postEvent.StartDate, - "end": this.postEvent.EndDate, - "venue": this.postEvent.Location, - "id": id, - "calendarId": CalendarId - } - - if (this.roomId) { - this.chatMethodService.sendMessage(this.roomId, data); - } - - }, - error => { - loader.remove() - this.showLoader = false - this.hhtpErrorHandle.httpStatusHandle(error) - }); - - } - else if (this.loggeduser.Profile == 'PR') { - - const CalendarId = this.selectedCalendarId() - let loader = this.toastService.loading(); - this.postEvent.CalendarId = CalendarId - - this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe( - (id) => { - - loader.remove() - - const eventId: any = id; - - const DocumentToSave: EventAttachment[] = this.documents.map((e) => { - return { - SourceTitle: e.Assunto, - ParentId: eventId, - Source: '1', - SourceId: e.Id, - ApplicationId: e.ApplicationType.toString(), - Id: '', - Link: '', - SerialNumber: '' - }; - }); - - DocumentToSave.forEach((attachments, i) => { - this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => { - if (DocumentToSave.length == (i + 1)) { - this.afterSave(); - } - }); - }); - - if (DocumentToSave.length == 0) { - this.afterSave(); - } - this.hhtpErrorHandle.httpsSucessMessagge('new event') - let data = { - "subject": this.postEvent.Subject, - "start": this.postEvent.StartDate, - "end": this.postEvent.EndDate, - "venue": this.postEvent.Location, - "id": id, - "calendarId": CalendarId - } - if (this.roomId) { - this.chatMethodService.sendMessage(this.roomId, data); - } - }, (error) => { - - //const connectionToServer = this.ServerConnectionService.BaseAPI() - - this.hhtpErrorHandle.httpStatusHandle(error) - - loader.remove() - this.showLoader = false - - }); - - } else if (this.loggeduser.Profile == 'SGGPR') { - - console.log(this.postEventToAprove) - console.log(this.postEvent) - console.log(this.postEvent.CalendarName) - console.log(this.CalendarName) - console.log(this.eventService.calendarNamesAry) - const CalendarId = this.selectedCalendarId() - - let selectedCalendar - try { - selectedCalendar = this.eventService.calendarNamesAry.find(calendar => calendar.Fullname === this.CalendarName) - } catch (error) { - - } - console.log('selectedCalendar', selectedCalendar) - - if (selectedCalendar) { - if (selectedCalendar.Role = 'Presidente da República') { - let loader = this.toastService.loading(); - - const DocumentToSave: EventAttachment[] = this.documents.map((e) => { - return { - SourceTitle: e.Assunto, - ParentId: "AGD_" + this.loggeduser.UserName + "_" + this.processeService.generateInstaceFormatDate(), - Source: '1', - SourceId: e.Id, - ApplicationId: e.ApplicationType.toString(), - Id: '', - Link: '', - SerialNumber: '' - }; - }); - - let body = this.eventToaproveBody(this.postEvent, CalendarId, this.loggeduser.RoleID, this.loggeduser.UserId, DocumentToSave); - await this.processeService.createEventToAprove(this.postEvent.CalendarName, 'pr', body).subscribe((id) => { - loader.remove() - this.afterSave(); - this.hhtpErrorHandle.httpsSucessMessagge('new event to aprove') - - - - - /* DocumentToSave.forEach((attachments, i) => { - this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => { - if (DocumentToSave.length == (i + 1)) { - this.afterSave(); - } - }); - }); - - if (DocumentToSave.length == 0) { - this.afterSave(); - } */ - - }, (error) => { - loader.remove() - this.showLoader = false - this.hhtpErrorHandle.httpStatusHandle(error) - }); - - - - } else if (selectedCalendar.Role = 'Ministro e Director do Gabinete do PR') { - let loader = this.toastService.loading(); - - const DocumentToSave: EventAttachment[] = this.documents.map((e) => { - return { - SourceTitle: e.Assunto, - ParentId: "AGD_" + this.loggeduser.UserName + "_" + this.processeService.generateInstaceFormatDate(), - Source: '1', - SourceId: e.Id, - ApplicationId: e.ApplicationType.toString(), - Id: '', - Link: '', - SerialNumber: '' - }; - }); - - let body = this.eventToaproveBody(this.postEvent, CalendarId, this.loggeduser.RoleID, this.loggeduser.UserId, DocumentToSave); - await this.processeService.createEventToAprove(this.postEvent.CalendarName, 'md', body).subscribe((id) => { - loader.remove() - this.afterSave(); - this.hhtpErrorHandle.httpsSucessMessagge('new event to aprove') - - - - /* DocumentToSave.forEach((attachments, i) => { - this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => { - if (DocumentToSave.length == (i + 1)) { - this.afterSave(); - } - }); - }); - - if (DocumentToSave.length == 0) { - this.afterSave(); - } */ - - }, (error) => { - loader.remove() - this.showLoader = false - this.hhtpErrorHandle.httpStatusHandle(error) - }); - - - } - - - - } - - if (!selectedCalendar && this.CalendarName == "Meu calendario") { - console.log('SG generic') - this.postEvent.CalendarName - - const CalendarId = this.selectedCalendarId() - let loader = this.toastService.loading(); - - this.postEvent.CalendarId = CalendarId - - this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe( - (id) => { - loader.remove(); - - const eventId: any = id; - - const DocumentToSave: EventAttachment[] = this.documents.map((e) => { - return { - SourceTitle: e.Assunto, - ParentId: eventId, - Source: '1', - SourceId: e.Id, - ApplicationId: e.ApplicationType.toString(), - Id: '', - Link: '', - SerialNumber: '' - }; - }); - - DocumentToSave.forEach((attachments, i) => { - this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => { - if (DocumentToSave.length == (i + 1)) { - this.afterSave(); - } - }); - }); - - if (DocumentToSave.length == 0) { - this.afterSave(); - } - - this.hhtpErrorHandle.httpsSucessMessagge('new event') - let data = { - "subject": this.postEvent.Subject, - "start": this.postEvent.StartDate, - "end": this.postEvent.EndDate, - "venue": this.postEvent.Location, - "id": id, - "calendarId": CalendarId - } - if (this.roomId) { - this.chatMethodService.sendMessage(this.roomId, data); - } - }, (error) => { - - loader.remove() - this.showLoader = false - this.hhtpErrorHandle.httpStatusHandle(error) - }); + if(value.isOk()) { + console.log(value) + this.afterSave(); + this.hhtpErrorHandle.httpsSucessMessagge('new event') + loader.remove(); + tracing.setAttribute('outcome', 'success') + } else { + console.log('create event error: ', value.error) + tracing.setAttribute('outcome', 'failed') + loader.remove(); + this.hhtpErrorHandle.httpStatusHandle(value.error.status) } + } else {} - - - } else { - - this.postEvent.CalendarName - - const CalendarId = this.selectedCalendarId() - let loader = this.toastService.loading(); - - this.postEvent.CalendarId = CalendarId - - this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe( - (id) => { - loader.remove(); - - const eventId: any = id; - - const DocumentToSave: EventAttachment[] = this.documents.map((e) => { - return { - SourceTitle: e.Assunto, - ParentId: eventId, - Source: '1', - SourceId: e.Id, - ApplicationId: e.ApplicationType.toString(), - Id: '', - Link: '', - SerialNumber: '' - }; - }); - - DocumentToSave.forEach((attachments, i) => { - this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => { - if (DocumentToSave.length == (i + 1)) { - this.afterSave(); - } - }); - }); - - if (DocumentToSave.length == 0) { - this.afterSave(); - } - - this.hhtpErrorHandle.httpsSucessMessagge('new event') - let data = { - "subject": this.postEvent.Subject, - "start": this.postEvent.StartDate, - "end": this.postEvent.EndDate, - "venue": this.postEvent.Location, - "id": id, - "calendarId": CalendarId - } - if (this.roomId) { - this.chatMethodService.sendMessage(this.roomId, data); - } - }, (error) => { - - loader.remove() - this.showLoader = false - this.hhtpErrorHandle.httpStatusHandle(error) - }); - - } } - selectedCalendarId() { - - if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postEvent.CalendarName == 'Oficial') { - - return this.eventService.calendarNamesType[this.CalendarName]['OficialId'] - - } else if (this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal'] && this.postEvent.CalendarName == 'Pessoal') { - - return this.eventService.calendarNamesType[this.CalendarName]['PessoalId'] - - } else { - - return '11:11' - } - } afterSave() { this.deleteTemporaryData(); @@ -954,9 +626,12 @@ export class NewEventPage implements OnInit { window['temp.path:/home/agenda/new-event.component.ts'] = { postEvent: this.postEvent, eventBody: this.eventBody, + allDayCheck: this.allDayCheck, segment: this.segment, CalendarName: this.CalendarName, - documents: this.documents + documents: this.documents, + selectedUserCalendar: this.selectedUserCalendar, + hasChangeCalendar: this.hasChangeCalendar } } @@ -971,17 +646,20 @@ export class NewEventPage implements OnInit { if (JSON.stringify(restoredData) != "{}" && undefined != restoredData) { this.postEvent = restoredData.postEvent + this.allDayCheck = restoredData.allDayCheck this.eventBody = restoredData.eventBody this.segment = restoredData.segment this.CalendarName = restoredData.CalendarName this.documents = restoredData.documents + this.selectedUserCalendar = restoredData.selectedUserCalendar + this.hasChangeCalendar = restoredData.hasChangeCalendar // restore dater for date and hours picker return true; } else { - + return false } } @@ -989,36 +667,15 @@ export class NewEventPage implements OnInit { window['temp.path:/home/agenda/new-event.component.ts'] = {} } - eventToaproveBody(event, calendarId, role, userId, attachments) { - let toAproveObject = { - "EventProcess": { - "Body": event.Body, - "Location": event.Location, - "Subject": event.Subject, - "StartDate": event.StartDate, - "EndDate": event.EndDate, - "Status": "Active", - "IsAllDayEvent": event.IsRecurring, - "EventType": event.EventType, - "ParticipantsList": event.Attendees, - "EventRecurrence": event.EventRecurrence, - "HasAttachments": event.HasAttachments, - "CalendarId": calendarId, - "Role": role, - "wxUserID": userId, - "TimeZone": "W. Central Africa Standard Time" - }, - "Attachments": attachments, - "InstanceID": "AGD_" + this.loggeduser.UserName + "_" + this.processeService.generateInstaceFormatDate() - } - - return toAproveObject; - } async fetchContacts(filter: string) { -console.log(this.loggeduser.Profile) + console.log(this.loggeduser.Profile) if (this.loggeduser.Profile == 'PR') { - this.contactsService.getContacts(filter).subscribe(result => { + + const RequestResult = await this.ContactRepositoryService.getUsersMap(); + if(RequestResult.isOk()) { + const result = RequestResult.value + if (this.eventPersons != null) { this.eventPersons.forEach(attendee => { const index: number = result.findIndex((cont) => { @@ -1031,18 +688,85 @@ console.log(this.loggeduser.Profile) } this.contacts = result; console.log('Attendes Email', this.loggeduser.Email) - let filterLoggedUserEmail = this.contacts.filter(item => item.RoleDescription == "Ministro e Director do Gabinete do PR") - console.log('Attendes Email', filterLoggedUserEmail) + let filterLoggedUserEmail = this.contacts.filter(item => item.RoleId == this.RoleIdService.MD) + console.log('Attendes Email', filterLoggedUserEmail); + + + if(filterLoggedUserEmail.length >= 1) { + filterLoggedUserEmail[0].IsRequired = true + } this.contacts = filterLoggedUserEmail; this.taskParticipants.push(this.contacts[0]); - this.setIntervenient.emit(this.taskParticipants); + this.setIntervenient.emit(this.taskParticipants); console.log('Attendes Email', this.taskParticipants) + + } else { + } - ); + } } + onCheckboxChange(event: any) { + if (this.allDayCheck) { + this.postEvent.IsAllDayEvent = this.allDayCheck; + this.postEvent.StartDate = this.setAlldayTime(this.postEvent.StartDate) + this.postEvent.EndDate = this.setAlldayTimeEndDate(this.postEvent.EndDate) + + console.log('Recurso ativado!!'); + } else { + this.postEvent.IsAllDayEvent = this.allDayCheck; + this.postEvent.EndDate = this.setAlldayTimeEndDateNotAlday(this.postEvent.EndDate) + console.log('Recurso desativado'); + + } + } + + setAlldayTime(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(0) + date.setMinutes(0) + date.setSeconds(0); + + + return date + } + + setAlldayTimeEndDate(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(23) + date.setMinutes(59) + date.setSeconds(0); + + + return date + } + + setAlldayTimeEndDateNotAlday(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(23) + date.setMinutes(0) + date.setSeconds(0); + + + return date + } + + onDateChange(e) { + + const cloneDateStartDate = new Date(this.postEvent.StartDate); + const cloneDateEndDate = new Date(this.postEvent.EndDate); + + if(cloneDateStartDate.getTime() >= cloneDateEndDate.getTime()) { + cloneDateStartDate.setHours(cloneDateStartDate.getHours() + 1); + this.postEvent.EndDate = cloneDateStartDate + } + + } } diff --git a/src/app/shared/agenda/view-event/view-event.page.html b/src/app/shared/agenda/view-event/view-event.page.html index 3cd10fa57..4d3b66a41 100644 --- a/src/app/shared/agenda/view-event/view-event.page.html +++ b/src/app/shared/agenda/view-event/view-event.page.html @@ -1,5 +1,5 @@ - +
@@ -17,7 +17,7 @@
-
-
Intervenientes
+
Intervenientes({{ loadedEvent.Attendees.length }})
@@ -115,18 +118,18 @@
-
Documentos Anexados
+
Documentos Anexados({{ loadedEvent.Attachments.length }})
  • - {{attach.SourceName}} + {{attach.subject || attach.sourceName || attach.SourceName || 'Sem título'}} {{attach.Stakeholders}}

    - {{ attach.CreateDate | date: 'dd-MM-yyyy HH:mm' }} + {{ attach.dateEntry | date: 'dd-MM-yyyy HH:mm' }}
    De {{showDateDuration(msg.file.start_date)}} a {{showDateDuration(msg.file.end_date)}}
    {{msg.file.venue}}
  • @@ -197,7 +197,7 @@ {{last ? scrollToBottom() : ''}}
    -
    +
    {{user.name}} saiu do grupo
    @@ -205,7 +205,7 @@ {{last ? scrollToBottom() : ''}}
    -
    +
    {{user.name}} foi removido do grupo
    @@ -213,7 +213,7 @@ {{last ? scrollToBottom() : ''}}
    -
    +
    Adicionou {{user.name}}
    diff --git a/src/app/shared/chat/group-messages/group-messages.page.ts b/src/app/shared/chat/group-messages/group-messages.page.ts index b90b88db4..04843c6e6 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.ts +++ b/src/app/shared/chat/group-messages/group-messages.page.ts @@ -12,7 +12,6 @@ import { SearchList } from 'src/app/models/search-document'; import { FileService } from 'src/app/services/functions/file.service'; import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page'; import { ThemeService } from 'src/app/services/theme.service' -import { ViewEventPage } from 'src/app/modals/view-event/view-event.page'; import { Storage } from '@ionic/storage'; import { ChatSystemService } from 'src/app/services/chat/chat-system.service'; import { MessageService } from 'src/app/services/chat/message.service'; @@ -30,7 +29,6 @@ import { SessionStore } from 'src/app/store/session.service'; import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page'; import { PermissionService } from 'src/app/services/permission.service'; import { FileValidatorService } from "src/app/services/file/file-validator.service" - @Component({ selector: 'app-group-messages', templateUrl: './group-messages.page.html', @@ -42,11 +40,9 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe loggedUser: any; message: any; messages: any; - allUsers: any[] = []; documents: SearchList[] = []; room: any = new Array(); - roomName: any; members: any; capturedImage: any; @@ -58,8 +54,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe currentPosition: any; startPosition: number; scrollToBottomBtn = false; - roomCountDownDate: string; - roomCountDownTime: string; isAdmin = false; @Input() roomId: string; @@ -112,8 +106,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe this.ChatSystemService.getUser() this.loggedUserChat = SessionStore.user.ChatData['data']; this.isGroupCreated = true; - this.roomCountDownDate = ""; - this.roomCountDownTime = ""; + } ngOnChanges(changes: SimpleChanges): void { @@ -124,7 +117,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe this.ChatSystemService.openRoom(this.roomId) this.ChatSystemService.getGroupRoom(this.roomId).scrollDown = this.scrollToBottomClicked this.groupNameFormart = this.ChatSystemService.getGroupRoom(this.roomId).name.split('-').join(' ') - this.showAvatar = false setTimeout(() => { @@ -134,6 +126,13 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe this.deleteRecording(); + + if (SessionStore.user.ChatData.data.userId == this.ChatSystemService.getGroupRoom(this.roomId).u._id) { + this.isAdmin = true + } else { + this.isAdmin = false + } + } ngOnInit() { @@ -151,10 +150,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe return this.timeService.showDateDuration(start); } - countDownDate() { - return this.timeService.countDownDateTimer(this.roomCountDownDate, this.roomId); - } - setStatus(status: string) { let body = { message: '', @@ -179,28 +174,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe } catch (err) { } } - async goToEvent(event: any) { - let classs; - if (window.innerWidth < 701) { - classs = 'modal modal-desktop' - } else { - classs = 'modal modal-desktop showAsideOptions' - } - - const modal = await this.modalController.create({ - component: ViewEventPage, - componentProps: { - eventId: event.id, - CalendarId: event.calendarId - }, - cssClass: classs, - }); - - modal.onDidDismiss().then((res) => { - - }); - await modal.present(); - } ngAfterViewInit() { this.scrollChangeCallback = () => this.onContentScrolled(event); @@ -336,12 +309,18 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe async getChatMembers() { - this.chatService.getAllUsers().subscribe(res => { - // + // this.chatService.getAllUsers().subscribe(res => { + // // + + // this.allUsers = res['users'] + // // + // }); + + + if(this.ChatSystemService.users.length == 0) { + this.ChatSystemService.getUser() + } - this.allUsers = res['users'] - // - }); } openGroupContactsPage() { @@ -377,28 +356,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe this.ChatSystemService.getGroupRoom(this.roomId).loadHistory({}); } - let room = await this.chatService.getRoomInfo(this.roomId).toPromise(); - this.room = room['room']; - if (this.room.name) { - try { - this.roomName = this.room.name.split('-').join(' '); - } catch (error) { - this.roomName = this.room.name; - } - - } - - - if(SessionStore.user.ChatData.data.userId == this.room.u._id){ - this.isAdmin = true - } else { - this.isAdmin = false - } - - if (this.room.customFields.countDownDate) { - this.roomCountDownDate = this.room.customFields.countDownDate; - } - this.getGroupContacts(this.room); } @@ -536,14 +493,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe } else { - if(res?.data?.name) { - try { - this.roomName = res.data.name.split('-').join(' '); - } catch (error) { - this.roomName = res.data.name - - } - } }; @@ -565,6 +514,9 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe async openOptions(ev: any) { + + console.trace(this.room) + const popover = await this.popoverController.create({ component: ChatPopoverPage, cssClass: 'chat-popover modal-desktop', @@ -930,7 +882,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe fileBase64 = await this._getBase64(file) formData = new FormData(); - formData.append('blobFile', blob); + formData.append('blobFile', file); } this.ChatSystemService.getGroupRoom(roomId).send({ @@ -1064,11 +1016,12 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe } downloadFileFromBrowser(fileName: string, data: any): void { - const linkSource = data; - const downloadLink = document.createElement("a"); - downloadLink.href = linkSource; - downloadLink.download = fileName; - downloadLink.click(); + const link = document.createElement("a") + link.href = `data:${data.type}';base64,${data.image_url}`; + link.download = fileName + link.click() + + link.remove() } b64toBlob(b64Data, contentType) { @@ -1150,10 +1103,10 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe }); modal.present(); } else { - this.downloadFileFromBrowser("file", str) + this.downloadFileFromBrowser(msg.attachments[0].title, msg.attachments[0]) } } else { - this.openFile(str, msg.attachments[0].title, msg.file.type); + this.openFile(msg.attachments.image_url, msg.attachments[0].title, msg.file.type); } } diff --git a/src/app/shared/chat/messages/messages.page.html b/src/app/shared/chat/messages/messages.page.html index ab8a5091d..fd28d70e8 100644 --- a/src/app/shared/chat/messages/messages.page.html +++ b/src/app/shared/chat/messages/messages.page.html @@ -196,9 +196,9 @@ {{msg.u.name}} criou esta reunião
    -
    - {{task.activityInstanceName}} + {{task.WorkflowName}}
    {{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/shared/gabinete-digital/diplomas-gerar/diplomas-gerar.page.html b/src/app/shared/gabinete-digital/diplomas-gerar/diplomas-gerar.page.html index 97888f2ad..27463642c 100644 --- a/src/app/shared/gabinete-digital/diplomas-gerar/diplomas-gerar.page.html +++ b/src/app/shared/gabinete-digital/diplomas-gerar/diplomas-gerar.page.html @@ -91,7 +91,7 @@
    - {{task.activityInstanceName}} + {{task.WorkflowName}}
    {{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/shared/gabinete-digital/diplomas/diplomas.page.html b/src/app/shared/gabinete-digital/diplomas/diplomas.page.html index 5af7322d7..65b3b4e67 100644 --- a/src/app/shared/gabinete-digital/diplomas/diplomas.page.html +++ b/src/app/shared/gabinete-digital/diplomas/diplomas.page.html @@ -128,7 +128,7 @@
    - {{task.activityInstanceName}} + {{task.WorkflowName}}
    {{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html index b7faae8f4..c59de001a 100644 --- a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html +++ b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html @@ -80,13 +80,13 @@ - + Reunião - + Viagem - + Conferência @@ -100,6 +100,15 @@
    +
    +
    + + Todo dia + + +
    +
    +
    @@ -113,6 +122,7 @@ placeholder="Choose a date" [(ngModel)]="startDate" [disabled]="disabled" + (ngModelChange)="onDateChange($event)" >
    --> - +
    @@ -285,20 +295,21 @@
    +
    - +

    - {{document.SourceName}} - Correspondencia - AccoesPresidenciais - ArquivoDespachoElect + {{document.subject || document.Description || 'Sem título'}} + Correspondencia + AccoesPresidenciais + ArquivoDespachoElect

    -

    {{document.Stakeholders}} {{document.CreateDate }}

    +

    {{document.Stakeholders}} {{document.dateEntry }}

    diff --git a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts index cafbd4728..db93f8c91 100644 --- a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts +++ b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts @@ -6,14 +6,13 @@ import { SearchList } from 'src/app/models/search-document'; import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page'; import { SearchPage } from 'src/app/pages/search/search.page'; import { AttachmentsService } from 'src/app/services/attachments.service'; -import { EventsService } from 'src/app/services/events.service'; -import { ProcessesService } from 'src/app/services/processes.service'; -import { ToastService } from 'src/app/services/toast.service'; import { Event, EventToApproveEdit } from '../../../models/event.model'; import { NgxMatDateFormats, NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker'; -import { NavigationExtras, Router } from '@angular/router'; import { ThemeService } from 'src/app/services/theme.service' import { HttpErrorHandle } from 'src/app/services/http-error-handle.service' +import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service'; +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; +import { AttendeesLIstChangeDetector } from 'src/app/module/agenda/data/async/change/attendeesLIstChangeDetector'; const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { parse: { @@ -44,13 +43,12 @@ export class EditEventToApproveComponent implements OnInit { public showSeconds = false; public touchUi = false; public enableMeridian = false; - public minDate = new Date().toISOString().slice(0,10) + public minDate = new Date().toISOString().slice(0, 10) public endMinDate = new Date(new Date().getTime() + 15 * 60000); public maxDate: any; public stepHour = 1; public stepMinute = 15; public stepSecond = 5; - recurringTypes: any; selectedRecurringType: any; currentDate = new Date() @@ -62,12 +60,14 @@ export class EditEventToApproveComponent implements OnInit { @ViewChild('picker1') picker1: any; serialNumber: string - loadedAttachments: Attachment[]= [] + loadedAttachments: any[] = [] + addedAttachmentsList: any[] = [] + deletedAttachmentsList: any[] = [] eventProcess = { serialNumber: "", taskStartDate: "", - workflowInstanceDataFields:{ + workflowInstanceDataFields: { Body: "", OccurrenceType: '', Category: '', @@ -91,10 +91,10 @@ export class EditEventToApproveComponent implements OnInit { show = false postEvent: Event; - isRecurring:string; + isRecurring: string; isEventEdited: boolean; - segment:string = "true"; - profile:string; + segment: string = "true"; + profile: string; eventAttendees: EventPerson[]; startDate: Date; endDate: Date; @@ -112,14 +112,11 @@ export class EditEventToApproveComponent implements OnInit { constructor( private modalController: ModalController, private navParams: NavParams, - private eventsService: EventsService, public alertController: AlertController, private attachmentsService: AttachmentsService, - private processes:ProcessesService, - private toastService: ToastService, - private router:Router, public ThemeService: ThemeService, - private httpErroHalde: HttpErrorHandle + private httpErroHalde: HttpErrorHandle, + private agendaDataRepository: AgendaDataRepositoryService ) { // Edit event to approve this.serialNumber = this.navParams.get('serialNumber'); @@ -129,8 +126,8 @@ export class EditEventToApproveComponent implements OnInit { ngOnInit() { + console.log('Here you ares') this.getTask() - this.getRecurrenceTypes(); } ngOnDestroy() { @@ -138,89 +135,97 @@ export class EditEventToApproveComponent implements OnInit { } myInterval = setInterval(() => { - document.querySelectorAll('.ngx-mat-timepicker input').forEach((e :any) => { - if(e) { + document.querySelectorAll('.ngx-mat-timepicker input').forEach((e: any) => { + if (e) { e.disabled = true; } }) }, 1000); - async getTask() { + @XTracerAsync({name:'mobile/loadEventToApproveDetails', bugPrint: true}) + async getTask(tracing?: TracingType) { - const result = await this.processes.GetTask(this.serialNumber).toPromise(); + /* const result = await this.processes.GetTask(this.serialNumber).toPromise(); */ + const res = await this.agendaDataRepository.getEventToApproveById(this.serialNumber) + if (res.isOk()) { + console.log('Loaded Event', res.value) - this.eventProcess = result - this.eventProcess.workflowInstanceDataFields.Category = result.workflowInstanceDataFields.EventType - this.eventProcess.workflowInstanceDataFields.LastOccurrence = new Date(this.eventProcess.workflowInstanceDataFields.LastOccurrence) + this.eventProcess = res.value as any + this.eventProcess.workflowInstanceDataFields.LastOccurrence = new Date(this.eventProcess.workflowInstanceDataFields.LastOccurrence) - this.startDate = new Date(this.eventProcess.workflowInstanceDataFields.StartDate); - this.endDate = new Date(this.eventProcess.workflowInstanceDataFields.EndDate); + this.startDate = new Date(this.eventProcess.workflowInstanceDataFields.StartDate); + this.endDate = new Date(this.eventProcess.workflowInstanceDataFields.EndDate); - // description - let body : any =this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '') - this.eventProcess.workflowInstanceDataFields.Body = body - this.Location = this.eventProcess.workflowInstanceDataFields.Location + // description + try { - this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId - try { - this.getAttachments() + let body: any = this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '') + this.eventProcess.workflowInstanceDataFields.Body = body - } catch (error) { - this.httpErroHalde.httpStatusHandle(error) - } + } catch (error) {} + this.Location = this.eventProcess.workflowInstanceDataFields.Location - if(this.eventProcess.workflowInstanceDataFields.IsRecurring == false) { - this.isRecurring = "Não se repete"; - } - else { - this.isRecurring = "Repete"; - } + this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId + this.eventProcess.workflowInstanceDataFields.Category = this.setEventType(this.eventProcess.workflowInstanceDataFields.EventType) - this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => { - if(e.IsRequired) { - this.taskParticipants.push(e); - } else { - this.taskParticipantsCc.push(e); + this.loadedAttachments = res.value.Attachments + /* this.getAttachments() + */ + if (this.eventProcess.workflowInstanceDataFields.IsRecurring == false) { + this.isRecurring = "Não se repete"; } - }) + else { + this.isRecurring = "Repete"; + } + + this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => { + if (e.IsRequired) { + this.taskParticipants.push(e); + } else { + this.taskParticipantsCc.push(e); + } + }) + + tracing.setAttribute('outcome', 'success') + } else { + tracing.setAttribute('outcome', 'failed') + this.httpErroHalde.httpStatusHandle(res.error) + } + + + /* }) */ } - getRecurrenceTypes() { - this.eventsService.getRecurrenceTypes().subscribe(res=>{ - this.recurringTypes = res; - }); - } - - onSelectedRecurringChanged(ev:any){ + onSelectedRecurringChanged(ev: any) { this.calculetedLastOccurrence(ev); - if(ev.length > 1){ + if (ev.length > 1) { this.postEvent.EventRecurrence.Type = ev.filter(data => data != '-1'); } - if(ev.length == 0){ + if (ev.length == 0) { this.postEvent.EventRecurrence.Type = "-1"; } } - calculetedLastOccurrence(type:number){ + calculetedLastOccurrence(type: number) { var valor; var opcao: boolean; if (type == 0) { valor = 7; opcao = true; - } else if(type == 1){ + } else if (type == 1) { valor = 30; opcao = true; - } else if(type == 2){ + } else if (type == 2) { valor = 1; opcao = false; - }else if(type == 3){ + } else if (type == 3) { valor = 5; opcao = false; } @@ -228,7 +233,7 @@ export class EditEventToApproveComponent implements OnInit { } - defineLastOccurrence(valor:number, opcao:boolean){ + defineLastOccurrence(valor: number, opcao: boolean) { var time = new Date(this.endDate); if (opcao == true) { time.setDate(time.getDate() + valor); @@ -248,29 +253,42 @@ export class EditEventToApproveComponent implements OnInit { openLastOccurrence() { let input: any = document.querySelector('#last-occurrence') - if(input) { + if (input) { input.click() } } - - close() { this.modalController.dismiss(); } - save() { + + onDateChange(e) { + + const cloneDateStartDate = new Date(this.startDate); + const cloneDateEndDate = new Date(this.endDate); + + if(cloneDateStartDate.getTime() >= cloneDateEndDate.getTime()) { + cloneDateStartDate.setHours(cloneDateStartDate.getHours() + 1); + this.endDate = cloneDateStartDate as any + } + + } + + @XTracerAsync({name:'desktop/edit-event', bugPrint: true, daley: 4000}) + async save(tracing?: TracingType) { // set dates to eventProcess object - this.taskParticipantsCc.forEach(e=>{ + this.taskParticipantsCc.forEach(e => { e.IsRequired = false }) + const serverCurrentList = this.eventProcess.workflowInstanceDataFields.ParticipantsList this.eventProcess.workflowInstanceDataFields.ParticipantsList = this.taskParticipants.concat(this.taskParticipantsCc) - this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e=>{ + this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => { - if(e.hasOwnProperty('$type')) { + if (e.hasOwnProperty('$type')) { delete e.$type } }) @@ -305,55 +323,163 @@ export class EditEventToApproveComponent implements OnInit { Category: this.eventProcess.workflowInstanceDataFields.Category } + const calendar = await this.agendaDataRepository.getCalendarByUserId((this.eventProcess as any).owner.wxUserId) - this.eventsService.postEventToApproveEdit(event).subscribe(()=>{ - this.httpErroHalde.httpsSucessMessagge('Editar evento') - window['approve-event-getTask']() - }, error =>{ - this.httpErroHalde.httpStatusHandle(error) - }) + if(calendar.isOk()) { + const value = await this.agendaDataRepository.updateEvent(this.eventProcess.serialNumber, event, true, calendar.value, tracing)//.subscribe((value) => { + if(value.isOk()) { + console.log(value) + this.httpErroHalde.httpsSucessMessagge('Editar evento') + window['approve-event-getTask']() + tracing.setAttribute('outcome', 'success') + } else { + this.httpErroHalde.httpStatusHandle(value.error) + console.log('edit event error: ', value.error) + tracing.setAttribute('outcome', 'failed') + } - this.loadedAttachments.forEach((document:any)=>{ - if(document['action'] == 'add') { - delete document.action - this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{ - window['approve-event-getTask'] () - // this.toastService._successMessage(); - }, error =>{ - if(error.status == 0) { - this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão') - } else { + console.log({serverCurrentList, ParticipantsList:this.eventProcess.workflowInstanceDataFields.ParticipantsList}) + const { insert, remove } = AttendeesLIstChangeDetector(serverCurrentList as any, this.eventProcess.workflowInstanceDataFields.ParticipantsList as any) - this.toastService._badRequest(); + console.log({insert, remove}) + + if(insert.length >= 1) { + + try { + await this.agendaDataRepository.addEventAttendee(this.eventProcess.serialNumber, insert, tracing).toPromise() + } catch (error) { + console.log('add Attendee error: ', error) + tracing.setAttribute('failed.attendees', 'true') } - }); - } else if(document['action'] == 'delete') { - delete document.action - this.attachmentsService.deleteEventAttachmentById(document.Id).subscribe( res=>{ - window['approve-event-getTask'] () - // this.toastService._successMessage() - }, error =>{ - if(error.status == 0) { - this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão') - } else { + // this.agendaDataRepository.addEventAttendee(this.eventProcess.serialNumber, insert, tracing).subscribe((value) => { - this.toastService._badRequest() + // }, ((error) => { + // console.log('add Attendee error: ', error) + // tracing.setAttribute('failed.attendees', 'true') + // })); + } + + + if(remove.length >= 1) { + + try { + await this.agendaDataRepository.removeEventAttendee(this.eventProcess.serialNumber, remove).toPromise() + } catch (error) { + console.log('add Attendee error: ', error) + tracing.setAttribute('failed.attendees', 'true') } - }) + + // this.agendaDataRepository.removeEventAttendee(this.eventProcess.serialNumber, remove).subscribe((value) => { + + // }, ((error) => { + // console.log('add Attendee error: ', error) + // tracing.setAttribute('failed.attendees', 'true') + // })); + } + + + + if (this.addedAttachmentsList.length > 0) { + try { + await this.agendaDataRepository.addEventAttachment(this.eventProcess.serialNumber, this.loadedAttachments, tracing).toPromise() + } catch (error) { + this.showLoader = false + console.log('add attachment error: ', error) + tracing.setAttribute('failed.add.attachment', 'true') + } + + // this.agendaDataRepository.addEventAttachment(this.eventProcess.serialNumber, this.loadedAttachments, tracing).subscribe((value) => { + // console.log(value) + // }, ((error) => { + // this.showLoader = false + // console.log('add attachment error: ', error) + // tracing.setAttribute('failed.add.attachment', 'true') + // })); + } + + if (this.deletedAttachmentsList.length > 0) { + + try { + await this.agendaDataRepository.removeEventAttachment(this.eventProcess.serialNumber, { attachments: this.deletedAttachmentsList }).toPromise() + } catch (error) { + this.showLoader = false + console.log('remove attachment error: ', error) + tracing.setAttribute('failed.remove.attachment', 'true') + } + + // this.agendaDataRepository.removeEventAttachment(this.eventProcess.serialNumber, { attachments: this.deletedAttachmentsList }).subscribe((value) => { + // console.log(value) + // }, ((error) => { + // this.showLoader = false + // console.log('remove attachment error: ', error) + // tracing.setAttribute('failed.remove.attachment', 'true') + // })); + } + + this.close(); } - }) - - this.close(); } + + + onCheckboxChange(event: any) { + + if (this.eventProcess.workflowInstanceDataFields.IsAllDayEvent) { + this.eventProcess.workflowInstanceDataFields.StartDate = this.setAlldayTime(this.eventProcess.workflowInstanceDataFields.StartDate) + this.eventProcess.workflowInstanceDataFields.EndDate = this.setAlldayTimeEndDate(this.eventProcess.workflowInstanceDataFields.EndDate) + + console.log('Recurso ativado!!'); + } else { + this.eventProcess.workflowInstanceDataFields.IsAllDayEvent = this.eventProcess.workflowInstanceDataFields.IsAllDayEvent; + this.eventProcess.workflowInstanceDataFields.EndDate = this.setAlldayTimeEndDateNotAlday(this.eventProcess.workflowInstanceDataFields.EndDate) + console.log('Recurso desativado'); + + } + } + + setAlldayTime(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(0) + date.setMinutes(0) + date.setSeconds(0); + + + return date + } + + + setAlldayTimeEndDate(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(23) + date.setMinutes(59) + date.setSeconds(0); + + + return date + } + + setAlldayTimeEndDateNotAlday(timeToReturn) { + let date: any = new Date(timeToReturn) || new Date(); + let newdate = new Date(); + date.setHours(23) + date.setMinutes(0) + date.setSeconds(0); + + + return date + } + + async openAttendees() { - if(window.innerWidth <= 1024) { + if (window.innerWidth <= 1024) { const modal = await this.modalController.create({ component: AttendeesPageModal, - componentProps: { + componentProps: { adding: this.adding, taskParticipants: this.taskParticipants, taskParticipantsCc: this.taskParticipantsCc @@ -366,7 +492,7 @@ export class EditEventToApproveComponent implements OnInit { modal.onDidDismiss().then((data) => { - if(data) { + if (data) { data = data['data']; const newAttendees: EventPerson[] = data['taskParticipants']; @@ -402,7 +528,7 @@ export class EditEventToApproveComponent implements OnInit { this.openAttendees(); } - dynamicSetIntervenient({taskParticipants, taskParticipantsCc}) { + dynamicSetIntervenient({ taskParticipants, taskParticipantsCc }) { this.taskParticipants = taskParticipants; this.taskParticipantsCc = taskParticipantsCc; } @@ -416,7 +542,7 @@ export class EditEventToApproveComponent implements OnInit { console.error('getAttachments', error) } - result.forEach((e)=>{ + result.forEach((e) => { e.action = false }) @@ -426,8 +552,16 @@ export class EditEventToApproveComponent implements OnInit { } deleteAttachment(attachment: Attachment, index) { + console.log( this.loadedAttachments) + const id: any = this.loadedAttachments[index].id + let update = this.removeItemById(this.loadedAttachments, id) + this.loadedAttachments = update + console.log( update) + this.deletedAttachmentsList.push(id) + } - this.loadedAttachments[index]['action'] = 'delete' + removeItemById(array, id) { + return array.filter(item => item.id !== id); } async getDoc() { @@ -437,34 +571,36 @@ export class EditEventToApproveComponent implements OnInit { componentProps: { type: 'AccoesPresidenciais & ArquivoDespachoElect', showSearchInput: true, + eventAgenda: true, select: true, } }); - modal.onDidDismiss().then( async (res)=>{ - if(res){ + modal.onDidDismiss().then(async (res) => { + if (res) { const data: SearchList = res.data.selected; - - const DocumentToSave: any = { - SourceTitle: data.Assunto, - ParentId: this.InstanceId, - Source: '1', - SourceId: data.Id, - ApplicationId: data.ApplicationType.toString(), - Id: '', - Link: '', - SerialNumber: '', - action: 'add', - CreateDate: data.Data, - Data: data.Data, - Description: data.DocTypeDesc, - SourceName: data.Assunto, - Stakeholders: data.EntidadeOrganicaNome, - }; + console.log(data) + /* const DocumentToSave: any = { + SourceTitle: data.Assunto, + ParentId: this.InstanceId, + Source: '1', + SourceId: data.Id, + ApplicationId: data.ApplicationType.toString(), + Id: '', + Link: '', + SerialNumber: '', + action: 'add', + CreateDate: data.Data, + Data: data.Data, + Description: data.DocTypeDesc, + SourceName: data.Assunto, + Stakeholders: data.EntidadeOrganicaNome, + }; */ - this.loadedAttachments.push(DocumentToSave) + this.loadedAttachments.push(data) + this.addedAttachmentsList.push(data) // await this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe(()=>{ @@ -476,7 +612,14 @@ export class EditEventToApproveComponent implements OnInit { await modal.present(); } - - + setEventType(eventType) { + var selectedEventType = { + 1: 'Meeting', + 2: 'Travel', + 3: 'Conference', + 4: 'Encontro' + } + return selectedEventType[eventType]; + } } diff --git a/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.html b/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.html index 6eaa521f1..da7adc820 100644 --- a/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.html +++ b/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.html @@ -2,49 +2,49 @@
    - +
    - +
    - +
    - + Para hoje - + Novas - + Lidas - + Não lidas - - + + Em atraso - + Todas - - + +
    @@ -53,35 +53,28 @@
    - - - -
    - - Minha agenda + + + +
    +
    AGENDA DO PR
    +
    AGENDA DO MDGPR
    +
    Agenda {{calendars.wxFullName}}
    +
    + Minha agenda +
    +
    + +
    +
    {{ environment.agendaPR}}
    +
    {{ environment.agendaVP}}
    +
    Agenda {{calendars.wxFullName}}
    +
    + Minha agenda +
    -
    {{ environment.agendaPR}}
    -
    {{ environment.agendaVP}}
    -
    Agenda do {{calendars.Fullname}}
    - -
    Minha agenda
    -
    {{ environment.agendaPR}}
    -
    {{ environment.agendaVP}}
    -
    Agenda do {{calendars.Fullname}}
    -
    - - -
    Minha agenda
    -
    {{ environment.agendaPR}}
    -
    {{ environment.agendaVP}}
    -
    Agenda do {{calendars.Fullname}}
    -
    @@ -107,10 +100,14 @@
    -
    +

    {{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}

    {{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}

    +
    +

    Todo

    +

    o dia

    +
    {{event.workflowInstanceDataFields.Subject}}
    {{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}
    diff --git a/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts b/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts index 2609fa03d..91b97bef3 100644 --- a/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts +++ b/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts @@ -12,6 +12,15 @@ import { EventsService } from 'src/app/services/events.service'; import { environment } from 'src/environments/environment'; import { TaskService } from 'src/app/services/task.service' import { ThemeService } from 'src/app/services/theme.service' +import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service'; +import { map } from 'rxjs/operators'; +import { RoleIdService } from 'src/app/services/role-id.service' +import { TableSharedCalendar } from 'src/app/module/agenda/data/data-source/agenda-local-data-source.service'; +import { Observable } from 'rxjs'; +import { EEventFilterStatus } from 'src/app/module/agenda/data/dto/enums'; +import { isHttpError } from 'src/app/services/http.service'; +import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer'; +import { ToastService } from 'src/app/services/toast.service'; @Component({ selector: 'app-events-to-approve', @@ -25,7 +34,7 @@ export class EventsToApprovePage implements OnInit { eventBody: EventBody; categories: string[]; serialnumber:string; - segment:any; + selectedUserCalendar:any; eventaprovacaostore = EventoAprovacaoStore; eventsList: any = [] @@ -33,9 +42,9 @@ export class EventsToApprovePage implements OnInit { eventoaprovacaostore = EventoAprovacaoStore; environment = environment filterName: 'Para hoje' | 'Novos'| 'Lidos'| 'Não lidos'| 'OverdueTasks' | 'Todos' = 'Todos' - - // + + // showSearch = false searchSubject = '' list = [] @@ -46,7 +55,7 @@ export class EventsToApprovePage implements OnInit { } routerSubscription; SessionStore = SessionStore; - + sharedCalendar: Observable constructor( private processes:ProcessesService, @@ -57,30 +66,32 @@ export class EventsToApprovePage implements OnInit { public eventService: EventsService, public TaskService: TaskService, public ThemeService: ThemeService, - ) + public AgendaDataRepositoryService: AgendaDataRepositoryService, + public RoleIdService: RoleIdService, + private toastService: ToastService, + ) {} ngOnInit() { - - this.eventService.onCalendarFinishLoad.subscribe(() => { - if(!this.segment) { - if(this.eventService.calendarNamesAry.includes('Meu calendario')) { - this.segment = 'Meu calendario'; - } else { - this.segment = this.eventService.calendarNamesAry[0].OwnerUserId - } - - // select pr by default - const pr = this.eventService.calendarNamesAry.find( e => e.Role == 'Presidente da República') - if(pr) { - this.segment = pr.OwnerUserId - } - this.dynamicSearch(); - } else { - this.dynamicSearch(); - } - + // Define the role priorities + const rolePriorities: { [key: number]: number } = { + 100000014: 1, // Presidente da República + 100000011: 2, // Vice Presidente (example role ID) + // Add other roles with their priorities here + }; + + this.sharedCalendar = this.AgendaDataRepositoryService.getShareCalendarItemsLive().pipe( + map(data => data.sort((a, b) => { + console.log('Raw data:', data); // Debug line + const priorityA = rolePriorities[a.roleId] || Infinity; + const priorityB = rolePriorities[b.roleId] || Infinity; + return priorityA - priorityB; + })) + ) + + this.eventService.onCalendarFinishLoad.subscribe(async() => { + this.setCalendarByDefault() }) this.LoadToApproveEvents() @@ -90,7 +101,7 @@ export class EventsToApprovePage implements OnInit { funx:() => { this.dynamicSearch() - + } }) @@ -114,9 +125,21 @@ export class EventsToApprovePage implements OnInit { this.dynamicSearch(); } + async setCalendarByDefault() { + const data = await this.AgendaDataRepositoryService.geCalendars() + + const prObject = data.find(e => e?.roleId == 100000014) + + if(prObject) { + this.selectedUserCalendar = prObject.wxUserId + } else { + this.selectedUserCalendar = SessionStore.user.UserId + } + } + ngOnDestroy() { this.listSubscription.delete() - + this.routerSubscription?.unsubscribe(); } @@ -132,8 +155,8 @@ export class EventsToApprovePage implements OnInit { async dynamicSearch() { if(this.showSearch && this.searchSubject) { - - const list = this.eventoaprovacaostore.get(this.segment).filter((task) => { + + const list = this.eventoaprovacaostore.get(this.selectedUserCalendar).filter((task) => { let subject = task.Folio || task.Subject || task.workflowInstanceDataFields.Subject subject = subject.toLowerCase(); return subject.includes(this.searchSubject.toLowerCase()) @@ -141,13 +164,11 @@ export class EventsToApprovePage implements OnInit { this.list = this.TaskService.reorderList(this.ordinance, list) } else { - const list = this.eventoaprovacaostore.get(this.segment) + const list = this.eventoaprovacaostore.get(this.selectedUserCalendar) this.list = this.TaskService.reorderList(this.ordinance, list) } - console.log(this.list) - } @@ -172,56 +193,62 @@ export class EventsToApprovePage implements OnInit { this.dynamicSearch() } - async LoadToApproveEvents() { + @XTracerAsync({name:'Events-to-approve/LoadToApproveEvents', bugPrint: true}) + async LoadToApproveEvents(tracing?: TracingType) { this.showLoader = true; - const segment = this.segment + const segment = this.selectedUserCalendar + let userId; - - if(this.segment == 'Meu calendario') { + if(this.selectedUserCalendar == SessionStore.user.UserId) { // color - if(SessionStore.user.Profile == 'PR') { this.color = 'pr' } else { this.color = 'mdgpr' } - + userId = SessionStore.user.UserId - let genericEvents = await this.processes.eventsToApprove(SessionStore.user.UserId,'mobile agenda').toPromise() - try { - this.eventsList = this.sortService.sortArrayByDate(genericEvents).reverse(); - } catch (error) { - this.eventsList = []; - } - - this.eventoaprovacaostore.save(segment, this.eventsList) - this.dynamicSearch() } else { - - this.color = 'pr' - let allEvents = await this.processes.eventsToApprove(segment, 'gabinete').toPromise() - try { - this.eventsList = this.sortService.sortArrayByDate(allEvents).reverse(); - } catch(error) { - this.eventsList = [] + userId = this.selectedUserCalendar + } + + if(userId) { + + let allEvents = await this.AgendaDataRepositoryService.eventToApproveList({ + userId, + status: EEventFilterStatus.Pending + }, tracing) + if(allEvents.isOk()) { + tracing.setAttribute('outcome', 'success') + + if(allEvents.value.length >= 1) { + this.eventsList = this.sortService.sortArrayByDate(allEvents.value).reverse(); + this.eventoaprovacaostore.save(segment, this.eventsList) + } else { + this.eventoaprovacaostore.save(segment, []) + } + + } else { + + tracing.setAttribute('outcome', 'failed') + + if(!isHttpError(allEvents.error)) { + this.toastService._badRequest('Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico. #4') + } + } - - this.eventsList = this.eventsList - this.eventsList = this.eventsList - this.showLoader = false; - this.eventoaprovacaostore.save(segment, this.eventsList) - this.dynamicSearch() + } else { + tracing.setAttribute('calling', 'early') + console.warn('calling to early Events-to-approve/LoadToApproveEvents') } this.showLoader = false; } - getFromDB() {} - toDateString(e) { return new Date(e).toDateString() } diff --git a/src/app/shared/gabinete-digital/expedients/expedients.page.ts b/src/app/shared/gabinete-digital/expedients/expedients.page.ts index fc4d482c4..819825c23 100644 --- a/src/app/shared/gabinete-digital/expedients/expedients.page.ts +++ b/src/app/shared/gabinete-digital/expedients/expedients.page.ts @@ -33,7 +33,7 @@ export class ExpedientsPage implements OnInit { listSubscription : { delete(): void; } - + routerSubscription; @@ -69,7 +69,7 @@ export class ExpedientsPage implements OnInit { } }) - + this.routerSubscription = this.router.events.subscribe((event) => { if (event instanceof NavigationStart && event.url.startsWith('/home/gabinete-digital?expedientes=true')) { @@ -81,8 +81,8 @@ export class ExpedientsPage implements OnInit { this.LoadList() } - - + + this.dynamicSearch(); } @@ -91,7 +91,7 @@ export class ExpedientsPage implements OnInit { this.listSubscription.delete() this.routerSubscription?.unsubscribe(); } - + reorderList(orderBy: string) { this.ordinance = orderBy; @@ -103,7 +103,7 @@ export class ExpedientsPage implements OnInit { async dynamicSearch() { if(this.showSearch && this.searchSubject) { - + const list = this.expedientegbstore.list.filter((task) => { let subject = task.Folio || task.Subject || task.workflowInstanceDataFields.Subject subject = subject.toLowerCase(); @@ -143,7 +143,7 @@ export class ExpedientsPage implements OnInit { this.skeletonLoader = true this.processes.GetTaskListExpediente(false).subscribe(result => { - + let taskslist = []; this.skeletonLoader = false @@ -152,7 +152,7 @@ export class ExpedientsPage implements OnInit { taskslist = res.map((e) => this.expedienteTaskPipe.transform(e)) taskslist = this.sortService.sortDate(taskslist, 'CreateDate') // this.addProcessTODb(taskslist); - + taskslist = taskslist.filter(function(item) { return item.activityInstanceName != 'Retificar Expediente' }) diff --git a/src/app/shared/gabinete-digital/generic/task-details/task-details.page.html b/src/app/shared/gabinete-digital/generic/task-details/task-details.page.html index 0e55f4200..d15af0cfe 100644 --- a/src/app/shared/gabinete-digital/generic/task-details/task-details.page.html +++ b/src/app/shared/gabinete-digital/generic/task-details/task-details.page.html @@ -40,7 +40,7 @@
    -

    {{ task.activityInstanceName }}

    +

    {{ task.WorkflowName }}

    @@ -74,7 +74,7 @@
    Detalhes
    -
    {{ task.Note || fulltask?.workflowInstanceDataFields?.TaskMessage}} 
    +
    @@ -88,7 +88,7 @@

    {{ Document.Assunto || "Sem assunto" }} Rascunho

    -

    {{ Document.Sender}}{{ Document.DocDate | date: 'dd-MM-yyyy HH:mm' }}

    +

    {{ Document?.Sender}}{{ Document.DocDate | date: 'dd-MM-yyyy HH:mm' }}

    @@ -103,15 +103,12 @@ - -
    @@ -120,15 +117,15 @@ -
    +
    - -
    - {{task.activityInstanceName}} + {{task.WorkflowName}}
    {{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/shared/gabinete-digital/pedidos/pedidos.page.html b/src/app/shared/gabinete-digital/pedidos/pedidos.page.html index 779ab3065..49000d6ce 100644 --- a/src/app/shared/gabinete-digital/pedidos/pedidos.page.html +++ b/src/app/shared/gabinete-digital/pedidos/pedidos.page.html @@ -136,7 +136,7 @@
    - {{task.activityInstanceName}} + {{task.WorkflowName}}
    {{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} @@ -175,7 +175,7 @@
    - {{task.activityInstanceName}} + {{task.WorkflowName}}
    {{ task.taskStartDate || task.TaskStartDate | date: 'dd-MM-yyyy HH:mm' }} diff --git a/src/app/shared/header/header.page.html b/src/app/shared/header/header.page.html index 5738a62f3..eeaacfbc0 100644 --- a/src/app/shared/header/header.page.html +++ b/src/app/shared/header/header.page.html @@ -1,10 +1,10 @@ -
    +