forked from vmware-archive/admiral
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VBV-1995 - Redesign the registry UI based on Option vmware-archive#2
Layout enhancements. Change-Id: If72c5e2289ade63f035a5c2b6e2e14a9a0607e39 Reviewed-on: https://bellevue-ci.eng.vmware.com:8080/36295 Upgrade-Verified: jenkins <[email protected]> Closures-Verified: jenkins <[email protected]> Bellevue-Verified: jenkins <[email protected]> CS-Verified: jenkins <[email protected]> Reviewed-by: Iveta Ilieva <[email protected]>
- Loading branch information
Showing
9 changed files
with
148 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<div class="title"><span>{{hasSearchQuery ? titleSearch : title}}</span><span | ||
v-if="count > -1" class="total-items">({{count}})</span><span | ||
v-if="!actionName" transition="fade-in"><refresh-button | ||
v-on:click="notifyRefresh()"></refresh-button><slot></slot></span> | ||
<action-confirmation v-else v-bind:action-name="actionName" | ||
v-bind:action-title="actionTitle"></action-confirmation> | ||
</div> | ||
v-if="!actionName" transition="fade-in"><refresh-button | ||
@click="notifyRefresh()"></refresh-button><slot></slot></span> | ||
<action-confirmation v-else :action-name="actionName" | ||
:action-title="actionTitle"></action-confirmation> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
/* | ||
* Copyright (c) 2018 VMware, Inc. All Rights Reserved. | ||
* | ||
* This product is licensed to you under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this product except in compliance with the License. | ||
* | ||
* This product may include a number of subcomponents with separate copyright notices | ||
* and license terms. Your use of these subcomponents is subject to the terms and | ||
* conditions of the subcomponent's license, as noted in the LICENSE file. | ||
*/ | ||
|
||
import uiCommonLib from 'admiral-ui-common'; | ||
|
||
/** | ||
* Tag selector for the grid search component. | ||
*/ | ||
var VueGridSearchTag = Vue.extend({ | ||
template: `<div v-if="searchTagName" id="searchTagsSelector" | ||
class="form-group search-tags-selection"><div | ||
class="form-control dropdown-holder"></div></div>`, | ||
props: { | ||
queryOptions: { | ||
type: Object, | ||
required: true | ||
}, | ||
searchTagName: { | ||
type: String, | ||
required: false | ||
}, | ||
searchTagOptions: { | ||
type: Array, | ||
required: false | ||
} | ||
}, | ||
|
||
data: function() { | ||
return { | ||
searchTagSelection: undefined | ||
}; | ||
}, | ||
|
||
attached: function() { | ||
this.unwatchTagOptions = this.$watch('searchTagOptions', () => { | ||
this.initSearchTagSelection(); | ||
}, { immediate: true }); | ||
}, | ||
|
||
detached: function() { | ||
this.unwatchTagOptions(); | ||
}, | ||
|
||
methods: { | ||
initSearchTagSelection() { | ||
if (!this.searchTagName || !this.searchTagOptions) { | ||
return; | ||
} | ||
|
||
// search tag input | ||
var elemSearchTags = $(this.$el).parent().find('#searchTagsSelector .form-control'); | ||
|
||
this.searchTagInput = new uiCommonLib.DropdownSearchMenu(elemSearchTags, { | ||
title: i18n.t('dropdownSearchMenu.title', { | ||
entity: this.searchTagName | ||
}), | ||
searchPlaceholder: i18n.t('dropdownSearchMenu.searchPlaceholder', { | ||
entity: this.searchTagName | ||
}) | ||
}); | ||
// options | ||
let options = this.searchTagOptions.map((tagOption) => { | ||
return { | ||
name: tagOption, | ||
value: tagOption | ||
}; | ||
}); | ||
this.searchTagInput.setOptions(options); | ||
|
||
if (this.queryOptions && this.queryOptions[this.searchTagName]) { | ||
this.searchTagSelection = { | ||
name: this.queryOptions[this.searchTagName], | ||
value: this.queryOptions[this.searchTagName] | ||
}; | ||
} | ||
this.searchTagInput.setSelectedOption(this.searchTagSelection); | ||
|
||
// select option | ||
this.searchTagInput.setOptionSelectCallback((option) => { | ||
this.searchTagSelection = option; | ||
|
||
this.$dispatch('search-option-select', { | ||
name: this.searchTagName, | ||
value: this.searchTagSelection.value | ||
}); | ||
}); | ||
|
||
// clear selection | ||
this.searchTagInput.setClearOptionSelectCallback(() => { | ||
this.searchTagSelection = undefined; | ||
|
||
this.$dispatch('search-option-select', null); | ||
}); | ||
} | ||
} | ||
}); | ||
|
||
Vue.component('search-tag-selector', VueGridSearchTag); | ||
|
||
export default VueGridSearchTag; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters