Skip to content

Commit

Permalink
Feat/homepage to functions (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ellenn-A authored Jun 26, 2024
1 parent 244a65a commit 96bd572
Show file tree
Hide file tree
Showing 14 changed files with 184 additions and 15 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "veritable-ui",
"version": "0.6.0",
"version": "0.6.1",
"description": "UI for Veritable",
"main": "src/index.ts",
"type": "module",
Expand Down
5 changes: 5 additions & 0 deletions public/images/layers.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions public/images/send.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions public/images/settings.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions public/images/user-check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions public/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,55 @@ a.connections-table.icon {
width: 12px;
background-image: url('../images/info-accent.svg');
}
.category-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 25px;
width: 70%;
height: 100%;
cursor: pointer;
}

.category-item {
background-color: #fff;
overflow-x: auto;
border-radius: 12px;
padding: 1rem;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: left;
font-size: 1.5rem;
max-height: 500px;
min-height: 250px;
}
.center-category {
display: flex;
justify-content: center;
align-items: center;
}
.category-header {
text-align: center;
font-size: 2rem;
padding-top: 10px;
margin: 0px;
font-weight: bold;
}
.category-text {
font-size: 0.875rem;
text-align: left;
}
.category-align-in-row {
display: flex;
flex-direction: row;
align-items: left;
}
.category-icon {
padding-top: 10px;
height: 41px;
width: 41px;
margin-bottom: 4rem;
}

/* Mobile view */
@media (max-width: 767px) {
Expand Down Expand Up @@ -373,4 +422,13 @@ a.connections-table.icon {
.search-window {
margin-left: 10px;
}
.category-item {
min-height: auto;
}
.category-header {
font-size: 1.5rem;
}
.category-container {
height: 100%;
}
}
33 changes: 33 additions & 0 deletions src/controllers/homepageController.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Get, Produces, Route, Security, SuccessResponse } from 'tsoa'
import { inject, injectable, singleton } from 'tsyringe'

import { Logger, type ILogger } from '../logger.js'

import HomepageTemplates from '../views/homepage.js'
import { HTML, HTMLController } from './HTMLController.js'

@singleton()
@injectable()
@Security('oauth2')
@Route('/')
@Produces('text/html')
export class HomepageController extends HTMLController {
constructor(
private homepageTemplates: HomepageTemplates,
@inject(Logger) private logger: ILogger
) {
super()
this.logger = logger.child({ controller: '/' })
}

/**
* Retrieves the homepage
*/
@SuccessResponse(200)
@Get('/')
public async homepage(): Promise<HTML> {
this.logger.debug('homepagepage requested')

return this.html(this.homepageTemplates.homepage())
}
}
1 change: 0 additions & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export default async (startEvents: boolean = true) => {
const apiSpec = await loadApiSpec(env)
app.get('/api-docs', (_req, res) => res.json(apiSpec))
app.use('/swagger', serve, setup(undefined, options))
app.get('/', (_, res) => res.redirect('/connection'))

RegisterRoutes(app)

Expand Down
Loading

0 comments on commit 96bd572

Please sign in to comment.