This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <!-- Seller Partner Panel related code --> | |
| <script src="$public-url/seller-store.vendor.min.js" type="text/javascript"></script> | |
| <script src="$public-url/seller-store.min.js" type="text/javascript"></script> | |
| </head> | |
| <body> | |
| <!-- Seller Partner Panel related code --> | |
| <seller-store-editor /> | |
| <!-- Seller Partner Panel related code --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import root from 'react-shadow'; | |
| import styles from './components/index.scss'; | |
| class SellerStoreEditorWebComponent extends HTMLElement { | |
| // ... | |
| private getComponentToRender() { | |
| return ( | |
| <root.div> | |
| <SellerStoreEditor /> | |
| <style type="text/css">{styles}</style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| import TitleInput from './TitleInput'; | |
| import OptionInput from './OptionInput'; | |
| import {withLogic} from "../../utilities/with-logic"; | |
| import DataLogic from "./data-logic"; | |
| type Option = { | |
| id: string; | |
| text: string; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = { | |
| postgre: { | |
| image: 'postgres', | |
| tag: '12.3-alpine', | |
| ports: [5432], | |
| env: { | |
| POSTGRES_PASSWORD: 'integration-pass', | |
| }, | |
| wait: { | |
| type: 'text', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| stages: | |
| - test | |
| integration-test: | |
| extends: .node-cache | |
| stage: test | |
| image: node:14-alpine | |
| services: | |
| - name: docker:20.10.1-dind |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 'Lint and Tests' | |
| on: push | |
| jobs: | |
| test: | |
| name: Lint and Test Code Base | |
| runs-on: ubuntu-latest | |
| strategy: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const postgreSQLAdapter: PostgreSQLAdapter = (global as any).postgreSQLAdapter; | |
| const adRepository = new AdvertisementRepository(postgreSQLAdapter); | |
| const repository = new ProductIntersectionRepository(postgreSQLAdapter); | |
| describe('ProductIntersectionRepository', () => { | |
| const UUID_PREFIX = 'f4f4c9e3-a077-4f3c-bf73-9c54cb57ffa'; | |
| beforeEach(async () => { | |
| await postgreSQLAdapter.query('DELETE FROM advertisements'); | |
| await postgreSQLAdapter.query('DELETE FROM advertisement_products'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class ProductIntersectionRepository { | |
| constructor(private readonly postgreSQLAdapter: PostgreSQLAdapter) | |
| async getActiveAdvertisementProducts( | |
| query: ProductIntersectionQuery | |
| ): Promise<AdvertisementWithProducts[]> | |
| } | |
| type ProductIntersectionQuery = { | |
| sellerID: number; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const http = require("http"); | |
| const https = require("https"); | |
| function request(options) { | |
| return new Promise((resolve, reject) => { | |
| const { url, data, ...rest } = options; | |
| const parsedURL = new URL(url); | |
| const isHTTPS = parsedURL.protocol === "https:"; | |
| const lib = isHTTPS ? https : http; |