Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Polish

Serwis CommentsService pozwala zarządzać komentarzami zadania, które aktualnie jest wykonywane. Posiada następujące funkcje:

  • showArea - otwiera pole komentarza wraz z przyciskami dodawania komentarza i ukrywania pola. Działa, gdy komentarze są włączone dla zadania.
    • Parametry funkcji

      NazwaTyp

      Wartość domyślna

      Opis
      doNotFocusBooleanfalseInformuje, czy nie rozpoczynać edycji wartości w polu (brak focus'a)


    • Rezultat funkcji: brak

 

  • hideArea - ukrywa pole komentarza wraz z przyciskami dodawania komentarza i ukrywania pola. Działa, gdy komentarze są włączone dla zadania.
    • Parametry funkcji: brak
    • Rezultat funkcji: brak

 

  • showCommentsForm (od 3.1.24) - pokazuje tabelkę komentarzy wraz z przyciskiem dodania komentarza. Działa, gdy komentarze są włączone dla zadania. 
    • Parametry funkcji: brak
    • Rezultat funkcji: brak

 

  • hideCommentsForm  (od 3.1.24) - ukrywa tabelkę komentarzy wraz z polem i przyciskiem dodania komentarza. Działa, gdy komentarze są włączone dla zadania.
    • Parametry funkcji: brak
    • Rezultat funkcji: brak

 

  • add - dodaje komentarz do procesu. Odświeża także tabelę komentarzy, jeżeli są one włączone dla zadania. Komentarz jest widziany jako dodany przez osobę aktualnie wykonującą zadanie.

 

    • Parametry funkcji


NazwaTyp

Wartość domyślna

Opis
commentStringnullTreść komentarza (maksymalnie 4000 znaków, dłuższe komentarze są ignorowane)
configObjectnull

Konfiguracja dodawania komentarza. Obiekt posiada następujące właściwości:

      • success (Typ Function) - Opcjonalna funkcja wykonywana po zapisie zakończonym sukcesem (domyślnie: null)
      • failure (Typ Function) - Opcjonalna funkcja wykonywana po zapisie zakończonym niepowodzeniem (domyślnie: null)
      • scope (Typ Object) - Scope dla opcjonalnych funkcji po dodaniu komentarza (success i failure)

Rezultat funkcji: brak

 

  • get - pobiera wszystkie komentarze dla zadania.

    • Parametry funkcji

      NazwaTyp

      Wartość domyślna

      Opis
      configObject{ }

      Konfiguracja pobierania komentarzy. Obiekt posiada następujące właściwości:

          - handler (Typ Function)

              Funkcja, która zostanie wywołana po pobraniu komentarzy dla zadania (domyślnie: null)

          - scope (Typ Object)

              Scope dla opcjonalnych funkcji wykonywanych po zapisie określonych we właściwościach success i failure (domyślnie: window)

          - success (Typ Function)

              Opcjonalna funkcja wykonywana po zapisie zakończonym sukcesem (domyślnie: null)

          - params (Typ Object[])

              Tablica określająca parametry przekazywane do funkcji określonej we właściwości handler, dodatkowo jest uzupełniana o pobrane komentarze dla zadania (domyślnie: [comments] - pobrane komentarze dla zadania)


    • Rezultat funkcji: brak


  • remove - usuwa komentarz dla zadania sprawdzając, czy podany komentarz został dodany przez osobę aktualnie wykonującą zadanie.
    • Parametry funkcji

      NazwaTyp

      Wartość domyślna

      Opis
      commentIdNumbernullIdentyfikator komentarza


    • Rezultat funkcji: brak


  • isEdited (od 3.1.8) - informuje, czy pole komentarza jest otwarte, a jego wartość niepusta.
    • Parametry funkcji: brak

    • Rezultat funkcji:

      TypOpis
      BooleanZwraca wartość true, jeżeli pole komentarza jest otwarte, a jego wartość niepusta
  • registerHook (od 3.2.94) - pozwala wpiąć się w moment dodawania komentarza przez użytkownika i wykonać jakąś akcję.
    • parametry Parametry funkcji

      NazwaTyp

      Wartość domyślna

      Opis
      hookObjectnullZdefiniowane hooki, które mają się wywołać: - beforeAdd (Typ Function) Funkcja, która zostanie wywołana zanim komentarz zostanie dodany przez użytkownika. Jeżeli funkcja zwróci wartość false, to komentarz nie zostanie dodany. Funkcja przyjmuje jako parametr oboiekt komentarza. - afterAdd (Typ Function) Funkcja, która zostanie dodana po pomyślnym dodaniu komentarza przez użytkownika. - scope (Typ Object) Scope dla wywołania funkcji
English

CommentsServiceallows to manage the comments of the task that is currently being performed. It has the following functions:

  • showArea- opens the comment field with the buttons for adding a comment and hiding the field. Works when comments are enabled for a task.
    • Function parameters

Name

Type

Default value

Description

doNotFocus

Boolean

false

Informs whether to startediting values in the field (no focus)

 

  • Function result: null

 

  • hideArea - hides the comment field together with the buttons for adding a comment and hiding the field. Works when comments are enabled for task.
    • Function parameters:null
    • Function result: null

 

  • showCommentsForm (from 3.1.24) - shows the table of comments together with the button for adding a comment. Works when comments are enabled for task.
    • Function parameters:null
    • Function result: null

 

  • hideCommentsForm (from 3.1.24) - hides a table of comments with a field and a comment button. Works when comments are enabled for task.
    • Function parameters:null
    • Function result: null

 

  • add - adds a comment to the process. It also refreshes the comments table if they are included for the task. The comment is seen as added by the person currently performing the task.
    • Function parameters:

Name

Type

Default value

Description

comment

String

null

Contents of the comment (maximum 4000 characters, longer comments are ignored)

config

Object

null

Configuration of adding a comment. The object has the following properties:

    • success (Function Type) - Optional function performed after successful writing (default: null)
    • failure (Function Type) - Optional function performed after unsuccessful writing (default: null)
    • scope (Object Type) - Scope for optional functions after adding a comment (success and failure)
    • Function result: null

 

  • get - gets all comments for the task.
    • Function parameters:

Name

Type

Default value

Description

config

Object

{ }

Configuration of downloading comments. The object has the following properties:

    - handler(Function Type)

        Function that will be called after downloading comments for the task (default: null)

    - scope(Object Type)

        Scope for optional functions performed after writing specified in the success and failure properties (default: window)

    - success(Function Type)

        Optional function performed after successful writing (default: null)

    - params(Object Type[])

        An array specifying parameters passed to the function specified in the handler property is additionally supplemented with downloaded comments for the task (default: [comments] - downloaded comments for the task)

    • Function result: null

 

  • remove - removes a comment for the task by checking if the comment provided was added by the person currently performing the task.
    • Function parameters:

 

Name

Type

Default value

Description

commentId

Number

null

Comment id

    • Function result: null

 

  • isEdited(from 3.1.8)informs whether the comment field is open and its value is not empty.
    • Function parameters: null
    • Function result:

Type

Description

Boolean

Returns true value if the comment field is open and its value is not empty.

 

  • registerHook (od 3.2.94) - allow to execute some actions while user is adding comment
    • Function parameters

      NameType

      Default value

      Description
      hookObjectnullHooks to be executed: - beforeAdd (Type Function) Function which will be executed before adding a comment. If function returns false the comment won't be aded. Function has one parameter - object of a comment. - afterAdd (Type Function) Function which will be executed after adding a comment. - scope (Type Object) Scope for functions