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

Breaking/tdr 9/handlebars 4 upgrade #78

Draft
wants to merge 17 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 8 commits
Commits
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
5 changes: 4 additions & 1 deletion build/path.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ module.exports = {
testOutputDir: path.resolve(rootPath, 'test'),
aliases: {
ui: srcDir,
build: path.resolve(rootPath, 'build')
build: path.resolve(rootPath, 'build'),
// Hardcoded paths to partial Handlebars templates (prevents unresolved template dependencies)
'ui-generis-widget-label.tpl': path.resolve(srcDir, 'generis/widget/widget.tpl'),
'ui-form-widget-label.tpl': path.resolve(srcDir, 'form/widget/tpl/label.tpl')
oatymart marked this conversation as resolved.
Show resolved Hide resolved
}
};
16 changes: 0 additions & 16 deletions build/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,6 @@ import wildcardExternal from '@oat-sa/rollup-plugin-wildcard-external';
const { srcDir, outputDir, aliases } = require('./path');
const Handlebars = require('handlebars');

/**
* Support of handlebars 1.3.0
* TODO remove once migrated to hbs >= 3.0.0
*/
const originalVisitor = Handlebars.Visitor;
Handlebars.Visitor = function() {
return originalVisitor.call(this);
};
Handlebars.Visitor.prototype = Object.create(originalVisitor.prototype);
Handlebars.Visitor.prototype.accept = function() {
try {
originalVisitor.prototype.accept.apply(this, arguments);
} catch (e) {}
};
/* --------------------------------------------------------- */

const inputs = glob.sync(path.join(srcDir, '**', '*.js'));

/**
Expand Down
141 changes: 85 additions & 56 deletions package-lock.json

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

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oat-sa/tao-core-ui",
"version": "0.26.0",
"version": "1.0.0",
"displayName": "TAO Core UI",
"description": "UI libraries of TAO",
"scripts": {
Expand Down Expand Up @@ -42,19 +42,19 @@
"@oat-sa/browserslist-config-tao": "^0.1.0",
"@oat-sa/expr-eval": "^1.3.0",
"@oat-sa/rollup-plugin-wildcard-external": "^0.1.0",
"@oat-sa/tao-core-libs": "^0.3.0",
"@oat-sa/tao-core-sdk": "^0.4.1",
"@oat-sa/tao-qunit-testrunner": "^0.1.3",
"@oat-sa/tao-core-libs": "oat-sa/tao-core-libs-fe#breaking/TDR-9/handlebars-4-upgrade",
"@oat-sa/tao-core-sdk": "oat-sa/tao-core-sdk-fe#breaking/TDR-9/handlebars-4-upgrade",
"@oat-sa/tao-qunit-testrunner": "^1.0.3",
"async": "^0.2.10",
"autoprefixer": "^9.5.1",
"decimal.js": "10.1.1",
"devbridge-autocomplete": "^1.2.20",
"dompurify": "^1.0.10",
"dompurify": "^2.0.7",
"flatpickr": "4.5.7",
"fs-extra": "^8.0.1",
"gamp": "^0.2.1",
"glob": "^7.1.4",
"handlebars": "1.3.0",
"handlebars": "4.5.3",
"interactjs": "1.3.4",
"jquery": "1.9.1",
"jquery-mockjax": "^2.5.0",
Expand Down
16 changes: 6 additions & 10 deletions src/datalist/tpl/list.tpl
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
{{#each list}}
<tr data-id="{{id}}">
{{#if ../selectable}}
{{#if @root.selectable}}
<td class="checkboxes"><input type="checkbox" name="cb[{{id}}]" value="1" /></td>
{{/if}}
<td class="label">{{label}}</td>
{{#if ../actions}}
{{#if @root.actions}}
<td class="actions">
{{#each ../../actions}}
{{#with ../../line}}
{{#unless ../hidden}}
{{#with ../../this}}
{{#each @root.actions}}
{{#unless hidden}}
<button class="btn-info small" data-control="{{id}}"{{#if title}} title="{{title}}"{{/if}}>
{{#if icon}}<span class="icon icon-{{icon}}"></span>{{/if}}
{{label}}
</button>
{{/with}}
{{/unless}}
{{/with}}
{{/each}}
{{/unless}}
{{/each}}
</td>
{{/if}}
</tr>
Expand Down
Loading