Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARC-1390 manual vs auto app creation #1239

Merged
merged 20 commits into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from 13 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
20 changes: 9 additions & 11 deletions src/routes/jira/configuration/jira-configuration-get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,15 @@ export const JiraConfigurationGet = async (
isGlobalInstall: installation.repository_selection === "all"
}));

// res.render("jira-configuration.hbs", {
// host: jiraHost,
// successfulConnections,
// failedConnections,
// hasConnections: !!installations.total,
// APP_URL: process.env.APP_URL,
// csrfToken: req.csrfToken(),
// nonce: res.locals.nonce
// });

res.render("jira-app-creation.hbs");
res.render("jira-configuration.hbs", {
host: jiraHost,
successfulConnections,
failedConnections,
hasConnections: !!installations.total,
APP_URL: process.env.APP_URL,
csrfToken: req.csrfToken(),
nonce: res.locals.nonce
});

req.log.info("Jira configuration rendered successfully.");
} catch (error) {
Expand Down
4 changes: 4 additions & 0 deletions static/assets/arrow-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions static/assets/cloud.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions static/assets/question.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions static/assets/server.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 43 additions & 5 deletions static/css/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,52 @@ a:focus {
z-index: 100;
}

.jira-and-github-header-conainer {
.navigation {
display: flex;
justify-content: space-between;
padding: 2em;
}

.navigation__backButton__container {
background: #fff;
border: none;
cursor: pointer;
}

.navigation__link {
color: inherit;
}

.navigation__icon {
transform: scale(1.3);
}

.navigation__help__container {
align-items: center;
display: flex;
}

.navigation__help__container > :last-child {
margin-left: 0.2em;
}

.navigation__help__message {
font-size: 1.2rem;
}

.navigation__link:hover {
background: #091E4208;
border-radius: 3px;
color: inherit;
}

.jira-and-github-header-container {
margin-top: 4em;
text-align: center;
}

.jira-and-github-header-title {
font-size: 30px;
font-size: 2rem;
font-weight: 500;
margin-top: 1em;
margin-top: 1.5em;
}


18 changes: 14 additions & 4 deletions static/css/jira-app-creation.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

.jiraAppCreation__content__container > .jiraAppCreation__options__prompt {
font-weight: 500;
margin: 3em auto;
margin: 2.5em auto;
}

.jiraAppCreation__options__prompt,
Expand All @@ -22,6 +22,7 @@

.jiraAppCreation__options__cardPrompt {
color: #5E6C84;
font-weight: 600;
margin-bottom: 1em;
}

Expand All @@ -35,18 +36,27 @@
border-radius: 3px;
box-shadow: 0 1px 1px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31);
display: flex;
padding: 3em 1.5em;
padding: 2em 1.5em;
position: relative;
width: 42%;
width: 41.5%;
}

.jiraSelectAppCreation__options__card:hover {
box-shadow: 0 3px 5px rgba(9, 30, 66, 0.2), 0 0 1px rgba(9, 30, 66, 0.31);
cursor: pointer;
}

.jiraSelectAppCreation__options__card__iconContainer {
display: flex;
justify-content: center;
}

.jiraSelectAppCreation__options__card__icon {
transform: scale(0.5);
}

.jiraSelectAppCreation__options__card__contentContainer {
margin-left: 2em;
margin-left: 1.5em;
}

.jiraSelectAppCreation__options__recommended {
Expand Down
82 changes: 82 additions & 0 deletions static/css/jira-select-github-version.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
.jiraSelectGitHubVersion__content {
margin: auto;
max-width: 840px;
}

.jiraSelectGitHubVersion__content {
margin-top: 4em;
}

.jiraSelectGitHubVersion__content__title {
color: #42526E;
margin-bottom: 3em;
text-align: center;
}

.jiraSelectGitHubVersion__options__container {
background: #FAFBFC;
border-radius: 12px;
padding: 1.5em;
}

.jiraSelectGitHubVersion__options__prompt {
color: #5E6C84;
font-size: 1.2rem;
margin-bottom: 1em;
}

.jiraSelectGitHubVersion__options__cardsContainer {
border-radius: 10px;
display: flex;
justify-content: space-between;
text-align: center;
}

.jiraSelectGitHubVersion__options__card {
background: #fff;
border-radius: 10px;
box-shadow: 0 1px 1px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31);
display: flex;
flex-direction: column;
max-width: 330px;
padding: 2em;
}

.jiraSelectGitHubVersion__options__card:hover {
box-shadow: 0 3px 5px rgba(9, 30, 66, 0.2), 0 0 1px rgba(9, 30, 66, 0.31);
cursor: pointer;
}

.jiraSelectGitHubVersion__options__card__title {
color: #253858;
font-size: 1.3rem;
}

.jiraSelectGitHubVersion__options__card__img.cloud {
margin: 2em auto;
}

.jiraSelectGitHubVersion__options__card__img.server {
transform: scale(0.7);
margin: 0.5em auto;
}

.jiraSelectGitHubVersion__options__card__info {
color: #5E6C84;
font-size: 1.15rem;
line-height: 1.5;
}

.jiraSelectGitHubVersion__actionBtn__container {
margin-top: 3em;
text-align: center;
}

.jiraSelectGitHubVersion__actionBtn {
font-size: 1.2rem;
}

.selected {
border: 4px solid #0065FF;
}

10 changes: 0 additions & 10 deletions static/js/jira-app-creation.js

This file was deleted.

8 changes: 8 additions & 0 deletions static/js/jira-select-card-option.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$(".optionsCard").click(function (event) {
event.preventDefault();
const selectedVersion = $(event.target).data("type");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay this is really minor. I am happy with the code as it it. It is just suggestions:

It seems we don't need the .data("type") here. We can just do the following:

$(".optionsCard").click(function (event) {
	event.preventDefault();
	$(".optionsCard").removeClass("selected");
  $(event.target).closet('.optionsCard').addClass('selected');
	$(".optionBtn").prop("disabled", false).attr("aria-disabled", "false").addClass("aui-button-primary");
});

So @mboudreau opinions? You mentioned the "data('type')" yesterday, I want to ask your thoughts.


for this, we could replace the
$(event.target).closet('.optionsCard').addClass('selected');
to
$(event.currentTarget).addClass('selected');


$(".optionsCard").removeClass("selected");
$(`.optionsCard.${selectedVersion}`).addClass("selected");
$(".optionBtn").prop("disabled", false).attr("aria-disabled", "false").addClass("aui-button-primary");
});
11 changes: 9 additions & 2 deletions views/jira-app-creation.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,20 @@
</div>

<div class="jiraAppCreation__actionBtn__container">
<button class="aui-button jiraAppCreation__actionBtn" id="jiraAppCreation__actionBtn" aria-disabled="true" disabled>Create</button>
<button
class="aui-button jiraAppCreation__actionBtn optionBtn"
id="jiraAppCreation__actionBtn"
aria-disabled="true"
disabled
>
Create
</button>
</div>
</section>

</div>

<script src="/public/js/jira-app-creation.js" nonce="{{nonce}}"></script>
<script src="/public/js/jira-select-card-option.js" nonce="{{nonce}}"></script>
<!-- Per https://blog.developer.atlassian.com/announcement-reminder-about-deprecation-of-xdm_e-usage-and-needing-to-load-all-js-from-the-cdn/ we are required to load this from this specific CDN -->
<!-- DO NOT TOUCH!!! THIS IS NEEDED FOR CONNECT OR ELSE IT WILL CAUSE AN ERROR -->
<script
Expand Down
Loading