Revize ceadebfe
Přidáno uživatelem Vojtěch Bartička před asi 2 roky(ů)
Backend/Core/Services/AnnotationService/AnnotationServiceEF.cs | ||
---|---|---|
174 | 174 |
else |
175 | 175 |
{ |
176 | 176 |
docToRender = annotation.CachedDocumentHTML; |
177 |
HTMLService.CachedInfo cachedInfo = new()
|
|
177 |
cachedInfoToReturn = new()
|
|
178 | 178 |
{ |
179 | 179 |
TagStartPositions = JsonConvert.DeserializeObject<List<int>>(annotation.CachedStartPositions), |
180 | 180 |
TagStartLengths = JsonConvert.DeserializeObject<List<int>>(annotation.CachedLengths), |
181 | 181 |
TagClosingPositions = JsonConvert.DeserializeObject<List<int>>(annotation.CachedClosingPositions), |
182 |
TagClosingLengths = JsonConvert.DeserializeObject<List<int>>(annotation.CachedClosingLengths) |
|
182 |
TagClosingLengths = JsonConvert.DeserializeObject<List<int>>(annotation.CachedClosingLengths), |
|
183 |
TagInstanceCSS = JsonConvert.DeserializeObject<List<TagInstanceCSSInfo>>(annotation.CachedCSS) |
|
183 | 184 |
}; |
184 | 185 |
|
185 | 186 |
// The annotation has been modified and we need to either add the new tag or remove the tag |
... | ... | |
188 | 189 |
if (annotation.ModifiedType == EModified.ADDED) |
189 | 190 |
{ |
190 | 191 |
var lastModifiedTag = context.AnnotationTags.Where(at => at.Id == annotation.LastModifiedTagId).First(); |
191 |
var result = htmlService.PartialPreprocessHTMLAddTag(docToRender, documentContent.Content, lastModifiedTag, tags, cachedInfo); |
|
192 |
var result = htmlService.PartialPreprocessHTMLAddTag(docToRender, documentContent.Content, lastModifiedTag, tags, cachedInfoToReturn);
|
|
192 | 193 |
docToRender = result.Item1; |
193 | 194 |
cachedInfoToReturn = result.Item2; |
194 | 195 |
} |
195 | 196 |
else if (annotation.ModifiedType == EModified.REMOVED) |
196 | 197 |
{ |
197 |
var result = htmlService.PartialPreprocessHTMLRemoveTag(docToRender, documentContent.Content, new AnnotationTag() { Id = annotation.LastModifiedTagId.Value }, tags, cachedInfo); |
|
198 |
var result = htmlService.PartialPreprocessHTMLRemoveTag(docToRender, documentContent.Content, new AnnotationTag() { Id = annotation.LastModifiedTagId.Value }, tags, cachedInfoToReturn);
|
|
198 | 199 |
docToRender = result.Item1; |
199 | 200 |
cachedInfoToReturn = result.Item2; |
200 | 201 |
} |
... | ... | |
249 | 250 |
} |
250 | 251 |
} |
251 | 252 |
|
252 |
if (annotation.State == EState.NEW) |
|
253 |
{ |
|
254 |
annotation.State = EState.IN_PROGRESS; |
|
255 |
} |
|
256 |
|
|
257 | 253 |
AnnotationTag annotationTag = new() |
258 | 254 |
{ |
259 | 255 |
Id = Guid.NewGuid(), |
... | ... | |
312 | 308 |
throw new ArgumentException($"Unknown tag type {request.Type}"); |
313 | 309 |
} |
314 | 310 |
|
311 |
if (annotation.State == EState.NEW) |
|
312 |
{ |
|
313 |
annotation.State = EState.IN_PROGRESS; |
|
314 |
} |
|
315 |
|
|
315 | 316 |
annotation.LastModifiedTagId = annotationTag.Id; |
316 | 317 |
annotation.ModifiedType = EModified.ADDED; |
317 | 318 |
|
Také k dispozici: Unified diff
Fixed issue with cached info not being returned to FE