Skip to content

Commit

Permalink
fix: #1218 correct folder name
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuong Vu committed May 27, 2020
1 parent e5405a5 commit e8fedc0
Show file tree
Hide file tree
Showing 99 changed files with 333 additions and 336 deletions.
19 changes: 10 additions & 9 deletions packages/demo-site/tpls/detail.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,26 @@
margin: 0 auto;
}
</style>
<link rel="stylesheet" href="<%= CDN_URL %>/property-detail.css" />
<link rel="stylesheet" href="<%= CDN_URL %>/appointment-bookings.css" />
<link rel="stylesheet" href="<%= CDN_URL %>/viewing-booking.css" />
<link rel="stylesheet" href="<%= CDN_URL %>/property-detail-widget.css" />
<link rel="stylesheet" href="<%= CDN_URL %>/book-valuation-widget.css" />
<link rel="stylesheet" href="<%= CDN_URL %>/book-viewing-widget.css" />
</head>

<body>
<div class="page-container">
<div id="property-detail"></div>
<div id="property-detail-widget"></div>
</div>
<script src="<%= CDN_URL %>/viewing-booking.js"></script>
<script src="<%= CDN_URL %>/property-detail.js"></script>
<script src="<%= CDN_URL %>/book-valuation-widget.js"></script>
<script src="<%= CDN_URL %>/book-viewing-widget.js"></script>
<script src="<%= CDN_URL %>/property-detail-widget.js"></script>
<script src="<%= CDN_URL %>/themes.js"></script>
<script>
ReapitPropertyDetailComponent &&
new ReapitPropertyDetailComponent({
ReapitPropertyDetailWidget &&
new ReapitPropertyDetailWidget({
theme: window.theme,
apiKey: '<%= API_KEY %>',
customerId: '<%= CUSTOMER_ID %>',
parentSelector: '#property-detail',
parentSelector: '#property-detail-widget',
})
</script>
<% if (development) { %>
Expand Down
18 changes: 9 additions & 9 deletions packages/demo-site/tpls/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<title>DEMO</title>
<style>
#appointment-bookings-valuation {
#book-valuation-widget {
float: right;
margin-bottom: 1em;
}
Expand All @@ -16,33 +16,33 @@
}
</style>
<link rel="stylesheet" href="<%= CDN_URL %>/search-widget.css" />
<link rel="stylesheet" href="<%= CDN_URL %>/appointment-bookings.css" />
<link rel="stylesheet" href="<%= CDN_URL %>/book-valuation-widget.css" />
</head>

<body>
<div class="page-container">
<div id="appointment-bookings-valuation"></div>
<div id="book-valuation-widget"></div>
<div id="search-widget"></div>
</div>
<script src="<%= CDN_URL %>/search-widget.js"></script>
<script src="<%= CDN_URL %>/appointment-bookings.js"></script>
<script src="<%= CDN_URL %>/book-valuation-widget.js"></script>
<script src="<%= CDN_URL %>/themes.js"></script>
<script>
ReapitSearchWidgetComponent &&
new ReapitSearchWidgetComponent({
ReapitSearchWidget &&
new ReapitSearchWidget({
theme: window.theme,
apiKey: '<%= API_KEY %>',
customerId: '<%= CUSTOMER_ID %>',
parentSelector: '#search-widget',
detailPageUrl: '/detail.html',
})
ReapitAppointmentBookingComponent &&
new ReapitAppointmentBookingComponent({
ReapitBookValuationWidget &&
new ReapitBookValuationWidget({
theme: window.theme,
apiKey: '<%= API_KEY %>',
customerId: '<%= CUSTOMER_ID %>',
parentSelector: '#appointment-bookings-valuation',
parentSelector: '#book-valuation-widget',
variant: 'VALUATION',
})
</script>
Expand Down
18 changes: 9 additions & 9 deletions packages/web-components/scripts/build-prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,26 @@ return (async () => {
const packages = [
{
rollUpPackageName: 'search-widget',
exportName: 'ReapitSearchWidgetComponent',
exportName: 'ReapitSearchWidget',
},
{
rollUpPackageName: 'appointment-bookings',
exportName: 'ReapitAppointmentBookingComponent',
rollUpPackageName: 'book-valuation-widget',
exportName: 'ReapitBookValuationWidget',
},
{
rollUpPackageName: 'viewing-booking',
exportName: 'ReapitViewingBookingComponent',
rollUpPackageName: 'book-viewing-widget',
exportName: 'ReapitBookViewingWidget',
},
{
rollUpPackageName: 'themes',
},
{
rollUpPackageName: 'property-detail',
exportName: 'ReapitPropertyDetailComponent',
rollUpPackageName: 'property-detail-widget',
exportName: 'ReapitPropertyDetailWidget',
},
{
rollUpPackageName: 'login',
exportName: 'LoginWithReapitComponent',
rollUpPackageName: 'login-reapit-component',
exportName: 'LoginReapitComponent',
},
]
const opts = {
Expand Down
2 changes: 1 addition & 1 deletion packages/web-components/scripts/build-serverless.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const stage = yargs.argv.stage
// relative to the root of web-components package
const listServerlessYmlFiles = [
'src/search-widget/server/serverless.yml',
'src/appointment-planner/server/serverless.yml',
'src/appointment-planner-component/server/serverless.yml',
]

const buildServerlessList = () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/web-components/scripts/release-serverless.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const stage = yargs.argv.stage
// relative to the root of web-components package
const listServerlessYmlFiles = [
'src/search-widget/server/serverless.yml',
'src/appointment-planner/server/serverless.yml',
'src/appointment-planner-component/tserver/serverless.yml',
]

const deployServerlessList = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ const production = !process.env.ROLLUP_WATCH

export const baseConfigurationWithoutTheme = {
...baseConfig,
input: 'src/appointment-bookings/client/core/index.ts',
output: generateRollupOutput({ production, fileName: 'appointment-bookings', name: 'appointmentBookings' }),
input: 'src/book-valuation-widget/client/core/index.ts',
output: generateRollupOutput({ production, fileName: 'book-valuation-widget', name: 'bookValuationWidget' }),
plugins: [
svelte({
dev: !production,
css: css => generateCssOutput({ css, fileName: 'appointment-bookings.css', production }),
css: css => generateCssOutput({ css, fileName: 'book-valuation-widget.css', production }),
}),
replace({
'process.env.NODE_ENV': JSON.stringify(config.NODE_ENV),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ const production = !process.env.ROLLUP_WATCH

export const baseConfigurationWithoutTheme = {
...baseConfig,
input: 'src/viewing-booking/client/core/index.ts',
output: generateRollupOutput({ production, fileName: 'viewing-booking', name: 'viewingBooking' }),
input: 'src/book-viewing-widget/client/core/index.ts',
output: generateRollupOutput({ production, fileName: 'book-viewing-widget', name: 'bookViewingWidget' }),
plugins: [
svelte({
dev: !production,
css: css => generateCssOutput({ css, fileName: 'viewing-booking.css', production }),
css: css => generateCssOutput({ css, fileName: 'book-viewing-widget.css', production }),
}),
replace({
'process.env.NODE_ENV': JSON.stringify(config.NODE_ENV),
Expand Down
14 changes: 8 additions & 6 deletions packages/web-components/scripts/rollup.config.demo-site.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import { baseConfigurationWithoutTheme as viewBookingBuidConfiguration } from './rollup.config.viewing-booking'
import { baseConfigurationWithoutTheme as appointmentBookingConfiguration } from './rollup.config.appointment-bookings'
import { baseConfigurationWithoutTheme as bookViewingWidgetConfiguration } from './rollup.config.book-viewing-widget'
// eslint-disable-next-line max-len
import { baseConfigurationWithoutTheme as bookValuationWidgetConfiguration } from './rollup.config.book-valuation-widget'
import { baseConfigurationWithoutTheme as searchWidgetConfiguration } from './rollup.config.search-widget'
import { baseConfigurationWithoutTheme as propertyDetailConfiguration } from './rollup.config.property-detail'
// eslint-disable-next-line max-len
import { baseConfigurationWithoutTheme as propertyDetailWidgetConfiguration } from './rollup.config.property-detail-widget'
import themeConfiguration from './rollup.config.themes'

/**
* all required modules for demo-site packages
*/

const buildConfigurations = [
propertyDetailConfiguration,
propertyDetailWidgetConfiguration,
searchWidgetConfiguration,
viewBookingBuidConfiguration,
appointmentBookingConfiguration,
bookViewingWidgetConfiguration,
bookValuationWidgetConfiguration,
themeConfiguration,
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ const production = !process.env.ROLLUP_WATCH

export const baseConfigurationWithoutTheme = {
...baseConfig,
input: 'src/login/index.ts',
output: generateRollupOutput({ production, fileName: 'login-with-reapit', name: 'login' }),
input: 'src/login-reapit-component/index.ts',
output: generateRollupOutput({
production,
fileName: 'login-reapit-component',
name: 'loginReapitComponent',
}),
plugins: [
replace({
'process.env.NODE_ENV': JSON.stringify(config.NODE_ENV),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import path from 'path'
import generateRollupOutput from './generate-rollup-output'
import generateCssOutput from './generate-css-output'
import themesConfiguration from './rollup.config.themes.js'
import { baseConfigurationWithoutTheme as viewBookinConfiguration } from './rollup.config.viewing-booking.js'
import { baseConfigurationWithoutTheme as viewBookinConfiguration } from './rollup.config.book-viewing-widget.js'

const config = require(path.resolve(__dirname, '..', 'config.json'))
const production = !process.env.ROLLUP_WATCH

export const baseConfigurationWithoutTheme = {
...baseConfig,
input: 'src/property-detail/client/core/index.ts',
output: generateRollupOutput({ production, fileName: 'property-detail', name: 'propertyDetail' }),
input: 'src/property-detail-widget/client/core/index.ts',
output: generateRollupOutput({ production, fileName: 'property-detail-widget', name: 'propertyDetailWidget' }),
plugins: [
replace({
'process.env.NODE_ENV': JSON.stringify(config.NODE_ENV),
Expand All @@ -24,7 +24,7 @@ export const baseConfigurationWithoutTheme = {
}),
svelte({
dev: !production,
css: css => generateCssOutput({ css, fileName: 'property-detail.css', production }),
css: css => generateCssOutput({ css, fileName: 'property-detail-widget.css', production }),
}),
...baseConfig.plugins,
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import svelte from 'rollup-plugin-svelte'
import propertyDetailConfigurations from './rollup.config.property-detail'
import propertyDetailConfigurations from './rollup.config.property-detail-widget'
import baseConfig from './rollup.config.base'
import replace from '@rollup/plugin-replace'
import path from 'path'
Expand Down
8 changes: 4 additions & 4 deletions packages/web-components/scripts/start-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ const path = require('path')

const getMoveHtmlScript = packageName => {
switch (packageName) {
case 'property-detail':
return 'mkdir -p ./public && cp ./src/property-detail/client/detail.html ./public/index.html'
case 'property-detail-widget':
return 'mkdir -p ./public && cp ./src/property-detail-widget/client/detail.html ./public/index.html'
case 'search-widget':
// eslint-disable-next-line max-len
return 'mkdir -p ./public && cp ./src/search-widget/client/index.html ./public/ && cp ./src/property-detail/client/detail.html ./public/'
return 'mkdir -p ./public && cp ./src/search-widget/client/index.html ./public/ && cp ./src/property-detail-widget/client/detail.html ./public/'
case 'demo-site':
return ''
case 'login':
case 'login-reapit-component':
return `mkdir -p ./public && cp ./src/${packageName}/index.html ./public/`
default:
return `mkdir -p ./public && cp ./src/${packageName}/client/index.html ./public/`
Expand Down

This file was deleted.

49 changes: 0 additions & 49 deletions packages/web-components/src/appointment-bookings/client/index.html

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ exports[`appointment bookings it matches a snapshot 1`] = `
<body>
<div>
<div
class="appointment-bookings-modal-header-container svelte-oki0zw"
data-testid="appointment-bookings-modal-header-container"
class="appointment-planner-component-modal-header-container svelte-w78aa4"
data-testid="appointment-planner-component-modal-header-container"
>
<button
class="svelte-oki0zw"
class="svelte-w78aa4"
data-testid="prev-week"
>
<svg
Expand Down Expand Up @@ -38,13 +38,13 @@ exports[`appointment bookings it matches a snapshot 1`] = `
</button>
<h1
class=" svelte-oki0zw"
class=" svelte-w78aa4"
>
Choose an Appointment
</h1>
<button
class="svelte-oki0zw"
class="svelte-w78aa4"
data-testid="next-week"
>
<svg
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import AppointmentBooking from '../appointment-planner.svelte'
import AppointmentPlanner from '../appointment-planner-component.svelte'
import '@testing-library/jest-dom/extend-expect'
import { render } from '@testing-library/svelte'
import MockDate from 'mockdate'
Expand All @@ -7,7 +7,7 @@ MockDate.set('Mon Apr 13')

describe('appointment bookings', () => {
it('it matches a snapshot', () => {
const wrapper = render(AppointmentBooking, { themeClasses: { svgNavigation: 'class1' } })
const wrapper = render(AppointmentPlanner, { themeClasses: { svgNavigation: 'class1' } })
const { container } = wrapper
expect(container).toMatchSnapshot()
})
Expand Down
Loading

0 comments on commit e8fedc0

Please sign in to comment.