Skip to content
Code-Schnipsel Gruppen Projekte

Revisionen vergleichen

Änderungen werden so angezeigt, als ob die Quellrevision mit der Zielrevision zusammengeführt würde. Erfahre mehr über den Vergleich von Revisionen.

Quelle

Zielprojekt auswählen
No results found

Ziel

Zielprojekt auswählen
  • quiqqer/products
1 Ergebnis
Änderungen anzeigen
Commits auf Quelle (3)
  • Henning Leutz's avatar
    fix: update variable declarations and cache handling · a8ecb4a0
    verfasst von Henning Leutz
    This commit involves refactoring code in Products.js by updating 'var' to 'let' or 'const' for
    proper scoping and better readability. It also introduces a new variable 'inAdministration' to
    handle specific conditions for QUIQQER's administrative state and modifies the condition for using
    cached data, considering 'inAdministration'. Expect no changes in functionality or behavior of the
    software with these changes.
    a8ecb4a0
  • Henning Leutz's avatar
    Merge branch 'next-2.x' into 'main' · 7a66d570
    verfasst von Henning Leutz
    fix: update variable declarations and cache handling
    
    See merge request !113
    7a66d570
  • Henning Leutz's avatar
    Merge branch 'main' into 'next-3.x' · c6b14298
    verfasst von Henning Leutz
    Update 'next-3.x' with latest changes from 'main'
    
    See merge request !114
    c6b14298
......@@ -84,19 +84,19 @@ define('package/quiqqer/products/bin/classes/Products', [
*/
openProduct: function (productId) {
return this.getChild(productId).then(function (attributes) {
var panel = attributes.typePanel;
let panel = attributes.typePanel;
if (panel === '' || typeof panel === 'undefined') {
panel = 'package/quiqqer/products/bin/controls/products/Product';
}
return new Promise(function (resolve) {
var needles = [];
let needles = [];
needles.push(panel);
needles.push('utils/Panels');
require(needles, function (Panel, Utils) {
var Control = new Panel({
const Control = new Panel({
productId: productId
});
......@@ -175,7 +175,7 @@ define('package/quiqqer/products/bin/classes/Products', [
}
require(['Projects'], function (Projects) {
var Project = Projects.get(result.project),
const Project = Projects.get(result.project),
Media = Project.getMedia();
Media.get(result.id).then(resolve).catch(function () {
......@@ -231,8 +231,13 @@ define('package/quiqqer/products/bin/classes/Products', [
const jsonData = JSON.stringify({productId, fields});
const key = btoa(String.fromCharCode(...new TextEncoder().encode(jsonData))).slice(0, 32);
let inAdministration = false;
if (typeof QUIQQER.inAdministration !== 'undefined' && QUIQQER.inAdministration) {
inAdministration = !!QUIQQER.inAdministration;
}
return new Promise(function (resolve, reject) {
if (!forceCache && typeof requestCache[key] !== 'undefined') {
if (!forceCache && typeof requestCache[key] !== 'undefined' && !inAdministration) {
// JSON.parse(JSON.stringify because JS reference usage
return resolve(JSON.parse(JSON.stringify(requestCache[key])));
}
......@@ -489,7 +494,7 @@ define('package/quiqqer/products/bin/classes/Products', [
'package/quiqqer/products/bin/controls/products/Product',
'utils/Panels'
], function (ProductPanel, Panels) {
var PPanel = new ProductPanel({
const PPanel = new ProductPanel({
productId: productId,
'#id': productId
});
......@@ -504,7 +509,7 @@ define('package/quiqqer/products/bin/classes/Products', [
* @param {number} pid
*/
addToVisited: function (pid) {
var visited = this.getVisitedProductIds();
let visited = this.getVisitedProductIds();
visited.push(pid);
visited = visited.unique();
......@@ -522,7 +527,7 @@ define('package/quiqqer/products/bin/classes/Products', [
* @returns {Array}
*/
getVisitedProductIds: function () {
var visited = QUI.Storage.get('quiqqer-products-visited');
let visited = QUI.Storage.get('quiqqer-products-visited');
if (!visited) {
return [];
......