fix: cleanup from #7029 (#7328)

* refactor: fix issues arose from #7029

* refactor: move replaceAll -> replace in makeKeyString

* fix: move order of escape to backslash first

* style: lint
This commit is contained in:
Tristan F 2023-12-28 15:39:28 -05:00 committed by GitHub
parent 5af491382e
commit 68e60e332e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 13 deletions

View File

@ -99,7 +99,9 @@ function makeKeyString(identifier) {
return identifier.key; return identifier.key;
} }
return [identifier.namespace.replace(/:/g, '\\:'), identifier.key].join(':'); return [identifier.namespace.replace(/\\/g, '\\\\').replace(/:/g, '\\:'), identifier.key].join(
':'
);
} }
/** /**

View File

@ -35,7 +35,7 @@ export default function (options) {
return !options || options.type === d.type; return !options || options.type === d.type;
}, },
view: function (domainObject) { view: function (domainObject) {
return new AutoflowTabularView(domainObject, openmct, document); return new AutoflowTabularView(domainObject, openmct);
} }
}); });
}; };

View File

@ -34,8 +34,9 @@
</template> </template>
<script> <script>
import { sanitizeUrl } from '@braintree/sanitize-url';
import tooltipHelpers from '../../../api/tooltips/tooltipMixins'; import tooltipHelpers from '../../../api/tooltips/tooltipMixins';
const sanitizeUrl = require('@braintree/sanitize-url').sanitizeUrl;
export default { export default {
mixins: [tooltipHelpers], mixins: [tooltipHelpers],

View File

@ -34,7 +34,7 @@
</template> </template>
<script> <script>
const sanitizeUrl = require('@braintree/sanitize-url').sanitizeUrl; import { sanitizeUrl } from '@braintree/sanitize-url';
export default { export default {
inject: ['domainObject'], inject: ['domainObject'],

View File

@ -44,12 +44,11 @@
</template> </template>
<script> <script>
import momentDurationFormatSetup from 'moment-duration-format';
import moment from 'moment-timezone';
import raf from 'utils/raf'; import raf from 'utils/raf';
import throttle from '../../../utils/throttle'; import throttle from '../../../utils/throttle';
const moment = require('moment-timezone');
const momentDurationFormatSetup = require('moment-duration-format');
const refreshRateSeconds = 2; const refreshRateSeconds = 2;
momentDurationFormatSetup(moment); momentDurationFormatSetup(moment);

View File

@ -26,7 +26,7 @@
</template> </template>
<script> <script>
const sanitizeUrl = require('@braintree/sanitize-url').sanitizeUrl; import { sanitizeUrl } from '@braintree/sanitize-url';
export default { export default {
inject: ['openmct', 'domainObject'], inject: ['openmct', 'domainObject'],

View File

@ -19,11 +19,10 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/*global module*/
const LocationBar = require('location-bar'); import EventEmitter from 'EventEmitter';
const EventEmitter = require('EventEmitter'); import LocationBar from 'location-bar';
const _ = require('lodash'); import _ from 'lodash';
class ApplicationRouter extends EventEmitter { class ApplicationRouter extends EventEmitter {
/** /**
@ -430,4 +429,4 @@ function paramsToObject(searchParams) {
return params; return params;
} }
module.exports = ApplicationRouter; export default ApplicationRouter;