From 0aad6e15e0f5f80d67c2ad68010aaec5bc98a391 Mon Sep 17 00:00:00 2001 From: syedfkabir Date: Fri, 28 Oct 2022 12:25:56 -0400 Subject: [PATCH 1/3] Make a HAL Form on the Project Item #48 --- src/project/formats/hal.ts | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/src/project/formats/hal.ts b/src/project/formats/hal.ts index c39e823..d6ca5fd 100644 --- a/src/project/formats/hal.ts +++ b/src/project/formats/hal.ts @@ -34,7 +34,7 @@ export function item(project: Project) { }, collection: { title: 'List of projects', - href: '/project' + href: '/project', }, client: { title: project.client.name, @@ -42,8 +42,39 @@ export function item(project: Project) { }, 'entry-collection': { title: 'List of time entries', - href: project.href + '/entry' - } + href: project.href + '/entry', + }, + }, + _templates: { + add: { + title: 'Add a Person to a Project', + method: 'POST', + contentType: 'application/json', + target: `${project.href}/person`, + properties: [ + { + name: 'Role', + prompt: 'Role', + required: true, + options: { + inline: ['member', 'manager', 'owner'], + }, + }, + { + name: 'name', + prompt: 'Name', + required: true, + placeHolder: 'John Doe', + }, + { + name: 'email', + prompt: 'Email', + required: true, + type: 'url', + placeHolder: 'mailto:johndoe@badgateway.net', + }, + ], + }, }, name: project.name, createdAt: project.createdAt.toISOString(), From 051bd6fcca733a0d9aef0124a5ee8cc34ee6be5f Mon Sep 17 00:00:00 2001 From: syedfkabir Date: Fri, 28 Oct 2022 12:41:19 -0400 Subject: [PATCH 2/3] Make a HAL Form on the Project Item #48 --- src/project/formats/hal.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/project/formats/hal.ts b/src/project/formats/hal.ts index d6ca5fd..82bc34b 100644 --- a/src/project/formats/hal.ts +++ b/src/project/formats/hal.ts @@ -67,8 +67,8 @@ export function item(project: Project) { placeHolder: 'John Doe', }, { - name: 'email', - prompt: 'Email', + name: 'href', + prompt: 'Href', required: true, type: 'url', placeHolder: 'mailto:johndoe@badgateway.net', From 95f7d8b206bbaa94b7586aadacfb5191b5442228 Mon Sep 17 00:00:00 2001 From: syedfkabir Date: Fri, 28 Oct 2022 12:45:03 -0400 Subject: [PATCH 3/3] Make a HAL Form on the Project Item #48 --- src/project/formats/hal.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/project/formats/hal.ts b/src/project/formats/hal.ts index 82bc34b..a8013dc 100644 --- a/src/project/formats/hal.ts +++ b/src/project/formats/hal.ts @@ -70,7 +70,6 @@ export function item(project: Project) { name: 'href', prompt: 'Href', required: true, - type: 'url', placeHolder: 'mailto:johndoe@badgateway.net', }, ],