Skip to content

Commit

Permalink
chore: [wip] async and handlebars version rollback, and extension for…
Browse files Browse the repository at this point in the history
… the pathes adding
  • Loading branch information
Kirill-Hatalski committed Oct 15, 2024
1 parent 9d91ea2 commit d536bd9
Show file tree
Hide file tree
Showing 57 changed files with 149 additions and 160 deletions.
2 changes: 1 addition & 1 deletion build/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import commonJS from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';
import istanbul from 'rollup-plugin-istanbul';

import { srcDir, outputDir } from "./path";
import { srcDir, outputDir } from "./path.js";

const isDev = process.env.NODE_ENV === 'development';

Expand Down
83 changes: 57 additions & 26 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@
"@oat-sa/eslint-config-tao": "^2.0.0",
"@oat-sa/prettier-config": "^0.1.1",
"@oat-sa/tao-qunit-testrunner": "^2.0.0",
"async": "^3.2.6",
"async": "^0.2.10",
"eslint": "^8.39.0",
"fetch-mock": "^9.11.0",
"glob": "^8.1.0",
"handlebars": "4.7.7",
"handlebars": "1.3.0",
"jquery-mockjax": "^2.6.0",
"jquery-simulate": "^1.0.2",
"node-qunit-puppeteer": "^1.0.13",
Expand Down
3 changes: 1 addition & 2 deletions src/core/asyncProcess.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
* @author Jean-Sébastien Conan <jean-sebastien.conan@vesperiagroup.com>
*/
import _ from 'lodash';
import Promise from './promise';
import eventifier from './eventifier';
import eventifier from './eventifier.js';

/**
* Defines a manager for async process with deferred steps.
Expand Down
2 changes: 1 addition & 1 deletion src/core/cachedStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* @author Jean-Sébastien Conan <jean-sebastien.conan@vesperiagroup.com>
*/
import store from './store';
import store from './store.js';

/**
* The default name of the key storage indexing the persisted data
Expand Down
6 changes: 3 additions & 3 deletions src/core/communicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
* @author Jean-Sébastien Conan <jean-sebastien.conan@vesperiagroup.com>
*/
import _ from 'lodash';
import providerRegistry from './providerRegistry';
import delegator from './delegator';
import eventifier from './eventifier';
import providerRegistry from './providerRegistry.js';
import delegator from './delegator.js';
import eventifier from './eventifier.js';

/**
* Some default config values
Expand Down
4 changes: 2 additions & 2 deletions src/core/communicator/poll.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
*/

import _ from 'lodash';
import pollingFactory from '../polling';
import coreRequest from '../request';
import pollingFactory from '../polling.js';
import coreRequest from '../request.js';

/**
* Some default config values
Expand Down
2 changes: 1 addition & 1 deletion src/core/communicator/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @author Bertrand Chevrier <bertrand@taotesting.com>
*/
import _ from 'lodash';
import pollProvider from './poll';
import pollProvider from './poll.js';

/**
* 'request' provider for {@link core/communicator}
Expand Down
2 changes: 1 addition & 1 deletion src/core/connectivity.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
* @author Bertrand Chevrier <bertrand@taotesting.com>
*/
import eventifier from './eventifier';
import eventifier from './eventifier.js';

/**
* @type {Boolean} the current status, true means online
Expand Down
8 changes: 4 additions & 4 deletions src/core/dataProvider/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
* @author Jean-Sébastien Conan <jean-sebastien@taotesting.com>
*/
import _ from 'lodash';
import delegator from '../delegator';
import eventifier from '../eventifier';
import providerRegistry from '../providerRegistry';
import tokenHandlerFactory from '../tokenHandler';
import delegator from '../delegator.js';
import eventifier from '../eventifier.js';
import providerRegistry from '../providerRegistry.js';
import tokenHandlerFactory from '../tokenHandler.js';

const _defaults = {};

Expand Down
7 changes: 3 additions & 4 deletions src/core/dataProvider/proxy/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @author Jean-Sébastien Conan <jean-sebastien@taotesting.com>
*/
import _ from 'lodash';
import request from '../request';
import request from '../request.js';

const _defaults = {
noCache: true,
Expand Down Expand Up @@ -89,7 +89,7 @@ export default {
* @param {string} method
* @returns {Promise|*}
*/
this.processRequest = function processRequest(action, params, method) {
this.processRequest = async function processRequest(action, params, method) {
let descriptor = config.actions[action];
const headers = {};
const tokenHandler = this.getTokenHandler();
Expand All @@ -114,7 +114,6 @@ export default {
if (config.noCache) {
params = _.merge({ _: new Date().getTime() }, params);
}

if (!config.noToken) {
token = tokenHandler.getToken();
if (token) {
Expand Down Expand Up @@ -152,7 +151,7 @@ export default {
},

/**
* Requests the server for a create action
* Requests the server for a creation action
* @param {Object} params
* @returns {Promise}
*/
Expand Down
4 changes: 2 additions & 2 deletions src/core/dataProvider/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* @author Martin Nicholson <martin@taotesting.com>
*/
import _ from 'lodash';
import coreRequest from '../request';
import coreRequest from '../request.js';

/**
* A wrapper for the core module which requests content from a TAO endpoint
Expand All @@ -56,7 +56,7 @@ export default function request(url, data, method, headers, background, noToken)
method: method,
headers: headers,
background: background,
noToken: noToken !== false
noToken: noToken !== false ? false : true
}).then(function(response) {
if (_.isUndefined(response)) { // in case 204 empty content
return Promise.resolve();
Expand Down
2 changes: 1 addition & 1 deletion src/core/databindcontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import $ from 'jquery';
import _ from 'lodash';
import DataBinder from './databinder';
import DataBinder from './databinder.js';

export default {
takeControl($container, options) {
Expand Down
4 changes: 2 additions & 2 deletions src/core/databinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import $ from 'jquery';
import _ from 'lodash';
import Handlebars from 'handlebars';
import Encoders from './encoder/encoders';
import Filters from './filter/filters';
import Encoders from './encoder/encoders.js';
import Filters from './filter/filters.js';

/**
* Get the value of a property defined by the path into the object
Expand Down
1 change: 0 additions & 1 deletion src/core/delegator.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ function delegator(api, provider, config) {
} else {
throw new Error(`There is no ${name} provider!`);
}

return response;
}

Expand Down
14 changes: 7 additions & 7 deletions src/core/encoder/encoders.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
* Copyright (c) 2016-2019 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
*/
import _ from 'lodash';
import boolean from './boolean';
import number from './number';
import float from './float';
import time from './time';
import array2str from './array2str';
import str2array from './str2array';
import entity from './entity';
import boolean from './boolean.js';
import number from './number.js';
import float from './float.js';
import time from './time.js';
import array2str from './array2str.js';
import str2array from './str2array.js';
import entity from './entity.js';

/**
* Extract the argument in parentheses from a function name: "foo(a,b)" return [a,b]
Expand Down
2 changes: 1 addition & 1 deletion src/core/error/ApiError.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Copyright (c) 2024 (original work) Open Assessment Technologies SA ;
*/

import errorTypes from './types';
import errorTypes from './types.js';

/**
* Errors sent by HTTP API / backend
Expand Down
2 changes: 1 addition & 1 deletion src/core/error/AuthError.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Copyright (c) 2024 (original work) Open Assessment Technologies SA ;
*/

import errorTypes from './types';
import errorTypes from './types.js';

/**
* Error due to client side authentication mechanisms
Expand Down
2 changes: 1 addition & 1 deletion src/core/error/NetworkError.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Copyright (c) 2024 (original work) Open Assessment Technologies SA ;
*/

import errorTypes from './types';
import errorTypes from './types.js';

/**
* Network errors
Expand Down
2 changes: 1 addition & 1 deletion src/core/error/RenderingError.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Copyright (c) 2024 (original work) Open Assessment Technologies SA ;
*/

import errorTypes from './types';
import errorTypes from './types.js';

/**
* Error in rendering
Expand Down
Loading

0 comments on commit d536bd9

Please sign in to comment.