Skip to content

Commit

Permalink
Merge pull request #102 from ssciwr/connect_milestone_to_backend
Browse files Browse the repository at this point in the history
Connect Milestone component to backend
  • Loading branch information
lkeegan authored Oct 9, 2024
2 parents 729220c + 314b2b5 commit d4ea8f8
Show file tree
Hide file tree
Showing 20 changed files with 300 additions and 305 deletions.
47 changes: 0 additions & 47 deletions .github/workflows/deploy.yml

This file was deleted.

36 changes: 21 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
# [mondey](https://ssciwr.github.io/mondey)
# [MONDEY](https://mondey.lkeegan.dev/)
[![run tests](https://github.com/ssciwr/mondey/actions/workflows/ci.yml/badge.svg)](https://github.com/ssciwr/mondey/actions/workflows/ci.yml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ssciwr_mondey&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=ssciwr_mondey)
[![codecov](https://codecov.io/gh/ssciwr/mondey/graph/badge.svg?token=1YBO3KUDAR)](https://codecov.io/gh/ssciwr/mondey)

Initial development for the MONDEY project.
The source code for the MONDEY website. This is currently under development!

## Frontend
## Current status

The frontend is automatically built and deployed as a static website to
[ssciwr.github.io/mondey](https://ssciwr.github.io/mondey)
on every push to the main branch using this [Github Action](.github/workflows/deploy.yml).
The website is temporarily hosted on a heicloud VM during development:

### Component demos
### User interface

- [Milestone](https://ssciwr.github.io/mondey/milestone)
- [Milestonegroup](https://ssciwr.github.io/mondey/milestonegroup)
This is the website that the end user would interact with (functionality is currently incomplete):

## Preview
- [Mondey website](https://mondey.lkeegan.dev/)

A preview of the full website including the admin interface backend is temporarily hosted on a heicloud VM during development:
Until more functionality is added to the main site above, there are also some stand-alone previews of individual components:

- [Milestone component](https://mondey.lkeegan.dev/milestone)
- [MilestoneGroup component](https://mondey.lkeegan.dev/milestonegroup)

### Admin interface

This is the interface that admins would use to edit the contents of the website:

- [Mondey admin interface](https://mondey.lkeegan.dev/admin)

### Developer interface

These API interfaces are only temporarily public for convenience during development, in production these will not be public:

- [Mondey website](https://mondey.lkeegan.dev/)
- [Mondey admin](https://mondey.lkeegan.dev/admin)
- [API documentation](https://mondey.lkeegan.dev/api/redoc)
- [Swagger UI to interact with API](https://mondey.lkeegan.dev/api/docs)

(Note: for now the API interface docs are public and unsecured for convenience during development, in production these would not be public)
8 changes: 4 additions & 4 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# [mondey-frontend-prototype](https://ssciwr.github.io/mondey-frontend-prototype)
# MONDEY frontend

Initial frontend prototyping for the MONDEY project.
The svelte frontend for the MONDEY project.

## Local development

Initial setup to edit the frontend locally:

- install [pnpm](https://pnpm.io/installation), e.g. `curl -fsSL https://get.pnpm.io/install.sh | sh -`
- clone the repo, e.g. `git clone https://github.com/ssciwr/mondey-frontend-prototype.git`
- go to the frontend folder of the repository, e.g. `cd mondey-frontend-prototype/frontend`
- clone the repo, e.g. `git clone https://github.com/ssciwr/mondey.git`
- go to the frontend folder of the repository, e.g. `cd mondey/frontend`
- install the node dependencies, e.g. `pnpm install`

To start a development server:
Expand Down
29 changes: 28 additions & 1 deletion frontend/src/lib/client/schemas.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ export const MilestonePublicSchema = {
},
text: {
additionalProperties: {
$ref: '#/components/schemas/MilestoneGroupTextPublic'
$ref: '#/components/schemas/MilestoneTextPublic'
},
type: 'object',
title: 'Text',
Expand Down Expand Up @@ -493,6 +493,33 @@ export const MilestoneTextSchema = {
title: 'MilestoneText'
} as const;

export const MilestoneTextPublicSchema = {
properties: {
title: {
type: 'string',
title: 'Title',
default: ''
},
desc: {
type: 'string',
title: 'Desc',
default: ''
},
obs: {
type: 'string',
title: 'Obs',
default: ''
},
help: {
type: 'string',
title: 'Help',
default: ''
}
},
type: 'object',
title: 'MilestoneTextPublic'
} as const;

export const UserCreateSchema = {
properties: {
email: {
Expand Down
9 changes: 8 additions & 1 deletion frontend/src/lib/client/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export type MilestoneImagePublic = {
export type MilestonePublic = {
id: number;
text?: {
[key: string]: MilestoneGroupTextPublic;
[key: string]: MilestoneTextPublic;
};
images?: Array<MilestoneImagePublic>;
};
Expand All @@ -124,6 +124,13 @@ export type MilestoneText = {
lang_id?: number | null;
};

export type MilestoneTextPublic = {
title?: string;
desc?: string;
obs?: string;
help?: string;
};

export type UserCreate = {
email: string;
password: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { InputAddon, Textarea, Label, ButtonGroup, Fileupload, Modal } from 'flowbite-svelte';
import { _ } from 'svelte-i18n';
import { onMount } from 'svelte';
import { languages } from '$lib/stores/adminStore';
import { languages } from '$lib/stores/langStore';
import type { MilestoneGroupAdmin } from '$lib/client/types.gen';
import { updateMilestoneGroupAdmin, uploadMilestoneGroupImage } from '$lib/client/services.gen';
import { milestoneGroupImageUrl, refreshMilestoneGroups } from '$lib/admin.svelte';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<script lang="ts">
import { InputAddon, Textarea, Label, ButtonGroup, Fileupload, Modal } from 'flowbite-svelte';
import { languages } from '$lib/stores/adminStore';
import { languages } from '$lib/stores/langStore';
import SaveButton from '$lib/components/Admin/SaveButton.svelte';
import CancelButton from '$lib/components/Admin/CancelButton.svelte';
import { _ } from 'svelte-i18n';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
type SelectOptionType
} from 'flowbite-svelte';
import { _ } from 'svelte-i18n';
import { languages } from '$lib/stores/adminStore';
import { languages } from '$lib/stores/langStore';
import { updateUserQuestion } from '$lib/client/services.gen';
import InputPreview from '$lib/components/Admin/InputPreview.svelte';
import SaveButton from '$lib/components/Admin/SaveButton.svelte';
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/Admin/Languages.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import { _ } from 'svelte-i18n';
import type { SelectOptionType } from 'flowbite-svelte';
import { updateLanguages } from '$lib/i18n';
import { languages } from '$lib/stores/adminStore';
import { languages } from '$lib/stores/langStore';
import DeleteModal from '$lib/components/Admin/DeleteModal.svelte';
import AddButton from '$lib/components/Admin/AddButton.svelte';
import DeleteButton from '$lib/components/Admin/DeleteButton.svelte';
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/lib/components/Admin/MilestoneGroups.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
import AddButton from '$lib/components/Admin/AddButton.svelte';
import EditButton from '$lib/components/Admin/EditButton.svelte';
import DeleteButton from '$lib/components/Admin/DeleteButton.svelte';
import { lang_id, milestoneGroups } from '$lib/stores/adminStore';
import { lang_id } from '$lib/stores/langStore';
import { milestoneGroups } from '$lib/stores/adminStore';
import { refreshMilestoneGroups, milestoneGroupImageUrl } from '$lib/admin.svelte';
import {
createMilestone,
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/lib/components/Admin/UserQuestions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
} from 'flowbite-svelte';
import { _ } from 'svelte-i18n';
import { lang_id, userQuestions } from '$lib/stores/adminStore';
import { lang_id } from '$lib/stores/langStore';
import { userQuestions } from '$lib/stores/adminStore';
import { onMount } from 'svelte';
import { refreshUserQuestions } from '$lib/admin.svelte';
import { deleteUserQuestion, createUserQuestion } from '$lib/client/services.gen';
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/LocaleChooser.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { Dropdown, DropdownItem } from 'flowbite-svelte';
import { ChevronDownOutline } from 'flowbite-svelte-icons';
import { locale, locales } from 'svelte-i18n';
import { languages, lang_id } from '$lib/stores/adminStore';
import { languages, lang_id } from '$lib/stores/langStore';
let dropdownOpen = false;
</script>
Expand Down
Loading

0 comments on commit d4ea8f8

Please sign in to comment.