Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/tng 1320 base url config #106

Merged
merged 7 commits into from
Aug 17, 2023
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
1 change: 0 additions & 1 deletion .env.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
NUXT_PUBLIC_BASE_URL=http://localhost:3000
NUXT_PRIVATE_API_KEY=xxxxxxxx-xxxx-xxxx-xxxxxxxx
NUXT_PRIVATE_CAAS=https://your-caas-api.e-spirit.cloud
NUXT_PRIVATE_PROJECT_ID=xxxxxxxx-xxxx-xxxx-xxxxxxxx
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/e2eTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches: [main, alpha]

env:
NUXT_PUBLIC_BASE_URL: ${{ secrets.NUXT_PUBLIC_BASE_URL }}
NUXT_PUBLIC_MODE: ${{ secrets.NUXT_PUBLIC_MODE }}
NUXT_PRIVATE_API_KEY: ${{ secrets.NUXT_PRIVATE_API_KEY }}
NUXT_PRIVATE_NAVIGATION_SERVICE: ${{ secrets.NUXT_PRIVATE_NAVIGATION_SERVICE }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ on:

env:
CI: ${{ secrets.CI }}
NUXT_PUBLIC_BASE_URL: ${{ secrets.NUXT_PUBLIC_BASE_URL }}
NUXT_PUBLIC_MODE: ${{ secrets.NUXT_PUBLIC_MODE }}
NUXT_PRIVATE_API_KEY: ${{ secrets.NUXT_PRIVATE_API_KEY }}
NUXT_PRIVATE_NAVIGATION_SERVICE: ${{ secrets.NUXT_PRIVATE_NAVIGATION_SERVICE }}
NUXT_PRIVATE_CAAS: ${{ secrets.NUXT_PRIVATE_CAAS }}
NUXT_PRIVATE_PROJECT_ID: ${{ secrets.NUXT_PRIVATE_PROJECT_ID }}
NUXT_PRIVATE_TENANT_ID: ${{ secrets.NUXT_PRIVATE_TENANT_ID }}


jobs:
release:
runs-on: ubuntu-latest
Expand Down
27 changes: 22 additions & 5 deletions app.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
import { LogLevel } from 'fsxa-api'
import { AppFileConfig } from './types'
declare module 'nuxt/schema' {
interface AppConfig {
defaultLocale?: string
logLevel?: LogLevel
devMode?: boolean
contentMode?: 'preview' | 'release'
snapUrl?: string
maxReferenceDepth?: number
remotes?: Record<
string,
{
id: string
locale: string
}
>
enableEventStream?: boolean
pathToServerAccessControlConfig?: string // EXPERIMENTAL optional path to file that exports server access control
pathToClientAccessControlConfig?: string // EXPERIMENTAL optional path to file that exports client access conrtol
}
}

const appConfig: AppFileConfig = {
export default defineAppConfig({
logLevel: LogLevel.WARNING,
devMode: false,
defaultLocale: 'de_DE',
enableEventStream: false
}

export default defineAppConfig(appConfig)
})
4 changes: 2 additions & 2 deletions components/AppLayout/LanguageSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<div
data-testid="languagesDropdown"
class="absolute top-10 right-0 hidden divide-y bg-white shadow-lg group-hover:block"
class="absolute right-0 top-10 hidden divide-y bg-white shadow-lg group-hover:block"
>
<ul>
<li v-for="locale of allLocales" :key="locale.identifier">
Expand All @@ -28,7 +28,7 @@
:class="{
underline: locale.identifier === activeLocale
}"
class="w-full py-3 px-4 hover:bg-gray-200"
class="w-full px-4 py-3 hover:bg-gray-200"
@click="changeLanguage(locale.identifier)"
>
{{ locale.name }}
Expand Down
6 changes: 3 additions & 3 deletions components/AppLayout/MobileNavigation.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div
class="fixed inset-0 top-0 left-0 -z-10 w-full border bg-white pt-16 text-gray-800"
class="fixed inset-0 left-0 top-0 -z-10 w-full border bg-white pt-16 text-gray-800"
data-testid="mobileNavigation"
>
<div class="container mx-auto h-screen w-full bg-white p-2">
Expand All @@ -11,7 +11,7 @@
:key="navItem?.id"
class="w-full"
>
<div class="flex items-center justify-between py-3 px-2 font-bold">
<div class="flex items-center justify-between px-2 py-3 font-bold">
<InternalLink :nav-item="navItem" @click="emit('close')" />
<button
v-if="
Expand Down Expand Up @@ -53,7 +53,7 @@
<li
v-for="subNavItem of getSubNavigation(navItem)"
:key="subNavItem?.id"
class="w-full py-3 px-2"
class="w-full px-2 py-3"
>
<InternalLink :nav-item="subNavItem" @click="emit('close')" />
</li>
Expand Down
4 changes: 2 additions & 2 deletions components/AppLayout/Navigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<InternalLink :nav-item="navItem" />
<ul
v-if="getSubNavigation(navItem).length > 0"
class="absolute top-6 right-0 hidden divide-y bg-white shadow-lg group-hover:block"
class="absolute right-0 top-6 hidden divide-y bg-white shadow-lg group-hover:block"
>
<li
v-for="subNavItem of getSubNavigation(navItem)"
:key="subNavItem?.id"
class="w-full py-3 px-4"
class="w-full px-4 py-3"
>
<InternalLink :nav-item="subNavItem" />
</li>
Expand Down
4 changes: 2 additions & 2 deletions components/Dev.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div
class="absolute top-0 right-0 z-20 bg-white"
class="absolute right-0 top-0 z-20 bg-white"
:class="{ 'z-40': devComponentVisible }"
>
<div>
Expand All @@ -25,7 +25,7 @@

<div
v-if="devComponentVisible"
class="fixed top-1/2 left-1/2 z-20 flex h-4/5 w-full max-w-4xl -translate-y-1/2 -translate-x-1/2 transform flex-col rounded-lg border bg-white shadow"
class="fixed left-1/2 top-1/2 z-20 flex h-4/5 w-full max-w-4xl -translate-x-1/2 -translate-y-1/2 transform flex-col rounded-lg border bg-white shadow"
>
<div class="flex p-4 text-gray-800">
<div>
Expand Down
2 changes: 1 addition & 1 deletion components/Section/FeaturedProducts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/>
<div class="w-1/3 text-gray-400 sm:px-2 md:px-8">
<h2
class="mt-4 ml-4 text-4xl uppercase"
class="ml-4 mt-4 text-4xl uppercase"
data-preview-id="#st_featured_products_title"
>
{{ data.st_featured_products_title }}
Expand Down
2 changes: 1 addition & 1 deletion components/Section/ProductCategory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</div>
<ElementsImage
v-if="product.data['tt_teaser_image']"
class="absolute top-0 left-0 h-40 w-full object-cover"
class="absolute left-0 top-0 h-40 w-full object-cover"
:image="product.data['tt_teaser_image']"
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/server/api/[endpoint].post.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ComparisonQueryOperatorEnum } from 'fsxa-api'
import { ServerErrors, FSXAProxyRoutes, FSXAApiErrors } from '~/types'
import { ServerErrors, FSXAProxyRoutes, FSXAApiErrors } from '../../../../types'

const baseURL = Cypress.env('cyBaseURL')

Expand Down
4 changes: 0 additions & 4 deletions docs/pages/Configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ We distinguish between preview and release data. This is the traditional FirstSp
=== CI
We use husky to enforce branch protection rules to prevent direct commits and pushes to the main branch. On your local machine this variable is not needed, but in your CI it can be set to 1 to allow the semantic release plugin to do releases. This is done automatically by Github.

=== NUXT_PUBLIC_BASE_URL `string` (_optional_ but recommended)

Default is set to `http://localhost:3000`.

=== NUXT_PUBLIC_SNAP_URL `string` (_optional_ but recommended)

Snap Library is an external dependency which offers a lot of LiveEdit features in the authoring environment to edit sections, images, datasets, etc. in place.
Expand Down
4 changes: 1 addition & 3 deletions docs/pages/CustomSitemap.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ import { FSXAApiSingleton } from "fsxa-api";

export default defineEventHandler(async (event) => {
const remoteApi = FSXAApiSingleton.instance;
const {
public: { baseURL },
} = useRuntimeConfig();
const baseURL = getRequestURL(event).origin
const navigationData = await remoteApi.fetchNavigation({ locale: "de_DE" });
const seoRoutes = Object.keys(navigationData?.seoRouteMap || []);
const xmlString = `<?xml version="1.0" encoding="UTF-8"?>
Expand Down
2 changes: 0 additions & 2 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ export default defineNuxtConfig({
// if you want to override the values during runtime
// they need to be: NUXT_PUBLIC_<KEY> or NUXT_PRIVATE_<KEY>, where KEY is the capitalized key of the object key (logLevel -> NUXT_PUBLIC_LOG_LEVEL)
// If you change baseUrl: process.env['NUXT_PUBLIC_SOMETHING_ELSE'], setting NUXT_PUBLIC_SOMETHING_ELSE will only work during build time
// During runtime, you need to use NUXT_PUBLIC_BASE_URL.
public: {
baseURL: process.env['NUXT_PUBLIC_BASE_URL'] || 'http://localhost:3000',
logLevel: process.env['NUXT_PUBLIC_LOG_LEVEL'],
mode: process.env['NUXT_PUBLIC_MODE'],
snapUrl: process.env['NUXT_PUBLIC_SNAP_URL'],
Expand Down
Loading