Skip to content

Commit aed861e

Browse files
design updates
1 parent 1d5ac53 commit aed861e

File tree

4 files changed

+94
-4
lines changed

4 files changed

+94
-4
lines changed

src/core/integrations/integrations/integrations-show/containers/document-types/containers/remote-document-types/components/RemoteDocumentTypeEditForm.vue

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,19 @@ import { TextInput } from '../../../../../../../../../shared/components/atoms/in
1010
import { Button } from '../../../../../../../../../shared/components/atoms/button';
1111
import { SecondaryButton } from '../../../../../../../../../shared/components/atoms/button-secondary';
1212
import { FieldQuery } from '../../../../../../../../../shared/components/organisms/general-form/containers/form-fields/field-query';
13-
import type { QueryFormField } from '../../../../../../../../../shared/components/organisms/general-form/formConfig';
13+
import type { CreateOnTheFly, QueryFormField } from '../../../../../../../../../shared/components/organisms/general-form/formConfig';
14+
import { FormType } from '../../../../../../../../../shared/components/organisms/general-form/formConfig';
1415
import { FieldType } from '../../../../../../../../../shared/utils/constants';
1516
import { Toast } from '../../../../../../../../../shared/modules/toast';
1617
import { processGraphQLErrors } from '../../../../../../../../../shared/utils';
1718
import { documentTypesQuerySelector } from '../../../../../../../../../shared/api/queries/documentTypes.js';
1819
import { getRemoteDocumentTypeQuery } from '../../../../../../../../../shared/api/queries/salesChannels.js';
20+
import { createDocumentTypeMutation } from '../../../../../../../../../shared/api/mutations/documentTypes.js';
1921
import {
2022
updateEbayDocumentTypeMutation,
2123
updateRemoteDocumentTypeMutation,
2224
} from '../../../../../../../../../shared/api/mutations/salesChannels.js';
25+
import { baseFormConfigConstructor as documentTypeBaseFormConfigConstructor } from '../../../../../../../../settings/document-types/configs';
2326
import RemoteDocumentTypeCategoriesList from './categories-lists/RemoteDocumentTypeCategoriesList.vue';
2427
2528
type CategoryId = string | number;
@@ -85,6 +88,20 @@ const breadcrumbsLinks = computed(() => [
8588
{ name: t('integrations.show.documentTypes.editTitle') },
8689
]);
8790
91+
const localDocumentTypeCreateOnTheFlyConfig = computed<CreateOnTheFly>(() => {
92+
const defaultName = (form.value.translatedName || form.value.name || '').trim();
93+
94+
return {
95+
config: documentTypeBaseFormConfigConstructor(
96+
t,
97+
FormType.CREATE,
98+
createDocumentTypeMutation,
99+
'createDocumentType',
100+
),
101+
...(defaultName ? { defaults: { name: defaultName } } : {}),
102+
};
103+
});
104+
88105
const localInstanceField = computed<QueryFormField>(() => ({
89106
type: FieldType.Query,
90107
name: 'localInstance',
@@ -97,6 +114,7 @@ const localInstanceField = computed<QueryFormField>(() => ({
97114
isEdge: true,
98115
multiple: false,
99116
filterable: true,
117+
createOnFlyConfig: localDocumentTypeCreateOnTheFlyConfig.value,
100118
}));
101119
102120
const localInstanceInitialOptions = computed(() =>

src/core/integrations/integrations/integrations-show/containers/document-types/containers/remote-document-types/components/categories-lists/AmazonDocumentTypeCategoriesList.vue

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ const setManualCategory = async () => {
522522
</Button>
523523
</div>
524524

525-
<div class="mt-3 space-y-2">
525+
<div class="mt-3 space-y-2 max-h-72 overflow-y-auto pr-1 category-list-scroll">
526526
<div
527527
v-for="item in categoryItems"
528528
:key="item.key"
@@ -735,4 +735,28 @@ const setManualCategory = async () => {
735735
opacity: 0;
736736
}
737737
}
738+
739+
.category-list-scroll {
740+
scrollbar-width: thin;
741+
scrollbar-color: #94a3b8 #f1f5f9;
742+
}
743+
744+
.category-list-scroll::-webkit-scrollbar {
745+
width: 8px;
746+
}
747+
748+
.category-list-scroll::-webkit-scrollbar-track {
749+
background: #f1f5f9;
750+
border-radius: 9999px;
751+
}
752+
753+
.category-list-scroll::-webkit-scrollbar-thumb {
754+
background: #94a3b8;
755+
border-radius: 9999px;
756+
border: 2px solid #f1f5f9;
757+
}
758+
759+
.category-list-scroll::-webkit-scrollbar-thumb:hover {
760+
background: #64748b;
761+
}
738762
</style>

src/core/integrations/integrations/integrations-show/containers/document-types/containers/remote-document-types/components/categories-lists/EbayDocumentTypeCategoriesList.vue

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ const setManualCategory = async () => {
438438
</Button>
439439
</div>
440440

441-
<div class="mt-3 space-y-2">
441+
<div class="mt-3 space-y-2 max-h-72 overflow-y-auto pr-1 category-list-scroll">
442442
<div
443443
v-for="item in categoryItems"
444444
:key="item.key"
@@ -585,4 +585,28 @@ const setManualCategory = async () => {
585585
opacity: 0;
586586
}
587587
}
588+
589+
.category-list-scroll {
590+
scrollbar-width: thin;
591+
scrollbar-color: #94a3b8 #f1f5f9;
592+
}
593+
594+
.category-list-scroll::-webkit-scrollbar {
595+
width: 8px;
596+
}
597+
598+
.category-list-scroll::-webkit-scrollbar-track {
599+
background: #f1f5f9;
600+
border-radius: 9999px;
601+
}
602+
603+
.category-list-scroll::-webkit-scrollbar-thumb {
604+
background: #94a3b8;
605+
border-radius: 9999px;
606+
border: 2px solid #f1f5f9;
607+
}
608+
609+
.category-list-scroll::-webkit-scrollbar-thumb:hover {
610+
background: #64748b;
611+
}
588612
</style>

src/core/integrations/integrations/integrations-show/containers/document-types/containers/remote-document-types/components/categories-lists/SheinDocumentTypeCategoriesList.vue

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ const setManualCategory = async () => {
384384
</Button>
385385
</div>
386386

387-
<div class="mt-3 space-y-2">
387+
<div class="mt-3 space-y-2 max-h-72 overflow-y-auto pr-1 category-list-scroll">
388388
<div
389389
v-for="item in categoryItems"
390390
:key="item.key"
@@ -505,4 +505,28 @@ const setManualCategory = async () => {
505505
opacity: 0;
506506
}
507507
}
508+
509+
.category-list-scroll {
510+
scrollbar-width: thin;
511+
scrollbar-color: #94a3b8 #f1f5f9;
512+
}
513+
514+
.category-list-scroll::-webkit-scrollbar {
515+
width: 8px;
516+
}
517+
518+
.category-list-scroll::-webkit-scrollbar-track {
519+
background: #f1f5f9;
520+
border-radius: 9999px;
521+
}
522+
523+
.category-list-scroll::-webkit-scrollbar-thumb {
524+
background: #94a3b8;
525+
border-radius: 9999px;
526+
border: 2px solid #f1f5f9;
527+
}
528+
529+
.category-list-scroll::-webkit-scrollbar-thumb:hover {
530+
background: #64748b;
531+
}
508532
</style>

0 commit comments

Comments
 (0)