diff --git a/solardoc/frontend/src/components/common/LoadingProgressSpinner.vue b/solardoc/frontend/src/components/common/LoadingProgressSpinner.vue
index 16b07ba1..fbc5c536 100644
--- a/solardoc/frontend/src/components/common/LoadingProgressSpinner.vue
+++ b/solardoc/frontend/src/components/common/LoadingProgressSpinner.vue
@@ -13,7 +13,7 @@ const { loading, currMsg } = storeToRefs(loadingStore)
- {{ currMsg || 'Loading...'}}
+ {{ currMsg || 'Loading...' }}
diff --git a/solardoc/frontend/src/components/editor/editor-navbar/EditorNavbar.vue b/solardoc/frontend/src/components/editor/editor-navbar/EditorNavbar.vue
index ce2b6f3f..b1227048 100644
--- a/solardoc/frontend/src/components/editor/editor-navbar/EditorNavbar.vue
+++ b/solardoc/frontend/src/components/editor/editor-navbar/EditorNavbar.vue
@@ -18,7 +18,7 @@ import { ensureLoggedIn } from '@/scripts/ensure-logged-in'
import { useRouter } from 'vue-router'
import { showInfoNotifFromObj } from '@/scripts/show-notif'
import constants from '@/plugins/constants'
-import {useLoadingStore} from "@/stores/loading";
+import { useLoadingStore } from '@/stores/loading'
const $router = useRouter()
diff --git a/solardoc/frontend/src/scripts/editor/editor.ts b/solardoc/frontend/src/scripts/editor/editor.ts
index 7c7356a2..75eddfaf 100644
--- a/solardoc/frontend/src/scripts/editor/editor.ts
+++ b/solardoc/frontend/src/scripts/editor/editor.ts
@@ -280,17 +280,17 @@ export class SolardocEditor {
const lines = content.split('\n')
const { slideIndex, subSlideIndex } = lines.slice(0, lineNumber).reduce(
(acc, line) => {
- line = line.trim();
+ line = line.trim()
if (line.startsWith('== ')) {
- acc.slideIndex++;
- acc.subSlideIndex = -1;
+ acc.slideIndex++
+ acc.subSlideIndex = -1
} else if (line.startsWith('=== ')) {
- acc.subSlideIndex++;
+ acc.subSlideIndex++
}
- return acc;
+ return acc
},
- { slideIndex: 0, subSlideIndex: -1 }
- );
+ { slideIndex: 0, subSlideIndex: -1 },
+ )
previewSelectedSlideStore.setSlide(slideIndex, false, subSlideIndex)
})
}
diff --git a/solardoc/frontend/src/services/phoenix/gen/phoenix-rest-service.ts b/solardoc/frontend/src/services/phoenix/gen/phoenix-rest-service.ts
index c00e16c1..045144ed 100644
--- a/solardoc/frontend/src/services/phoenix/gen/phoenix-rest-service.ts
+++ b/solardoc/frontend/src/services/phoenix/gen/phoenix-rest-service.ts
@@ -6,7 +6,6 @@
*/
import * as Oazapfts from 'oazapfts/lib/runtime'
import * as QS from 'oazapfts/lib/runtime/query'
-
export const defaults: Oazapfts.RequestOpts = {
baseUrl: 'http://localhost:4000/phx/api',
}
@@ -87,6 +86,7 @@ export type UpdateFile = {
content?: string
file_name?: string
is_global?: boolean
+ new_sync_algorithm?: boolean
}
export type Ping = {
date: number
@@ -128,7 +128,6 @@ export type UserPrivate = {
role?: string
username?: string
}
-
/**
* Log out a user
*/
@@ -154,7 +153,6 @@ export function deleteV2AuthBearer(authorization: string, opts?: Oazapfts.Reques
},
})
}
-
/**
* Log in a user
*/
@@ -181,7 +179,6 @@ export function postV2AuthBearer(userLogin: UserLogin, opts?: Oazapfts.RequestOp
}),
)
}
-
/**
* List all currently running editor channels
*/
@@ -203,7 +200,6 @@ export function getV2EditorChannels(authorization: string, opts?: Oazapfts.Reque
},
})
}
-
/**
* Get a single editor channel
*/
@@ -233,7 +229,6 @@ export function getV2EditorChannelsById(
},
})
}
-
/**
* List all files owned by the current user
*/
@@ -255,7 +250,6 @@ export function getV2Files(authorization: string, opts?: Oazapfts.RequestOpts) {
},
})
}
-
/**
* Create a new file
*/
@@ -290,7 +284,6 @@ export function postV2Files(
}),
)
}
-
/**
* List all global files
*/
@@ -342,7 +335,6 @@ export function getV2FilesGlobal(
},
)
}
-
/**
* Create a new file permission
*/
@@ -381,7 +373,6 @@ export function postV2FilesPermissions(
}),
)
}
-
/**
* Get a single file permission
*/
@@ -411,7 +402,6 @@ export function getV2FilesPermissionsById(
},
})
}
-
/**
* Update a single file
*/
@@ -451,7 +441,6 @@ export function putV2FilesPermissionsById(
}),
)
}
-
/**
* Gets the permissions for one file for all users who have access to it
*/
@@ -485,7 +474,6 @@ export function getV2FilesByFileIdPermissions(
},
})
}
-
/**
* Gets the permissions for one file from one specific user
*/
@@ -520,7 +508,6 @@ export function getV2FilesByFileIdPermissionsAndUserId(
},
})
}
-
/**
* Deletes a file
*/
@@ -550,7 +537,6 @@ export function deleteV2FilesById(authorization: string, id: string, opts?: Oaza
},
})
}
-
/**
* Get a single file
*/
@@ -576,7 +562,6 @@ export function getV2FilesById(authorization: string, id: string, opts?: Oazapft
},
})
}
-
/**
* Update a single file
*/
@@ -616,7 +601,6 @@ export function putV2FilesById(
}),
)
}
-
/**
* Ping the server
*/
@@ -628,7 +612,6 @@ export function getV2Ping(opts?: Oazapfts.RequestOpts) {
...opts,
})
}
-
/**
* Create a new share url
*/
@@ -663,7 +646,6 @@ export function postV2Share(
}),
)
}
-
/**
* Delete a share url
*/
@@ -689,7 +671,6 @@ export function deleteV2ShareById(authorization: string, id: string, opts?: Oaza
},
})
}
-
/**
* Get a single share url
*/
@@ -715,7 +696,6 @@ export function getV2ShareById(authorization: string, id: string, opts?: Oazapft
},
})
}
-
/**
* Get a channel via a share url
*/
@@ -745,7 +725,6 @@ export function getV2ShareByIdChannel(
},
})
}
-
/**
* Get a file via a share url
*/
@@ -771,7 +750,6 @@ export function getV2ShareByIdFile(authorization: string, id: string, opts?: Oaz
},
})
}
-
/**
* List all users
*/
@@ -787,7 +765,6 @@ export function getV2Users(authorization: string, opts?: Oazapfts.RequestOpts) {
},
})
}
-
/**
* Create a new user
*/
@@ -810,7 +787,6 @@ export function postV2Users(createUser: CreateUser, opts?: Oazapfts.RequestOpts)
}),
)
}
-
/**
* Get the current user
*/
@@ -832,7 +808,6 @@ export function getV2UsersCurrent(authorization: string, opts?: Oazapfts.Request
},
})
}
-
/**
* Get a single user by id
*/
diff --git a/solardoc/frontend/src/services/render/gen/backend-rest-service.ts b/solardoc/frontend/src/services/render/gen/backend-rest-service.ts
index 6378106e..af106259 100644
--- a/solardoc/frontend/src/services/render/gen/backend-rest-service.ts
+++ b/solardoc/frontend/src/services/render/gen/backend-rest-service.ts
@@ -1,12 +1,11 @@
/**
* @solardoc/rest-api
- * 1.0.0-beta.5
+ * v1.0.0-beta.5
* DO NOT MODIFY - This file has been generated using oazapfts.
* See https://www.npmjs.com/package/oazapfts
*/
import * as Oazapfts from 'oazapfts/lib/runtime'
import * as QS from 'oazapfts/lib/runtime/query'
-
export const defaults: Oazapfts.RequestOpts = {
baseUrl: '/',
}
@@ -66,7 +65,6 @@ export type RenderedSlideImageDtoModel = {
cache: CacheDtoModel
download: DownloadDtoModel
}
-
export function getV1Ping(opts?: Oazapfts.RequestOpts) {
return oazapfts.fetchJson<{
status: 200
@@ -75,7 +73,6 @@ export function getV1Ping(opts?: Oazapfts.RequestOpts) {
...opts,
})
}
-
export function postV1RenderPresentationImages(
renderPresentationDtoModel?: RenderPresentationDtoModel,
opts?: Oazapfts.RequestOpts,
@@ -92,7 +89,6 @@ export function postV1RenderPresentationImages(
}),
)
}
-
export function postV1RenderPresentationPdf(
renderPresentationDtoModel?: RenderPresentationDtoModel,
opts?: Oazapfts.RequestOpts,
@@ -109,7 +105,6 @@ export function postV1RenderPresentationPdf(
}),
)
}
-
export function postV1RenderPresentationRjsHtml(
renderPresentationDtoModel?: RenderPresentationDtoModel,
opts?: Oazapfts.RequestOpts,
@@ -126,7 +121,6 @@ export function postV1RenderPresentationRjsHtml(
}),
)
}
-
export function postV1RenderSlideByIdImage(
id: string,
renderPresentationDtoModel?: RenderPresentationDtoModel,
@@ -144,7 +138,6 @@ export function postV1RenderSlideByIdImage(
}),
)
}
-
export function getV1ResultByUuid(
uuid: string,
{
diff --git a/solardoc/frontend/src/views/HomeView.vue b/solardoc/frontend/src/views/HomeView.vue
index 33db93b7..2703f766 100644
--- a/solardoc/frontend/src/views/HomeView.vue
+++ b/solardoc/frontend/src/views/HomeView.vue
@@ -234,7 +234,7 @@ async function routeWithLoading(to: string) {
}
@include r-min(var.$window-xmedium) {
- min-height: 30rem;
+ min-height: 30rem;
gap: max(6rem, 10vw);
flex-flow: row wrap;
padding: 0 4rem 4rem 4rem;
diff --git a/solardoc/phoenix-server/lib/solardoc_phoenix/files/file.ex b/solardoc/phoenix-server/lib/solardoc_phoenix/files/file.ex
index f4f1c975..d3b642e6 100644
--- a/solardoc/phoenix-server/lib/solardoc_phoenix/files/file.ex
+++ b/solardoc/phoenix-server/lib/solardoc_phoenix/files/file.ex
@@ -11,6 +11,7 @@ defmodule SolardocPhoenix.Files.File do
field :last_edited, :naive_datetime
field :content, :string, default: ""
field :is_global, :boolean, default: false
+ field :new_sync_algorithm, :boolean, default: true
belongs_to :channel, SolardocPhoenix.EditorChannels.EditorChannel
belongs_to :owner, SolardocPhoenix.Accounts.User
@@ -21,7 +22,7 @@ defmodule SolardocPhoenix.Files.File do
def create_changeset(file, attrs) do
now = NaiveDateTime.utc_now() |> NaiveDateTime.truncate(:second)
file
- |> cast(attrs, [:file_name, :owner_id, :content, :is_global])
+ |> cast(attrs, [:file_name, :owner_id, :content, :is_global, :new_sync_algorithm])
|> validate_required([:file_name, :owner_id])
|> validate_length(:file_name, min: 1, max: 40)
|> unique_constraint([:file_name, :owner_id])
@@ -33,7 +34,7 @@ defmodule SolardocPhoenix.Files.File do
def update_changeset(file, attrs) do
now = NaiveDateTime.utc_now() |> NaiveDateTime.truncate(:second)
file
- |> cast(attrs, [:file_name, :content, :channel_id, :is_global])
+ |> cast(attrs, [:file_name, :content, :channel_id, :is_global, :new_sync_algorithm])
|> unique_constraint([:file_name, :owner_id])
|> unique_constraint(:channel_id)
|> validate_length(:file_name, min: 1, max: 40)
diff --git a/solardoc/phoenix-server/lib/solardoc_phoenix_web/v2/controllers/files/file_controller.ex b/solardoc/phoenix-server/lib/solardoc_phoenix_web/v2/controllers/files/file_controller.ex
index e9e351a6..88e30c5e 100644
--- a/solardoc/phoenix-server/lib/solardoc_phoenix_web/v2/controllers/files/file_controller.ex
+++ b/solardoc/phoenix-server/lib/solardoc_phoenix_web/v2/controllers/files/file_controller.ex
@@ -24,6 +24,7 @@ defmodule SolardocPhoenixWeb.V2.FileController do
created :integer, "Creation date in UNIX timestamp milliseconds", required: true
channel_id :string, "UUID of the channel created for this file, if one exists", required: false
is_global :boolean, "Whether the file is global or not", required: true
+ new_sync_algorithm :boolean, "Whether the file uses the new sync algorithm", required: true
end
end,
GlobalFile: swagger_schema do
@@ -68,6 +69,7 @@ defmodule SolardocPhoenixWeb.V2.FileController do
file_name :string, "File name", required: false
content :string, "File content", required: false
is_global :boolean, "Whether the file is global or not", required: false
+ new_sync_algorithm :boolean, "Whether the file uses the new sync algorithm", required: false
end
end,
ErrorResp: swagger_schema do
diff --git a/solardoc/phoenix-server/priv/repo/migrations/20250302145843_add_new_sync_algorithm_file_flag.exs b/solardoc/phoenix-server/priv/repo/migrations/20250302145843_add_new_sync_algorithm_file_flag.exs
new file mode 100644
index 00000000..8254daa1
--- /dev/null
+++ b/solardoc/phoenix-server/priv/repo/migrations/20250302145843_add_new_sync_algorithm_file_flag.exs
@@ -0,0 +1,9 @@
+defmodule SolardocPhoenix.Repo.Migrations.AddNewSyncAlgorithmFileFlag do
+ use Ecto.Migration
+
+ def change do
+ alter table(:files) do
+ add :new_sync_algorithm, :boolean, null: false, default: true
+ end
+ end
+end