diff --git a/ui/pages/add/license/[identifier].vue b/ui/pages/add/license/[identifier].vue
index 46b74d7a..2f9c447a 100644
--- a/ui/pages/add/license/[identifier].vue
+++ b/ui/pages/add/license/[identifier].vue
@@ -194,6 +194,29 @@ const navigateToPR = () => {
+
+
+
+
+ Dashboard
+
+
+
+
+ {{ data?.owner }}
+
+
+
+
+ {{ data?.repo }}
+
+
+
+
+ Edit License
+
+
+
diff --git a/ui/pages/dashboard/[owner]/[repo].vue b/ui/pages/dashboard/[owner]/[repo].vue
index 3527c9d0..fe8e0496 100644
--- a/ui/pages/dashboard/[owner]/[repo].vue
+++ b/ui/pages/dashboard/[owner]/[repo].vue
@@ -26,28 +26,6 @@ if (error.value) {
}
}
-const licenseRequests = computed(() => {
- if (!data.value) {
- return {
- closed: [],
- open: [],
- };
- }
-
- const openLicenseRequests = data.value?.licenseRequests.filter(
- (request) => request.open,
- );
-
- const closedLicenseRequests = data.value?.licenseRequests.filter(
- (request) => !request.open,
- );
-
- return {
- closed: closedLicenseRequests,
- open: openLicenseRequests,
- };
-});
-
const generateSeed = (seed: string) => {
return generate({
join: "-",
@@ -133,74 +111,142 @@ const rerunCwlValidation = async () => {
-
-
-
-
-
-
- ID: {{ generateSeed(licenseRequest.identifier) }}
-
-
- {{
- $dayjs
- .unix(parseInt(licenseRequest.timestamp) / 1000)
- .format("MMMM DD, YYYY HH:mmA")
- }}
-
-
+
+
+
+
+
+ A License is required according to the FAIR-BioRS guidelines
+
+
+
+
+
+
+
+
+ Edit License
+
+
+
+
-
- View License
-
-
-
-
+
-
+
+
+
+
+
+
+
+
+ ID:
+ {{
+ generateSeed(data?.licenseRequest?.identifier || "hello")
+ }}
+
+
+
+
+ View License
+
+
+
@@ -214,15 +260,7 @@ const rerunCwlValidation = async () => {
class="rounded-lg bg-white shadow-md"
bordered
>
-
-
-
-
There are no codemetadata requests for this repository yet.
diff --git a/ui/pages/view/cwl-validation/[identifier].vue b/ui/pages/view/cwl-validation/[identifier].vue
index bafd99de..794bdfd1 100644
--- a/ui/pages/view/cwl-validation/[identifier].vue
+++ b/ui/pages/view/cwl-validation/[identifier].vue
@@ -31,6 +31,29 @@ if (data.value) {
+
+
+
+
+ Dashboard
+
+
+
+
+ {{ data?.owner }}
+
+
+
+
+ {{ data?.repo }}
+
+
+
+
+ View CWL Validation
+
+
+
diff --git a/ui/server/api/dashboard/[owner]/[repo]/index.get.ts b/ui/server/api/dashboard/[owner]/[repo]/index.get.ts
index 729ba60b..89cb3d87 100644
--- a/ui/server/api/dashboard/[owner]/[repo]/index.get.ts
+++ b/ui/server/api/dashboard/[owner]/[repo]/index.get.ts
@@ -36,14 +36,9 @@ export default defineEventHandler(async (event) => {
const licenseRequestsCollection = db.collection("licenseRequests");
// Get all license requests for the repository sorted by timestamp
- const allLicenseRequests = await licenseRequestsCollection
- .find({
- repositoryId,
- })
- .sort({
- timestamp: -1,
- })
- .toArray();
+ const licenseRequest = await licenseRequestsCollection.findOne({
+ repositoryId,
+ });
const codeMetadataCollection = db.collection("codeMetadata");
@@ -81,14 +76,16 @@ export default defineEventHandler(async (event) => {
repo: cwlValidation.repo as string,
}
: null,
- licenseRequests: allLicenseRequests.map((licenseRequest) => ({
- identifier: licenseRequest.identifier as string,
- licenseId: licenseRequest.licenseId as string,
- open: licenseRequest.open as boolean,
- owner: licenseRequest.owner as string,
- pullRequest: (licenseRequest.pullRequestURL as string) || "",
- repo: licenseRequest.repo as string,
- timestamp: licenseRequest.updated_at as string,
- })),
+ licenseRequest: licenseRequest
+ ? {
+ identifier: licenseRequest.identifier as string,
+ licenseId: licenseRequest.licenseId as string,
+ open: licenseRequest.open as boolean,
+ owner: licenseRequest.owner as string,
+ pullRequest: (licenseRequest.pullRequestURL as string) || "",
+ repo: licenseRequest.repo as string,
+ timestamp: licenseRequest.updated_at as string,
+ }
+ : null,
};
});
diff --git a/ui/server/api/license/[identifier]/index.post.ts b/ui/server/api/license/[identifier]/index.post.ts
index abfb8c35..9e8e5f53 100644
--- a/ui/server/api/license/[identifier]/index.post.ts
+++ b/ui/server/api/license/[identifier]/index.post.ts
@@ -167,10 +167,6 @@ export default defineEventHandler(async (event) => {
});
// Create a pull request for the new branch with the license content
-
- /**
- * todo: figure out how to resolve the issue number
- */
const { data: pullRequestData } = await octokit.request(
"POST /repos/{owner}/{repo}/pulls",
{
@@ -179,7 +175,11 @@ export default defineEventHandler(async (event) => {
title: "feat: ✨ LICENSE file added",
head: newBranchName,
base: defaultBranch,
- // body: `Resolves #${context.payload.issue.number}`,
+ body: `This pull request ${
+ existingLicenseSHA
+ ? "updates the existing LICENSE file"
+ : `adds the LICENSE file with the ${licenseId} license terms`
+ }. Please review the changes and merge the pull request if everything looks good.`,
headers: {
"X-GitHub-Api-Version": "2022-11-28",
},
diff --git a/ui/pages/dashboard/[owner]/[repo].vue b/ui/pages/dashboard/[owner]/[repo].vue
index 3527c9d0..fe8e0496 100644
--- a/ui/pages/dashboard/[owner]/[repo].vue
+++ b/ui/pages/dashboard/[owner]/[repo].vue
@@ -26,28 +26,6 @@ if (error.value) {
}
}
-const licenseRequests = computed(() => {
- if (!data.value) {
- return {
- closed: [],
- open: [],
- };
- }
-
- const openLicenseRequests = data.value?.licenseRequests.filter(
- (request) => request.open,
- );
-
- const closedLicenseRequests = data.value?.licenseRequests.filter(
- (request) => !request.open,
- );
-
- return {
- closed: closedLicenseRequests,
- open: openLicenseRequests,
- };
-});
-
const generateSeed = (seed: string) => {
return generate({
join: "-",
@@ -133,74 +111,142 @@ const rerunCwlValidation = async () => {
-
-
-
-
-
-
- ID: {{ generateSeed(licenseRequest.identifier) }}
-
-
- {{
- $dayjs
- .unix(parseInt(licenseRequest.timestamp) / 1000)
- .format("MMMM DD, YYYY HH:mmA")
- }}
-
-
+
+
+
+
+
+ A License is required according to the FAIR-BioRS guidelines
+
+
+
+
+
+
+
+
+ Edit License
+
+
+
+
-
- View License
-
-
-
-
+
-
+
+
+
+
+
+
+
+
+ ID:
+ {{
+ generateSeed(data?.licenseRequest?.identifier || "hello")
+ }}
+
+
+
+
+ View License
+
+
+
@@ -214,15 +260,7 @@ const rerunCwlValidation = async () => {
class="rounded-lg bg-white shadow-md"
bordered
>
-
-
-
-
There are no codemetadata requests for this repository yet.
diff --git a/ui/pages/view/cwl-validation/[identifier].vue b/ui/pages/view/cwl-validation/[identifier].vue
index bafd99de..794bdfd1 100644
--- a/ui/pages/view/cwl-validation/[identifier].vue
+++ b/ui/pages/view/cwl-validation/[identifier].vue
@@ -31,6 +31,29 @@ if (data.value) {
+
+
+
+
+ Dashboard
+
+
+
+
+ {{ data?.owner }}
+
+
+
+
+ {{ data?.repo }}
+
+
+
+
+ View CWL Validation
+
+
+
diff --git a/ui/server/api/dashboard/[owner]/[repo]/index.get.ts b/ui/server/api/dashboard/[owner]/[repo]/index.get.ts
index 729ba60b..89cb3d87 100644
--- a/ui/server/api/dashboard/[owner]/[repo]/index.get.ts
+++ b/ui/server/api/dashboard/[owner]/[repo]/index.get.ts
@@ -36,14 +36,9 @@ export default defineEventHandler(async (event) => {
const licenseRequestsCollection = db.collection("licenseRequests");
// Get all license requests for the repository sorted by timestamp
- const allLicenseRequests = await licenseRequestsCollection
- .find({
- repositoryId,
- })
- .sort({
- timestamp: -1,
- })
- .toArray();
+ const licenseRequest = await licenseRequestsCollection.findOne({
+ repositoryId,
+ });
const codeMetadataCollection = db.collection("codeMetadata");
@@ -81,14 +76,16 @@ export default defineEventHandler(async (event) => {
repo: cwlValidation.repo as string,
}
: null,
- licenseRequests: allLicenseRequests.map((licenseRequest) => ({
- identifier: licenseRequest.identifier as string,
- licenseId: licenseRequest.licenseId as string,
- open: licenseRequest.open as boolean,
- owner: licenseRequest.owner as string,
- pullRequest: (licenseRequest.pullRequestURL as string) || "",
- repo: licenseRequest.repo as string,
- timestamp: licenseRequest.updated_at as string,
- })),
+ licenseRequest: licenseRequest
+ ? {
+ identifier: licenseRequest.identifier as string,
+ licenseId: licenseRequest.licenseId as string,
+ open: licenseRequest.open as boolean,
+ owner: licenseRequest.owner as string,
+ pullRequest: (licenseRequest.pullRequestURL as string) || "",
+ repo: licenseRequest.repo as string,
+ timestamp: licenseRequest.updated_at as string,
+ }
+ : null,
};
});
diff --git a/ui/server/api/license/[identifier]/index.post.ts b/ui/server/api/license/[identifier]/index.post.ts
index abfb8c35..9e8e5f53 100644
--- a/ui/server/api/license/[identifier]/index.post.ts
+++ b/ui/server/api/license/[identifier]/index.post.ts
@@ -167,10 +167,6 @@ export default defineEventHandler(async (event) => {
});
// Create a pull request for the new branch with the license content
-
- /**
- * todo: figure out how to resolve the issue number
- */
const { data: pullRequestData } = await octokit.request(
"POST /repos/{owner}/{repo}/pulls",
{
@@ -179,7 +175,11 @@ export default defineEventHandler(async (event) => {
title: "feat: ✨ LICENSE file added",
head: newBranchName,
base: defaultBranch,
- // body: `Resolves #${context.payload.issue.number}`,
+ body: `This pull request ${
+ existingLicenseSHA
+ ? "updates the existing LICENSE file"
+ : `adds the LICENSE file with the ${licenseId} license terms`
+ }. Please review the changes and merge the pull request if everything looks good.`,
headers: {
"X-GitHub-Api-Version": "2022-11-28",
},
ID: {{ generateSeed(licenseRequest.identifier) }}
- -- {{ - $dayjs - .unix(parseInt(licenseRequest.timestamp) / 1000) - .format("MMMM DD, YYYY HH:mmA") - }} -
-A License is required according to the FAIR-BioRS guidelines
+ + + +