Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Develop #73

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
147 changes: 78 additions & 69 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions src/app/constants/LogDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import * as m from 'mithril';
import { IDescription } from '../interfaces/Description';
import { ILog } from '../interfaces/Log';
import { formatDateField } from '../utility/DateUtil';
import { ITag } from '../interfaces/Tag';

/**
* The tab information used by the TabHeader and TabContent of the Log detail page.
Expand Down Expand Up @@ -62,6 +63,16 @@ const LogDescription: IDescription[] = [
return log.user &&
log.user.name;
}
},
{
label: 'Tags',
value: (log: ILog): JSX.Element => (
<div>
{log.tags!.map((tag: ITag) => {
return <span key={tag.tagId}><span key={tag.tagId} class={`badge badge-primary`}>{tag.tagText}</span>, </span>;
})}
</div>
)
}
];

Expand Down
3 changes: 2 additions & 1 deletion src/app/constants/apiUrls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ export const getLog = (id: string | number): string => `${BASE_URL}logs/${id}`;
export const linkRunToLogUrl = (runNumber: number): string => `${BASE_URL}logs/${runNumber}/runs`;
export const postLog = (): string => `${BASE_URL}logs`;
export const postAttachment = (logId: string | number): string => `${BASE_URL}logs/${logId}/attachments`;
export const getTagsForLog = (logId: string | number): string => `${BASE_URL}logs/${logId}/tags`;

// Tag
export const getTags = (query?: string): string => `${BASE_URL}tags${query ? `?${query}` : ''}`;
export const getTag = (id: string | number): string => `${BASE_URL}tags/${id}`;
export const getTagsForLog = (logId: string | number): string => `${BASE_URL}tags/${logId}/logs`;
export const getTagsForRun = (runId: string | number): string => `${BASE_URL}tags/${runId}/runs`;
export const postTag = (): string => `${BASE_URL}tags`;
export const updateTag = (id: string | number): string => `${BASE_URL}tags/${id}`;
export const deleteTage = (id: string | number): string => `${BASE_URL}tags/${id}`;
export const linkTagToLogUrl = (id: string | number): string => `${BASE_URL}tags/${id}/logs`;
2 changes: 2 additions & 0 deletions src/app/interfaces/Log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import { IAttachmentCreate, IAttachment } from './Attachment';
import { IUser } from './User';
import { IRun } from './Run';
import { ITag } from './Tag';

/**
* Interface with the fields for fetching one or more Log entries.
Expand All @@ -24,6 +25,7 @@ export interface ILog {
user: IUser;
runs?: IRun[];
attachments?: IAttachment[];
tags?: ITag[];
comments?: ILog[];
commentFkRootLogId?: number;
commentFkParentLogId?: number;
Expand Down
4 changes: 2 additions & 2 deletions src/app/interfaces/Tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
* Interface with the fields for fetching one or more Attachment entries.
*/
export interface ITag {
id?: number;
tagId?: number;
tagText: string;
}

/**
* Interface with the fields for creating a Attachment entry.
*/
export interface ITagCreate {
fileId?: number;
tagId?: number;
tagText: string;
}
Loading