Some fixes

This commit is contained in:
Eugene Burmakin 2025-11-23 00:43:31 +01:00
parent 5266436396
commit 78ac365c00
9 changed files with 49 additions and 18 deletions

View file

@ -6,6 +6,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## Unreleased
## TEST
- [ ] KML upload
- [ ] OIDC login with Authentik
- [ ] How does it work with existing settings to disable registrations?
- [ ] Place creation
- [ ] Tag creation + management
- [ ] Place privacy zones
- [ ] Settings panel is scrollable
- [ ] Family members can enable their location sharing and see each other on the map
- [ ] Home location
# OIDC and KML support release
To configure your OIDC provider, set the following environment variables:

View file

@ -3,7 +3,7 @@ import { Controller } from "@hotwired/stimulus"
// Enhanced Color Picker Controller
// Based on RailsBlocks pattern: https://railsblocks.com/docs/color-picker
export default class extends Controller {
static targets = ["picker", "display", "input", "swatch"]
static targets = ["picker", "display", "displayText", "input", "swatch"]
static values = {
default: { type: String, default: "#6ab0a4" }
}
@ -49,6 +49,11 @@ export default class extends Controller {
this.displayTarget.style.backgroundColor = color
}
// Update display text
if (this.hasDisplayTextTarget) {
this.displayTextTarget.textContent = color
}
// Update active swatch styling
this.updateActiveSwatchWithColor(color)

View file

@ -7,7 +7,7 @@
<li><strong>✅ GPX:</strong> Track files (.gpx)</li>
<li><strong>✅ GeoJSON:</strong> Feature collections (.json)</li>
<li><strong>✅ OwnTracks:</strong> Recorder files (.rec)</li>
<li><strong>✅ KML:</strong> KML files (.kml)</li>
<li><strong>✅ KML:</strong> KML files (.kml, .kmz)</li>
</ul>
<div class="text-xs text-gray-500 mt-2">
File format is automatically detected during upload.

View file

@ -69,7 +69,7 @@
</div>
</div>
<% unless DawarichSettings.self_hosted? %>
<% unless DawarichSettings.self_hosted? || current_user.provider.blank? %>
<div>
<h2 class="text-2xl font-bold mb-4 flex items-center">
<%= icon 'link', class: "text-primary mr-1" %> Connected Accounts

View file

@ -71,13 +71,11 @@
<div class="flex items-center gap-3">
<label class="flex items-center gap-2 cursor-pointer group">
<span class="text-sm font-medium">Custom:</span>
<%= f.color_field :color,
class: "w-12 h-12 rounded-lg cursor-pointer border-2 border-base-300 hover:scale-105 transition-transform color-input",
data: {
color_picker_target: "picker",
action: "input->color-picker#updateFromPicker"
},
value: tag.color.presence || '#6ab0a4' %>
<input type="color"
class="w-12 h-12 rounded-lg cursor-pointer border-2 border-base-300 hover:scale-105 transition-transform color-input"
value="<%= tag.color.presence || '#6ab0a4' %>"
data-color-picker-target="picker"
data-action="input->color-picker#updateFromPicker">
</label>
<!-- Color Display -->
@ -92,7 +90,7 @@
</div>
</div>
<%= f.hidden_field :color, data: { color_picker_target: "input" } %>
<%= f.hidden_field :color, value: tag.color.presence || '#6ab0a4', data: { color_picker_target: "input" } %>
<label class="label">
<span class="label-text-alt">Choose from swatches or pick a custom color</span>

View file

@ -1,6 +1,7 @@
class AddOmniauthToUsers < ActiveRecord::Migration[8.0]
def change
add_column :users, :provider, :string
add_column :users, :uid, :string
add_column :users, :provider, :string unless column_exists? :users, :provider
add_column :users, :uid, :string unless column_exists? :users, :uid
add_index :users, [:provider, :uid], unique: true, algorithm: :concurrently
end
end

View file

@ -3,10 +3,12 @@ class AddUserIdToPlaces < ActiveRecord::Migration[8.0]
def up
# Add nullable for backward compatibility, will enforce later via data migration
add_reference :places, :user, null: true, index: {algorithm: :concurrently} unless foreign_key_exists?(:places, :users)
unless column_exists?(:places, :user_id)
add_reference :places, :user, null: true, index: { algorithm: :concurrently }
end
end
def down
remove_reference :places, :user, index: true if foreign_key_exists?(:places, :users)
remove_reference :places, :user, index: true if column_exists?(:places, :user_id)
end
end

View file

@ -1,8 +1,21 @@
# frozen_string_literal: true
class AddPrivacyRadiusToTags < ActiveRecord::Migration[8.0]
disable_ddl_transaction!
def change
def up
add_column :tags, :privacy_radius_meters, :integer
add_index :tags, :privacy_radius_meters, where: "privacy_radius_meters IS NOT NULL", algorithm: :concurrently
add_index :tags,
:privacy_radius_meters,
where: 'privacy_radius_meters IS NOT NULL',
algorithm: :concurrently
end
def down
remove_index :tags,
column: :privacy_radius_meters,
where: 'privacy_radius_meters IS NOT NULL',
algorithm: :concurrently
remove_column :tags, :privacy_radius_meters
end
end

View file

@ -1,5 +1,5 @@
class AddNoteToPlaces < ActiveRecord::Migration[8.0]
def change
add_column :places, :note, :text
add_column :places, :note, :text unless column_exists? :places, :note
end
end