feat: Add IntegrationRepository and ShopProClient for managing integrations and fetching products from shopPRO API

This commit is contained in:
2026-02-23 23:28:55 +01:00
parent b312dc56e3
commit 18d0019c28
54 changed files with 10397 additions and 393 deletions

View File

@@ -98,9 +98,10 @@ a {
}
.container {
max-width: 1120px;
margin: 24px auto;
padding: 0 18px 24px;
max-width: none;
width: calc(100% - 28px);
margin: 18px 14px;
padding: 0 6px 24px;
}
.card {
@@ -209,6 +210,521 @@ a {
overflow: auto;
}
.page-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.filters-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 12px;
}
.filters-actions {
display: flex;
align-items: end;
gap: 8px;
}
.product-form .form-control {
width: 100%;
}
.form-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 12px;
}
.form-actions {
display: flex;
gap: 8px;
flex-wrap: wrap;
}
.field-inline {
display: flex;
align-items: center;
gap: 8px;
margin-top: 6px;
}
.modal-backdrop {
position: fixed;
inset: 0;
background: rgba(15, 23, 42, 0.5);
display: flex;
align-items: center;
justify-content: center;
padding: 16px;
z-index: 200;
}
.modal-backdrop[hidden] {
display: none;
}
.modal {
width: min(560px, 100%);
background: #fff;
border-radius: 10px;
box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
overflow: hidden;
}
.modal__header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
padding: 16px 18px;
border-bottom: 1px solid var(--c-border);
}
.modal__header h3 {
margin: 0;
font-size: 18px;
color: var(--c-text-strong);
}
.modal__body {
padding: 16px 18px 18px;
}
.status-pill {
display: inline-flex;
align-items: center;
justify-content: center;
border: 1px solid #fed7d7;
background: #fff5f5;
color: #9b2c2c;
padding: 2px 8px;
border-radius: 999px;
font-size: 12px;
font-weight: 600;
}
.status-pill.is-active {
border-color: #b7ebcf;
background: #f0fff6;
color: #0f6b39;
}
.table-list {
display: grid;
gap: 14px;
}
.table-list__header {
display: flex;
justify-content: space-between;
align-items: center;
gap: 12px;
flex-wrap: wrap;
}
.table-list__left {
display: inline-flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
}
.table-list-header-actions {
display: inline-flex;
align-items: center;
gap: 10px;
flex-wrap: wrap;
}
.js-filter-toggle-btn.is-active {
border-color: #cbd5e0;
background: #edf2ff;
color: var(--c-primary-dark);
}
.table-filter-badge {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 18px;
height: 18px;
padding: 0 5px;
font-size: 11px;
font-weight: 700;
color: #fff;
background: var(--c-primary);
border-radius: 999px;
}
.table-filters-wrapper {
display: none;
}
.table-filters-wrapper.is-open {
display: block;
}
.table-list-filters {
display: grid;
gap: 12px;
grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.table-col-toggle-wrapper {
position: relative;
}
.table-col-toggle-dropdown {
display: none;
position: absolute;
right: 0;
top: calc(100% + 6px);
z-index: 30;
width: 260px;
max-height: 360px;
overflow: auto;
border: 1px solid var(--c-border);
border-radius: 10px;
background: #fff;
box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}
.table-col-toggle-dropdown.is-open {
display: block;
}
.table-col-toggle-header {
padding: 10px 12px;
border-bottom: 1px solid var(--c-border);
font-size: 12px;
font-weight: 700;
color: var(--c-muted);
}
.table-col-toggle-item {
display: flex;
align-items: center;
gap: 10px;
padding: 8px 12px;
font-size: 13px;
color: var(--c-text-strong);
}
.table-col-toggle-item:hover {
background: #f8fafc;
}
.table-col-toggle-footer {
border-top: 1px solid var(--c-border);
padding: 8px 12px;
}
.table-col-hidden {
display: none;
}
.table-col-switch {
position: relative;
display: inline-block;
width: 34px;
min-width: 34px;
height: 18px;
}
.table-col-switch input {
opacity: 0;
width: 0;
height: 0;
position: absolute;
}
.table-col-switch-slider {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #cbd5e1;
border-radius: 999px;
transition: background-color 0.2s ease;
}
.table-col-switch-slider::before {
content: "";
position: absolute;
height: 14px;
width: 14px;
left: 2px;
bottom: 2px;
background: #fff;
border-radius: 50%;
transition: transform 0.2s ease;
}
.table-col-switch input:checked + .table-col-switch-slider {
background: #16a34a;
}
.table-col-switch input:checked + .table-col-switch-slider::before {
transform: translateX(16px);
}
.table-sort-link {
display: inline-flex;
align-items: center;
gap: 6px;
color: var(--c-text-strong);
text-decoration: none;
}
.table-sort-link:hover {
color: var(--c-primary-dark);
}
.table-sort-icon.is-muted {
color: #a0aec0;
}
.table-list__footer {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
flex-wrap: wrap;
}
.table-list-per-page-form {
display: inline-flex;
align-items: center;
gap: 8px;
}
.table-list-per-page-form .form-control {
min-width: 90px;
}
.table-inline-action {
display: inline-block;
margin-right: 6px;
}
.product-name-cell {
display: inline-flex;
align-items: center;
gap: 10px;
}
.product-name-thumb {
width: 60px;
height: 60px;
border-radius: 6px;
object-fit: cover;
border: 1px solid var(--c-border);
background: #f8fafc;
}
.product-name-thumb--empty {
display: inline-block;
width: 60px;
height: 60px;
border-radius: 6px;
border: 1px dashed #cbd5e0;
background: #f8fafc;
}
.product-name-thumb-btn {
border: 0;
padding: 0;
background: transparent;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
}
.product-name-thumb-btn:focus-visible {
outline: none;
box-shadow: var(--focus-ring);
border-radius: 8px;
}
.modal--image-preview {
width: min(760px, 100%);
}
.product-image-preview__img {
display: block;
width: 100%;
max-height: 70vh;
object-fit: contain;
border-radius: 8px;
background: #f8fafc;
}
.product-images-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
gap: 12px;
}
.product-image-card {
border: 1px solid #dfe3ea;
border-radius: 10px;
padding: 10px;
background: #fff;
}
.product-image-card__thumb-wrap {
position: relative;
border-radius: 8px;
overflow: hidden;
background: #f2f5f8;
}
.product-image-card__thumb {
width: 100%;
height: 160px;
object-fit: cover;
display: block;
}
.product-image-card__thumb.is-empty {
height: 160px;
display: grid;
place-items: center;
color: #6b7785;
font-size: 12px;
}
.product-image-card__badge {
display: none;
position: absolute;
top: 8px;
left: 8px;
background: #1f7a43;
color: #fff;
padding: 3px 8px;
border-radius: 999px;
font-size: 11px;
}
.product-image-card.is-main .product-image-card__badge {
display: inline-block;
}
.product-image-card__meta {
margin-top: 8px;
font-size: 11px;
line-height: 1.25;
color: #5f6b79;
overflow-wrap: anywhere;
}
.product-image-card__actions {
margin-top: 10px;
display: grid;
grid-template-columns: 1fr;
gap: 8px;
}
.product-image-card__actions .btn {
min-height: 34px;
font-size: 12px;
line-height: 1.2;
padding: 6px 10px;
}
.product-links-search-form {
display: grid;
gap: 12px;
grid-template-columns: minmax(220px, 320px) minmax(220px, 1fr) auto;
align-items: end;
}
.product-links-head {
display: grid;
gap: 8px;
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.product-tabs-nav {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
}
.product-links-inline-form {
display: grid;
gap: 8px;
grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) auto;
align-items: center;
}
.product-links-actions-row {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: nowrap;
}
.product-links-actions-row .product-links-relink-form {
flex: 1 1 auto;
}
.product-links-unlink-form {
margin: 0;
flex: 0 0 auto;
}
.product-link-events-list {
margin: 0;
padding: 0;
list-style: none;
display: grid;
gap: 4px;
}
.product-link-events-list li {
display: grid;
gap: 2px;
}
.product-link-events-type {
font-weight: 600;
color: var(--c-text-strong);
}
.product-link-events-date {
color: var(--c-muted);
font-size: 12px;
}
.product-show-images-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
gap: 12px;
}
.product-show-image-card {
border: 1px solid var(--c-border);
border-radius: 10px;
background: #fff;
padding: 10px;
}
.product-show-image {
width: 100%;
max-height: 260px;
object-fit: cover;
border-radius: 8px;
border: 1px solid #d9e0ea;
}
@media (max-width: 768px) {
.app-shell {
grid-template-columns: 1fr;
@@ -241,14 +757,47 @@ a {
.container {
margin-top: 16px;
padding: 0 14px 18px;
width: calc(100% - 16px);
margin-left: 8px;
margin-right: 8px;
padding: 0 4px 18px;
}
.settings-grid {
grid-template-columns: 1fr;
}
.page-head {
flex-direction: column;
align-items: flex-start;
}
.filters-grid,
.form-grid,
.table-list-filters,
.product-links-search-form,
.product-links-inline-form {
grid-template-columns: 1fr;
}
.filters-actions {
align-items: center;
}
.table-list__header,
.table-list__footer {
align-items: flex-start;
}
.product-links-head {
grid-template-columns: 1fr;
}
.card {
padding: 18px;
}
.modal--image-preview {
width: min(92vw, 100%);
}
}

View File

@@ -47,6 +47,17 @@
background: #f8fafc;
}
.btn--danger {
color: #ffffff;
border-color: #b91c1c;
background: #dc2626;
}
.btn--danger:hover {
border-color: #991b1b;
background: #b91c1c;
}
.btn--block {
width: 100%;
}