Add provider and development relationship modeling
This commit is contained in:
+7
-4
@@ -27,6 +27,7 @@ const searchQuery = ref('')
|
||||
const categoryFilter = ref('all')
|
||||
const dataTypeFilter = ref('all')
|
||||
const tagFilter = ref('all')
|
||||
const connectionTypeFilter = ref('all')
|
||||
const placingPreset = ref<SystemPreset | null>(null)
|
||||
const selectedCapabilityIds = ref<string[]>([])
|
||||
const presentationMode = ref(false)
|
||||
@@ -157,6 +158,7 @@ function recordsForSelectedSystem(kind: TransferKind) { if (!selectedSystem.valu
|
||||
function systemName(id: string) { return landscape.value.systems.find((system) => system.id === id)?.name || id }
|
||||
const latestSelectedRecord = computed(() => selectedSystem.value ? transferHistory.value.filter((record) => record.destinationId === selectedSystem.value?.id).slice(-1)[0] : undefined)
|
||||
const matchesSystem = (system: SystemModel) => { const query = searchQuery.value.trim().toLowerCase(); const queryMatch = !query || `${system.name} ${system.description}`.toLowerCase().includes(query); const categoryMatch = categoryFilter.value === 'all' || system.category === categoryFilter.value; const dataMatch = dataTypeFilter.value === 'all' || landscape.value.connections.some((connection) => connection.dataType === dataTypeFilter.value && (connection.sourceId === system.id || connection.targetId === system.id)); const tagMatch = tagFilter.value === 'all' || (system.tags || []).includes(tagFilter.value); return queryMatch && categoryMatch && dataMatch && tagMatch }
|
||||
function connectionVisible(connection: ConnectionModel) { return connectionTypeFilter.value === 'all' || (connection.connectionType || 'data-flow') === connectionTypeFilter.value }
|
||||
function isSystemDimmed(system: SystemModel) { if (!matchesSystem(system)) return true; if (!playing.value || !currentConnections.value.length) return false; return !currentConnections.value.some((connection) => connection.sourceId === system.id || connection.targetId === system.id) }
|
||||
function animatePacket(duration: number) {
|
||||
stopAnimation(); const started = performance.now()
|
||||
@@ -195,7 +197,7 @@ function rebuildGraph() {
|
||||
landscape.value.systems.forEach(buildNode)
|
||||
for (const connection of landscape.value.connections) {
|
||||
const source = graph.getNodeById(visualNodeId(connection.sourceId)); const target = graph.getNodeById(visualNodeId(connection.targetId))
|
||||
if (source && target) source.connect(0, target, 0)
|
||||
if (source && target && connectionVisible(connection)) source.connect(0, target, 0)
|
||||
}
|
||||
nextTick(() => { graphCanvas?.draw(true, true); drawPackets() })
|
||||
}
|
||||
@@ -207,13 +209,13 @@ function drawPackets() {
|
||||
graphCanvas.onDrawForeground = original
|
||||
if (!currentConnections.value.length || stepIndex.value < 0) return
|
||||
const ctx = graphCanvas.ctx as CanvasRenderingContext2D
|
||||
for (const connection of landscape.value.connections) {
|
||||
for (const connection of landscape.value.connections.filter(connectionVisible)) {
|
||||
if (!connection.showCableLabel) continue
|
||||
const from = graph.getNodeById(visualNodeId(connection.sourceId)); const to = graph.getNodeById(visualNodeId(connection.targetId))
|
||||
if (!from || !to) continue
|
||||
ctx.save(); ctx.fillStyle = '#7887a2'; ctx.font = '10px Inter, sans-serif'; ctx.fillText(connectionLabel(connection), (from.pos[0] + to.pos[0]) / 2, (from.pos[1] + to.pos[1]) / 2 - 8); ctx.restore()
|
||||
ctx.save(); const typeColors: Record<string, string> = { 'data-flow': '#8795ff', deployment: '#f2a65a', dependency: '#9b76e9', 'source-repository': '#26c6a6' }; ctx.strokeStyle = typeColors[connection.connectionType || 'data-flow']; ctx.lineWidth = 2; ctx.setLineDash(connection.connectionType === 'dependency' ? [5, 5] : connection.connectionType === 'source-repository' ? [2, 5] : []); ctx.beginPath(); ctx.moveTo(from.pos[0] + from.size[0] / 2, from.pos[1] + 50); ctx.lineTo(to.pos[0] + to.size[0] / 2, to.pos[1] + 50); ctx.stroke(); ctx.fillStyle = '#7887a2'; ctx.font = '10px Inter, sans-serif'; ctx.fillText(connectionLabel(connection), (from.pos[0] + to.pos[0]) / 2, (from.pos[1] + to.pos[1]) / 2 - 8); ctx.restore()
|
||||
}
|
||||
for (const connection of currentConnections.value) {
|
||||
for (const connection of currentConnections.value.filter(connectionVisible)) {
|
||||
const from = graph.getNodeById(visualNodeId(connection.sourceId)); const to = graph.getNodeById(visualNodeId(connection.targetId))
|
||||
if (!from || !to) continue
|
||||
const x = from.pos[0] + from.size[0] + (to.pos[0] - from.pos[0] - from.size[0]) * packetProgress.value
|
||||
@@ -272,5 +274,6 @@ onUnmounted(stopAnimation)
|
||||
<div v-if="customBuilderOpen" class="modal-backdrop" @click.self="customBuilderOpen = false"><section class="custom-builder panel"><div class="inspector-header"><div><span class="eyebrow">CUSTOM SYSTEM BUILDER</span><h2>Reusable system definition</h2><p class="muted">Definitions are saved to the local preset library. Placed instances remain independent.</p></div><button class="danger-icon" @click="customBuilderOpen = false">×</button></div><div class="builder-meta"><label>Name<input v-model="customDraft.name" /></label><label>Category<select v-model="customDraft.category"><option value="application">Application</option><option value="service">Service</option><option value="data">Data</option><option value="human">Human / role</option><option value="external">External</option></select></label><label>Colour<input v-model="customDraft.color" type="color" /></label><label>Description<textarea v-model="customDraft.description" rows="2"></textarea></label></div><div class="builder-section"><div class="steps-head"><span>Actions</span><button class="icon-button" @click="addCustomAction">+</button></div><article v-for="action in customDraft.definition.actions" :key="action.id" class="definition-card"><div class="definition-grid"><label>Name<input v-model="action.name" /></label><label>Trigger<select v-model="action.trigger"><option value="button">Button</option><option value="incoming">Incoming request / event</option><option value="schedule">Simulated schedule</option></select></label></div><label>Description<input v-model="action.description" /></label><label>Example input JSON<textarea v-model="action.input" rows="2" class="code"></textarea></label><div class="steps-head"><span>Outputs</span><button class="icon-button" @click="addCustomOutput(action)">+</button></div><div v-for="output in action.outputs" :key="output.id" class="nested-row"><input v-model="output.name" placeholder="Output name" /><textarea v-model="output.payload" rows="2" class="code" placeholder="Example JSON"></textarea><input v-model="output.condition" placeholder="Outcome condition (optional)" /><label class="checkbox-label"><input v-model="output.parallel" type="checkbox" /> Parallel output</label></div></article></div><div class="builder-section"><div class="steps-head"><span>Endpoints</span><button class="icon-button" @click="addCustomEndpoint">+</button></div><article v-for="endpoint in customDraft.definition.endpoints" :key="endpoint.id" class="definition-card"><div class="definition-grid"><label>Name<input v-model="endpoint.name" /></label><label>Protocol<select v-model="endpoint.protocol"><option>HTTPS</option><option>HTTP</option><option>GraphQL</option><option>Webhook</option><option>Message queue</option></select></label><label>Method<input v-model="endpoint.method" /></label><label>Path<input v-model="endpoint.path" /></label></div><label>Example request JSON<textarea v-model="endpoint.request" rows="2" class="code"></textarea></label><label>Triggers action<select v-model="endpoint.triggersActionId"><option value="">No action</option><option v-for="action in customDraft.definition.actions" :key="action.id" :value="action.id">{{ action.name }}</option></select></label><div class="steps-head"><span>Responses</span><button class="icon-button" @click="addCustomResponse(endpoint)">+</button></div><div v-for="response in endpoint.responses" :key="response.id" class="nested-row response-row"><label>Status<input v-model.number="response.status" type="number" /></label><label>Delay ms<input v-model.number="response.delayMs" type="number" min="0" /></label><textarea v-model="response.body" rows="2" class="code" placeholder="Response body JSON"></textarea></div></article></div><div class="modal-actions"><button class="ghost" @click="customBuilderOpen = false">Cancel</button><button class="primary" @click="saveCustomBuilder">Save reusable preset</button></div></section></div>
|
||||
<section v-if="activeTab === 'containers'" class="container-editor panel"><div class="section-heading"><span>Environment containers</span><button class="primary" @click="addContainer">Add container</button></div><div class="container-list"><button v-for="container in landscape.containers" :key="container.id" class="list-item" :class="{selected: selectedContainerId === container.id}" @click="selectContainer(container.id)"><span class="system-dot" :style="{background: container.color}"></span><span><strong>{{ container.name }}</strong><small>{{ container.collapsed ? 'Collapsed' : 'Expanded' }} · {{ landscape.systems.filter((system) => system.containerId === container.id).length }} systems</small></span></button></div><div v-if="selectedContainer" class="container-form"><label>Name<input v-model="selectedContainer.name" @change="rebuildGraph" /></label><label>Colour<input v-model="selectedContainer.color" type="color" @change="rebuildGraph" /></label><label>Parent<select v-model="selectedContainer.parentId" @change="rebuildGraph"><option value="">No parent</option><option v-for="parent in landscape.containers.filter((item) => item.id !== selectedContainer.id)" :key="parent.id" :value="parent.id">{{ parent.name }}</option></select></label><label>Position X<input v-model.number="selectedContainer.position[0]" type="number" @change="rebuildGraph" /></label><label>Position Y<input v-model.number="selectedContainer.position[1]" type="number" @change="rebuildGraph" /></label><label>Width<input v-model.number="selectedContainer.size[0]" type="number" min="180" @change="rebuildGraph" /></label><label>Height<input v-model.number="selectedContainer.size[1]" type="number" min="120" @change="rebuildGraph" /></label><label class="checkbox-label"><input v-model="selectedContainer.collapsed" type="checkbox" @change="rebuildGraph" /> Collapse to summary</label><div class="container-move"><button class="ghost" @click="moveContainer(selectedContainer, -20, 0)">← Move</button><button class="ghost" @click="moveContainer(selectedContainer, 20, 0)">Move →</button><button class="ghost" @click="moveContainer(selectedContainer, 0, -20)">↑ Move</button><button class="ghost" @click="moveContainer(selectedContainer, 0, 20)">↓ Move</button></div><button class="text-danger" @click="deleteContainer(selectedContainer.id)">Delete container</button></div></section>
|
||||
<section class="tag-panel panel"><label>Filter by system tag<select v-model="tagFilter"><option value="all">All tags</option><option v-for="tag in allTags" :key="tag">{{ tag }}</option></select></label><label v-if="selectedSystem">Selected system tags<input :value="(selectedSystem.tags || []).join(', ')" @change="selectedSystem.tags = $event.target.value.split(',').map((tag) => tag.trim()).filter(Boolean); persist()" /></label></section>
|
||||
<section class="category-panel panel"><label>Filter by category<select v-model="categoryFilter"><option value="all">All categories</option><option value="application">Application</option><option value="saas-service">SaaS Service</option><option value="cloud-service">Cloud Service</option><option value="development-tool">Development Tool</option><option value="data-store">Data Store</option><option value="service">Service</option><option value="data">Data</option><option value="human">Human</option><option value="external">External</option></select></label><label>Filter connections<select v-model="connectionTypeFilter" @change="rebuildGraph"><option value="all">All relationship types</option><option value="data-flow">Data Flow</option><option value="deployment">Deployment</option><option value="dependency">Dependency</option><option value="source-repository">Source Repository</option></select></label><label v-if="selectedConnection">Selected relationship type<select v-model="selectedConnection.connectionType"><option value="data-flow">Data Flow</option><option value="deployment">Deployment</option><option value="dependency">Dependency</option><option value="source-repository">Source Repository</option></select></label></section>
|
||||
</main>
|
||||
</template>
|
||||
|
||||
+4
-2
@@ -4,9 +4,11 @@ import { definitionFromCapabilities, demoLandscape, getPreset, systemFromPreset,
|
||||
describe('landscape model', () => {
|
||||
it('provides the editable demo landscape', () => {
|
||||
const landscape = demoLandscape()
|
||||
expect(landscape.systems).toHaveLength(6)
|
||||
expect(landscape.scenarios.map((scenario) => scenario.name)).toEqual(expect.arrayContaining(['Place order', 'Register customer', 'Contact enquiry', 'Sample request', 'Commercial order', 'Order retry and recovery']))
|
||||
expect(landscape.systems).toHaveLength(8)
|
||||
expect(landscape.scenarios.map((scenario) => scenario.name)).toEqual(expect.arrayContaining(['Place order', 'Register customer', 'Contact enquiry', 'Sample request', 'Commercial order', 'Order retry and recovery', 'Commit, build and deploy']))
|
||||
expect(landscape.scenarios[0].steps[2].connectionIds).toHaveLength(2)
|
||||
expect(getPreset('bitbucket')?.category).toBe('development-tool')
|
||||
expect(landscape.connections.find((connection) => connection.id === 'azure-devops-website')?.connectionType).toBe('deployment')
|
||||
})
|
||||
it('round-trips a valid landscape and preserves positions', () => {
|
||||
const source = demoLandscape(); const imported = validateLandscape(JSON.parse(JSON.stringify(source)))
|
||||
|
||||
+25
-4
@@ -1,4 +1,5 @@
|
||||
export type SystemCategory = 'application' | 'service' | 'data' | 'human' | 'external'
|
||||
export type SystemCategory = 'application' | 'saas-service' | 'cloud-service' | 'development-tool' | 'data-store' | 'service' | 'data' | 'human' | 'external'
|
||||
export type ConnectionType = 'data-flow' | 'deployment' | 'dependency' | 'source-repository'
|
||||
|
||||
export interface PortModel { id: string; name: string; description: string }
|
||||
export interface ActionModel { id: string; name: string; description: string; payload: string }
|
||||
@@ -25,6 +26,7 @@ export interface SystemModel {
|
||||
definition?: SystemDefinition
|
||||
containerId?: string
|
||||
tags?: string[]
|
||||
providerMetadata?: { provider: string; service?: string; region?: string }
|
||||
}
|
||||
|
||||
export interface EnvironmentContainerModel {
|
||||
@@ -54,6 +56,7 @@ export interface ConnectionModel {
|
||||
targetPortId?: string
|
||||
responsePayload?: string
|
||||
responseStatus?: number
|
||||
connectionType?: ConnectionType
|
||||
}
|
||||
|
||||
export interface ScenarioStep {
|
||||
@@ -104,7 +107,14 @@ export const SYSTEM_PRESETS: SystemPreset[] = [
|
||||
{ id: 'email', name: 'Email Platform', description: 'Transactional and lifecycle messaging.', category: 'external', color: '#4aa3df', capabilities: [capability('transactional-email', 'Transactional email', 'Send a message from a template.', [port('email-request', 'Email request', 'A message request.')], [port('delivery-event', 'Delivery event', 'Delivery status.')], [action('send-email', 'Send email', 'Send a fictional transactional email.', '{"messageId":"msg_44","template":"order-confirmation","to":"sam@example.test"}')], '{"template":"order-confirmation","to":"sam@example.test"}'), capability('campaigns', 'Campaigns', 'Send lifecycle or campaign messages.', [port('campaign-request', 'Campaign request', 'A campaign message request.')], [port('campaign-event', 'Campaign event', 'Campaign delivery status.')], [action('send-campaign', 'Send campaign', 'Send a fictional campaign message.', '{"campaign":"welcome","customerId":"cus_89"}')], '{"campaign":"welcome","customerId":"cus_89"}') ]},
|
||||
{ id: 'analytics', name: 'Analytics', description: 'Collect and report product and business events.', category: 'data', color: '#8f7cf2', capabilities: [capability('event-collection', 'Event collection', 'Accept events from connected systems.', [port('event', 'Event', 'A product or business event.')], [port('accepted-event', 'Accepted event', 'An accepted analytics event.')], [action('capture-event', 'Capture event', 'Capture a fictional analytics event.', '{"event":"checkout_completed","visitorId":"vis_204"}')], '{"event":"checkout_completed","visitorId":"vis_204"}'), capability('reporting', 'Reporting', 'Produce a simple report payload.', [port('report-query', 'Report query', 'A report query.')], [port('report', 'Report', 'A generated report.')], [action('run-report', 'Run report', 'Generate a fictional report.', '{"report":"weekly-orders","orders":42}')], '{"report":"weekly-orders","orders":42}') ]},
|
||||
{ id: 'api', name: 'API', description: 'Orchestrate requests between applications and services.', category: 'service', color: '#26c6a6', capabilities: [capability('http-api', 'HTTP API', 'Receive and route application requests.', [port('request', 'Request', 'An inbound API request.')], [port('response', 'Response', 'A response returned to the caller.')], [action('handle-request', 'Handle request', 'Handle a fictional API request.', '{"requestId":"req_1001","status":"accepted"}')], '{"requestId":"req_1001","status":"accepted"}'), capability('webhooks', 'Webhooks', 'Send outbound event notifications.', [port('event', 'Event', 'An event to publish.')], [port('webhook', 'Webhook', 'An outbound webhook delivery.')], [action('send-webhook', 'Send webhook', 'Send a fictional webhook.', '{"event":"order.created","id":"ord_1042"}')], '{"event":"order.created","id":"ord_1042"}') ]},
|
||||
{ id: 'sales-review-role', name: 'Sales review', description: 'A sales team role that reviews sample requests.', category: 'human', color: '#f06ca9', capabilities: [capability('sales-review', 'Sales review', 'Review a sample request and choose the next action.', [port('review-request', 'Review request', 'Information waiting for a sales decision.')], [port('decision', 'Decision', 'The selected sales action.')], [action('approve', 'Approve', 'Approve a request for fulfilment.', '{"decision":"approved","reviewerRole":"sales"}'), action('reject', 'Reject', 'Reject a request and notify the customer.', '{"decision":"rejected","reviewerRole":"sales"}'), action('edit', 'Edit', 'Edit the request before forwarding.', '{"decision":"edited","reviewerRole":"sales"}'), action('forward', 'Forward', 'Forward the request for another review.', '{"decision":"forwarded","reviewerRole":"sales"}')], '{"decision":"pending","reviewerRole":"sales"}') ]}
|
||||
{ id: 'sales-review-role', name: 'Sales review', description: 'A sales team role that reviews sample requests.', category: 'human', color: '#f06ca9', capabilities: [capability('sales-review', 'Sales review', 'Review a sample request and choose the next action.', [port('review-request', 'Review request', 'Information waiting for a sales decision.')], [port('decision', 'Decision', 'The selected sales action.')], [action('approve', 'Approve', 'Approve a request for fulfilment.', '{"decision":"approved","reviewerRole":"sales"}'), action('reject', 'Reject', 'Reject a request and notify the customer.', '{"decision":"rejected","reviewerRole":"sales"}'), action('edit', 'Edit', 'Edit the request before forwarding.', '{"decision":"edited","reviewerRole":"sales"}'), action('forward', 'Forward', 'Forward the request for another review.', '{"decision":"forwarded","reviewerRole":"sales"}')], '{"decision":"pending","reviewerRole":"sales"}') ]},
|
||||
{ id: 'bitbucket', name: 'Bitbucket', description: 'Source repository and pull request workflows.', category: 'development-tool', color: '#2684ff', capabilities: [capability('repository', 'Source repository', 'Track commits and pull requests.', [port('commit', 'Commit', 'A fictional source commit.')], [port('repository-event', 'Repository event', 'A source control event.')], [action('commit', 'Commit pushed', 'Simulate a commit event.', '{"commit":"abc123","branch":"main"}')], '{"commit":"abc123","branch":"main"}')]},
|
||||
{ id: 'azure-devops', name: 'Azure DevOps', description: 'Simulated build and deployment orchestration.', category: 'development-tool', color: '#0078d4', capabilities: [capability('pipeline', 'Build pipeline', 'Build and release source changes.', [port('build-trigger', 'Build trigger', 'A source change to build.')], [port('deployment', 'Deployment', 'A deployment event.')], [action('run-build', 'Run build', 'Simulate a successful build.', '{"buildId":"build_42","status":"succeeded"}')], '{"buildId":"build_42","status":"queued"}')]},
|
||||
{ id: 'mailchimp', name: 'Mailchimp', description: 'Simulated SaaS marketing and email automation.', category: 'saas-service', color: '#f5b335', capabilities: [capability('campaign', 'Campaign', 'Send a fictional campaign event.', [port('campaign-request', 'Campaign request', 'Campaign details.')], [port('campaign-event', 'Campaign event', 'Campaign delivery event.')], [action('send-campaign', 'Send campaign', 'Simulate campaign delivery.', '{"campaignId":"cmp_17","status":"sent"}')], '{"campaignId":"cmp_17"}')]},
|
||||
{ id: 'sitecore-ordercloud', name: 'Sitecore OrderCloud', description: 'Simulated headless commerce service.', category: 'saas-service', color: '#f06ca9', capabilities: [capability('commerce-api', 'Commerce API', 'Process fictional commerce requests.', [port('order-request', 'Order request', 'A commerce order.')], [port('order-response', 'Order response', 'A commerce response.')], [action('create-order', 'Create order', 'Simulate order creation.', '{"orderId":"oc_1001","status":"accepted"}')], '{"orderId":"oc_1001"}')]},
|
||||
{ id: 'azure-functions', name: 'Azure Functions', description: 'Simulated serverless compute.', category: 'cloud-service', color: '#00a4ef', capabilities: [capability('function', 'Function', 'Run a fictional function.', [port('trigger', 'Trigger', 'An event that invokes a function.')], [port('result', 'Result', 'Function result.')], [action('invoke', 'Invoke function', 'Simulate function execution.', '{"invocationId":"inv_9","status":"complete"}')], '{"invocationId":"inv_9"}')]},
|
||||
{ id: 'service-bus', name: 'Service Bus', description: 'Simulated cloud message broker.', category: 'cloud-service', color: '#5d8ee8', capabilities: [capability('messaging', 'Messaging', 'Publish fictional messages.', [port('message', 'Message', 'A message to publish.')], [port('message-event', 'Message event', 'A published message event.')], [action('publish', 'Publish message', 'Simulate message publication.', '{"messageId":"msg_9","status":"accepted"}')], '{"messageId":"msg_9"}')]},
|
||||
{ id: 'azure-storage', name: 'Storage', description: 'Simulated object and data storage.', category: 'data-store', color: '#86bc25', capabilities: [capability('blob-storage', 'Blob storage', 'Store fictional data objects.', [port('object', 'Object', 'An object to store.')], [port('stored-object', 'Stored object', 'Storage confirmation.')], [action('store', 'Store object', 'Simulate object storage.', '{"objectKey":"orders/oc_1001.json","status":"stored"}')], '{"objectKey":"orders/oc_1001.json"}')]}
|
||||
]
|
||||
|
||||
export function getPreset(id: string) { return SYSTEM_PRESETS.find((preset) => preset.id === id) }
|
||||
@@ -126,7 +136,9 @@ export const demoLandscape = (): LandscapeModel => ({
|
||||
{ id: 'erp', name: 'ERP', description: 'Back-office order fulfilment and inventory system.', category: 'data', color: '#f2a65a', position: [650, 100], presetId: 'erp', containerId: 'azure-resource-group', tags: ['Production', 'Customer Data'], capabilities: cloneCapabilities(getPreset('erp')!.capabilities) },
|
||||
{ id: 'crm', name: 'CRM', description: 'Customer profile and lifecycle management.', category: 'data', color: '#dd6bca', position: [650, 290], presetId: 'crm', containerId: 'azure-resource-group', tags: ['Production', 'Customer Data'], capabilities: cloneCapabilities(getPreset('crm')!.capabilities) },
|
||||
{ id: 'email', name: 'Email Platform', description: 'Transactional and lifecycle messaging.', category: 'external', color: '#4aa3df', position: [930, 290], containerId: 'azure-resource-group', tags: ['Test', 'Business Function'], capabilities: cloneCapabilities(getPreset('email')!.capabilities) },
|
||||
{ id: 'sales-review', name: 'Sales review', description: 'Sales team role that reviews sample requests.', category: 'human', color: '#f06ca9', position: [650, 480], containerId: 'azure-resource-group', tags: ['Production', 'Business Function'], presetId: 'sales-review-role', capabilities: cloneCapabilities(getPreset('sales-review-role')!.capabilities) }
|
||||
{ id: 'sales-review', name: 'Sales review', description: 'Sales team role that reviews sample requests.', category: 'human', color: '#f06ca9', position: [650, 480], containerId: 'azure-resource-group', tags: ['Production', 'Business Function'], presetId: 'sales-review-role', capabilities: cloneCapabilities(getPreset('sales-review-role')!.capabilities) },
|
||||
{ id: 'bitbucket', name: 'Bitbucket', description: 'Source repository for application code.', category: 'development-tool', color: '#2684ff', position: [80, 700], tags: ['Test', 'Source Control'], providerMetadata: { provider: 'Atlassian', service: 'Bitbucket' }, presetId: 'bitbucket', capabilities: cloneCapabilities(getPreset('bitbucket')!.capabilities) },
|
||||
{ id: 'azure-devops', name: 'Azure DevOps', description: 'Build and release orchestration.', category: 'development-tool', color: '#0078d4', position: [360, 700], tags: ['Test', 'Deployment'], providerMetadata: { provider: 'Microsoft', service: 'Azure DevOps' }, presetId: 'azure-devops', capabilities: cloneCapabilities(getPreset('azure-devops')!.capabilities) }
|
||||
],
|
||||
connections: [
|
||||
{ id: 'website-api', sourceId: 'website', targetId: 'api', label: 'Order request', description: 'Website submits a new order to the API.', payload: '{"orderId":"ord_1042","total":129.5}' },
|
||||
@@ -144,7 +156,9 @@ export const demoLandscape = (): LandscapeModel => ({
|
||||
{ id: 'api-erp-commercial', sourceId: 'api', targetId: 'erp', label: 'Fulfil commercial order', description: 'API creates the commercial order in ERP.', payload: '{"orderId":"ord_2048","status":"new"}', protocol: 'HTTPS', dataType: 'JSON', deliveryMethod: 'immediate', showCableLabel: true },
|
||||
{ id: 'website-sales-review', sourceId: 'website', targetId: 'sales-review', label: 'Sample review', description: 'Website sends a sample request to Sales.', payload: '{"orderId":"smp_1042","sku":"sample-blue"}', protocol: 'HTTPS', dataType: 'JSON', deliveryMethod: 'manual', showCableLabel: true },
|
||||
{ id: 'sales-erp', sourceId: 'sales-review', targetId: 'erp', label: 'Approved sample', description: 'Sales approves the sample for ERP fulfilment.', payload: '{"orderId":"smp_1042","decision":"approved"}', protocol: 'HTTPS', dataType: 'JSON', deliveryMethod: 'manual', showCableLabel: true },
|
||||
{ id: 'sales-email', sourceId: 'sales-review', targetId: 'email', label: 'Rejected sample notice', description: 'Sales rejection triggers a customer notification.', payload: '{"template":"sample-rejected","orderId":"smp_1042"}', protocol: 'HTTPS', dataType: 'JSON', deliveryMethod: 'manual', showCableLabel: true }
|
||||
{ id: 'sales-email', sourceId: 'sales-review', targetId: 'email', label: 'Rejected sample notice', description: 'Sales rejection triggers a customer notification.', payload: '{"template":"sample-rejected","orderId":"smp_1042"}', protocol: 'HTTPS', dataType: 'JSON', deliveryMethod: 'manual', showCableLabel: true },
|
||||
{ id: 'bitbucket-azure-devops', sourceId: 'bitbucket', targetId: 'azure-devops', label: 'Commit triggers build', description: 'A source commit triggers the build pipeline.', payload: '{"commit":"abc123","branch":"main"}', connectionType: 'source-repository', exchangeType: 'event-transfer', protocol: 'Webhook', dataType: 'Event', deliveryMethod: 'immediate', showCableLabel: true },
|
||||
{ id: 'azure-devops-website', sourceId: 'azure-devops', targetId: 'website', label: 'Deploy website', description: 'A successful build deploys the website.', payload: '{"buildId":"build_42","environment":"Production"}', connectionType: 'deployment', exchangeType: 'event-transfer', protocol: 'HTTPS', dataType: 'Event', deliveryMethod: 'scheduled', showCableLabel: true }
|
||||
],
|
||||
scenarios: [
|
||||
{
|
||||
@@ -199,6 +213,13 @@ export const demoLandscape = (): LandscapeModel => ({
|
||||
{ id: 'human-sample-1', connectionIds: ['website-sales-review'], explanation: 'The website sends a sample request to the Sales review role.', payload: '{"orderId":"smp_1042","sku":"sample-blue"}', delayMs: 800, outcome: 'success' },
|
||||
{ id: 'human-sample-decision', connectionIds: [], explanation: 'Sales reviews the sample request and chooses what happens next.', payload: '{"decision":"pending","orderId":"smp_1042"}', delayMs: 500, humanDecision: { roleSystemId: 'sales-review', task: 'Review the sample request and decide whether Sales should approve fulfilment or notify the customer that the request cannot proceed.', receivedData: '{"orderId":"smp_1042","sku":"sample-blue","customer":"sam@example.test"}', editableFields: { customerNote: 'Please confirm the colour before fulfilment.' }, actions: [{ id: 'approve', name: 'Approve', description: 'Send the approved sample to ERP.', payload: '{"orderId":"smp_1042","decision":"approved"}', connectionId: 'sales-erp' }, { id: 'reject', name: 'Reject', description: 'Notify the customer that the sample was rejected.', payload: '{"orderId":"smp_1042","decision":"rejected"}', connectionId: 'sales-email' }, { id: 'edit', name: 'Edit', description: 'Edit the request and forward it to ERP.', payload: '{"orderId":"smp_1042","decision":"edited","note":"Please confirm the colour"}', connectionId: 'sales-erp' }, { id: 'forward', name: 'Forward', description: 'Forward the request to ERP for another review.', payload: '{"orderId":"smp_1042","decision":"forwarded"}', connectionId: 'sales-erp' }] } }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'commit-build-deploy', name: 'Commit, build and deploy', description: 'Simulate a source commit triggering a build and deployment.', startSystemId: 'bitbucket', startActionId: 'commit',
|
||||
steps: [
|
||||
{ id: 'dev-1', connectionIds: ['bitbucket-azure-devops'], explanation: 'A developer pushes a commit to the source repository.', payload: '{"commit":"abc123","branch":"main"}', delayMs: 700, outcome: 'success' },
|
||||
{ id: 'dev-2', connectionIds: ['azure-devops-website'], explanation: 'Azure DevOps completes the build and deploys the website.', payload: '{"buildId":"build_42","environment":"Production"}', delayMs: 1100, outcome: 'success' }
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
.navigation-panel{display:flex;justify-content:space-between;gap:18px;padding:12px 16px}.nav-fields{display:flex;align-items:end;gap:10px;flex:1}.nav-fields label{color:#8996af;font-size:10px;font-weight:700;flex:1}.nav-fields input,.nav-fields select{display:block;width:100%;margin-top:5px;background:#0d1320;color:#dce4f4;border:1px solid #303d58;border-radius:4px;padding:7px;font-size:11px}.nav-fields button{height:31px;white-space:nowrap}.minimap-wrap{flex:0 0 220px}.minimap-wrap canvas{display:block;width:220px;height:120px;border:1px solid #303d58;border-radius:4px;margin-top:5px}@media(max-width:800px){.navigation-panel{display:block}.nav-fields{display:grid;grid-template-columns:1fr 1fr}.minimap-wrap{margin-top:12px}.minimap-wrap canvas{width:100%}}
|
||||
.container-editor,.tag-panel{padding:16px;margin-top:14px}.container-list{display:flex;gap:8px;flex-wrap:wrap}.container-list .list-item{width:auto;min-width:180px}.container-form{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:14px;padding-top:14px;border-top:1px solid #263149}.container-form label,.tag-panel label{color:#8996af;font-size:11px;font-weight:700}.container-form input,.container-form select,.tag-panel select,.tag-panel input{display:block;width:100%;margin-top:5px;background:#0d1320;color:#dce4f4;border:1px solid #303d58;border-radius:4px;padding:8px}.container-move{display:flex;gap:5px;align-items:end;flex-wrap:wrap}.tag-panel{display:flex;gap:14px;align-items:end}.tag-panel label{min-width:220px}.tag-panel label+label{flex:1}@media(max-width:700px){.container-form{grid-template-columns:1fr 1fr}.tag-panel{display:block}.tag-panel label{display:block;margin-bottom:10px}}
|
||||
.category-panel{display:flex;gap:12px;align-items:end;padding:12px 16px;margin-top:14px}.category-panel label{color:#8996af;font-size:11px;font-weight:700;min-width:190px}.category-panel select{display:block;width:100%;margin-top:5px;background:#0d1320;color:#dce4f4;border:1px solid #303d58;border-radius:4px;padding:8px}@media(max-width:700px){.category-panel{display:block}.category-panel label{display:block;margin-bottom:10px}}
|
||||
|
||||
Reference in New Issue
Block a user