Skip to content

Commit

Permalink
fix part 2 of 2 to feedback implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaden505 committed Dec 11, 2024
1 parent 6fd47f0 commit 32b6719
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
13 changes: 4 additions & 9 deletions lib/public/views/Logs/Create/TemplatedLogCreationModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ export class TemplatedLogCreationModel extends LogCreationModel {
*
* @param {function} [onCreation] function called when log is created, with the id of the created log
* @param {LogCreationRelations} relations the relations of the log
* @param {logTemplateKey|null} templateKey the key of the template to use
* @param {object} templateData the template data of the log
*/
constructor(onCreation, relations, templateData) {
constructor(onCreation, relations, templateKey, templateData) {

Check warning on line 56 in lib/public/views/Logs/Create/TemplatedLogCreationModel.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/Logs/Create/TemplatedLogCreationModel.js#L56

Added line #L56 was not covered by tests
super(onCreation, relations);

this._templateData = templateData;

Check warning on line 59 in lib/public/views/Logs/Create/TemplatedLogCreationModel.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/Logs/Create/TemplatedLogCreationModel.js#L59

Added line #L59 was not covered by tests
Expand All @@ -63,14 +64,8 @@ export class TemplatedLogCreationModel extends LogCreationModel {
*/
this._templateKey = null;

/**
* @type {LogTemplate|null}
* @private
*/
this._template = null;

if (templateData.templateKey) {
this.useTemplate(templateData.templateKey);
if (templateKey) {
this.useTemplate(templateKey);

Check warning on line 68 in lib/public/views/Logs/Create/TemplatedLogCreationModel.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/Logs/Create/TemplatedLogCreationModel.js#L67-L68

Added lines #L67 - L68 were not covered by tests
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/public/views/Logs/LogsModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export class LogsModel extends Observable {
templateData.detectorOrSubsystem = detectorOrSubsystem;

Check warning on line 139 in lib/public/views/Logs/LogsModel.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/Logs/LogsModel.js#L138-L139

Added lines #L138 - L139 were not covered by tests
}

this._creationModel = new TemplatedLogCreationModel(this.handleLogCreation.bind(this), relations, templateData);
this._creationModel = new TemplatedLogCreationModel(this.handleLogCreation.bind(this), relations, templateKey, templateData);

Check warning on line 142 in lib/public/views/Logs/LogsModel.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/Logs/LogsModel.js#L142

Added line #L142 was not covered by tests
this._creationModel.bubbleTo(this);
}

Expand Down

0 comments on commit 32b6719

Please sign in to comment.