Skip to content

Commit

Permalink
Merge pull request #253 from KenEucker/develop
Browse files Browse the repository at this point in the history
Adds Search
  • Loading branch information
KenEucker authored May 4, 2024
2 parents 25fbb96 + 6b640ec commit a885de0
Show file tree
Hide file tree
Showing 48 changed files with 526 additions and 352 deletions.
4 changes: 2 additions & 2 deletions functions/achievements-background.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Handler } from '@netlify/functions'
import BikeTagClient from 'biketag'
import { Achievement, Game, Player, Tag } from 'biketag/dist/common/schema'
import { getSupportedGames } from '../src/common/utils'
import { getSupportedGames } from '../src/common'
import { getBikeTagClientOpts } from './common'
import { HttpStatusCode } from './common/constants'
import { getBikeTagClientOpts } from './common/methods'
import { BackgroundProcessResults } from './common/types'

export const assignAchievements = async (): Promise<BackgroundProcessResults> => {
Expand Down
2 changes: 1 addition & 1 deletion functions/achievements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BikeTagClient } from 'biketag'
import { getAchievementsPayload } from 'biketag/dist/common/payloads'
import { Game } from 'biketag/dist/common/schema'
import request from 'request'
import { getBikeTagClientOpts, getPayloadOpts } from './common/methods'
import { getBikeTagClientOpts, getPayloadOpts } from './common'

const achievementsHandler: Handler = async (event) => {
const biketagOpts = getBikeTagClientOpts(
Expand Down
2 changes: 1 addition & 1 deletion functions/ambassadors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BikeTagClient } from 'biketag'
import { getAmbassadorsPayload } from 'biketag/dist/common/payloads'
import { Game } from 'biketag/dist/common/schema'
import request from 'request'
import { getBikeTagClientOpts, getPayloadOpts } from './common/methods'
import { getBikeTagClientOpts, getPayloadOpts } from './common'

const ambassadorsHandler: Handler = async (event) => {
const biketagOpts = getBikeTagClientOpts(
Expand Down
16 changes: 8 additions & 8 deletions functions/approve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { Handler } from '@netlify/functions'
import { BikeTagClient } from 'biketag'
import { Game } from 'biketag/dist/common/schema'
import request from 'request'
import { HttpStatusCode } from './common/constants'
import {
acceptCorsHeaders,
getActiveQueueForGame,
getBikeTagClientOpts,
getPayloadOpts,
getProfileAuthorization,
setNewBikeTagPost,
} from './common/methods'
acceptCorsHeaders,
getActiveQueueForGame,
getBikeTagClientOpts,
getPayloadOpts,
getProfileAuthorization,
setNewBikeTagPost,
} from './common'
import { HttpStatusCode } from './common/constants'

const approveHandler: Handler = async (event) => {
/// Bailout on OPTIONS requests
Expand Down
2 changes: 1 addition & 1 deletion functions/authorize.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { builder, Handler } from '@netlify/functions'
import { BikeTagClient } from 'biketag'
import request from 'request'
import { getBikeTagClientOpts, getBikeTagHash, getPayloadOpts } from './common'
import { HttpStatusCode } from './common/constants'
import { getBikeTagClientOpts, getBikeTagHash, getPayloadOpts } from './common/methods'

const authorizeHandler: Handler = async (event) => {
const {
Expand Down
12 changes: 6 additions & 6 deletions functions/autopost-background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { Handler } from '@netlify/functions'
import BikeTagClient from 'biketag'
import { Game } from 'biketag/dist/common/schema'
import request from 'request'
import { HttpStatusCode } from './common/constants'
import {
getActiveQueueForGame,
getBikeTagClientOpts,
getWinningTagForCurrentRound,
setNewBikeTagPost,
} from './common/methods'
getActiveQueueForGame,
getBikeTagClientOpts,
getWinningTagForCurrentRound,
setNewBikeTagPost,
} from './common'
import { HttpStatusCode } from './common/constants'
import { BackgroundProcessResults } from './common/types'

export const autoPostNewBikeTags = async (): Promise<BackgroundProcessResults> => {
Expand Down
4 changes: 2 additions & 2 deletions functions/autopost-clear.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Handler } from '@netlify/functions'
import BikeTagClient from 'biketag'
import { Game } from 'biketag/dist/common/schema'
import { HttpStatusCode } from './common/constants'
import {
archiveAndClearQueue,
getActiveQueueForGame,
getBikeTagClientOpts,
isRequestAllowed,
} from './common/methods'
} from './common'
import { HttpStatusCode } from './common/constants'
import { BackgroundProcessResults } from './common/types'

export const autoClearQueue = async (event): Promise<BackgroundProcessResults> => {
Expand Down
10 changes: 5 additions & 5 deletions functions/autopost-notify.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Handler } from '@netlify/functions'
import BikeTagClient from 'biketag'
import { Game } from 'biketag/dist/common/schema'
import { HttpStatusCode } from './common/constants'
import {
getBikeTagClientOpts,
isRequestAllowed,
sendNewBikeTagNotifications,
} from './common/methods'
getBikeTagClientOpts,
isRequestAllowed,
sendNewBikeTagNotifications,
} from './common'
import { HttpStatusCode } from './common/constants'
import { BackgroundProcessResults } from './common/types'

export const autoNotifyNewBikeTagPosted = async (event): Promise<BackgroundProcessResults> => {
Expand Down
4 changes: 4 additions & 0 deletions functions/common/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './constants'
export * from './methods'
export * from './types'

4 changes: 2 additions & 2 deletions functions/common/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import nodemailer from 'nodemailer'
import { extname, join } from 'path'
import qs from 'qs'
import request from 'request'
import { BikeTagProfile } from '../../src/common/types'
import {
getDomainInfo,
getImgurImageSized,
getTagDate,
isAuthenticationEnabled,
} from '../../src/common/utils'
} from '../../src/common'
import { BikeTagProfile } from '../../src/common/types'
import { ErrorMessage, HttpStatusCode } from './constants'
import { BackgroundProcessResults, activeQueue } from './types'

Expand Down
4 changes: 2 additions & 2 deletions functions/current.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import axios from 'axios'
import { BikeTagClient } from 'biketag'
import { Game } from 'biketag/dist/common/schema'
import request from 'request'
import { getDomainInfo, getImgurImageSized } from '../src/common/utils'
import { getDomainInfo, getImgurImageSized } from '../src/common'
import { getBikeTagClientOpts, getPayloadOpts } from './common'
import { HttpStatusCode } from './common/constants'
import { getBikeTagClientOpts, getPayloadOpts } from './common/methods'

const currentTagHandler = async (event) => {
const biketagOpts = getBikeTagClientOpts(
Expand Down
2 changes: 1 addition & 1 deletion functions/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { builder, Handler } from '@netlify/functions'
import { BikeTagClient } from 'biketag'
import { getGamePayload } from 'biketag/dist/common/payloads'
import request from 'request'
import { getBikeTagClientOpts, getPayloadOpts } from './common/methods'
import { getBikeTagClientOpts, getPayloadOpts } from './common'

const gameHandler: Handler = async (event) => {
const biketagOpts = getBikeTagClientOpts(
Expand Down
2 changes: 1 addition & 1 deletion functions/players.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BikeTagClient } from 'biketag'
import { getPlayersPayload } from 'biketag/dist/common/payloads'
import { Game } from 'biketag/dist/common/schema'
import request from 'request'
import { getBikeTagClientOpts, getPayloadOpts } from './common/methods'
import { getBikeTagClientOpts, getPayloadOpts } from './common'

const playersHandler: Handler = async (event) => {
const biketagOpts = getBikeTagClientOpts(
Expand Down
6 changes: 3 additions & 3 deletions functions/profile.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Handler } from '@netlify/functions'
import { getDomainInfo } from '../src/common/utils'
import { ErrorMessage, HttpStatusCode } from './common/constants'
import { getDomainInfo } from '../src/common'
import {
acceptCorsHeaders,
getBikeTagAuth0Profile,
getBikeTagPlayerProfile,
getProfileAuthorization,
handleAuth0ProfileRequest,
} from './common/methods'
} from './common'
import { ErrorMessage, HttpStatusCode } from './common/constants'

const profileHandler: Handler = async (event) => {
/// Bailout on OPTIONS requests
Expand Down
2 changes: 1 addition & 1 deletion functions/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BikeTagClient } from 'biketag'
import { getQueuePayload } from 'biketag/dist/common/payloads'
import { Game } from 'biketag/dist/common/schema'
import request from 'request'
import { getBikeTagClientOpts, getPayloadOpts } from './common/methods'
import { getBikeTagClientOpts, getPayloadOpts } from './common'

const queueHandler: Handler = async (event) => {
const biketagOpts = getBikeTagClientOpts(
Expand Down
2 changes: 1 addition & 1 deletion functions/recent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BikeTagClient } from 'biketag'
import { getTagsPayload } from 'biketag/dist/common/payloads'
import { Game } from 'biketag/dist/common/schema'
import request from 'request'
import { getBikeTagClientOpts, getPayloadOpts } from './common/methods'
import { getBikeTagClientOpts, getPayloadOpts } from './common'

const recentHandler: Handler = async (event) => {
const response = {
Expand Down
2 changes: 1 addition & 1 deletion functions/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BikeTagClient } from 'biketag'
import { getSettingsPayload } from 'biketag/dist/common/payloads'
import { Game } from 'biketag/dist/common/schema'
import request from 'request'
import { getBikeTagClientOpts, getPayloadOpts } from './common/methods'
import { getBikeTagClientOpts, getPayloadOpts } from './common'

const setttingsHandler: Handler = async (event) => {
const biketagOpts = getBikeTagClientOpts(
Expand Down
16 changes: 8 additions & 8 deletions functions/submission-created.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { BikeTagClient } from 'biketag'
import { Ambassador, Game, Tag } from 'biketag/dist/common/schema'
import request from 'request'
import { stringifyNumber } from '../src/common/utils'
import { HttpStatusCode } from './common/constants'
import { stringifyNumber } from '../src/common'
import {
defaultLogo,
getBikeTagClientOpts,
getEncodedExpiry,
getSanityImageUrl,
sendEmailsToAmbassadors,
} from './common/methods'
defaultLogo,
getBikeTagClientOpts,
getEncodedExpiry,
getSanityImageUrl,
sendEmailsToAmbassadors,
} from './common'
import { HttpStatusCode } from './common/constants'

export const handler = async (event) => {
const body = JSON.parse(event.body)
Expand Down
2 changes: 1 addition & 1 deletion functions/tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BikeTagClient } from 'biketag'
import { getTagsPayload } from 'biketag/dist/common/payloads'
import { Game } from 'biketag/dist/common/schema'
import request from 'request'
import { getBikeTagClientOpts, getPayloadOpts } from './common/methods'
import { getBikeTagClientOpts, getPayloadOpts } from './common'

const tagsHandler: Handler = async (event) => {
const biketagOpts = getBikeTagClientOpts(
Expand Down
2 changes: 1 addition & 1 deletion functions/token.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Handler } from '@netlify/functions'
import { BikeTagClient } from 'biketag'
import request from 'request'
import { acceptCorsHeaders, getBikeTagClientOpts, getPayloadAuthorization } from './common'
import { HttpStatusCode } from './common/constants'
import { acceptCorsHeaders, getBikeTagClientOpts, getPayloadAuthorization } from './common/methods'

const tokenHandler: Handler = async (event) => {
/// Bailout on OPTIONS requests
Expand Down
13 changes: 8 additions & 5 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<meta property="og:image" :content="logo" />
</Head>
<div :class="isWhiteBackground">
<div :class="`spacer-top ${isWhiteBackground}`"></div>
<bike-tag-menu variant="top" />
<div :class="`${isNotLanding ? 'spacer-top' : 'spacer-less'} ${isWhiteBackground}`"></div>
<bike-tag-menu v-if="isNotLanding" variant="top" />
<confetti-explosion v-if="showConfetti" />
<service-worker />
<router-view />
Expand All @@ -23,12 +23,12 @@
</template>

<script setup name="App">
import { ref, inject, computed, onMounted, watch, nextTick } from 'vue'
import { useRouter } from 'vue-router'
import { useBikeTagStore } from '@/store/index'
import { useAuth0 } from '@auth0/auth0-vue'
import { debug, isAuthenticationEnabled } from './common/utils'
import { computed, inject, nextTick, onMounted, ref, watch } from 'vue'
import ConfettiExplosion from 'vue-confetti-explosion'
import { useRouter } from 'vue-router'
import { debug, isAuthenticationEnabled } from './common'
// componets
import BikeTagMenu from '@/components/BikeTagMenu.vue'
Expand Down Expand Up @@ -189,6 +189,9 @@ created()
.spacer-bottom {
margin-bottom: 50px;
}
.spacer-less {
height: 0;
}
.spacer-top {
height: 85px;
Expand Down
2 changes: 1 addition & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import 'bootstrap-vue-next/dist/bootstrap-vue-next.css'
import 'bootstrap/dist/css/bootstrap.css'
import 'highlight.js/styles/monokai.css'
import 'vue-toast-notification/dist/theme-sugar.css'
import { debug, isAuthenticationEnabled } from './common/utils'
import { debug, isAuthenticationEnabled } from './common'

class BikeTagApp {
protected emitter
Expand Down
17 changes: 16 additions & 1 deletion src/assets/styles/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,22 @@ body {
color: black;
}

.search-bar {
display: flex;
margin-bottom: 25px;

.biketag__button {
padding-inline: 15px;
min-height: auto;
background-size: contain;
color: $btn-primary-text-color;
}
}

.clear-search-button {
color: $btn-primary-text-color;
}

@keyframes spin {
from {
transform: rotate(0deg);
Expand Down Expand Up @@ -182,7 +198,6 @@ body {
font-weight: $tag-player-font-weight;
font-size: $tag-player-font-size;
line-height: $tag-player-line-height;
text-transform: uppercase;
}

.tag-date {
Expand Down
2 changes: 1 addition & 1 deletion src/common/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './constants'
export * from './methods'
export * from './types'
export * from './utils'
export * from './uuid'
2 changes: 1 addition & 1 deletion src/common/utils.ts → src/common/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
DomainInfo,
deca,
special,
} from '../../src/common'
} from '.'

export const stringifyNumber = (n: number): string => {
if (n < 20) return special[n]
Expand Down
2 changes: 1 addition & 1 deletion src/components/BikeDex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</template>

<script setup name="BikeDex">
import { getTagDate } from '@/common/utils'
import { getTagDate } from '@/common'
// props
const props = defineProps({
Expand Down
4 changes: 2 additions & 2 deletions src/components/BikeTagCamera.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
</template>

<script setup name="BikeTagCamera">
import { ref, onMounted } from 'vue'
import { exportHtmlToDownload } from '@/common/utils'
import { exportHtmlToDownload } from '@/common'
import { onMounted, ref } from 'vue'
const props = defineProps({
title: {
Expand Down
10 changes: 5 additions & 5 deletions src/components/BikeTagFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@
</template>

<script setup name="BikeTagFooter">
import { ref, computed, onBeforeUnmount, nextTick } from 'vue'
import { useRouter } from 'vue-router'
import { useBikeTagStore } from '@/store/index'
import HintIcon from '@/assets/images/hint-icon.svg'
import CloseRounded from '@/assets/images/close-rounded.svg'
import HintIcon from '@/assets/images/hint-icon.svg'
import { exportHtmlToDownload } from '@/common'
import { useBikeTagStore } from '@/store/index'
import { computed, onBeforeUnmount, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import { exportHtmlToDownload } from '@/common/utils'
import { useRouter } from 'vue-router'
// componets
import BikeTagButton from '@/components/BikeTagButton.vue'
Expand Down
Loading

0 comments on commit a885de0

Please sign in to comment.