Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
38 changes: 38 additions & 0 deletions .github/workflows/build-and-commit-dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and Commit Dist

on:
push:
branches:
- '**'

jobs:
build-and-commit-dist:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'

- name: Install dependencies
run: npm ci

- name: Build dist
run: npm run dist

- name: Commit dist changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
if [[ -n $(git status --porcelain dist) ]]; then
git add dist
git commit -m "chore: Update dist"
git push
else
echo "No changes in dist to commit."
fi
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,3 @@ node_modules
test/resources/*
!test/resources/**/.gitkeep
!test/resources/favicon.ico

dist/
!dist/resources/**/.gitkeep
!dist/resources/favicon.ico
!dist/index.scss
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,52 @@
# integration-core-ui
Repository to store the common assets files that integration-core may require

# UI Build Instructions

To generate the appropriate UI files, run the following commands:

## 1. Install dependencies

```bash
npm install
```

## 2. Build distribution files

```bash
npm run dist
```

This will generate all necessary UI resources in the ```dist``` directory.

## 3. Content of the ```dist/resources``` directory
The ```dist/resources``` directory contains:
- assets/fonts files
- css/sequra-core.css file
- js files
- lang files

## 4. Rebuilding After Changes

The contents of the `dist` directory are automatically regenerated and committed to the repository on every push to any branch. This is handled by a GitHub Actions workflow, which runs `npm run dist` and commits any changes to `dist` back to the remote repository. You do not need to manually build or commit the `dist` directory when pushing changes; this process is fully automated.

That said, if you want to manually trigger a rebuild of the `dist` directory after every change to the UI source files, the next command should be run:

```bash
npm run dist
```

to regenerate the output files.

## 5. Distributing UI Resources

Once the UI resources are generated in the ```dist``` directory, the new code should be pushed.

In every SeQura integration, should be added a development dependency to the ```sequra-core-admin-fe``` package:

```"sequra-core-admin-fe": "github:sequra/integration-core-ui"```

After adding the dependency, install or update the project's packages using the appropriate package manager (npm) to ensure that ```sequra-core-admin-fe``` is installed.
The package will be placed in the ```node_modules``` directory.

Each SeQura integration includes specific instructions in its README file that should be followed to correctly import and place the CORE UI resources.
92 changes: 92 additions & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<!DOCTYPE html>
<!--suppress HtmlUnknownTarget -->
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
/>
<meta http-equiv="X-UA-Compatible" content="ie=edge"/>
<link rel="stylesheet" href="/css/design-demo.css"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,1,0" />
<title>SeQura</title>
</head>
<body>
<main id="sq-page-wrapper"></main>
<div class="sq-page-loader sqs--hidden" id="sq-spinner">
<div class="sq-loader sqt--large">
<span class="sqp-spinner"></span>
</div>
</div>

//#scripts#
<script>
document.addEventListener('DOMContentLoaded', () => {
const baseApiUrl = 'https://d95e17e23f81.ngrok.app';
SequraFE.translations = {
default: '%default_translations%',
current: '%current_lang_translations%'
};

SequraFE.utilities.showLoader();

const onboardingPageConfig = {
getConnectionDataUrl: baseApiUrl + '/connection',
saveConnectionDataUrl: baseApiUrl + '/connection',
validateConnectionDataUrl: baseApiUrl + '/connection-validation',
getSellingCountriesUrl: baseApiUrl + '/selling-countries',
getCountrySettingsUrl: baseApiUrl + '/country-configuration',
saveCountrySettingsUrl: baseApiUrl + '/country-configuration',
getWidgetSettingsUrl: baseApiUrl + '/widget-settings',
saveWidgetSettingsUrl: baseApiUrl + '/widget-settings',
getWidgetConfiguratorUrl: baseApiUrl + '/widget-configurator',
getPaymentMethodsUrl: baseApiUrl + '/payment-methods',
}

const pageConfiguration = {
onboarding: onboardingPageConfig,
settings: {
...onboardingPageConfig,
getShopCategoriesUrl: baseApiUrl + '/categories',
getGeneralSettingsUrl: baseApiUrl + '/general-settings',
saveGeneralSettingsUrl: baseApiUrl + '/general-settings',
getShopOrderStatusesUrl: baseApiUrl + '/order-statuses',
getOrderStatusMappingSettingsUrl: baseApiUrl + '/order-status-settings',
saveOrderStatusMappingSettingsUrl: baseApiUrl + '/order-status-settings',
disconnectUrl: baseApiUrl + '/disconnect'
},
payment: {
getPaymentMethodsUrl: baseApiUrl + '/payment-methods',
getSellingCountriesUrl: baseApiUrl + '/selling-countries',
getCountrySettingsUrl: baseApiUrl + '/country-configuration',
getConnectionDataUrl: baseApiUrl + '/connection',
validateConnectionDataUrl: baseApiUrl + '/connection-validation',
}
};

SequraFE.state = new SequraFE.StateController({
storesUrl: baseApiUrl + '/stores',
merchantsUrl: baseApiUrl + '',
currentStoreUrl: baseApiUrl + '/stores/current',
stateUrl: baseApiUrl + '/state',
versionUrl: baseApiUrl + '/version',
shopNameUrl: baseApiUrl + '/shop-name',
downloadVersionUrl: 'https://logeecom.com/wp-content/uploads/2016/09/logo-white.png',
pageConfiguration: pageConfiguration
});

SequraFE.pages = {
onboarding: ['connect','countries', 'widgets'],
settings: ['general','connection','order_status','widget'],
payment: ['methods']
}

SequraFE.isPromotional = !SequraFE.pages.payment || SequraFE.pages.payment.length === 0;

SequraFE.state.display();
SequraFE.utilities.hideLoader();
});
</script>
</body>
</html>
Binary file added dist/resources/assets/fonts/Inter/Inter-Bold.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added dist/resources/assets/fonts/sq-icons/sq-icons.eot
Binary file not shown.
Loading