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

Feature/nexcess domains alt #144

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0ece713
chore: Jorge's sitebuilder work
chumpgrub Nov 5, 2022
abe4fff
chore: Jorge's storebuilder work
chumpgrub Nov 5, 2022
0f17877
chore: Jorge's wme-ui work
chumpgrub Nov 5, 2022
448ec62
chore: pnpm-lock commit
chumpgrub Nov 5, 2022
aca6e11
chore: Update package version to 1.6.0-alpha.4
chumpgrub Nov 5, 2022
2837a28
chore: Fix text regression
chumpgrub Nov 6, 2022
b66d02e
chore: Increment alpha package version
chumpgrub Nov 6, 2022
cc7b0d3
chore: Replace lorem ipsum
chumpgrub Nov 7, 2022
6a3986b
chore: Makes search icon clickable on FindDomain screen
chumpgrub Nov 7, 2022
44a4dd1
chore: Add styles to make ListItemCheckout button from appearing clic…
chumpgrub Nov 8, 2022
529b3fb
chore: Update placeholder text
chumpgrub Nov 8, 2022
45c110b
fix: Remove old StoreBuilder styles from theme object
chumpgrub Nov 8, 2022
fc0a28b
chore: Increment alpha version
chumpgrub Nov 8, 2022
7e6aeee
chore: Commit mix-manifest.json change
chumpgrub Nov 8, 2022
f6cdce5
fix: Update redirect to use nexcess domain and UUID value
chumpgrub Nov 8, 2022
c0529eb
chore: Increment alpha package
chumpgrub Nov 8, 2022
f80eae6
chore: Fixes indenting
chumpgrub Nov 8, 2022
92f74a5
chore: Increment alpha version
chumpgrub Nov 8, 2022
730eae5
chore: Leverage new pruchaseFlowUrl property
chumpgrub Nov 9, 2022
3b316bd
chore: Increment alpha version
chumpgrub Nov 9, 2022
279d4b8
chore: Add new content to VerifyDomain screen
chumpgrub Nov 9, 2022
7d7722e
chore: Fix indentations
chumpgrub Nov 9, 2022
858bab0
chore: Increment alpha package
chumpgrub Nov 9, 2022
3290478
fix: Adds support for non 12 month terms
chumpgrub Nov 9, 2022
9707d13
chore: Lint fixes
chumpgrub Nov 9, 2022
d617b8c
chore: Conflict resolved
chumpgrub Nov 9, 2022
982c67a
Merge branch 'main' into feature/nexcess-domains-alt
jorgemasta Nov 10, 2022
683f7ed
Merge pull request #128 from moderntribe/feature/nexcess-domains-term…
chumpgrub Nov 10, 2022
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
Prev Previous commit
Next Next commit
fix: Adds support for non 12 month terms
  • Loading branch information
chumpgrub committed Nov 9, 2022
commit 32904788f8a5861337cff6447abdbee6fbecf1fa
21 changes: 16 additions & 5 deletions packages/sitebuilder/src/utils/parseDomainListItem.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sprintf } from '@wordpress/i18n';
import { sprintf, _n } from '@wordpress/i18n';
import { GoLiveStringData } from '@sb/wizards/go-live/data/constants';

type DomainListItem = {
@@ -10,13 +10,24 @@ type DomainListItem = {
selected: boolean,
}

function getPrice(price: string, isAvailable: boolean) {
function getPrice(termFees: DomainTermFees, isAvailable: boolean) {
if (! isAvailable) {
return undefined;
}
return sprintf('%1$s %2$s',

// Get the terms available for this domain.
const terms = Object.keys(termFees);
const shortestTerm = Math.min(...terms.map((term) => Number(term)));
const termToYear = shortestTerm / 12;
const price = termFees[ shortestTerm ];

// eslint-disable-next-line @wordpress/i18n-translator-comments
const perYear = _n('year', 'years', termToYear, 'nexcess-mapps');

return sprintf('%1$s / %2$s %3$s',
price,
GoLiveStringData.domainItems.perYear
termToYear,
perYear
);
}

@@ -41,7 +52,7 @@ export function parseDomainListItem(domain: Domain, selected: boolean): DomainLi
return ({
name: domain.domain,
disabled: ! domain.is_available,
price: getPrice(domain.package.term_fees[ '12' ], domain.is_available),
price: getPrice(domain.package.term_fees, domain.is_available),
chipLabel: getChipLabel(domain.is_available, selected),
chipColor: getChipColor(domain.is_available, selected),
selected,
1 change: 0 additions & 1 deletion packages/sitebuilder/src/wizards/go-live/data/constants.ts
Original file line number Diff line number Diff line change
@@ -87,7 +87,6 @@ export const GoLiveStringData = {
nevermind: __('Do not skip verification', 'nexcess-mapps')
},
domainItems: {
perYear: __('/ year', 'nexcess-mapps'),
taken: __('Taken', 'nexcess-mapps'),
selected: __('Selected', 'nexcess-mapps'),
available: __('Available', 'nexcess-mapps'),
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ const ConnectWithNexcess = () => {
},
'& .MuiTouchRipple-root': {
display: 'none',
},
},
}
} } />
{ index < selectedDomains.length - 1 && (