Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 5 additions & 7 deletions webapp/src/components/sidebar_right/gitlab_items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ export const notificationReasons: Record<string | symbol, string> = {
approval_required: 'Your approval is required on this issue/merge request.',
unmergeable: 'This merge request can\'t be merged.',
merge_train_removed: 'A merge train was removed.',
member_access_requested: 'reqested access to a project/group.'
Comment thread
raghavaggarwal2308 marked this conversation as resolved.
Outdated
};

const SUCCESS = 'success';
const PENDING = 'pending';

function GitlabItems({item, theme}: GitlabItemsProps) {
function GitlabItems({item, theme}: GitlabItemsProps) {
Comment thread
raghavaggarwal2308 marked this conversation as resolved.
Outdated
const style = getStyle(theme);

const repoName = item.references?.full || item.project?.path_with_namespace || '';
Expand All @@ -48,7 +49,7 @@ function GitlabItems({item, theme}: GitlabItemsProps) {
);
}

const titleText = item.title || item.target?.title || '';
const titleText = item.title || item.target?.title || item.body || '';

let title: React.ReactNode = titleText;
if (item.web_url || item.target_url) {
Expand Down Expand Up @@ -174,17 +175,14 @@ function GitlabItems({item, theme}: GitlabItemsProps) {
</div>
<div>
{number}
<span className='light'>{repoName}</span>
{repoName && <span className='light'>({repoName})</span>}
</div>
{labels}
<div
className='light'
style={style.subtitle}
>
{'Opened'}
{item.created_at && ` ${formatTimeSince(item.created_at)} ago`}
{userName && ` by ${userName}`}
{'.'}
{milestone}
</div>
<div
Expand All @@ -194,7 +192,7 @@ function GitlabItems({item, theme}: GitlabItemsProps) {
{item.action_name && (
<>
<div>{item.updated_at && `Updated ${formatTimeSince(item.updated_at)} ago.`}</div>
{notificationReasons[item.action_name]}
{item.action_name=='member_access_requested' && <a href={item.author.web_url}>{item.author.name}</a>} {notificationReasons[item.action_name]}
Comment thread
raghavaggarwal2308 marked this conversation as resolved.
Outdated
</>
)}
</div>
Expand Down
3 changes: 3 additions & 0 deletions webapp/src/types/gitlab_items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export interface Label {

export interface User {
username: string;
web_url: string;
name: string;
}

export interface References {
Expand Down Expand Up @@ -57,6 +59,7 @@ export interface Item {
num_approvers: number;
total_reviewers: number;
reviewers: User[];
body: string;
}

export interface GitlabItemsProps {
Expand Down