Skip to content

Commit

Permalink
Merge branch 'main' of github.com:atlassian/jenkins-for-jira into fea…
Browse files Browse the repository at this point in the history
…ture/design-4
  • Loading branch information
anshengxu committed Mar 7, 2024
2 parents 9e411e8 + 57af85a commit 5aea46c
Show file tree
Hide file tree
Showing 14 changed files with 508 additions and 620 deletions.
401 changes: 240 additions & 161 deletions app/jenkins-for-jira-ui/package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions app/jenkins-for-jira-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@
"homepage": ".",
"dependencies": {
"@atlaskit/avatar": "20.5.10",
"@atlaskit/button": "16.10.1",
"@atlaskit/button": "16.18.1",
"@atlaskit/code": "^15.1.0",
"@atlaskit/css-reset": "6.5.4",
"@atlaskit/drawer": "^7.6.5",
"@atlaskit/dropdown-menu": "11.14.2",
"@atlaskit/dynamic-table": "14.11.6",
"@atlaskit/dropdown-menu": "11.14.4",
"@atlaskit/dynamic-table": "14.11.11",
"@atlaskit/empty-state": "7.6.3",
"@atlaskit/form": "8.11.13",
"@atlaskit/icon": "21.12.7",
"@atlaskit/logo": "13.14.8",
"@atlaskit/modal-dialog": "12.6.10",
"@atlaskit/page-header": "10.4.4",
"@atlaskit/progress-tracker": "8.5.2",
"@atlaskit/progress-tracker": "8.5.7",
"@atlaskit/spinner": "15.5.3",
"@atlaskit/tabs": "^13.4.9",
"@atlaskit/textarea": "^5.0.0",
"@atlaskit/textfield": "5.6.4",
"@atlaskit/theme": "12.5.5",
"@atlaskit/textfield": "5.6.8",
"@atlaskit/theme": "12.5.6",
"@atlaskit/tokens": "^1.28.1",
"@atlaskit/tooltip": "17.8.4",
"@atlaskit/tooltip": "17.8.10",
"@atlassiansox/analytics-web-client": "^4.14.3",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@emotion/css": "11.7.1",
Expand Down
4 changes: 0 additions & 4 deletions app/jenkins-for-jira-ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { fetchFeatureFlagFromBackend } from './api/fetchFeatureFlagFromBackend';
import { ServerManagement } from './components/ServerManagement/ServerManagement';
import { ServerNameForm } from './components/ServerNameForm/ServerNameForm';
import { JenkinsSetup } from './components/JenkinsSetup/JenkinsSetup';
import { ConnectionComplete } from './components/ConnectionComplete/ConnectionComplete';
import { GlobalPage } from './components/GlobalPage/GlobalPage';
import { fetchModuleKey } from './api/fetchModuleKey';
import { ConnectionWizard } from './components/ConnectionWizard/ConnectionWizard';
Expand Down Expand Up @@ -150,9 +149,6 @@ const App: React.FC = () => {
<Route path="/setup/:id/:settings/:path">
<JenkinsSetup />
</Route>
<Route path="/connection-complete/:id/:admin/:path">
<ConnectionComplete />
</Route>
<Route path="/connection-info/:path">
<ConnectionWizard />
</Route>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,8 @@ const JenkinsSetup = (): JSX.Element => {

if (connectionSettings) {
if (path === 'admin') {
history.push('/');
} else {
history.push('/');
} else {
router.navigate(globalPageUrl);
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,7 @@ const ServerManagement = (): JSX.Element => {
Connect a new Jenkins server
</Button>
<SharePage
analyticsScreenEventNameEnum={AnalyticsScreenEventsEnum.ServerManagementScreenName}
moduleKey={moduleKey}/>
analyticsScreenEventNameEnum={AnalyticsScreenEventsEnum.ServerManagementScreenName}/>
</ButtonGroup>
);

Expand Down
22 changes: 8 additions & 14 deletions app/jenkins-for-jira-ui/src/components/SharePage/SharePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { JenkinsModal } from '../JenkinsServerList/ConnectedServer/JenkinsModal'
import { shareModalInstruction } from '../ServerManagement/ServerManagement.styles';

import { fetchGlobalPageUrl } from '../../api/fetchGlobalPageUrl';
import { CONFIG_PAGE } from '../../common/constants';

const analyticsClient = new AnalyticsClient();

Expand All @@ -28,13 +27,7 @@ export const getSiteNameFromUrl = (url: string): string => {
}
};

const getSharePageMessage = (globalPageUrl: string, moduleKey?: string): string => {
const versionRequirementMessage = moduleKey === CONFIG_PAGE
? `
Not a member of this Jira site? You can follow the instructions here instead:
https://support.atlassian.com/jira-cloud-administration/docs/how-jenkins-for-jira-works/` : '';

const getSharePageMessage = (globalPageUrl: string): string => {
return `Hi there,
Jenkins for Jira is now installed and connected on ${getSiteNameFromUrl(globalPageUrl)}.
Expand All @@ -44,19 +37,20 @@ To set up what build and deployment events Jenkins send to Jira, follow the set
${globalPageUrl}
You'll need to follow the set up guide for each connected server.
${versionRequirementMessage}`;
Not a member of this Jira site? You can follow the instructions here instead:
https://support.atlassian.com/jira-cloud-administration/docs/how-jenkins-for-jira-works/`;
};

type SharePageProps = {
analyticsScreenEventNameEnum: AnalyticsScreenEventsEnum;
buttonAppearance?: string;
moduleKey?: string;
};

export const SharePage = ({
analyticsScreenEventNameEnum,
buttonAppearance,
moduleKey
buttonAppearance
}:SharePageProps): JSX.Element => {
const textAreaRef = useRef<HTMLTextAreaElement>(null);
const [isCopiedToClipboard, setIsCopiedToClipboard] = useState(false);
Expand All @@ -77,8 +71,8 @@ export const SharePage = ({
};

await fetchData();
setSharePageMessage(getSharePageMessage(globalPageUrl, moduleKey));
}, [globalPageUrl, moduleKey]);
setSharePageMessage(getSharePageMessage(globalPageUrl));
}, [globalPageUrl]);

useEffect(() => {
constructSharePageMessage();
Expand Down
Loading

0 comments on commit 5aea46c

Please sign in to comment.