Skip to content

Commit 5141fce

Browse files
authored
fix: correct history link handling in library UI (#1667)
1 parent 745076b commit 5141fce

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

app/components/TemplateItem.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export default class TemplateItem extends React.Component {
114114
</SyntaxHighlighter>
115115
</div>
116116
<p className="align-right">
117-
<a className="faint" href={this.state.template.HistoryUrl}>
117+
<a className="faint" href={this.state.template.HistoryUrl} rel="noopener noreferrer" target="_blank">
118118
History &raquo;
119119
</a>
120120
</p>

gulpfile.babel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import jasmineTerminalReporter from "jasmine-terminal-reporter";
3131
import eventStream from "event-stream";
3232
import fs from "fs";
3333
import jsonlint from "gulp-jsonlint";
34+
import path from "path";
3435

3536
const sass = gulpSass(dartSass);
3637
const clientDir = "app";
@@ -292,8 +293,7 @@ function provideMissingData() {
292293
return eventStream.map(function (file, cb) {
293294
var fileContent = file.contents.toString();
294295
var template = JSON.parse(fileContent);
295-
var pathParts = file.path.split("\\");
296-
var fileName = pathParts[pathParts.length - 1];
296+
var fileName = path.basename(file.path);
297297

298298
if (!template.HistoryUrl) {
299299
template.HistoryUrl = "https://github.com/OctopusDeploy/Library/commits/master/step-templates/" + fileName;

0 commit comments

Comments
 (0)