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

fix(mwpw-165609): restore card collection rendering by correcting getAttribute implementation #219

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all 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: 3 additions & 2 deletions commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ module.exports = {
{
rules: {
'jira-ticket-in-scope': ({scope}) => {
const pattern = /^MWPW-\d+$/;
const pattern = /^mwpw-\d+$/;
const hasValidTicket = pattern.test(scope || '');
return [
hasValidTicket,
'Scope must contain JIRA ticket (e.g., feat(MWPW-123): message)',
'Scope must contain JIRA ticket (e.g., feat(mwpw-123): message)',
];
},
},
Expand All @@ -18,4 +18,5 @@ module.exports = {
'scope-empty': [2, 'never'], // scope is required
'jira-ticket-in-scope': [2, 'always'], // enforce our custom rule
},
defaultIgnores: false,
};
2 changes: 1 addition & 1 deletion dist/app.css

Large diffs are not rendered by default.

15 changes: 3 additions & 12 deletions dist/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Chimera UI Libraries - Build 0.23.28 (1/6/2025, 16:49:34)
* Chimera UI Libraries - Build 0.24.1 (1/14/2025, 19:06:40)
*
*/
/******/ (function(modules) { // webpackBootstrap
Expand Down Expand Up @@ -56126,8 +56126,6 @@ Object.defineProperty(exports, "__esModule", {
});
exports.ConsonantPageModel = undefined;

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _reactDomComponents = __webpack_require__(107);

var _Container = __webpack_require__(108);
Expand All @@ -56152,18 +56150,11 @@ var ConsonantPageModel = exports.ConsonantPageModel = function (_DOMModel) {

var _this = _possibleConstructorReturn(this, (ConsonantPageModel.__proto__ || Object.getPrototypeOf(ConsonantPageModel)).call(this, element));

_this.id = element.getAttribute('id'); // Initialize id
_this.dataConfig = element.getAttribute('data-config'); // Initialize dataConfig
_this.getAttribute('id', 'id');
_this.getAttribute('data-config', 'dataConfig');
return _this;
}

_createClass(ConsonantPageModel, [{
key: 'getAttribute',
value: function getAttribute(attr) {
return this[attr]; // Return the attribute value
}
}]);

return ConsonantPageModel;
}(_reactDomComponents.DOMModel);

Expand Down
4 changes: 2 additions & 2 deletions dist/main.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/main.source.js
Original file line number Diff line number Diff line change
Expand Up @@ -2099,7 +2099,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});
/***/ (function(module, exports, __webpack_require__) {

"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ConsonantPageModel = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _reactDomComponents = __webpack_require__(107);\n\nvar _Container = __webpack_require__(108);\n\nvar _Container2 = _interopRequireDefault(_Container);\n\nvar _decorators = __webpack_require__(314);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ConsonantPageModel = exports.ConsonantPageModel = function (_DOMModel) {\n _inherits(ConsonantPageModel, _DOMModel);\n\n function ConsonantPageModel(element) {\n _classCallCheck(this, ConsonantPageModel);\n\n var _this = _possibleConstructorReturn(this, (ConsonantPageModel.__proto__ || Object.getPrototypeOf(ConsonantPageModel)).call(this, element));\n\n _this.id = element.getAttribute('id'); // Initialize id\n _this.dataConfig = element.getAttribute('data-config'); // Initialize dataConfig\n return _this;\n }\n\n _createClass(ConsonantPageModel, [{\n key: 'getAttribute',\n value: function getAttribute(attr) {\n return this[attr]; // Return the attribute value\n }\n }]);\n\n return ConsonantPageModel;\n}(_reactDomComponents.DOMModel);\n\nvar consonantPageRDC = (0, _reactDomComponents.createRDC)('consonant-card-collection', ConsonantPageModel, (0, _decorators.parseDataConfig)(_Container2.default));\nexports.default = consonantPageRDC;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9yZWFjdC9zcmMvanMvY29tcG9uZW50cy9Db25zb25hbnQvUGFnZS9Db25zb25hbnRQYWdlRE9NLmpzeD81ZTMzIl0sIm5hbWVzIjpbIkNvbnNvbmFudFBhZ2VNb2RlbCIsImVsZW1lbnQiLCJpZCIsImdldEF0dHJpYnV0ZSIsImRhdGFDb25ma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ZWxlbWVudC5nZXRBdHRyaWJ1dGUoJ2lkJyk7IC8vIEluaXRpYWxpemUgaWRcbiAgICAgICAgdGhpcy5kYXRhQ29uZmlnID0gZWxlbWVudC5nZXRBdHRyaWJ1dGUoJ2RhdGEtY29uZmlnJyk7IC8vIEluaXRpYWxpemUgZGF0YUNvbmZpZ1xuICAgIH1cblxuICAgIGdldEF0dHJpYnV0ZShhdHRyKSB7XG4gICAgICAgIHJldHVybiB0aGlzW2F0dHJdOyAvLyBSZXR1cm4gdGhlIGF0dHJpYnV0ZSB2YWx1ZVxuICAgIH1cbn1cblxuY29uc3QgY29uc29uYW50UGFnZVJEQyA9IGNyZWF0ZVJEQygnY29uc29uYW50LWNhcmQtY29sbGVjdGlvbicsIENvbnNvbmFudFBhZ2VNb2RlbCwgcGFyc2VEYXRhQ29uZmlnKENvbnRhaW5lcikpO1xuZXhwb3J0IGRlZmF1bHQgY29uc29uYW50UGFnZVJEQztcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyAuL3JlYWN0L3NyYy9qcy9jb21wb25lbnRzL0NvbnNvbmFudC9QYWdlL0NvbnNvbmFudFBhZ2VET00uanN4Il0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///313\n");
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ConsonantPageModel = undefined;\n\nvar _reactDomComponents = __webpack_require__(107);\n\nvar _Container = __webpack_require__(108);\n\nvar _Container2 = _interopRequireDefault(_Container);\n\nvar _decorators = __webpack_require__(314);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ConsonantPageModel = exports.ConsonantPageModel = function (_DOMModel) {\n _inherits(ConsonantPageModel, _DOMModel);\n\n function ConsonantPageModel(element) {\n _classCallCheck(this, ConsonantPageModel);\n\n var _this = _possibleConstructorReturn(this, (ConsonantPageModel.__proto__ || Object.getPrototypeOf(ConsonantPageModel)).call(this, element));\n\n _this.getAttribute('id', 'id');\n _this.getAttribute('data-config', 'dataConfig');\n return _this;\n }\n\n return ConsonantPageModel;\n}(_reactDomComponents.DOMModel);\n\nvar consonantPageRDC = (0, _reactDomComponents.createRDC)('consonant-card-collection', ConsonantPageModel, (0, _decorators.parseDataConfig)(_Container2.default));\nexports.default = consonantPageRDC;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9yZWFjdC9zcmMvanMvY29tcG9uZW50cy9Db25zb25hbnQvUGFnZS9Db25zb25hbnRQYWdlRE9NLmpzeD81ZTMzIl0sIm5hbWVzIjpbIkNvbnNvbmFudFBhZ2VNb2RlbCIsImVsZW1lbnQiLCJnZXRBdHRyaWJ1dGUiLCJET01Nb2RlbCIsImNvbnNvbmFudFBhZ2VSREMiLCJDb250YWluZXIiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFBQTs7QUFDQTs7OztBQUNBOzs7Ozs7Ozs7O0lBRWFBLGtCLFdBQUFBLGtCOzs7QUFDVCxnQ0FBWUMsT0FBWixFQUFxQjtBQUFBOztBQUFBLDRJQUNYQSxPQURXOztBQUVqQixjQUFLQyxZQUFMLENBQWtCLElBQWxCLEVBQXdCLElBQXhCO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LmpzeCJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///313\n");

/***/ }),
/* 314 */
Expand Down
8 changes: 2 additions & 6 deletions react/src/js/components/Consonant/Page/ConsonantPageDOM.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ import { parseDataConfig } from '../Helpers/decorators';
export class ConsonantPageModel extends DOMModel {
constructor(element) {
super(element);
this.id = element.getAttribute('id'); // Initialize id
this.dataConfig = element.getAttribute('data-config'); // Initialize dataConfig
}

getAttribute(attr) {
return this[attr]; // Return the attribute value
this.getAttribute('id', 'id');
this.getAttribute('data-config', 'dataConfig');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ describe('ConsonantPageModel', () => {
test('should initialize ConsonantPageModel with correct attributes', () => {
const model = new ConsonantPageModel(element);

expect(model.getAttribute('id')).toBe('test-id');
expect(model.getAttribute('dataConfig')).toBe('{"key": "value"}'); // Corrected to match the attribute name
expect(model.props.id).toBe('test-id');
expect(model.props.dataConfig).toBe('{"key": "value"}'); // Corrected to match the attribute name
});

test('should set id and dataConfig attributes correctly', () => {
const model = new ConsonantPageModel(element);

expect(model.getAttribute('id')).toEqual('test-id');
expect(model.getAttribute('dataConfig')).toEqual('{"key": "value"}'); // Corrected to match the attribute name
expect(model.props.id).toEqual('test-id');
expect(model.props.dataConfig).toEqual('{"key": "value"}'); // Corrected to match the attribute name
});
});
Loading