Approval queue conflict — Tasks block

Free

tasks-approval-queue-conflict · for app, workflows pages

Approval queue conflict

Two versions of the same item side by side, to keep one, the other or both

Documentation

Installation

One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).

pnpm dlx shadcn-vue@latest add @trame/tasks-approval-queue-conflict

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import TasksApprovalQueueConflict from '@/components/trame/blocks/tasks/tasks-approval-queue-conflict.vue'

const props = {
title: "To approve",
items: [
{
id: 1,
kind: "Goodwill credit",
summary: "15% credit on booking no. 10482, Desert Road trip",
params: [
{
label: "Amount",
value: "$184.00"
},
{
label: "Customer",
value: "Ruth Adeyemi"
}
],
requester: "Helen",
at: "2 h ago",
expires: "expires in 12 h",
local: {
modified: "yesterday, 5:40 p.m.",
size: "$184.00",
by: "Helen",
note: "No credit"
},
remote: {
modified: "today, 8:05 a.m.",
size: "$156.40",
by: "Samir",
note: "15% credit applied"
},
reason: "Goodwill credit requested after a delayed transfer.",
evidence: "The airport transfer arrived three hours late on day one."
},
{
id: 2,
kind: "Deletion",
summary: "Delete 340 traveler profiles with no trip in 3 years",
params: [
{
label: "List",
value: "Trip alerts"
}
],
requester: "Samir",
at: "5 h ago",
expires: "expires in 2 days",
reason: "Check the retention rules before deleting.",
evidence: "The selection covers travelers with no booking and no active trip alert."
}
],
approve: "approve",
decline: "decline",
both: "keep-both",
options: {
footnote: "A request that expires is declined automatically. Nothing changes until you decide."
}
}
</script>

<template>
<TasksApprovalQueueConflict v-bind="props" />
</template>

Props

Each prop says who changes it: Words, Picture, Action, Design, Data.* required.

PropTypeDescription
title*stringWordsthe queue’s heading ("To approve")
countnumberDatahow many requests wait in all, when the items are only a few of them
items*Item[]Datathe pending requests, oldest first
approvestringActionapproves a request (conflict: keeps the incoming version)
declinestringActiondeclines a request (conflict: keeps the local version)
bothstringActionconflict: keeps both versions
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Item items[] · 11 props
PropTypeDescription
id*string | numberthe item’s id
kind*stringWordswhat kind of request it is ("Discount", "Deletion")
summary*stringWordswhat is asked, in one line, exactly as the request states it
paramsParam[]the request’s details, each a label and a value
requester*stringWordswho asked
at*stringWordswhen, as written ("2 h ago")
expiresstringWordsthe deadline as the host states it ("expires in 12 h"): never computed by the block
evidencestringWordsthe host’s supporting content or reported passage
reasonstringWordsthe host’s reason for review
localLocalconflict: the version here
remoteRemoteconflict: the incoming version
Param items[].params[] · 2 props
PropTypeDescription
label*stringWordswhat the value is about
value*stringWordsthe value, as the merchant states it
Local items[].local · 4 props
PropTypeDescription
modified*stringWordswhen this version was last changed, as written
sizestringWordsits size or its weight, as written
bystringWordswho changed it
notestringWordswhat differs, one line
Remote items[].remote · 4 props
PropTypeDescription
modified*stringWordswhen this version was last changed, as written
sizestringWordsits size or its weight, as written
bystringWordswho changed it
notestringWordswhat differs, one line
Options options · 3 props
PropTypeDescription
footnotestringWordsa line stating what expiry or a decision does, as configured
emptystringWordswhat an empty queue says
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa band of the page that redefines the theme surfaces inside it
What it asks your app for

The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).

MemberWhat it is for
hrefthe address an action leads to, or null to hide what leads there
actruns a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error }
canwhether the page has this action
cartCountthe cart badge’s number
cartDrawerwhether your app has a cart drawer
cartOpenwhether the cart drawer is open
labelyour word for an interface key, or undefined to keep the block’s own

The words it says itself, in English and French; label(key) replaces any of them:

KeyEnglishFrench
newsletter.alreadyYou are already subscribed.Vous êtes déjà inscrit.
newsletter.doneDone: you are subscribed.C’est noté : vous êtes inscrit.
newsletter.invalidCheck the email address.Vérifiez l’adresse e-mail.
newsletter.tooManyToo many attempts, try again in a moment.Trop de tentatives, réessayez dans un moment.

Features

  • Every word in the server HTML
  • Same markup in Vue and React
  • Theme tokens only: every theme, light and dark
  • Shows what you give it, invents nothing
  • No motion; still under reduced motion
  • Real buttons and links, a visible focus
  • Asks your app through actions: approve, decline, both
  • Reads approvals from your app

A tasks section, for app, workflows pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.

Built with

The components this block is made of; each one installs on its own too.

More tasks blocks

  • Task list by person: A lead checking what each person has on their plate: one card per assignee with their counts and tasks, the unassigned ones last.
  • Task list focus: Today and overdue tasks beside a quieter upcoming agenda, using only the host’s deadline classifications.
  • Task list grouped: A checklist grouped by work status for completing the team’s own tasks without moving cards.
  • Task list table: A comparable task register with owner, deadline and priority for the team’s own records.
  • Ticket queue table detail: A ticket register above the open case for reviewing the merchant’s own support queue without losing the order context.

All 10 tasks blocks