Skip to content

Commit

Permalink
Merge branch 'release-2024-fall' of github.com:ProcessMaker/processma…
Browse files Browse the repository at this point in the history
…ker into bugfix/FOUR-19987
  • Loading branch information
CarliPinell committed Nov 6, 2024
2 parents 05b136a + 7bc3f3a commit 8fd7a7d
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 18 deletions.
5 changes: 5 additions & 0 deletions resources/js/admin/devlink/components/BundleAssets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ const computedFields = computed(() => {
return fields.filter(field => field.key !== 'menu');
});
const isLocal = computed(() => {
return bundle.value.dev_link_id === null;
});
const loadAssets = async () => {
loading.value = true;
const response = await window.ProcessMaker.apiClient.get(`/api/1.0/devlink/local-bundles/${bundleId}`);
Expand Down Expand Up @@ -126,6 +130,7 @@ const remove = async (asset) => {
>
<template #cell(name)="data">
<a :href="data.item.url" target="_blank">{{ data.item.name }}</a>
<i v-if="!isLocal" class="ml-2 fa fa-lock"></i>
</template>

<template #cell(menu)="data">
Expand Down
5 changes: 4 additions & 1 deletion resources/js/admin/devlink/components/Instance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ const load = () => {
ProcessMaker.apiClient
.get(`/devlink/${route.params.id}/remote-bundles?filter=${filter.value}`)
.then((result) => {
bundles.value = result.data.data;
bundles.value = result.data.data.filter(bundle =>{
// Do not show remote bundles
return bundle.dev_link_id === null;
});
loading.value = false;
});
};
Expand Down
2 changes: 1 addition & 1 deletion resources/jscomposition/base/table/BaseTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
:class="{
'tw-table-fixed':getDefaultConfig(config).tableFixed
}">
<thead class="tw-border-b tw-sticky tw-top-0 tw-z-10 tw-bg-gray-100">
<thead class="tw-border-b tw-sticky tw-top-0 tw-z-[9] tw-bg-gray-100">
<tr>
<THeader
v-for="(column, index) in columns"
Expand Down
6 changes: 6 additions & 0 deletions resources/jscomposition/cases/casesMain/config/columns.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ export const taskColumn = () => ({
params: {
href: (option) => `/tasks/${option.id}/edit`,
formatterOptions: (option, row, column, columns) => option.name,
filterData: (row, column, columns) => {
if (row.case_status === "COMPLETED") {
return [];
}
return row.tasks.filter((el) => el.status === "ACTIVE");
},
},
}),
});
Expand Down
38 changes: 22 additions & 16 deletions resources/jscomposition/system/table/cell/TruncatedOptionsCell.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
<template>
<div class="tw-flex tw-relative tw-text-nowrap tw-whitespace-nowrap tw-p-3">
<div class="tw-overflow-hidden tw-text-ellipsis ">
<div
v-if="optionsModel.length"
class="tw-overflow-hidden tw-text-ellipsis">
<a
v-if="href !== null"
class="hover:tw-text-blue-400 tw-text-gray-500"
:href="href(row[column.field][0])"
:href="href(optionsModel[0])"
>
{{ getValue() }}
{{ getValueOption(optionsModel[0], 0) }}
</a>
<span
v-else
class="hover:tw-text-blue-400 tw-text-gray-500 hover:tw-cursor-pointer"
href="#"
@click.prevent.stop="onClickOption(row[column.field][0], 0)"
@click.prevent.stop="onClickOption(optionsModel[0], 0)"
>
{{ getValue() }}
{{ getValueOption(optionsModel[0], 0) }}
</span>
</div>
<AppPopover
Expand Down Expand Up @@ -43,7 +45,7 @@
>
<a
v-if="href !== null"
class="tw-flex tw-py-2 tw-px-4 transition duration-300 hover:tw-bg-gray-200"
class="tw-flex tw-py-2 tw-px-4 transition duration-300 tw-text-gray-500 hover:tw-bg-gray-200 hover:tw-text-blue-400"
:href="href(option)"
>
{{ getValueOption(option, index) }}
Expand All @@ -63,7 +65,7 @@
</div>
</template>
<script>
import { defineComponent, ref } from "vue";
import { defineComponent, ref, onMounted } from "vue";
import { isFunction } from "lodash";
import { AppPopover } from "../../../base/index";
Expand Down Expand Up @@ -96,19 +98,17 @@ export default defineComponent({
type: Function,
default: null,
},
// Filter Data, method to filter the input data
filterData: {
type: Function,
default: null,
},
},
setup(props) {
const show = ref(false);
const optionsModel = ref(props.row[props.column.field]);
const getValue = () => {
if (isFunction(props.column?.formatter)) {
return props.column?.formatter(props.row, props.column, props.columns);
}
return props.row[props.column.field].length ? props.row[props.column.field][0].name : "";
};
const getValueOption = (option, index) => {
const getValueOption = (option) => {
if (isFunction(props.formatterOptions)) {
return props.formatterOptions(option, props.row, props.column, props.columns);
}
Expand All @@ -127,13 +127,19 @@ export default defineComponent({
show.value = false;
};
onMounted(() => {
// Filter the data before render
if (props.filterData) {
optionsModel.value = props.filterData(props.row, props.column, props.columns);
}
});
return {
show,
optionsModel,
onClose,
onClickOption,
onClick,
getValue,
getValueOption,
};
},
Expand Down

0 comments on commit 8fd7a7d

Please sign in to comment.