Skip to content

Commit

Permalink
https://trello.com/c/rURV6IES/5907-update-integration-interstitial
Browse files Browse the repository at this point in the history
  • Loading branch information
ppezaris authored and bcanzanella committed Mar 23, 2021
1 parent e314536 commit b643b80
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
13 changes: 8 additions & 5 deletions shared/ui/Stream/CrossPostIssueControls/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface ProviderDisplay {
customPullRequestFilterHelpLink?: string;
customPullRequestFilterExample?: string;

supportsPR2CR?: boolean;
supportsPRManagement?: boolean;
}

export const PROVIDER_MAPPINGS: { [provider: string]: ProviderDisplay } = {
Expand Down Expand Up @@ -84,7 +84,7 @@ export const PROVIDER_MAPPINGS: { [provider: string]: ProviderDisplay } = {
customPullRequestFilterExample:
"The variable @me can be used to specify the logged in user within a search. ",
supportsStartWork: true,
supportsPR2CR: true
supportsPRManagement: true
},
github_enterprise: {
displayName: "GitHub Enterprise",
Expand All @@ -103,7 +103,8 @@ export const PROVIDER_MAPPINGS: { [provider: string]: ProviderDisplay } = {
"The variable @me can be used to specify the logged in user within a search. ",
customPullRequestFilterHelpLink:
"https://docs.github.com/en/github/searching-for-information-on-github/searching-issues-and-pull-requests",
supportsStartWork: true
supportsStartWork: true,
supportsPRManagement: true
},
gitlab: {
displayName: "GitLab",
Expand All @@ -113,7 +114,8 @@ export const PROVIDER_MAPPINGS: { [provider: string]: ProviderDisplay } = {
cardLabel: "issue",
customPullRequestFilterExample: 'Example: "state:opened scope:created_by_me" ',
customPullRequestFilterHelpLink: "https://docs.gitlab.com/ee/api/merge_requests.html",
supportsStartWork: true
supportsStartWork: true,
supportsPRManagement: true
},
gitlab_enterprise: {
displayName: "GitLab Self-Managed",
Expand All @@ -126,7 +128,8 @@ export const PROVIDER_MAPPINGS: { [provider: string]: ProviderDisplay } = {
cardLabel: "issue",
customPullRequestFilterExample: 'Example: "state:opened scope:created_by_me" ',
customPullRequestFilterHelpLink: "https://docs.gitlab.com/ee/api/merge_requests.html",
supportsStartWork: true
supportsStartWork: true,
supportsPRManagement: true
},
jira: {
displayName: "Jira",
Expand Down
4 changes: 2 additions & 2 deletions shared/ui/Stream/PrePRProviderInfoModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export interface PrePRProviderInfoModalProps {
}

export const PrePRProviderInfoModal = (props: PrePRProviderInfoModalProps) => {
const { displayName, icon, supportsPR2CR } = PROVIDER_MAPPINGS[props.providerName];
const { displayName, icon, supportsPRManagement } = PROVIDER_MAPPINGS[props.providerName];

const prLabel = getPRLabelForProvider(props.providerName);

Expand Down Expand Up @@ -81,7 +81,7 @@ export const PrePRProviderInfoModal = (props: PrePRProviderInfoModalProps) => {
</CSText>
</div>
</Section>
{supportsPR2CR && (
{supportsPRManagement && (
<Section>
<Icon name="pull-request" />
<div>
Expand Down
9 changes: 7 additions & 2 deletions shared/ui/Stream/PullRequests/GitLab/RightActionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,11 @@ export const RightActionBar = props => {
else return milestone.title;
}, [pr.milestone]);

const pluralize = (word: string, list) => {
if (list && list.nodes && list.nodes.length == 1) return word;
else return `${word}s`;
};

return (
<Right className={rightOpen ? "expanded" : "collapsed"}>
<AsideBlock onClick={() => !rightOpen && close()}>
Expand Down Expand Up @@ -532,7 +537,7 @@ export const RightActionBar = props => {
{rightOpen ? (
<>
<JustifiedRow>
<label>Assignees</label>
<label>{pluralize("Assignee", pr.assignees)}</label>
<Link onClick={openAssignees}>
<InlineMenu
items={assigneeMenuItems}
Expand Down Expand Up @@ -575,7 +580,7 @@ export const RightActionBar = props => {
{rightOpen ? (
<>
<JustifiedRow>
<label>Reviewers</label>
<label>{pluralize("Reviewer", pr.reviewers)}</label>
<Link onClick={openReviewers}>
<InlineMenu
items={reviewerMenuItems}
Expand Down

0 comments on commit b643b80

Please sign in to comment.