-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Criando listagem de evento de nacoes e criando formulario para edicao…
… do evento de nacoes. Inserido os mecanismos de injeção de dependencia
- Loading branch information
1 parent
bfe625b
commit 598d819
Showing
23 changed files
with
564 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
<!doctype html> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link | ||
href="https://cdn.jsdelivr.net/npm/@mdi/[email protected]/css/materialdesignicons.min.css" | ||
rel="stylesheet" | ||
/> | ||
<meta name="color-scheme" content="dark" /> | ||
<title>Vite + Vue + TS</title> | ||
</head> | ||
<body> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,25 @@ | ||
<template> | ||
<v-layout class="rounded rounded-md"> | ||
<sidebar-component></sidebar-component> | ||
<header-component></header-component> | ||
|
||
|
||
|
||
|
||
<v-main> | ||
<v-container> | ||
|
||
<router-view></router-view> | ||
</v-container> | ||
</v-main> | ||
</v-layout> | ||
</template> | ||
<template> | ||
<v-layout class="rounded rounded-md"> | ||
<sidebar-component></sidebar-component> | ||
<header-component></header-component> | ||
<v-main> | ||
<v-container> | ||
<router-view></router-view> | ||
</v-container> | ||
</v-main> | ||
</v-layout> | ||
</template> | ||
|
||
<style scoped></style> | ||
<script lang="ts"> | ||
import { defineComponent } from 'vue'; | ||
import SidebarComponent from './components/sidebar/sidebar.component.vue' | ||
import HeaderComponent from './components/header/header.component.vue' | ||
import SidebarComponent from './components/sidebar/sidebar.component.vue'; | ||
import HeaderComponent from './components/header/header.component.vue'; | ||
export default defineComponent({ | ||
components: { | ||
SidebarComponent, | ||
HeaderComponent | ||
} | ||
}) | ||
HeaderComponent, | ||
}, | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,30 @@ | ||
<template> | ||
|
||
<!-- <v-navigation-drawer theme="dark" permanent rail> | ||
<v-divider></v-divider> | ||
<v-list density="compact" nav> | ||
<v-list-item prepend-avatar="https://cdn.vuetifyjs.com/images/cards/house.jpg" value="house" | ||
nav></v-list-item> | ||
<v-list-item prepend-avatar="https://cdn.vuetifyjs.com/images/cards/road.jpg" value="road" | ||
nav></v-list-item> | ||
<v-list-item prepend-avatar="https://cdn.vuetifyjs.com/images/cards/plane.jpg" value="plane" | ||
nav></v-list-item> | ||
</v-list> | ||
</v-navigation-drawer> --> | ||
|
||
<v-navigation-drawer permanent> | ||
<v-list-item class="pa-4" prepend-avatar="https://randomuser.me/api/portraits/men/75.jpg" nav> | ||
John Doe | ||
</v-list-item> | ||
|
||
<v-divider></v-divider> | ||
<v-list> | ||
<v-list-item title="Home" value="home"></v-list-item> | ||
|
||
<v-list-item title="Contacts" value="contacts"></v-list-item> | ||
|
||
<v-list-item title="Settings" value="settings"></v-list-item> | ||
</v-list> | ||
</v-navigation-drawer> | ||
|
||
|
||
</template> | ||
<v-navigation-drawer permanent> | ||
<v-list-item class="pa-4" nav> {{ username }} </v-list-item> | ||
|
||
<v-divider></v-divider> | ||
<v-list> | ||
<v-list-item link href="/" title="Home" value="home"></v-list-item> | ||
<v-list-item | ||
href="/nation-events" | ||
title="Evento de nações" | ||
value="nations" | ||
></v-list-item> | ||
<v-list-item href="/" title="Ligas" value="leagues"></v-list-item> | ||
</v-list> | ||
</v-navigation-drawer> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue'; | ||
import { authStore } from '../../store/auth-store'; | ||
export default defineComponent({ | ||
computed: { | ||
username() { | ||
const store = authStore(); | ||
return store.username; | ||
}, | ||
}, | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { AuthStore } from '../../store/auth-store.interface'; | ||
import { AuthAd } from './auth-ad'; | ||
|
||
export class MemoryAdService implements AuthAd { | ||
constructor(private readonly storeService: AuthStore) {} | ||
async connect(): Promise<boolean> { | ||
this.storeService.setToken('mock token'); | ||
|
||
this.storeService.setUsername('Geraldo Silva'); | ||
this.storeService.setUserCode('123456'); | ||
|
||
return true; | ||
} | ||
async refreshToken(): Promise<string> { | ||
return 'true'; | ||
} | ||
async disconnect(): Promise<void> {} | ||
|
||
isAuthenticated(): boolean { | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import axios, { Axios } from 'axios'; | ||
import { HttpClient } from './http-client'; | ||
|
||
export class AxiosAdapter implements HttpClient { | ||
private http: Axios; | ||
|
||
constructor() { | ||
this.http = axios.create({ | ||
baseURL: import.meta.env.VITE_BACKEND_URL, | ||
}); | ||
} | ||
|
||
async get<T>(url: string): Promise<T> { | ||
return this.http.get(url).then((response) => response.data); | ||
} | ||
|
||
async post<T>(url: string, data: any): Promise<T> { | ||
return this.http.post(url, data).then((response) => response.data); | ||
} | ||
|
||
async put<T>(url: string, data: any): Promise<T> { | ||
return this.http.put(url, data).then((response) => response.data); | ||
} | ||
|
||
async delete<T>(url: string): Promise<T> { | ||
return this.http.delete(url).then((response) => response.data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const HTTP_CLIENT = Symbol('HTTP_Client'); | ||
export interface HttpClient { | ||
get<T>(url: string): Promise<T>; | ||
post<T>(url: string, data: any): Promise<T>; | ||
put<T>(url: string, data: any): Promise<T>; | ||
delete<T>(url: string): Promise<T>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,50 @@ | ||
<template> | ||
<v-row> | ||
<v-col cols="12"> | ||
<v-card> | ||
<v-card-title> | ||
<h1>Home</h1> | ||
</v-card-title> | ||
<v-card-text> | ||
<p>Welcome to Rockstar Gaming</p> | ||
</v-card-text> | ||
</v-card> | ||
</v-col> | ||
<v-col cols="12"> | ||
<v-row justify="center"> | ||
<v-col cols="3"> | ||
<v-card> | ||
<v-img src="/images/league/create-league-card.jpg" class="align-end" | ||
gradient="to bottom, rgba(0,0,0,.1), rgba(0,0,0,.5)" height="200px" cover> | ||
<v-card-title class="text-white"> | ||
Cria uma nova liga | ||
</v-card-title> | ||
</v-img> | ||
<v-row> | ||
<v-col cols="12"> | ||
<v-card> | ||
<v-card-title> | ||
<h1>Home</h1> | ||
</v-card-title> | ||
<v-card-text> | ||
<p>Welcome to Rockstar Gaming</p> | ||
</v-card-text> | ||
</v-card> | ||
</v-col> | ||
<v-col cols="12"> | ||
<v-row justify="center"> | ||
<v-col cols="3"> | ||
<v-card> | ||
<v-img | ||
src="/images/league/create-league-card.jpg" | ||
class="align-end" | ||
gradient="to bottom, rgba(0,0,0,.1), rgba(0,0,0,.5)" | ||
height="200px" | ||
cover | ||
> | ||
<v-card-title class="text-white"> | ||
Cria uma nova liga | ||
</v-card-title> | ||
</v-img> | ||
|
||
<v-card-actions> | ||
<v-spacer></v-spacer> | ||
<v-btn @click="createNewLeague"> | ||
Nova liga | ||
</v-btn> | ||
</v-card-actions> | ||
</v-card> | ||
</v-col> | ||
</v-row> | ||
<v-card-actions> | ||
<v-spacer></v-spacer> | ||
<v-btn @click="createNewNationEvent"> Nova liga de nações </v-btn> | ||
</v-card-actions> | ||
</v-card> | ||
</v-col> | ||
</v-row> | ||
</v-row> | ||
</v-col> | ||
</v-row> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue' | ||
import { defineComponent } from 'vue'; | ||
export default defineComponent({ | ||
methods: { | ||
createNewLeague() { | ||
this.$router.push({ name: 'create-league' }) | ||
} | ||
} | ||
}) | ||
</script> | ||
methods: { | ||
createNewNationEvent() { | ||
this.$router.push({ name: 'create-nation-event' }); | ||
}, | ||
}, | ||
}); | ||
</script> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
export class NationEvent { | ||
public id: string; | ||
public name: string; | ||
public season: string; | ||
|
||
constructor( | ||
data: NationEventInput = { | ||
id: '', | ||
name: '', | ||
season: '', | ||
} | ||
) { | ||
this.id = data.id; | ||
this.name = data.name; | ||
this.season = data.season; | ||
} | ||
|
||
create() { | ||
console.log(this, 'vai salvar isso no backend'); | ||
} | ||
|
||
update() { | ||
// Update the nation event | ||
} | ||
} | ||
|
||
export type NationEventInput = { | ||
id: string; | ||
name: string; | ||
season: string; | ||
}; |
Oops, something went wrong.