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

fix(com-pwa): reported issue and deploy canary and beta #1104

Merged
merged 16 commits into from
May 2, 2023
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
16 changes: 16 additions & 0 deletions cloud/classic/com-pwa/env/develop-soffit-order.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
U2FsdGVkX1+wcTEudbN0P+aFNemIKqVaqm2eAcegDJN+FO68CxjuqW4ozEn5YF7A
03wVjR1IUkvys9YzE+o0OV+LdXUunGG/Cpe7PNi8tHXZeAWmndm3z5NdvJnjjusp
/DEXMgadKKcpUeclg98lhNXTKX0AlFOcTUTYm+P2GTG7Z98WCSEtJM2dkl27tjtz
p+a4XhOMu2ovDSBpWVRoyTT/8got8x5W0hp+IimJTkef0SgMfiTLlc4X0NZ54x9l
b5t48mA7DEH1SRBqZkYrx38peMb3ogX/iHcc7UpwUr7SKz5e1k6MaDJFScY0yXhC
2zc89TenJwCNxSAQ5YtEx5I+QX2ALTt9+glKbdq8MMT/zoudc7rC6C2+A311Q2MV
lccNuW8hdFxN//WLn19K3vmbnwFC6rRBf1YcxV7X8Jka3te7mqazhunfn7aUilW5
x8UgojvD7kHt/LeRB8q9WxvyFXijY2PA/64DyI99/sx7kN0JUZ6IS8X9LPXAcTSe
pXuEadbiPDxXhoLhH6R8BUWhQhMOIX9gw+1ZheEaT/oMR/zNLdxRags6DrmfKG14
YQwWSLzGAwLuvXwWSN0iZOufx7J8z79Aw2tNGWZ+6WEragityETt6BquQgu1uk06
w5QFWEpItDjmFJYSC0ypua61krG4yV5/6wnXa4Fib73AJgBaSt+YCd1SJhje+msw
/PynqXA72HbnH1yQyIQnom9X48uq/rK5pEA5RDAHzydv30isMtwNtUfStzNavTkS
Kd1M0sgPclCq1UOR9WuIdwUJzNC93WAGBsXljfl7ef7Ht1754Bx1V1YZEvaExh2T
RNMEbnnPlOunASnlqQHgTR9mGnadT/UT10FVhQ+iZ9IL58Yf2nsyFtLjgPAkMUkc
ysC3q5/F0x1vO2r0mUDYl0SHn2C+H6n/fFarUUu3JWI1OLkpqdw3A6xIIiqV7S6l
WqXMs4DwwWa9Ji8lhmV3av7U7QQSpaiqCmT2ZXIawBRTMzzaWgizZc2XgBojmenO
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ config_js_envsubst() {
return 0
fi
echo >&3 "$ME: Running envsubst on $config_js_path"
envsubst "$defined_envs" < "$config_js_path" > "$config_js_path"
envsubst "$defined_envs" < "$config_js_path" > "$config_js_path.tmp"
Copy link
Member

Choose a reason for hiding this comment

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

${}

mv "$config_js_path.tmp" "$config_js_path"
Copy link
Member

Choose a reason for hiding this comment

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

-f

}

config_js_envsubst
Expand Down
1 change: 1 addition & 0 deletions uniquely/com-api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {logger} from './lib/config.js';
import './route/home.js';
import './route/patch-price-list.js';
import './route/patch-product-list.js';
import './route/patch-user.js';
import './route/put-order.js';

logger.logOther?.('..:: Alwatr Customer Order Management API ::..');
4 changes: 1 addition & 3 deletions uniquely/com-api/src/route/patch-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@ nanoServer.route('PATCH', '/user-list/', async (connection) => {
};
}

userStorage.set(user);

saveSeparateUserProfile(user);

return {
ok: true,
data: {},
data: await userStorage.set(user),
alimd marked this conversation as resolved.
Show resolved Hide resolved
};
});

Expand Down
1 change: 0 additions & 1 deletion uniquely/com-api/src/route/put-order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import type {Order} from '@alwatr/type/customer-order-management.js';
nanoServer.route('PUT', '/order/', async (connection) => {
logger.logMethod?.('put-order');

connection.requireToken(config.nanoServer.accessToken);
const params = connection.requireQueryParams<{userId: string}>({userId: 'string'});
const remoteAddress = connection.getRemoteAddress();
const clientId = connection.requireClientId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,15 @@ import type {ComUser, Order} from '@alwatr/type/customer-order-management.js';

export const orderStorageContextConsumer = serverContextConsumer<AlwatrDocumentStorage<Order>>(
'order_storage_context',
{
...config.fetchContextOptions,
url: config.api + '/order-list/',
},
config.fetchContextOptions,
);

orderStorageContextConsumer.fsm.defineSignals([
{
signalId: userProfileContextConsumer.id,
callback: (user: ComUser): void => {
orderStorageContextConsumer.request({
queryParameters: {
userId: user.id,
},
url: config.api + '/storage/order-list-' + user.id,
});
},
receivePrevious: 'NextCycle',
Expand Down
10 changes: 2 additions & 8 deletions uniquely/com-pwa/src/manager/context-provider/price-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ export const productPriceStorageContextConsumer = serverContextConsumer<AlwatrDo
'product_price_storage_context',
{
...config.fetchContextOptions,
url: config.api + '/price-list/',
queryParameters: {
name: config.priceListName.replace('${productStorage}', 'tile'),
},
url: config.api + '/storage/price-list-' + config.priceListName.replace('${productStorage}', 'tile'),
},
);

Expand All @@ -33,10 +30,7 @@ export const productFinalPriceStorageContextConsumer = serverContextConsumer<Alw
'product_final_price_storage_context',
{
...config.fetchContextOptions,
url: config.api + '/price-list/',
queryParameters: {
name: config.finalPriceListName.replace('${productStorage}', 'tile'),
},
url: config.api + '/storage/price-list-' + config.finalPriceListName.replace('${productStorage}', 'tile'),
},
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ export const productStorageContextConsumer = serverContextConsumer<AlwatrDocumen
'product_storage_context',
{
...config.fetchContextOptions,
url: config.api + '/product-list/',
queryParameters: {
storage: 'tile',
},
url: config.api + '/storage/product-list-tile',
},
);

Expand Down
2 changes: 1 addition & 1 deletion uniquely/com-pwa/src/manager/context-provider/sign-in.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ signInServerContext.subscribe(() => {

export const signIn = (phoneNumber: number, token: string): void => {
signInServerContext.request({
url: `${config.api}/storage/${simpleHashNumber(phoneNumber)}-${token}`,
url: `${config.api}/storage/user/${simpleHashNumber(phoneNumber)}-${token}`,
});
};
2 changes: 1 addition & 1 deletion uniquely/com-pwa/src/ui/alwatr-pwa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AlwatrPwa extends AlwatrPwaElement {
}

protected override _routesConfig: RoutesConfig = {
routeId: (routeContext) => routeContext.sectionList[0]?.toString(),
routeId: (routeContext) => routeContext.sectionList[0]?.toString() ?? '',
templates: {
'home': this._renderPageHome,
'_404': this._renderPage404,
Expand Down
9 changes: 6 additions & 3 deletions uniquely/com-pwa/src/ui/page/order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,12 @@ export class AlwatrPageNewOrder extends UnresolvedMixin(LocalizeMixin(SignalMixi

return html`
<alwatr-icon-box .content=${content}></alwatr-icon-box>
<alwatr-button .icon=${buttons.retry.icon} .clickSignalId=${buttons.retry.clickSignalId}>
${message('retry')}
</alwatr-button>
<div>
<alwatr-button
.content=${{icon: buttons.retry.icon, clickSignalId: buttons.retry.clickSignalId}}
> ${message('retry')}
</alwatr-button>
</div>
`;
}

Expand Down