Skip to content

Commit

Permalink
fix(webapps): refactor to use asset module instead of loaders (camund…
Browse files Browse the repository at this point in the history
  • Loading branch information
tasso94 authored Jul 3, 2023
1 parent da3c34d commit 3001745
Show file tree
Hide file tree
Showing 174 changed files with 340 additions and 457 deletions.
2 changes: 1 addition & 1 deletion webapps/frontend/camunda-commons-ui/lib/analytics/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

var angular = require('angular');

var modalTemplate = require('./modal.html')();
var modalTemplate = require('./modal.html?raw');

// CAMUNDA_VERSION has a structure of 'major.minor.patch[-SNAPSHOT]', but we only need 'major.minor' for doc links
var camundaVersion = (CAMUNDA_VERSION || '').match(/([0-9]+.[0-9]+)/); // eslint-disable-line
Expand Down
2 changes: 1 addition & 1 deletion webapps/frontend/camunda-commons-ui/lib/auth/page/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

'use strict';

var template = require('./login.html')();
var template = require('./login.html?raw');
var logo = require('svg-inline-loader?classPrefix&removeSVGTagAttrs=false!./logo.svg');

var $ = require('jquery');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'use strict';

var angular = require('camunda-bpm-sdk-js/vendor/angular');
var template = require('./engineSelect.html')();
var template = require('./engineSelect.html?raw');

var $ = require('jquery');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'use strict';

var angular = require('camunda-bpm-sdk-js/vendor/angular');
var template = require('./inPlaceTextField.html')();
var template = require('./inPlaceTextField.html?raw');

/**
* @name inPlaceTextField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

'use strict';

const template = require('./cam-annotation-edit.html')();
const template = require('./cam-annotation-edit.html?raw');
const annotationModal = require('./cam-annotation-modal');

module.exports = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

'use strict';

var template = require('./cam-annotation-modal.html')();
var template = require('./cam-annotation-modal.html?raw');

module.exports = (annotation, readOnly, callback) => {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var ModuleLoader = require('../../util/moduleLoader');

var angular = require('camunda-bpm-sdk-js/vendor/angular'),
Viewer = require('../../util/viewer'),
template = require('./cam-widget-bpmn-viewer.html')();
template = require('./cam-widget-bpmn-viewer.html?raw');

module.exports = [
'$q',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

'use strict';

var template = require('./cam-share-link.html')();
var template = require('./cam-share-link.html?raw');

module.exports = [
'$location',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

var Clipboard = require('clipboard');

var template = require('./cam-widget-clipboard.html')();
var template = require('./cam-widget-clipboard.html?raw');

module.exports = [
'$timeout',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

var Viewer = require('cmmn-js/lib/NavigatedViewer');

var template = require('./cam-widget-cmmn-viewer.html')();
var template = require('./cam-widget-cmmn-viewer.html?raw');

module.exports = [
'$compile',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

'use strict';

var template = require('./cam-widget-debug.html')();
var template = require('./cam-widget-debug.html?raw');

module.exports = [
function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var Viewer = require('./lib/navigatedViewer').default;
var Modeler = require('camunda-dmn-js').CamundaPlatformModeler;
var changeDmnNamespace = require('../../util/change-dmn-namespace');

var template = require('./cam-widget-dmn-viewer.html')();
var template = require('./cam-widget-dmn-viewer.html?raw');

// This is only relevant when editMode===true,
// but we only want to rewrite the function once
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

'use strict';

var template = require('./cam-widget-footer.html')();
var template = require('./cam-widget-footer.html?raw');

module.exports = [
function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
var $ = require('jquery');

var angular = require('camunda-bpm-sdk-js/vendor/angular'),
template = require('./cam-widget-header.html'),
logo = require('raw-loader!./logo-2020-round.svg').default;
template = require('./cam-widget-header.html?raw'),
logo = require('./logo-2020-round.svg?raw');

var apps = {
welcome: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

var angular = require('camunda-bpm-sdk-js/vendor/angular'),
$ = require('jquery'),
template = require('./cam-widget-inline-field.html')();
template = require('./cam-widget-inline-field.html?raw');

const dialogController = require('./dialog/controller');
const dialogTemplate = require('./dialog/template.html')();
const dialogTemplate = require('./dialog/template.html?raw');

function getScrollParent(element) {
var style = getComputedStyle(element);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'use strict';

var angular = require('camunda-bpm-sdk-js/vendor/angular'),
template = require('./cam-widget-loader.html')();
template = require('./cam-widget-loader.html?raw');

module.exports = [
'$translate',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'use strict';

var angular = require('camunda-bpm-sdk-js/vendor/angular'),
template = require('./cam-widget-password.html')();
template = require('./cam-widget-password.html?raw');

module.exports = [
'camAPI',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'use strict';

var $ = require('jquery'),
template = require('./cam-widget-search-pill.html')();
template = require('./cam-widget-search-pill.html?raw');

module.exports = [
'$timeout',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
var angular = require('camunda-bpm-sdk-js/vendor/angular'),
copy = angular.copy,
$ = require('jquery'),
template = require('./cam-widget-search.html')();
template = require('./cam-widget-search.html?raw');

var dateRegex = /(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)(?:.(\d\d\d)| )?$/;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

'use strict';

var template = require('./cam-widget-selection-type.html');
var template = require('./cam-widget-selection-type.html?raw');

module.exports = [
'$location',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

var angular = require('camunda-bpm-sdk-js/vendor/angular'),
typeUtils = require('camunda-bpm-sdk-js/lib/forms/type-util'),
templateDialog = require('./cam-widget-variable-dialog.html')(),
templateStringDialog = require('./cam-widget-string-dialog.html')();
templateDialog = require('./cam-widget-variable-dialog.html?raw'),
templateStringDialog = require('./cam-widget-string-dialog.html?raw');

var varUtils = {};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

var angular = require('camunda-bpm-sdk-js/vendor/angular'),
varUtils = require('./cam-variable-utils'),
template = require('./cam-widget-variable.html')();
template = require('./cam-widget-variable.html?raw');

var variableTypes = varUtils.types;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

var angular = require('camunda-bpm-sdk-js/vendor/angular'),
varUtils = require('../variable/cam-variable-utils'),
template = require('./cam-widget-variables-table.html'),
confirmationTemplate = require('./cam-widget-variables-deletion-dialog.html')();
template = require('./cam-widget-variables-table.html?raw'),
confirmationTemplate = require('./cam-widget-variables-deletion-dialog.html?raw');

var typeUtils = varUtils.typeUtils;

Expand Down
79 changes: 0 additions & 79 deletions webapps/frontend/package-lock.json

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

2 changes: 0 additions & 2 deletions webapps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
"babel-loader": "9.1.2",
"copy-webpack-plugin": "11.0.0",
"css-loader": "6.7.3",
"ejs-loader": "0.5.0",
"eslint": "8.38.0",
"eslint-config-prettier": "8.8.0",
"eslint-plugin-camunda-licensed": "0.4.6",
Expand All @@ -91,7 +90,6 @@
"mini-css-extract-plugin": "2.7.5",
"prettier": "1.19.1",
"raw-loader": "4.0.2",
"string-replace-loader": "3.1.0",
"svg-inline-loader": "0.8.2",
"terser-webpack-plugin": "5.3.7",
"webpack": "5.79.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ import {

window.define = define;
window.require = rjsrequire;
window.bust = '$CACHE_BUST';
window.bust = CAMUNDA_VERSION; // eslint-disable-line

// camunda-admin-bootstrap is copied as-is, so we have to inline everything
const appRoot = document.querySelector('base').getAttribute('app-root');
const baseImportPath = `${appRoot}/app/admin/`;

requirejs.config({
baseUrl: baseImportPath,
urlArgs: 'bust=$CACHE_BUST'
urlArgs: `bust=${CAMUNDA_VERSION}` // eslint-disable-line
});

const loadConfig = (async function() {
Expand Down Expand Up @@ -86,7 +86,7 @@ define('camunda-admin-bootstrap', function() {
node.setAttribute('rel', 'stylesheet');
node.setAttribute(
'href',
plugin.location + '/plugin.css?bust=$CACHE_BUST'
plugin.location + `/plugin.css?bust=${CAMUNDA_VERSION}` // eslint-disable-line
);
document.head.appendChild(node);
});
Expand Down
Loading

0 comments on commit 3001745

Please sign in to comment.