Skip to content

Commit

Permalink
Merge pull request #109 from gewaer/development
Browse files Browse the repository at this point in the history
fix: columns table
  • Loading branch information
SparoHawk authored Jan 31, 2023
2 parents c6725e4 + 8277097 commit 53e3f76
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 124 deletions.
67 changes: 25 additions & 42 deletions dist/gw-browse.common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/gw-browse.common.js.map

Large diffs are not rendered by default.

67 changes: 25 additions & 42 deletions dist/gw-browse.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/gw-browse.umd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/gw-browse.umd.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/gw-browse.umd.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gewaer/gw-browse",
"version": "0.4.5",
"version": "0.5.1",
"description": "Base browse component for the Gewaer platform.",
"main": "./dist/gw-browse.umd.min.js",
"files": [
Expand Down
64 changes: 33 additions & 31 deletions src/browse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
@show-custom-filters-form="
$modal.show('custom-filters-form')
"
@add="event => $emit('add', event)"
>
<template #before-search-bar>
<slot name="before-search-bar" />
Expand All @@ -63,34 +64,6 @@
class="pagination-controls pc-top row"
>
<slot name="before-pagination" />

<!-- <div class="d-flex">
<template v-if="showResultsPerPage">
<div class="col-auto">
<label class="mb-0">Results per page:</label>
</div>
<div class="col-auto">
<multiselect
v-model="selectedPerPage"
:allow-empty="false"
:show-labels="false"
:options="resultsPerPageOptions"
:searchable="false"
placeholder=""
@input="changePerPage"
/>
</div>
<div v-show="totalPages > 1" class="col-auto separator">
|
</div>
</template>
<vuetable-pagination
ref="paginationTop"
:css="pagination"
class="col-auto"
@vuetable-pagination:change-page="onChangePage"
/>
</div> -->
</div>
<div class="table-responsive">
<vuetable
Expand Down Expand Up @@ -534,7 +507,9 @@ export default {
target.classList.contains("justify-content-end");
if (!isAction) {
this.$router.push({ path: `/browse/leads/edit/${id}` });
this.$router.push({
path: `/browse/${this.$route.params.resource}/edit/${id}`
});
}
},
bulkDelete() {},
Expand Down Expand Up @@ -628,6 +603,33 @@ export default {
this.tableFields = this.processTableFields(
response.data.tableFields
);
if (this.$route.params.resource === "leads") {
this.tableFields = this.tableFields.map(({ ...rest }) => {
if (rest.field === "leads_visits_count") {
return { ...rest, visible: false };
}
if (rest.name === "people.name") {
return {
...rest,
visible: true,
title: "Contact Person"
};
}
if (rest.name === "owner.fullname") {
return {
...rest,
visible: true,
name: "owner.full_name"
}
}
return { ...rest, visible: true };
});
}
const bulkActions = response.data.bulkActions || [];
this.validateBulkActions(bulkActions);
Expand Down Expand Up @@ -677,10 +679,10 @@ export default {
this.$refs.Vuetable.tablePagination = data;
this.showPagination &&
this.showPaginationBottom &&
this.$refs.paginationBottom.setPaginationData(data);
this.$refs.paginationBottom?.setPaginationData(data);
this.showPagination &&
this.showPaginationTop &&
this.$refs.paginationTop.setPaginationData(data);
this.$refs.paginationTop?.setPaginationData(data);
},
refresh() {
this.$refs.Vuetable.refresh();
Expand Down
6 changes: 3 additions & 3 deletions src/components/resource-actions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@
</dropdown>

<div v-if="showCreateResource" class="col-auto">
<router-link
:to="createUrl"
<button
class="add-record-btn btn btn-primary p-2"
@click="$emit('add', currentResource.title)"
>
<i class="d-none d-sm-inline fa fa-plus-circle" />
Add {{ singularize(currentResource.title) }}
</router-link>
</button>
</div>

<slot name="after-create-resource" />
Expand Down

0 comments on commit 53e3f76

Please sign in to comment.