mirror of https://github.com/rancher/ui.git
Merge pull request #5188 from nwmac/remove-marked-and-dompurify
Remove use of marked and dompurify dependencies
This commit is contained in:
commit
e2613a9afb
|
|
@ -67,9 +67,7 @@
|
||||||
expand=(action expandFn)
|
expand=(action expandFn)
|
||||||
expandOnInit=false
|
expandOnInit=false
|
||||||
}}
|
}}
|
||||||
{{marked-down
|
{{t "generic.removed" }}
|
||||||
markdown=model.app.notes
|
|
||||||
}}
|
|
||||||
{{/accordion-list-item}}
|
{{/accordion-list-item}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col span-8">
|
<div class="col span-8">
|
||||||
{{#if appReadmeContent}}
|
{{#if appReadmeContent}}
|
||||||
{{marked-down markdown=appReadmeContent}}
|
{{t "generic.removed" }}
|
||||||
{{else if (not noAppReadme)}}
|
{{else if (not noAppReadme)}}
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<i class="icon icon-spinner icon-spin icon-3x"></i>
|
<i class="icon icon-spinner icon-spin icon-3x"></i>
|
||||||
|
|
@ -66,7 +66,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{{#if readmeContent}}
|
{{#if readmeContent}}
|
||||||
<div class="col span-12" style="overflow-y: auto; max-height: 500px;">
|
<div class="col span-12" style="overflow-y: auto; max-height: 500px;">
|
||||||
{{marked-down markdown=readmeContent}}
|
{{t "generic.removed" }}
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<h2 class="mb-10">
|
<h2 class="mb-10">
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col span-8">
|
<div class="col span-8">
|
||||||
{{#if appReadmeContent}}
|
{{#if appReadmeContent}}
|
||||||
{{marked-down markdown=appReadmeContent}}
|
{{t "generic.removed" }}
|
||||||
{{else if (not noAppReadme)}}
|
{{else if (not noAppReadme)}}
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<i class="icon icon-spinner icon-spin icon-3x"></i>
|
<i class="icon icon-spinner icon-spin icon-3x"></i>
|
||||||
|
|
@ -59,7 +59,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{{#if readmeContent}}
|
{{#if readmeContent}}
|
||||||
<div class="col span-12 readme-content">
|
<div class="col span-12 readme-content">
|
||||||
{{marked-down markdown=readmeContent}}
|
{{t "generic.removed" }}
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<h2 class="mb-10">
|
<h2 class="mb-10">
|
||||||
|
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
||||||
import Component from '@ember/component';
|
|
||||||
import layout from './template';
|
|
||||||
import { htmlSafe } from '@ember/string';
|
|
||||||
import { get, computed } from '@ember/object';
|
|
||||||
import { next } from '@ember/runloop';
|
|
||||||
|
|
||||||
var Marked = null;
|
|
||||||
var DOMPurify = null;
|
|
||||||
|
|
||||||
export default Component.extend({
|
|
||||||
layout,
|
|
||||||
markdown: null,
|
|
||||||
init() {
|
|
||||||
this._super(...arguments);
|
|
||||||
|
|
||||||
|
|
||||||
if (!Marked) {
|
|
||||||
import('marked').then( (module) => {
|
|
||||||
Marked = module.default;
|
|
||||||
import('dompurify').then( (module) => {
|
|
||||||
DOMPurify = module.default;
|
|
||||||
|
|
||||||
if ( this.isDestroyed || this.isDestroying ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
next(() => this.notifyPropertyChange('parsedMarkdown'));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
parsedMarkdown: computed('markdown', function() {
|
|
||||||
if ( !Marked ) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
const html = Marked(get(this, 'markdown'), { breaks: true });
|
|
||||||
|
|
||||||
return htmlSafe(DOMPurify.sanitize(html));
|
|
||||||
}),
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
{{parsedMarkdown}}
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
export { default } from 'shared/components/marked-down/component';
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"async": "*",
|
"async": "*",
|
||||||
"d3": "*",
|
"d3": "*",
|
||||||
"dompurify": "*",
|
|
||||||
"echarts": "*",
|
"echarts": "*",
|
||||||
"@rancher/ember-api-store": "*",
|
"@rancher/ember-api-store": "*",
|
||||||
"ember-auto-import": "*",
|
"ember-auto-import": "*",
|
||||||
|
|
@ -27,7 +26,6 @@
|
||||||
"json2yaml": "*",
|
"json2yaml": "*",
|
||||||
"jsyaml": "*",
|
"jsyaml": "*",
|
||||||
"liquid-fire": "*",
|
"liquid-fire": "*",
|
||||||
"marked": "*",
|
|
||||||
"prettycron": "*",
|
"prettycron": "*",
|
||||||
"prismjs": "*",
|
"prismjs": "*",
|
||||||
"semver": "*",
|
"semver": "*",
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
"broccoli-asset-rev": "^3.0.0",
|
"broccoli-asset-rev": "^3.0.0",
|
||||||
"d3": "3.5.17",
|
"d3": "3.5.17",
|
||||||
"dompurify": "^2.1.1",
|
|
||||||
"dot-object": "^2.1.4",
|
"dot-object": "^2.1.4",
|
||||||
"dotenv": "^8.2.0",
|
"dotenv": "^8.2.0",
|
||||||
"echarts": "4.9.0",
|
"echarts": "4.9.0",
|
||||||
|
|
@ -93,7 +92,6 @@
|
||||||
"linkifyjs": "^4.1.3",
|
"linkifyjs": "^4.1.3",
|
||||||
"linkify-string": "^4.1.3",
|
"linkify-string": "^4.1.3",
|
||||||
"loader.js": "^4.7.0",
|
"loader.js": "^4.7.0",
|
||||||
"marked": "^2.0.0",
|
|
||||||
"moment": "~2.29.4",
|
"moment": "~2.29.4",
|
||||||
"node-sass": "4.14.1",
|
"node-sass": "4.14.1",
|
||||||
"objects-to-csv": "^1.3.5",
|
"objects-to-csv": "^1.3.5",
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,7 @@ generic:
|
||||||
persistentVolume: persistent volume
|
persistentVolume: persistent volume
|
||||||
random: Random
|
random: Random
|
||||||
remove: Remove
|
remove: Remove
|
||||||
|
removed: Functionality has been removed from the legacy UI
|
||||||
restarts: Restarts
|
restarts: Restarts
|
||||||
role: Role
|
role: Role
|
||||||
save: Save
|
save: Save
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue