Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 812ee966

Přidáno uživatelem Dominik Poch před téměř 3 roky(ů)

Added notes

Zobrazit rozdíly:

webapp/contexts/AnnotationContext.tsx
52 52
     */
53 53
    changeLength: (occurrence: TagInstanceInfo, newValue: number) => void;
54 54

  
55
    /**
56
     * Changes a note of an occurrence of an annotation.
57
     * @param occurrence Occurrence whose note should be changed.
58
     * @param newValue New value of the note.
59
     */
60
    changeNote: (occurrence: TagInstanceInfo, newValue: string) => void;
61

  
55 62
    /**
56 63
     * Changes sentiment of an annotation.
57 64
     * @param occurrence Occurrence whose sentiment should be changed.
......
121 128
        return;
122 129
    },
123 130

  
131
    /**
132
     * Changes a note of an occurrence of an annotation.
133
     * @param occurrence Occurrence whose note should be changed.
134
     * @param newValue New value of the note.
135
     */
136
    changeNote: (occurrence: TagInstanceInfo, newValue: string) => {
137
        return;
138
    },
139

  
124 140
    /**
125 141
     * Changes sentiment of an annotation.
126 142
     * @param occurrence Occurrence whose sentiment should be changed.
......
239 255
        //TODO: Implement method (should use objects from server API)
240 256
    };
241 257

  
258
    /**
259
     * Changes a note of an occurrence of an annotation.
260
     * @param occurrence Occurrence whose note should be changed.
261
     * @param newValue New value of the note.
262
     */
263
    const changeNote = async (occurrence: TagInstanceInfo, newValue: string) => {
264
        if (!occurrence.occurenceId) {
265
            console.log('invalid occurrence');
266
            return;
267
        }
268

  
269
        const postRes =
270
            await annotationController.annotationAnnotationIdTagOccurenceIdNotePost(
271
                props.annotationId,
272
                occurrence.occurenceId,
273
                { note: newValue }
274
            );
275

  
276
        await refreshAnnotation();
277
    };
278

  
242 279
    /**
243 280
     * Changes sentiment of an annotation.
244 281
     * @param occurrence Occurrence whose sentiment should be changed.
......
310 347
                deleteOccurrence,
311 348
                changeLength,
312 349
                changePosition,
350
                changeNote,
313 351
                changeSentiment,
314 352
                refreshAnnotation,
315 353
                annotation,

Také k dispozici: Unified diff