Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merging 2.5.3 and 2.6.3 into develop #4338

Merged
merged 33 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
628a0ef
[SDAAP-56] Quirk in the headline character count counts the last spac…
marwoodandrew Jan 3, 2023
a3b16bb
Revert "send currently selected tags when refreshing imatrics (#4149)"
MarkLark86 Feb 15, 2023
9afb059
fix(build/auto-tagging): Upgrade Typescript to 4.9.5
MarkLark86 Feb 15, 2023
38c361b
fix(build/sams): Upgrade Typescript to 4.9.5
MarkLark86 Feb 15, 2023
c46c950
fix(build/sams): Ignore Typescript errors for now
MarkLark86 Feb 15, 2023
9a327ba
fix(build/videoEditor): Upgrade Typescript to 4.9.5
MarkLark86 Feb 15, 2023
561353b
fix(build/videoEditor): Remove unnecessary forwardRef
MarkLark86 Feb 16, 2023
b079569
Revert "Revert "send currently selected tags when refreshing imatrics…
petrjasek Feb 21, 2023
c2222a1
fix e2e test server
petrjasek Feb 21, 2023
576569e
update extensions typescript
petrjasek Feb 23, 2023
9cbbef4
[SDESK-6847] fix: Update moment and use newer timezone file for webpa…
MarkLark86 Mar 9, 2023
e8990c8
fix regression for SDBELGA-605 (#4223)
tomaskikutis Mar 15, 2023
d8002f5
Revert "fix(build): Upgrade Typescript to 4.9.5"
petrjasek Mar 16, 2023
60ba87d
update client core
petrjasek Mar 16, 2023
7b2fbe1
release v2.6.2
petrjasek Mar 16, 2023
9d53622
DST fix date calculations wrong (#4230)
marwoodandrew Apr 5, 2023
891b6b5
Merge remote-tracking branch 'origin/hotfix/2.2.2' into hotfix/2.6.3
petrjasek Apr 14, 2023
751fda3
Merge remote-tracking branch 'origin/hotfix/2.5.3' into hotfix/2.6.3
petrjasek Apr 14, 2023
3e88ae9
Add image suggestion feature to iMatrics widget (#4175)
imatricsOpenSource Mar 1, 2023
9d18206
update e2e server runtime
petrjasek Apr 25, 2023
3dc4662
improve table copy pasting into editor3 (#4252)
petrjasek May 25, 2023
ed677b4
[TGA-45] Update IVocabulary interface with `selection_type` (#4300)
MarkLark86 Jul 27, 2023
0be35b9
[SDAAP-92] Dynamicaly update the body_footer in editor3 (#4308)
marwoodandrew Aug 21, 2023
9ee6050
Bump UIF version to fix menu component (#4323)
thecalcc Sep 7, 2023
c4e9339
Merge remote-tracking branch 'origin/hotfix/2.6.2' into hotfix/2.6.3
petrjasek Sep 12, 2023
76b41d6
fix height on places field (#4328)
dzonidoo Sep 14, 2023
6e1f60d
remove bg color (#4329)
dzonidoo Sep 20, 2023
726a54a
Link shortcut and formatting options zindex fix (#4326)
thecalcc Sep 14, 2023
0839596
Multi line image caption (#4324)
thecalcc Sep 8, 2023
528eeb1
fix auto tagging extension compile (#4330)
petrjasek Sep 22, 2023
e0b924b
Merge remote-tracking branch 'origin/hotfix/2.5.3' into develop
petrjasek Oct 6, 2023
0fa45fa
Merge remote-tracking branch 'origin/hotfix/2.6.3' into develop
petrjasek Oct 6, 2023
24e7cdc
update dependencies
petrjasek Oct 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .fireq.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"superdesk_branch": "release/2.5"
}
2 changes: 1 addition & 1 deletion e2e/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8
FROM python:3.10

ADD requirements.txt .
RUN pip3 install -U pip wheel setuptools
Expand Down
2 changes: 1 addition & 1 deletion e2e/server/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile requirements.in
Expand Down
235 changes: 139 additions & 96 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "superdesk-core",
"version": "2.6.1",
"version": "2.6.2",
"license": "AGPL-3.0",
"repository": {
"type": "git",
Expand Down Expand Up @@ -119,7 +119,7 @@
"sass-loader": "6.0.6",
"shortid": "2.2.8",
"style-loader": "0.20.2",
"superdesk-ui-framework": "^3.0.54",
"superdesk-ui-framework": "^3.0.59",
"ts-loader": "3.5.0",
"tslint": "5.11.0",
"typescript": "~4.9.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ export function ArticleEditDirective(
scope.item.body_footer = scope.item.body_footer + scope.extra.body_footer_value.value;
mainEditScope.dirty = true;
autosave.save(scope.item, scope.origItem);
scope.refresh();
}

// first option should always be selected, as multiple helplines could be added in footer
Expand Down
2 changes: 1 addition & 1 deletion scripts/core/editor3/components/handlePastedText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export function handlePastedText(text: string, _html: string): DraftHandleValue
return 'handled';
}

if (htmlComesFromDraftjsEditor(html)) {
if (htmlComesFromDraftjsEditor(html, false)) {
return 'not-handled';
}

Expand Down
19 changes: 19 additions & 0 deletions scripts/core/editor3/components/tests/handlePastedText.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {cursorAtEndPosition, cursorAtPosition} from './utils';
import {insertContentInState, createHtmlFromText} from '../handlePastedText';
import {getAnnotationsFromContentState} from 'core/editor3/helpers/editor3CustomData';
import {getContentStateFromHtml} from 'core/editor3/html/from-html';
import {htmlComesFromDraftjsEditor} from 'core/editor3/helpers/htmlComesFromDraftjsEditor';
import HTML_WITH_TABLE from './pastedHtmlWithTable.html';

describe('editor3.handlePastedText', () => {
it('should insert text without selection', () => {
Expand Down Expand Up @@ -111,4 +113,21 @@ describe('editor3.handlePastedText', () => {

expect(contentState.getPlainText('\n')).toEqual(text);
});

it('should handle table blocks', () => {
const contentState = getContentStateFromHtml(HTML_WITH_TABLE);
const blocks = contentState.getBlocksAsArray();

expect(htmlComesFromDraftjsEditor(HTML_WITH_TABLE, false)).toBe(false);

expect(blocks.length).toBe(2);
expect(blocks[0].getType()).toBe("atomic");

const entity = contentState.getEntity(blocks[0].getEntityAt(0));
expect(entity.getType()).toBe("TABLE");

const tableData = entity.getData().data;
expect(tableData.numRows).toBe(6);
expect(tableData.numCols).toBe(4);
});
});
765 changes: 765 additions & 0 deletions scripts/core/editor3/components/tests/pastedHtmlWithTable.html

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions scripts/core/editor3/helpers/htmlComesFromDraftjsEditor.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
export const htmlComesFromDraftjsEditor = (html: string) =>
new DOMParser().parseFromString(html, 'text/html').querySelector('[data-offset-key]') != null;
export const htmlComesFromDraftjsEditor = (html: string, allowTables = true) => {
const tree = new DOMParser().parseFromString(html, 'text/html');

return tree.querySelector('[data-offset-key]') != null && (
allowTables || tree.getElementsByClassName('table-inside').length === 0
);
};
22 changes: 22 additions & 0 deletions scripts/core/editor3/html/from-html/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ class HTMLParser {
* about the HTML that was extracted.
*/
pruneNodes() {
this.cleanUpDraftTables();

this.tree.html(this.manageEmbeds(this.tree.html()));

this.tree.find('iframe').each((i, node) => {
Expand Down Expand Up @@ -357,6 +359,26 @@ class HTMLParser {

return atomicBlock(block, 'MEDIA', 'MUTABLE', mediaJson);
}

/**
* When copy&pasting between windows without editor instance around
* we just get internal draft html with editors inside table which
* is not feasible for parsing, so replace the inner editor markup
* with the contents of the span inside.
*/
cleanUpDraftTables() {
const handleInnerEditor = (i, elem) => {
const content = elem.querySelector('span[data-text="true"]').innerHTML;

elem.innerHTML = content;
};

this.tree.find('.table-inside > table').each((i, table) => {
$(table).find('th').each(handleInnerEditor);
$(table).find('td').each(handleInnerEditor);
$(table).closest('figure').replaceWith(table);
});
}
}

export function getContentStateFromHtml(html: string, associations: object = {}): ContentState {
Expand Down
1 change: 1 addition & 0 deletions scripts/core/superdesk-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ declare module 'superdesk-api' {
preffered_items?: boolean;
tags?: Array<IVocabularyTag>;
disable_entire_category_selection?: boolean;
selection_type?: 'single selection' | 'multi selection' | 'do not show';
}

export interface IArticleField extends IVocabulary {
Expand Down
Loading