Compare commits

..

6 Commits

Author SHA1 Message Date
RustamRu
351420bc62 0.9.1
All checks were successful
it-academy/dry-wash-pl/pipeline/head This commit looks good
2025-02-23 12:37:44 +03:00
RustamRu
61b042eee6 fix: image input accept, i18n (#88)
All checks were successful
it-academy/dry-wash-pl/pipeline/head This commit looks good
2025-02-23 12:37:04 +03:00
RustamRu
ac006267a2 0.9.0
All checks were successful
it-academy/dry-wash-pl/pipeline/head This commit looks good
2025-02-23 12:11:20 +03:00
RustamRu
63d9d069c0 feat: add car image feature
All checks were successful
it-academy/dry-wash-pl/pipeline/head This commit looks good
2025-02-23 12:08:50 +03:00
c83ebf02bc Merge pull request 'feature/upload-car-image' (#90) from feature/upload-car-image into main
All checks were successful
it-academy/dry-wash-pl/pipeline/head This commit looks good
Reviewed-on: #90
2025-02-23 12:02:39 +03:00
RustamRu
1968df7bb3 fix: getOrder test (#88)
All checks were successful
it-academy/dry-wash-pl/pipeline/pr-main This commit looks good
2025-02-23 11:58:56 +03:00
10 changed files with 26 additions and 12 deletions

View File

@@ -21,7 +21,16 @@ module.exports = {
features: { features: {
'dry-wash': { 'dry-wash': {
// add your features here in the format [featureName]: { value: string } // add your features here in the format [featureName]: { value: string }
'order-view-status-polling': { value: '3000' } "order-view-status-polling": {
"on": true,
"value": "3000",
"key": "order-view-status-polling"
},
"car-img-upload": {
"on": true,
"value": "true",
"key": "car-img-upload"
}
}, },
}, },
config: { config: {

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "dry-wash", "name": "dry-wash",
"version": "0.8.0", "version": "0.9.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "dry-wash", "name": "dry-wash",
"version": "0.8.0", "version": "0.9.1",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@babel/core": "^7.26.7", "@babel/core": "^7.26.7",

View File

@@ -1,6 +1,6 @@
{ {
"name": "dry-wash", "name": "dry-wash",
"version": "0.8.0", "version": "0.9.1",
"description": "<a id=\"readme-top\"></a>", "description": "<a id=\"readme-top\"></a>",
"main": "./src/index.tsx", "main": "./src/index.tsx",
"scripts": { "scripts": {

View File

@@ -11,5 +11,8 @@ export const FEATURE = {
return interval; return interval;
} }
} }
},
carImageUpload: {
isOn: Boolean(features?.['car-img-upload'])
} }
}; };

View File

@@ -13,6 +13,7 @@ export const extractErrorMessageFromResponse = ({
}: FetchBaseQueryError) => { }: FetchBaseQueryError) => {
if ( if (
typeof data === 'object' && typeof data === 'object' &&
data !== null &&
'error' in data && 'error' in data &&
typeof data.error === 'string' typeof data.error === 'string'
) { ) {

View File

@@ -64,7 +64,7 @@ export const CarImageForm: FC<CarImageFormProps> = memo(function CarImageForm({
<Input <Input
{...field} {...field}
ref={fileInputRef} ref={fileInputRef}
accept='.jpg,.png' accept='image/png,image/jpeg'
value={value?.fileName} value={value?.fileName}
onChange={(event) => { onChange={(event) => {
onChange(event.target.files[0]); onChange(event.target.files[0]);

View File

@@ -11,7 +11,7 @@ export const useHandleUploadCarImageResponse = (query: {
}) => { }) => {
const toast = useToast(); const toast = useToast();
const { t } = useTranslation('~', { const { t } = useTranslation('~', {
keyPrefix: 'dry-wash.order-create.upload-car-image-query', keyPrefix: 'dry-wash.order-view.upload-car-image-query',
}); });
useEffect(() => { useEffect(() => {

View File

@@ -16,7 +16,6 @@ exports[`Страница просмотра заказа отображает
</h2> </h2>
<div <div
class="chakra-stack css-1n38vgh" class="chakra-stack css-1n38vgh"
created="2025-01-19T14:04:02.985Z"
data-testid="order-details" data-testid="order-details"
> >
<div <div
@@ -26,6 +25,9 @@ exports[`Страница просмотра заказа отображает
class="chakra-heading css-1jb3vzl" class="chakra-heading css-1jb3vzl"
> >
Заказ №{{number}} Заказ №{{number}}
(
Sunday, January 19, 2025 5:04 PM
)
</h2> </h2>
<span <span
class="css-6jfsiv" class="css-6jfsiv"

View File

@@ -75,7 +75,7 @@ exports[`Страница заказов должна корректно ото
<p <p
class="chakra-text css-52ukzg" class="chakra-text css-52ukzg"
> >
20.02.2025 23.02.2025
</p> </p>
<button <button
class="chakra-button css-ez23ye" class="chakra-button css-ez23ye"

View File

@@ -70,7 +70,7 @@ const Page: FC = () => {
<> <>
<> <>
{isSuccess && ( {isSuccess && (
<VStack p={4} alignItems='flex-start' gap={4}> <VStack p={4} alignItems='flex-start' gap={4} data-testid='order-details'>
<OrderDetails <OrderDetails
orderNumber={order.orderNumber} orderNumber={order.orderNumber}
status={order.status} status={order.status}
@@ -81,10 +81,9 @@ const Page: FC = () => {
location={order.location} location={order.location}
startWashTime={order.startWashTime} startWashTime={order.startWashTime}
endWashTime={order.endWashTime} endWashTime={order.endWashTime}
created={order.created} created={order.created}
data-testid='order-details'
/> />
<CarImageForm orderId={orderId} /> {FEATURE.carImageUpload.isOn && <CarImageForm orderId={orderId} />}
</VStack> </VStack>
)} )}
</> </>