Skip to content

Commit

Permalink
Merge pull request #1513 from OctopusDeploy/sf/revert-performance-change
Browse files Browse the repository at this point in the history
Revert performance changes as it break API consumers
  • Loading branch information
steve-fenton-octopus authored May 20, 2024
2 parents 22b2139 + 194003b commit 68101d2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ node_modules/
dist/
build/
app/services/*.json
integrations/
.idea/

junitresults.xml
Expand Down
2 changes: 1 addition & 1 deletion app/components/TemplateItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default class TemplateItem extends React.Component {
<div className="step-template">
<div className="row clearfix">
<div className="column two-thirds">
<img className="logo" loading="lazy" src={this.state.template.Logo} />
<img className="logo" src={"data:image/gif;base64," + this.state.template.Logo} />
<h2 className="name">{this.state.template.Name}</h2>
<p className="who-when faint no-top-margin">
<i>{this.state.template.ActionType}</i> exported {moment(this.state.template.ExportedAt).calendar()} by
Expand Down
2 changes: 1 addition & 1 deletion app/components/TemplateList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class TemplateList extends React.Component {
let friendlySlug = SlugMaker.make(item.Name);
return (
<li className={"item-summary " + (item.ScriptClass || "")} key={index + "." + item.Name}>
<img loading="lazy" src={item.Logo} />
<img src={"data:image/gif;base64," + item.Logo} />
<h4 key={index + "." + item.Name + ".0"}>
<Link to={`/step-templates/${item.Id}/${friendlySlug}`}>{item.Name}</Link>
</h4>
Expand Down
6 changes: 4 additions & 2 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,10 @@ function provideMissingData() {

template.Category = humanize(categoryId);

// Note: this deprecates base64 encoded images in the template files - they will be ignored
template.Logo = "https://i.octopus.com/library/step-templates/" + categoryId + ".png";
if (!template.Logo) {
var logo = fs.readFileSync("./step-templates/logos/" + categoryId + ".png");
template.Logo = Buffer.from(logo).toString("base64");
}

file.contents = Buffer.from(JSON.stringify(template));

Expand Down

0 comments on commit 68101d2

Please sign in to comment.