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

Yaml hist diff #144

Merged
merged 3 commits into from
Sep 17, 2019
Merged
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
6 changes: 5 additions & 1 deletion imports/ui/pages/resources/resourcesSingle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ export class ResourceYamlDisplay extends React.Component{
compareYamls: this.state.compareYamls,
};
var newYamlStr = _.get(this.state, 'compareYamls[0].yamlStr', 'null');
if(!newYamlStr || newYamlStr == 'null'){
// defaults to the resource.data yaml if no resourceHistObj found
newYamlStr = histAttrs.resource.data;
}
var newYamlObj = newYamlStr;
_.attempt(()=>{
newYamlObj = JSON.parse(newYamlStr);
Expand Down Expand Up @@ -173,7 +177,7 @@ export class ResourceYamlDisplay extends React.Component{
<Blaze template="stringifyp" data={newYamlObj} />
}
{!newYamlObj &&
<div class="alert alert-warning">
<div className="alert alert-warning">
Error: Failed to load resource yaml object
</div>
}
Expand Down