Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added badges for Alternatives column in the request lists
  • Loading branch information
gustavobascope committed Jun 13, 2024
commit c3d325f1737e5a1efd66290ef74aa3119c05eaec
12 changes: 12 additions & 0 deletions resources/js/components/shared/FilterTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,18 @@ export default {
border-radius: 5px;
padding: 7px;
}
.status-alternative-a {
background: rgba(224, 229, 232, 1);
color: rgba(0, 0, 0, 0.75);
border-radius: 5px;
padding: 7px;
}
.status-alternative-b {
background: rgba(249, 232, 195, 1);
color: rgba(0, 0, 0, 0.75);
border-radius: 5px;
padding: 7px;
}
@-moz-document url-prefix() {
.pm-table-truncate {
overflow: hidden;
Expand Down
21 changes: 20 additions & 1 deletion resources/js/requests/components/RequestsListing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ import paginationTable from "../../components/shared/PaginationTable.vue";
import PMColumnFilterIconAsc from "../../components/PMColumnFilterPopover/PMColumnFilterIconAsc.vue";
import PMColumnFilterIconDesc from "../../components/PMColumnFilterPopover/PMColumnFilterIconDesc.vue";
import FilterTableBodyMixin from "../../components/shared/FilterTableBodyMixin";
import { BadgePlugin } from "bootstrap-vue";

const uniqIdsMixin = createUniqIdsMixin();

Expand Down Expand Up @@ -397,7 +398,25 @@ export default {
};
},
formatProcessVersionAlternative(value) {
return `Alternative ${value}`;
let color = "primary";
let badge = "alternative-a";

if (value === "A") {
color = "primary";
badge = "alternative-a";
} else if (value === "B") {
color = "secondary";
badge = "alternative-b";
} else if (value === null) {
return "-";
}

return `
<span
class="badge badge-${color} status-${badge}"
>
Alternative ${value}
</span>`;
},
transform(dataInput) {
const data = _.cloneDeep(dataInput);
Expand Down