Repository: ignite Updated Branches: refs/heads/master b1539457a -> 7c4705c0b
IGNITE-9103 Web Console: Fixed select menu component with items that contains html. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7c4705c0 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7c4705c0 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7c4705c0 Branch: refs/heads/master Commit: 7c4705c0b9a248608fadccd874fcccc1e7378ea7 Parents: b153945 Author: Alexander Kalinin <[email protected]> Authored: Tue Jul 31 10:14:10 2018 +0700 Committer: Alexey Kuznetsov <[email protected]> Committed: Tue Jul 31 10:14:10 2018 +0700 ---------------------------------------------------------------------- .../app/components/bs-select-menu/index.js | 6 ++++-- .../components/bs-select-menu/strip.filter.js | 22 ++++++++++++++++++++ .../app/components/bs-select-menu/template.pug | 2 +- .../transcludeToBody.directive.js | 2 +- 4 files changed, 28 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/7c4705c0/modules/web-console/frontend/app/components/bs-select-menu/index.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/bs-select-menu/index.js b/modules/web-console/frontend/app/components/bs-select-menu/index.js index a9bafb2..0f2a258 100644 --- a/modules/web-console/frontend/app/components/bs-select-menu/index.js +++ b/modules/web-console/frontend/app/components/bs-select-menu/index.js @@ -18,9 +18,11 @@ import angular from 'angular'; import directive from './directive'; -import {directive as transcludeToBody} from './transcludeToBody.directive'; +import {default as transcludeToBody} from './transcludeToBody.directive'; +import stripFilter from './strip.filter'; export default angular .module('ignite-console.bs-select-menu', []) .directive('bssmTranscludeToBody', transcludeToBody) - .directive('bsSelectMenu', directive); + .directive('bsSelectMenu', directive) + .filter('bsSelectStrip', stripFilter); http://git-wip-us.apache.org/repos/asf/ignite/blob/7c4705c0/modules/web-console/frontend/app/components/bs-select-menu/strip.filter.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/bs-select-menu/strip.filter.js b/modules/web-console/frontend/app/components/bs-select-menu/strip.filter.js new file mode 100644 index 0000000..4dbe58b --- /dev/null +++ b/modules/web-console/frontend/app/components/bs-select-menu/strip.filter.js @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default function() { + return function(val) { + return val.replace(/(<\/?\w+>)/igm, ''); + }; +} http://git-wip-us.apache.org/repos/asf/ignite/blob/7c4705c0/modules/web-console/frontend/app/components/bs-select-menu/template.pug ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/bs-select-menu/template.pug b/modules/web-console/frontend/app/components/bs-select-menu/template.pug index 4ffa144..7cd2195 100644 --- a/modules/web-console/frontend/app/components/bs-select-menu/template.pug +++ b/modules/web-console/frontend/app/components/bs-select-menu/template.pug @@ -37,7 +37,7 @@ ul.bs-select-menu( ng-click='$select($index, $event); $event.stopPropagation();' ng-class=`{ 'bssm-item-button__active': $isActive($index) }` data-placement='right auto' - title='{{ ::match.label }}' + title='{{ ::match.label | bsSelectStrip }}' ) img.bssm-active-indicator.icon-left( ng-src='{{ $isActive($index) ? "/images/checkbox-active.svg" : "/images/checkbox.svg" }}' http://git-wip-us.apache.org/repos/asf/ignite/blob/7c4705c0/modules/web-console/frontend/app/components/bs-select-menu/transcludeToBody.directive.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/bs-select-menu/transcludeToBody.directive.js b/modules/web-console/frontend/app/components/bs-select-menu/transcludeToBody.directive.js index b415719..de4fbfa 100644 --- a/modules/web-console/frontend/app/components/bs-select-menu/transcludeToBody.directive.js +++ b/modules/web-console/frontend/app/components/bs-select-menu/transcludeToBody.directive.js @@ -40,7 +40,7 @@ class Controller { } } -export function directive() { +export default function directive() { return { restrict: 'E', transclude: true,
