Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7ba8414

Browse filesBrowse files
committed
feature(deploy) update test job in deployment script
1 parent 909e298 commit 7ba8414
Copy full SHA for 7ba8414

File tree

Expand file treeCollapse file tree

8 files changed

+224
-5
lines changed
Filter options
Expand file treeCollapse file tree

8 files changed

+224
-5
lines changed

‎.github/workflows/deploy-int.yaml

Copy file name to clipboardExpand all lines: .github/workflows/deploy-int.yaml
+13-1Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ env:
1212
jobs:
1313
test-application:
1414
runs-on: ubuntu-latest
15+
services:
16+
mysql:
17+
image: mysql:8.0.30
18+
ports:
19+
- "3306:3306"
20+
env:
21+
MYSQL_ROOT_PASSWORD: pw
22+
MYSQL_DATABASE: fullstackjack
23+
MYSQL_USER: jack
24+
MYSQL_PASSWORD: 12345678
25+
env:
26+
DATABASE_URL: mysql://root:pw@localhost:3306/fullstackjack
1527
steps:
1628
- uses: actions/checkout@v3
1729
- name: Test Application
@@ -22,7 +34,7 @@ jobs:
2234
- run: |
2335
yarn
2436
yarn build
25-
yarn test
37+
yarn ci:test
2638
2739
create-deployment-artifacts:
2840
needs: test-application

‎components/layout/navbar.vue

Copy file name to clipboardExpand all lines: components/layout/navbar.vue
+20-2Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,18 @@ watch(user, async () => {
6666
Videos
6767
</span>
6868
</nuxt-link>
69-
<nuxt-link to="/tutorials/overview">
69+
<nuxt-link to="/tutorials">
7070
<span
7171
class="text-base font-medium text-gray-500 dark:text-gray-200 hover:text-gray-900 dark:hover:text-gray-300 ">
7272
Tutorials
7373
</span>
7474
</nuxt-link>
75+
<nuxt-link to="/articles/overview">
76+
<span
77+
class="text-base font-medium text-gray-500 dark:text-gray-200 hover:text-gray-900 dark:hover:text-gray-300 ">
78+
Articles
79+
</span>
80+
</nuxt-link>
7581
<nuxt-link to="/ask-jack/search">
7682
<span
7783
class="text-base font-medium text-gray-500 dark:text-gray-200 hover:text-gray-900 dark:hover:text-gray-300 ">
@@ -245,7 +251,7 @@ watch(user, async () => {
245251
</NuxtLink>
246252
</li>
247253
<li>
248-
<NuxtLink to="/tutorials/overview"
254+
<NuxtLink to="/tutorials"
249255
class="flex items-center p-2 text-base font-normal text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700">
250256
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
251257
stroke="currentColor" class="w-6 h-6">
@@ -256,6 +262,18 @@ watch(user, async () => {
256262
<span class="flex-1 ml-3 whitespace-nowrap">Tutorials</span>
257263
</NuxtLink>
258264
</li>
265+
<li>
266+
<NuxtLink to="/articles"
267+
class="flex items-center p-2 text-base font-normal text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700">
268+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
269+
stroke="currentColor" class="w-6 h-6">
270+
<path stroke-linecap="round" stroke-linejoin="round"
271+
d="M12 7.5h1.5m-1.5 3h1.5m-7.5 3h7.5m-7.5 3h7.5m3-9h3.375c.621 0 1.125.504 1.125 1.125V18a2.25 2.25 0 01-2.25 2.25M16.5 7.5V18a2.25 2.25 0 002.25 2.25M16.5 7.5V4.875c0-.621-.504-1.125-1.125-1.125H4.125C3.504 3.75 3 4.254 3 4.875V18a2.25 2.25 0 002.25 2.25h13.5M6 7.5h3v3H6v-3z" />
272+
</svg>
273+
274+
<span class="flex-1 ml-3 whitespace-nowrap">Articles</span>
275+
</NuxtLink>
276+
</li>
259277
<li>
260278
<NuxtLink to="/ask-jack/search"
261279
class="flex items-center p-2 text-base font-normal text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700">

‎pages/tutorials/[...slug].vue renamed to ‎pages/articles/[...slug].vue

Copy file name to clipboardExpand all lines: pages/articles/[...slug].vue
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<div>
77
<nuxt-link
88
class="block cursor-pointer max-w-2xl "
9-
href="/tutorials/overview"
9+
href="/articles/overview"
1010
>
1111
<svg
1212
xmlns="http://www.w3.org/2000/svg"

‎pages/tutorials/overview.vue renamed to ‎pages/articles/overview.vue

Copy file name to clipboardExpand all lines: pages/articles/overview.vue
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ definePageMeta({
1111
<main class="flex justify-center w-100 my-10">
1212

1313

14-
<ContentList path="/tutorials" v-slot="{ list }">
14+
<ContentList path="/articles" v-slot="{ list }">
1515

1616
{{list.article}}
1717
<div class="flex flex-col justify-center w-100">

‎pages/tutorials/[name].vue

Copy file name to clipboard
+163Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
<script setup lang="ts">
2+
import { Series, Video, Topic } from ".prisma/client";
3+
import getParam from "~/composables/getParam";
4+
5+
definePageMeta({
6+
layout: 'mobile-only',
7+
});
8+
9+
const setColorTheme = (newTheme: Theme) => {
10+
useColorMode().preference = newTheme
11+
}
12+
13+
const route = useRoute()
14+
15+
type topicData = {
16+
series: Series[]
17+
videos: Video[]
18+
topic: Topic
19+
}
20+
21+
const topicName = getParam('name') as string
22+
const { data, pending } = await useFetch<topicData>(`/api/topic/${topicName}`, { key: route.fullPath })
23+
const videoPlaceholderElement = ref(null)
24+
const videoWrapper = ref(null)
25+
const loading = ref(true)
26+
const activeVideo = ref(data.value?.videos[0])
27+
28+
function setActive(video: Video) {
29+
activeVideo.value = video
30+
31+
const htmlString = `<div class="video__youtube" :id="${activeVideo.value.host_id}">
32+
<img src="https://i.ytimg.com/vi/${activeVideo.value.host_id}/maxresdefault.jpg"
33+
class="block object-cover object-center lg:rounded-lg w-full min-w-200 aspect-video mb-10 p-0"
34+
alt="video thumbnail" />
35+
</div>
36+
`
37+
videoWrapper.value.innerHTML = htmlString;
38+
}
39+
40+
function isActive(video: Video) {
41+
return video.host_id == activeVideo.value.host_id
42+
}
43+
44+
function createIframe(vidId: string) {
45+
const url = 'https://www.youtube.com/embed/' + vidId + '?autoplay=1'
46+
const htmlString = `<iframe class="mt-5 block object-cover object-center lg:rounded-lg w-full min-w-200 aspect-video mb-10 p-0" src="${url}" allowfullscreen allow="autoplay"></iframe>`
47+
48+
videoWrapper.value.innerHTML = htmlString;
49+
}
50+
51+
onMounted(() => {
52+
if(data.value?.videos[0]) {
53+
setActive(data.value?.videos[0])
54+
loading.value = false
55+
console.log('is loading: ',loading.value)
56+
}
57+
})
58+
59+
</script>
60+
61+
<template>
62+
63+
<div v-if="data" class="md:flex dark:bg-slate-900">
64+
<aside class=" hidden md:block pl-10 pr-10 text-left h-screen w-1/4 dark:bg-slate-900">
65+
<div class="text-gray-800 dark:text-gray-100 text-xl">
66+
<div class="p-2.5 mt-1 flex items-center">
67+
<NuxtLink to="/">
68+
<img class="h-20" src="/img/logo_clear_fsj.png" alt="full stack jack logo">
69+
<h1 class="font-bold text-gray-800 dark:text-gray-200 text-[15px]">Full Stack Jack</h1>
70+
</NuxtLink>
71+
</div>
72+
<div>
73+
74+
<span class="hidden md:block " @click="setColorTheme($colorMode.preference == 'dark' ? 'light' : 'dark')">
75+
<svg v-if="$colorMode.value == 'dark'" xmlns="http://www.w3.org/2000/svg"
76+
class="h-6 w-6 text-gray-50 hidden lg:block" viewBox="0 0 20 20" fill="currentColor">
77+
<path d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z" />
78+
</svg>
79+
<svg v-if="$colorMode.value == 'light'" xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 hidden lg:block"
80+
viewBox="0 0 20 20" fill="currentColor">
81+
<path fill-rule="evenodd"
82+
d="M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z"
83+
clip-rule="evenodd" />
84+
</svg>
85+
</span>
86+
87+
</div>
88+
<div class="my-2 bg-gray-600 h-[1px]"></div>
89+
</div>
90+
<div>
91+
<img class="h-16" :src="data?.topic.image" v-if="data?.topic.image !== '/img/nuxt3.svg'" alt="nuxt 3 logo">
92+
<svg v-if="data?.topic.image == '/img/nuxt3.svg'" viewBox="0 0 221 65" fill="none"
93+
xmlns="http://www.w3.org/2000/svg" class="h-26 mr-5">
94+
<g clip-path="url(#a)">
95+
<path fill="currentColor"
96+
d="M82.5623 18.5705h7.3017l15.474 24.7415V18.5705h6.741v35.0576h-7.252L89.3025 28.938v24.6901h-6.7402V18.5705ZM142.207 53.628h-6.282v-3.916c-1.429 2.7559-4.339 4.3076-8.015 4.3076-5.822 0-9.603-4.1069-9.603-10.0175V28.3847h6.282v14.3251c0 3.4558 2.146 5.8592 5.362 5.8592 3.524 0 5.974-2.7044 5.974-6.4099V28.3847h6.282V53.628ZM164.064 53.2289l-6.026-8.4144-6.027 8.4144h-6.69l9.296-13.1723-8.58-12.0709h6.843l5.158 7.2641 5.106-7.2641h6.895l-8.632 12.0709 9.295 13.1723h-6.638ZM183.469 20.7726v7.6116h7.149v5.1593h-7.149v12.5311c0 .4208.17.8245.473 1.1223.303.2978.715.4654 1.144.4661h5.532v5.9547h-4.137c-5.617 0-9.293-3.2062-9.293-8.8109V33.5484h-5.056v-5.1642h3.172c1.479 0 2.34-.8639 2.34-2.2932v-5.3184h5.825Z">
97+
</path>
98+
<path fill-rule="evenodd" clip-rule="evenodd"
99+
d="M30.1185 11.5456c-1.8853-3.24168-6.5987-3.24169-8.484 0L1.08737 46.8747c-1.885324 3.2417.47133 7.2938 4.24199 7.2938H21.3695c-1.6112-1.4081-2.2079-3.8441-.9886-5.9341l15.5615-26.675-5.8239-10.0138Z"
100+
fill="#80EEC0"></path>
101+
<path
102+
d="M43.1374 19.2952c1.5603-2.6523 5.461-2.6523 7.0212 0l17.0045 28.9057c1.5603 2.6522-.39 5.9676-3.5106 5.9676h-34.009c-3.1206 0-5.0709-3.3154-3.5106-5.9676l17.0045-28.9057ZM209.174 53.8005H198.483c0-1.8514.067-3.4526 0-6.0213h10.641c1.868 0 3.353.1001 4.354-.934 1-1.0341 1.501-2.3351 1.501-3.9029 0-1.8347-.667-3.2191-2.002-4.1532-1.301-.9674-2.985-1.4511-5.054-1.4511h-2.601v-5.2539h2.652c1.701 0 3.119-.4003 4.253-1.2009 1.134-.8006 1.701-1.9849 1.701-3.5527 0-1.301-.434-2.3351-1.301-3.1023-.834-.8007-2.001-1.201-3.503-1.201-1.634 0-2.918.4837-3.853 1.4511-.9.9674-1.401 2.1517-1.501 3.5527h-6.254c.133-3.2358 1.251-5.7877 3.352-7.6558 2.135-1.868 4.887-2.8021 8.256-2.8021 2.402 0 4.42.4337 6.055 1.301 1.668.834 2.919 1.9515 3.753 3.3525.867 1.4011 1.301 2.9523 1.301 4.6536 0 1.9681-.551 3.636-1.651 5.0037-1.068 1.3344-2.402 2.235-4.004 2.7021 1.969.4003 3.57 1.3677 4.804 2.9022 1.234 1.5011 1.852 3.4025 1.852 5.7043 0 1.9347-.468 3.7028-1.402 5.304-.934 1.6012-2.301 2.8855-4.103 3.8529-1.768.9674-3.953 1.4511-6.555 1.4511Z"
103+
fill="#00DC82"></path>
104+
</g>
105+
<defs>
106+
<clipPath id="a">
107+
<path fill="#fff" d="M0 0h221v65H0z"></path>
108+
</clipPath>
109+
</defs>
110+
</svg>
111+
</div>
112+
<div
113+
class="p-2.5 mt-3 flex items-center rounded-md px-4 duration-300 cursor-pointer hover:bg-green-600 text-white"
114+
onclick="dropdown()">
115+
<i class="bi bi-chat-left-text-fill"></i>
116+
<div class="flex justify-between w-full items-center">
117+
<span class="text-sm rotate-180" id="arrow">
118+
<i class="bi bi-chevron-down"></i>
119+
</span>
120+
</div>
121+
</div>
122+
<ul class="text-left mx-auto text-gray-800 dark:text-gray-200 font-bold">
123+
<li class="cursor-pointer p-2 hover:bg-green-400 rounded-md mt-1" :class="{ 'bg-green-600': isActive(video) }"
124+
@click="setActive(video)" v-for="video in data?.videos">
125+
{{ video.title }}
126+
</li>
127+
</ul>
128+
</aside>
129+
<div class="w-screen pt-0 mt-0" v-if="!pending && data">
130+
131+
<section v-if="activeVideo" class="overflow-hidden text-gray-700">
132+
<div class=" w-full min-w-200 ">
133+
<div class="clickable" @click="createIframe(activeVideo.host_id)" ref="videoWrapper">
134+
<div class="video__youtube" :id="activeVideo.host_id">
135+
<img src="https://i.ytimg.com/vi/${activeVideo.value.host_id}/maxresdefault.jpg"
136+
class="block object-cover object-center lg:rounded-lg w-full min-w-200 aspect-video mb-10 p-0"
137+
alt="video thumbnail" />
138+
</div>
139+
</div>
140+
</div>
141+
</section>
142+
<!-- <section v-else>
143+
loading. . . . {{loading}}
144+
</section> -->
145+
146+
</div>
147+
<div class="md:hidden">
148+
<ul class="mx-auto text-left mx-auto text-gray-800 dark:text-gray-200 font-bold">
149+
<li class="cursor-pointer p-2 hover:bg-green-600 rounded-md mt-1" @click="setActive(video)"
150+
v-for="video in data?.videos">
151+
{{ video.title }}
152+
</li>
153+
</ul>
154+
</div>
155+
</div>
156+
157+
</template>
158+
159+
<style>
160+
.clickable {
161+
cursor: pointer;
162+
}
163+
</style>

‎pages/tutorials/index.vue

Copy file name to clipboard
+26Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<script setup lang="ts">
2+
import TopicCard from "~~/components/elements/TopicCard.vue";
3+
const route = useRoute()
4+
const { data: rows } = await useFetch('/api/topics', { key: route.fullPath })
5+
</script>
6+
7+
<template>
8+
<div>
9+
<div v-if="rows">
10+
<div aria-label="group of cards" tabindex="0" class="py-8 w-full ">
11+
<div v-for="row in rows" class="lg:flex items-center justify-center w-full">
12+
<div v-for="topic in row" aria-label=""
13+
class="lg:w-4/12 lg:m-7 md:h-108 lg:mb-0 mb-7 dark:bg-gray-800 bg-white
14+
p-6 shadow rounded transition duration-500 hover:scale-110 dark:hover:shadow-xl hover:shadow-xl" :class="
15+
{
16+
'hover:dark:shadow-green-400 hover:shadow-green-400': topic.accentColor == 'green',
17+
'hover:dark:shadow-red-400 hover:shadow-red-400': topic.accentColor == 'red',
18+
'hover:dark:shadow-indigo-400 hover:shadow-indigo-400': topic.accentColor == 'indigo',
19+
}">
20+
<TopicCard :topic="topic" />
21+
</div>
22+
</div>
23+
</div>
24+
</div>
25+
</div>
26+
</template>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.