Skip to content

Commit

Permalink
Revert "Release v1.0.0 of sudosos-frontend (#237)"
Browse files Browse the repository at this point in the history
This reverts commit 7ae141d.
  • Loading branch information
JustSamuel committed Jun 27, 2024
1 parent 7ae141d commit 4363331
Show file tree
Hide file tree
Showing 15 changed files with 2,890 additions and 8,668 deletions.
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
name: Release Docker Image CI
name: Dashboard - Dockerize

on:
workflow_dispatch:
push:
tags:
- 'v*'
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
release:
dockerize:
runs-on: ubuntu-latest
container:
image: docker:dind
strategy:
matrix:
app: [ dashboard, point-of-sale ]
include:
- app: dashboard
env_file_main: ${{ vars.ENV_FILE_PRODUCTION }}
docker_tag: ${{ vars.DOCKER_TAG_DASHBOARD }}
dockerfile_path: "apps/dashboard/Dockerfile"
- app: point-of-sale
env_file_main: ${{ vars.ENV_FILE_PRODUCTION }}
docker_tag: ${{ vars.DOCKER_TAG_POS }}
dockerfile_path: "apps/point-of-sale/Dockerfile"

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: .

- name: Set up environment
- name: Set up environment - main
env:
ENV_FILE: ${{ matrix.env_file_main }}
ENV_FILE: ${{ vars.ENV_FILE_PRODUCTION }}
if: github.ref == 'refs/heads/main'
run: |
echo "${ENV_FILE}" > ./apps/${{ matrix.app }}/.env
echo "${ENV_FILE}" > ./apps/dashboard/.env
- name: Set up environment - develop
env:
ENV_FILE: ${{ vars.ENV_FILE_DEVELOPMENT }}
if: github.ref == 'refs/heads/develop'
run: |
echo "${ENV_FILE}" > apps/dashboard/.env
- name: Get Docker meta (for tags)
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
${{ vars.DOCKER_REGISTRY }}/${{ matrix.docker_tag }}
${{ vars.DOCKER_REGISTRY }}/${{ vars.DOCKER_TAG_DASHBOARD }}
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
- name: Set up QEMU
Expand All @@ -55,21 +55,21 @@ jobs:
uses: docker/setup-buildx-action@v2

- name: Login to SudoSOS Container Registry
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
uses: docker/login-action@v2
with:
registry: ${{ vars.DOCKER_REGISTRY }}
username: ${{ secrets.SVC_GH_SUDOSOS_USERNAME }}
password: ${{ secrets.SVC_GH_SUDOSOS_PWD }}

# Build and push Docker image with Buildx
# Build and push Docker image with Buildx (only push on push to main/develop)
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
push: true
platforms: linux/amd64 #SudoSOS does not run on linux/arm64
push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
file: ${{ matrix.dockerfile_path }}
file: "apps/dashboard/Dockerfile"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Image CI
name: Point of Sale - Dockerize

on:
workflow_dispatch:
Expand All @@ -16,29 +16,6 @@ jobs:
runs-on: ubuntu-latest
container:
image: docker:dind
strategy:
matrix:
app: [ dashboard, point-of-sale, point-of-sale-ab]
include:
- app: dashboard
env_file_main: ${{ vars.ENV_FILE_PRODUCTION }}
env_file_develop: ${{ vars.ENV_FILE_DEVELOPMENT }}
docker_tag: ${{ vars.DOCKER_TAG_DASHBOARD }}
dockerfile_path: "apps/dashboard/Dockerfile"
dir: "dashboard"
- app: point-of-sale
env_file_main: ${{ vars.ENV_FILE_PRODUCTION }}
env_file_develop: ${{ vars.ENV_FILE_DEVELOPMENT }}
docker_tag: ${{ vars.DOCKER_TAG_POS }}
dockerfile_path: "apps/point-of-sale/Dockerfile"
dir: "point-of-sale"
- app: point-of-sale-ab
env_file_main: ${{ vars.ENV_FILE_PRODUCTION }}
env_file_develop: ${{ vars.ENV_FILE_PRODUCTION }}
docker_tag: ${{ vars.DOCKER_TAG_POS }}-ab
dockerfile_path: "apps/point-of-sale/Dockerfile"
dir: "point-of-sale"

steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -47,26 +24,29 @@ jobs:

- name: Set up environment - main
env:
ENV_FILE: ${{ matrix.env_file_main }}
ENV_FILE: ${{ vars.ENV_FILE_PRODUCTION }}
if: github.ref == 'refs/heads/main'
run: |
echo "${ENV_FILE}" > ./apps/${{ matrix.dir }}/.env
echo "${ENV_FILE}" > ./apps/point-of-sale/.env
- name: Set up environment - develop
env:
ENV_FILE: ${{ matrix.env_file_develop }}
if: github.ref != 'refs/heads/main'
ENV_FILE: ${{ vars.ENV_FILE_DEVELOPMENT }}
if: github.ref == 'refs/heads/develop'
run: |
echo "${ENV_FILE}" > apps/${{ matrix.dir }}/.env
echo "${ENV_FILE}" > apps/point-of-sale/.env
- name: Get Docker meta (for tags)
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
${{ vars.DOCKER_REGISTRY }}/${{ matrix.docker_tag }}
${{ vars.DOCKER_REGISTRY }}/${{ vars.DOCKER_TAG_POS }}
# generate Docker tags based on the following events/attributes
tags: |
type=ref,enable=true,priority=600,prefix=,suffix=,event=branch
type=ref,event=branch
type=semver,pattern={{version}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand All @@ -93,4 +73,4 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
file: ${{ matrix.dockerfile_path }}
file: "apps/point-of-sale/Dockerfile"
34 changes: 0 additions & 34 deletions .github/workflows/semver.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .releaserc.json

This file was deleted.

1 change: 0 additions & 1 deletion apps/point-of-sale/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ WORKDIR /app
COPY lib/common/ lib/common/
COPY apps/point-of-sale/package.json apps/point-of-sale/
COPY ./package.json ./package-lock.json ./
COPY ./.git ./
RUN npm install
COPY apps/point-of-sale/ apps/point-of-sale/
RUN npm run build --workspace=sudosos-point-of-sale
Expand Down
2 changes: 0 additions & 2 deletions apps/point-of-sale/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
/// <reference types="vite/client" />
declare const __GIT_BRANCH__: string;
declare const __GIT_COMMIT__: string;
15 changes: 0 additions & 15 deletions apps/point-of-sale/src/components/GitInfo.vue

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="container-grid-wrapper flex-1 h-full mb-3 pr-6 mr-3 mt-2" ref="wrapper">
<div class="container gap-3 pr-5">
<div class="container-grid-wrapper flex-1 h-full mb-3 mr-3">
<div class="container grid gap-2 pr-5 pb-3">
<ProductComponent
v-for="product in sortedProducts"
:key="`${product.product.id}-${product.container.id}`"
Expand Down Expand Up @@ -39,15 +39,13 @@ const props = defineProps({
});
const searchQuery = ref(props.searchQuery);
const wrapper = ref();
watch(() => props.searchQuery, (newValue) => {
searchQuery.value = newValue;
}, { immediate: true });
const getFilteredProducts = () => {
if (!props.pointOfSale) return [];
wrapper.value?.scrollTo(0, 0);
let filteredProducts = props.pointOfSale.containers.flatMap((container) => {
return container.products.map((product) => ({
Expand Down Expand Up @@ -117,7 +115,6 @@ const sortedProducts = computed(() => {
> .container {
grid-template-columns: repeat(auto-fill, minmax($product-column-width, 1fr));
display: grid;
}
}
</style>
2 changes: 1 addition & 1 deletion apps/point-of-sale/src/components/ProductComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const startFlyingAnimation = async () => {
}
.product-card {
padding: 0 0 8px 0;
padding: 1rem 0 8px 0;
height: fit-content;
border-radius: $border-radius;
overflow: hidden;
Expand Down
4 changes: 2 additions & 2 deletions apps/point-of-sale/src/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
--gewis-red: rgba(212, 0, 0, 1);
--gewis-dark-red: #c40000;
/* Product card width */
--product-card-width: 128px;
--product-card-width: 160px;
--accent-color: rgba(212, 0, 0, 1);
}

Expand All @@ -32,7 +32,7 @@ $border-radius-sm: 10px;
$border-radius-xs: 5px;

/* Products */
$product-column-width: 128px;
$product-column-width: 160px;
$product-card-size: 128px;
$product-price-height: 15px;

Expand Down
2 changes: 0 additions & 2 deletions apps/point-of-sale/src/views/LoginView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
</div>
</div>
<SettingsIconComponent />
<GitInfo/>
<EanLoginComponent :handle-login="eanLogin"/>
</template>

Expand All @@ -44,7 +43,6 @@ import { useCartStore } from '@/stores/cart.store';
import apiService from '@/services/ApiService';
import BannerComponent from '@/components/Banner/BannerComponent.vue';
import EanLoginComponent from "@/components/EanLoginComponent.vue";
import GitInfo from "@/components/GitInfo.vue";
const userStore = useUserStore();
const authStore = useAuthStore();
Expand Down
20 changes: 0 additions & 20 deletions apps/point-of-sale/vite.config.plugin-git-info.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/point-of-sale/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { fileURLToPath, URL } from 'node:url';
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import useGitInfo from "./vite.config.plugin-git-info";

// https://vitejs.dev/config/
export default defineConfig({
Expand All @@ -24,8 +23,5 @@ export default defineConfig({
},
server: {
port: 5174
},
define: {
...useGitInfo(),
}
});
Loading

0 comments on commit 4363331

Please sign in to comment.