Skip to content

Commit

Permalink
Merge branch 'develop' into ui-configs
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaskikutis committed Oct 6, 2021
2 parents 67dd9b8 + b13d34f commit e80d000
Show file tree
Hide file tree
Showing 120 changed files with 1,577 additions and 2,313 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
missing-translations-strings.js
language-mapping-list.js
*.d.ts
scripts/extensions/*/node_modules
scripts/extensions/**/dist
scripts/extensions/**/refs.d.ts
end-to-end-testing-helpers/dist
end-to-end-testing-helpers/node_modules
spec/**/*.js
10 changes: 2 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,12 @@ jobs:

- uses: actions/setup-node@v1
with:
node-version: '12.x'
node-version: '10.x'

# avoid file watch limit error
- run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- run: npm ci

# running @superdesk/build-tools is required to generate instance configuration schema
# otherwise imports would not be found and linting/unit tests would fail
- run: npm install && npm run build
working-directory: e2e/client

- run: npm run test

e2e:
Expand All @@ -41,7 +35,7 @@ jobs:

- uses: actions/setup-node@v1
with:
node-version: '12.x'
node-version: '10.x'


- name: Start e2e server
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ e2e-test-results
templates-cache.generated.js
styles/extension-styles.generated.css
e2e/client/specs/**/*.js
*.generated.ts
.env
npm-debug.log
index.html
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Superdesk Client Changelog

## [2.2.0] 2021-05-04
## [2.2.0] 2021-05-05

[Changes](https://github.com/superdesk/superdesk-client-core/milestone/87?closed=1)

Expand Down
8 changes: 4 additions & 4 deletions build-tools/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superdesk/build-tools",
"version": "2.0.1",
"version": "1.0.16",
"publishConfig": {
"access": "public"
},
Expand Down
18 changes: 2 additions & 16 deletions build-tools/src/extensions/extract-translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ const fs = require('fs');
const path = require('path');
const getExtensionDirectoriesSync = require('./get-extension-directories-sync');

const {GettextExtractor, JsExtractors, HtmlExtractors} = require('gettext-extractor');
const {GettextExtractor, JsExtractors} = require('gettext-extractor');
const extractor = new GettextExtractor();

function extractTranslations(clientDir) {
for (const {extensionRootPath} of getExtensionDirectoriesSync(clientDir)) {
const package = JSON.parse(fs.readFileSync(path.join(extensionRootPath, 'package.json'), 'utf-8'));
const paths = _.get(package, 'superdeskExtension.translations-extract-paths');


if (paths == null || !Array.isArray(paths)) {
continue;
return null;
}

const pathsAbsolute = paths.map((p) => path.join(extensionRootPath, p));
Expand All @@ -39,19 +38,6 @@ function extractTranslations(clientDir) {
jsParser.parseFilesGlob(`${_path}/**/*.@(ts|js|tsx|jsx)`);
}

const htmlParser = extractor
.createHtmlParser([
HtmlExtractors.elementContent('[translate]', {
attributes: {
textPlural: 'translate-plural',
},
}),
]);

for (const _path of pathsAbsolute) {
htmlParser.parseFilesGlob(`${_path}/**/*.@(html)`);
}

extractor.savePotFile(`${extensionRootPath}/translations.generated.pot`);
}
}
Expand Down
71 changes: 0 additions & 71 deletions build-tools/src/generate-instance-configuration-schema.js

This file was deleted.

16 changes: 2 additions & 14 deletions build-tools/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const installExtensions = require('./extensions/install-extensions');
const {mergeTranslationsFromExtensions} = require('./extensions/translations');
const {extractTranslations} = require('./extensions/extract-translations');
const {namespaceCSS, watchCSS} = require('./extensions/css');
const {generateInstanceConfigurationSchema} = require('./generate-instance-configuration-schema');

const {Command} = require('commander');
const program = new Command();
Expand All @@ -27,14 +26,6 @@ program.configureHelp({
},
});

program.command('generate-instance-configuration-schema <main-client-dir>')
.description('reads typescript interfaces and generates JSON schema that will be used to generate the UI')
.action((mainClientDir) => {
const clientDirAbs = path.join(currentDir, mainClientDir);

generateInstanceConfigurationSchema(clientDirAbs);
});

program.command('po-to-json <source-dir-po> <output-dir-json>')
.description('convert .po files in the directory to .json format that is used by Superdesk')
.action((sourcePo, outputJson) => {
Expand All @@ -48,8 +39,8 @@ program.command('build-root-repo <main-client-dir>')
.description('executes all actions required to prepare the main repo for usage')
.action((mainClientDir) => {
const clientDirAbs = path.join(currentDir, mainClientDir);

generateInstanceConfigurationSchema(clientDirAbs);
const poDir = path.join(clientDirAbs, 'node_modules/superdesk-core/po');
const translationsDir = path.join(currentDir, mainClientDir, 'dist/languages');

// build will fail if extensions are not installed
installExtensions(clientDirAbs);
Expand All @@ -60,9 +51,6 @@ program.command('build-root-repo <main-client-dir>')
{stdio: 'inherit'}
);

const poDir = path.join(clientDirAbs, 'node_modules/superdesk-core/po');
const translationsDir = path.join(currentDir, mainClientDir, 'dist/languages');

// translationsDir is only created after the build and would get removed if created before build
poToJson(poDir, translationsDir);
mergeTranslationsFromExtensions(clientDirAbs);
Expand Down
8 changes: 0 additions & 8 deletions e2e/client/specs/globals.d.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
// testing
declare const describe: any;

declare const xdescribe: any;

declare const fdescribe: any;

declare const beforeEach: any;

declare const afterEach: any;

declare const expect: any;

declare const it: any;

declare const fit: any;

declare const xit: any;
2 changes: 1 addition & 1 deletion e2e/client/specs/users_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('users', () => {

it('can save and use language preferences', () => {
userPreferences.setLang('Deutsch');
browser.wait(ECE.elementToBeClickable(userPreferences.btnSave), 3000);
browser.wait(() => userPreferences.btnSave.isDisplayed(), 3000);
userPreferences.btnSave.click();

browser.sleep(500); // wait for modal
Expand Down
Loading

0 comments on commit e80d000

Please sign in to comment.