forked from vikunja/vikunja
Compare commits
3 Commits
renovate/g
...
main
Author | SHA1 | Date | |
---|---|---|---|
2e3603507c | |||
2efc1b5a87 | |||
|
090c67138a |
|
@ -36,8 +36,9 @@ Make sure to check the other doc articles for specific development tasks like [t
|
||||||
## Frontend requirements
|
## Frontend requirements
|
||||||
|
|
||||||
The code for the frontend is located at [code.vikunja.io/frontend](https://code.vikunja.io/frontend).
|
The code for the frontend is located at [code.vikunja.io/frontend](https://code.vikunja.io/frontend).
|
||||||
|
More instructions can be found in the repo's README.
|
||||||
|
|
||||||
You need to have yarn v1 and nodejs in version 16 installed.
|
You need to have [pnpm](https://pnpm.io/) and nodejs in version 16 or 18 installed.
|
||||||
|
|
||||||
## Git flow
|
## Git flow
|
||||||
|
|
||||||
|
|
|
@ -98,12 +98,12 @@ Check out the docs [in the frontend repo](https://kolaente.dev/vikunja/frontend/
|
||||||
To run the frontend unit tests, run
|
To run the frontend unit tests, run
|
||||||
|
|
||||||
{{< highlight bash >}}
|
{{< highlight bash >}}
|
||||||
yarn test:unit
|
pnpm test:unit
|
||||||
{{< /highlight >}}
|
{{< /highlight >}}
|
||||||
|
|
||||||
The frontend also has a watcher available that re-runs all unit tests every time you change something.
|
The frontend also has a watcher available that re-runs all unit tests every time you change something.
|
||||||
To use it, simply run
|
To use it, simply run
|
||||||
|
|
||||||
{{< highlight bash >}}
|
{{< highlight bash >}}
|
||||||
yarn test:unit-watch
|
pnpm test:unit-watch
|
||||||
{{< /highlight >}}
|
{{< /highlight >}}
|
||||||
|
|
|
@ -38,9 +38,7 @@ More options are available, please refer to the [magefile docs]({{< ref "../deve
|
||||||
|
|
||||||
The code for the frontend is located at [code.vikunja.io/frontend](https://code.vikunja.io/frontend).
|
The code for the frontend is located at [code.vikunja.io/frontend](https://code.vikunja.io/frontend).
|
||||||
|
|
||||||
You need to have yarn v1 and nodejs in version 16 installed.
|
1. Make sure you have [pnpm](https://pnpm.io/) properly installed on your system.
|
||||||
|
2. Clone the repo with `git clone https://code.vikunja.io/frontend` and switch into the directory.
|
||||||
1. Make sure [yarn v1](https://yarnpkg.com/getting-started/install) is properly installed on your system.
|
3. Install all dependencies with `pnpm install`
|
||||||
3. Clone the repo with `git clone https://code.vikunja.io/frontend` and switch into the directory.
|
4. Build the frontend with `pnpm build`. This will result in a static js bundle in the `dist/` folder which you can deploy.
|
||||||
3. Install all dependencies with `yarn install`
|
|
||||||
4. Build the frontend with `yarn build`. This will result in a js bundle in the `dist/` folder which you can deploy.
|
|
||||||
|
|
39
docs/content/doc/setup/subdirectory.md
Normal file
39
docs/content/doc/setup/subdirectory.md
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
---
|
||||||
|
title: "Running Vikunja in a subdirectory"
|
||||||
|
date: 2022-09-23T12:15:04+02:00
|
||||||
|
draft: false
|
||||||
|
menu:
|
||||||
|
sidebar:
|
||||||
|
parent: "setup"
|
||||||
|
---
|
||||||
|
|
||||||
|
# Running Vikunja in a subdirectory
|
||||||
|
|
||||||
|
Running Vikunja in a subdirectory is not supported out of the box.
|
||||||
|
However, you can still run it in a subdirectory but need to build the frontend yourself.
|
||||||
|
|
||||||
|
## Frontend
|
||||||
|
|
||||||
|
First, make sure you're able to build the frontend from source.
|
||||||
|
Check [the guide about building from source]({{< ref "build-from-source.md">}}#frontend) about that.
|
||||||
|
|
||||||
|
Then, run
|
||||||
|
|
||||||
|
```
|
||||||
|
pnpm vite build --base=/SUBPATH
|
||||||
|
pnpm workbox copyLibraries dist/
|
||||||
|
```
|
||||||
|
|
||||||
|
Where `SUBPATH` is the subdirectory you want to run Vikunja on.
|
||||||
|
|
||||||
|
Once you have the build files you can deploy them as usual.
|
||||||
|
Note that when deploying in docker you'll need to put the files in a web container yourself, you
|
||||||
|
can't use the `Dockerfile` in the repo without modifications.
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
If you're not using a reverse proxy you're good to go.
|
||||||
|
Simply configure the api url in the frontend as you normally would.
|
||||||
|
|
||||||
|
If you're using a reverse proxy you'll need to adjust the paths so that the api is available at `/SUBPATH/api/v1`.
|
||||||
|
You can check if everything is working correctly by opening `/SUBPATH/api/v1/info` in a browser.
|
|
@ -1289,18 +1289,39 @@ func setTaskDatesFromCurrentDateRepeat(oldTask, newTask *Task) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If a task has a start and end date, the end date should keep the difference to the start date when setting them as new
|
// We want to preserve intervals among the due, start and end dates.
|
||||||
if !oldTask.StartDate.IsZero() && !oldTask.EndDate.IsZero() {
|
// The due date is used as a reference point for all new dates, so the
|
||||||
diff := oldTask.EndDate.Sub(oldTask.StartDate)
|
// behaviour depends on whether the due date is set at all.
|
||||||
newTask.StartDate = now.Add(repeatDuration)
|
if oldTask.DueDate.IsZero() {
|
||||||
newTask.EndDate = now.Add(repeatDuration + diff)
|
// If a task has no due date, but does have a start and end date, the
|
||||||
} else {
|
// end date should keep the difference to the start date when setting
|
||||||
if !oldTask.StartDate.IsZero() {
|
// them as new
|
||||||
|
if !oldTask.StartDate.IsZero() && !oldTask.EndDate.IsZero() {
|
||||||
|
diff := oldTask.EndDate.Sub(oldTask.StartDate)
|
||||||
newTask.StartDate = now.Add(repeatDuration)
|
newTask.StartDate = now.Add(repeatDuration)
|
||||||
|
newTask.EndDate = now.Add(repeatDuration + diff)
|
||||||
|
} else {
|
||||||
|
if !oldTask.StartDate.IsZero() {
|
||||||
|
newTask.StartDate = now.Add(repeatDuration)
|
||||||
|
}
|
||||||
|
|
||||||
|
if !oldTask.EndDate.IsZero() {
|
||||||
|
newTask.EndDate = now.Add(repeatDuration)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// If the old task has a start and due date, we set the new start date
|
||||||
|
// to preserve the interval between them.
|
||||||
|
if !oldTask.StartDate.IsZero() {
|
||||||
|
diff := oldTask.DueDate.Sub(oldTask.StartDate)
|
||||||
|
newTask.StartDate = newTask.DueDate.Add(-diff)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the old task has an end and due date, we set the new end date
|
||||||
|
// to preserve the interval between them.
|
||||||
if !oldTask.EndDate.IsZero() {
|
if !oldTask.EndDate.IsZero() {
|
||||||
newTask.EndDate = now.Add(repeatDuration)
|
diff := oldTask.DueDate.Sub(oldTask.EndDate)
|
||||||
|
newTask.EndDate = newTask.DueDate.Add(-diff)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user