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

fix: switch to use vue-select instead of Multiselect #2274

Merged
7 changes: 7 additions & 0 deletions packages/client/src/assets/adjust-vue-select.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* Make vue-select dropdowns match the height for other form controls */
.vs__dropdown-toggle {
padding-top: 4px;
padding-bottom: 7px;
padding-left: 4px;
padding-right: 4px;
}
6 changes: 2 additions & 4 deletions packages/client/src/components/Modals/GrantDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@
<br />
<b-row style="padding: 16px;">
<h4>Assigned {{newTerminologyEnabled ? 'Teams': 'Agencies'}}</h4>
<multiselect v-model="selectedAgencies" :options="agencies" :multiple="true" :close-on-select="false"
<v-select v-model="selectedAgencies" :options="agencies" :multiple="true" :close-on-select="false"
:clear-on-select="false" :placeholder="`Select ${newTerminologyEnabled ? 'teams': 'agencies'}`" label="name" track-by="id"
style="width: 300px; margin: 0 16px;" :show-labels="false"
>
</multiselect>
</v-select>
<b-button variant="outline-success" @click="assignAgenciesToGrant">Assign</b-button>
</b-row>
<b-table :items="assignedAgencies" :fields="assignedAgenciesFields">
Expand All @@ -92,12 +92,10 @@
<script>
import { mapActions, mapGetters } from 'vuex';
import { debounce } from 'lodash';
import Multiselect from 'vue-multiselect';
import { newTerminologyEnabled } from '@/helpers/featureFlags';
import { titleize } from '../../helpers/form-helpers';

export default {
components: { Multiselect },
props: {
selectedGrant: Object,
},
Expand Down
26 changes: 11 additions & 15 deletions packages/client/src/components/Modals/SearchPanel.vue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the code on line 472 (css for .search-panel .search-fields-radio-group) still relevant?
Seems like it was a workaround when using a Multiselect component, removing this styling doesn't seem to cause radio buttons to overlap with any dropdowns.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call! Just pushed a new commit to remove this.

Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@
<b-form-group
id="funding-type-group"
label="Funding Type"
label-for="funding-type"
>
<multiselect
<v-select
id="funding-type"
v-model="formData.criteria.fundingTypes"
:options="fundingTypeOptions"
Expand All @@ -104,15 +105,14 @@
:close-on-select="false"
:searchable="false"
selectLabel=""
:limit="2"
/>
</b-form-group>
<b-form-group
id="eligibility-group"
label="Eligibility"
label-for="eligibility"
>
<multiselect
<v-select
id="eligibility"
v-model="formData.criteria.eligibility"
:options="eligibilityCodes"
Expand All @@ -122,29 +122,28 @@
:close-on-select="false"
:searchable="true"
selectLabel=""
:limit="3"
/>
</b-form-group>
<b-form-group
id="opportunity-category-group"
label="Category"
label-for="opportunity-category"
>
<multiselect
<v-select
id="opportunity-category"
v-model="formData.criteria.opportunityCategories"
:options="opportunityCategoryOptions"
:multiple="true"
:close-on-select="false"
:searchable="false"
:limit="2"
placeholder="Select Opportunity Category"
/>
</b-form-group>
<b-form-group
id="bill-group"
label="Appropriation Bill"
label-for="bill"
>
<multiselect
<v-select
id="bill"
v-model="formData.criteria.bill"
:options="billOptions"
Expand All @@ -154,6 +153,7 @@
:searchable="false"
placeholder="All Bills"
:show-labels="false"
:clearable="false"
/>
</b-form-group>
<b-form-group
Expand All @@ -171,8 +171,9 @@
<b-form-group
id="posted-within-group"
label="Posted Within"
label-for="posted-within"
>
<multiselect
<v-select
id="posted-within"
v-model="formData.criteria.postedWithin"
:options="postedWithinOptions"
Expand All @@ -182,6 +183,7 @@
:searchable="false"
placeholder="All Time"
:show-labels="false"
:clearable="false"
/>
</b-form-group>
<b-form-group
Expand Down Expand Up @@ -219,7 +221,6 @@

import { mapActions, mapGetters } from 'vuex';
import { VBToggle } from 'bootstrap-vue';
import Multiselect from 'vue-multiselect';
import { billOptions } from '@/helpers/constants';
import { DateTime } from 'luxon';

Expand All @@ -237,7 +238,6 @@ const defaultCriteria = {
};

export default {
components: { Multiselect },
props: {
SearchType: String,
showModal: Boolean,
Expand Down Expand Up @@ -439,10 +439,6 @@ export default {
};
</script>
<style>
.search-panel .multiselect__option {
word-break: break-all;
white-space: normal;
}
.search-panel .sidebar-footer {
border-top: 1.5px solid #e8e8e8;
justify-content: space-between;
Expand Down
1 change: 1 addition & 0 deletions packages/client/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import App from './App.vue';
import router from './router';
import store from './store';
import './assets/fix-sticky-headers.css';
import './assets/adjust-vue-select.css';

const fetchApi = require('@/helpers/fetchApi');

Expand Down
Loading