Files
wekan/client/features/settings.js
T
Lauri Ojansivu ebe985d453 A location in an Admin Panel table opens a map, through the card's own chooser.
Admin Panel / Problems / Offices names the places accounts log in from -
"London", with the country's flag - and a name is only useful if it leads
somewhere. Clicking one now asks which map to open it at, from the same eleven
providers a card's location offers.

THE SAME CHOOSER, not a second one. The provider list was eleven options inside
cardDetails.jade; it is client/components/main/mapProvider.jade now, and both
callers include it. Two lists would be eleven places to add a provider instead
of one, and they would disagree the first time only one was edited. The
isMapProvider helper moves with it, so neither caller needs its own copy, and so
do its styles - they were scoped to .js-card-location-form, which stopped being
true the moment a second template used them.

What the two do NOT share is the rest. A card's popup EDITS a location - name,
address, coordinates, delete - and none of that applies to an office: its
location arrived in a CDN header, WeKan did not ask for it and cannot correct
it. So tablePageMapPopup is the map half alone: where this is, the link, the
chooser, and a save that makes the choice the default for cards too, because
profile.mapProvider is the one setting both read.

A cell is a link only when the row HAS coordinates. A city name is not a
position, and a map URL built from one would either search for the word or
invent a place, so buildRows drops a location without lat/lon and the cell stays
plain text. The link follows the selection BEFORE it is saved: choosing a
provider and finding the link still pointing at the old one reads as broken.

The handler lives on the shared table page, not on the report. That is also
where the "clicking a user opens the Edit user popup" handler goes: three
reports each had their own identical copy, because each was written where its
own page was. A Blaze event bubbles through the template hierarchy, so one
handler on tablePage reaches every report - and a report added later gets both
without being told.

Two things the guards caught, both worth naming. The popup had no title, which
in WeKan means no header and so no close button; it opens with
titleKey: 'location-open-map-at' - the phrase the chooser is already labelled
with in every language - rather than adding a key to 154 files. And a comment
between an `if` and its `else if` breaks jade nesting, which
tests/jadeCompiles.test.cjs has a negative test for; the comments sit above the
chain.

Thanks to xet7 !
2026-08-16 17:33:09 +03:00

52 lines
2.9 KiB
JavaScript

import '/client/components/settings/adminProblems.jade';
import '/client/components/settings/attachments.jade';
import '/client/components/settings/attachmentSettings.jade';
import '/client/components/settings/connectionMethod.jade';
import '/client/components/settings/informationBody.jade';
import '/client/components/settings/invitationCode.jade';
import '/client/components/settings/migrationProgress.jade';
import '/client/components/settings/peopleBody.jade';
import '/client/components/settings/settingBody.jade';
import '/client/components/settings/settingHeader.jade';
import '/client/components/settings/leftMenu.jade';
import '/client/components/settings/tablePage.jade';
import '/client/components/settings/tablePage.js';
import '/client/components/settings/translationBody.jade';
import '/client/components/settings/adminProblems.js';
import '/client/components/settings/attachments.js';
import '/client/components/settings/connectionMethod.js';
import '/client/components/settings/informationBody.js';
import '/client/components/settings/invitationCode.js';
// The left menu's caret. Its .jade above only DRAWS the caret: the click that
// folds the menu and the `isLeftMenuCollapsed` helper that says whether it is
// folded live here, and package.json sets meteor.mainModule, so a file nobody
// imports is simply not in the bundle. Without this line the caret rendered and
// did nothing - an unregistered helper is undefined, so the panel never took
// the `collapsed` class either. docs/Features/Page/Left-Menu.md
import '/client/components/settings/leftMenu.js';
import '/client/components/settings/lockedUsersBody.js';
import '/client/components/settings/migrationProgress.js';
import '/client/components/settings/peopleBody.js';
import '/client/components/settings/settingBody.js';
import '/client/components/settings/settingHeader.js';
import '/client/components/settings/problemsSummary.jade';
import '/client/components/settings/problemsSummary.js';
import '/client/components/settings/translationBody.js';
// adminProblems.css was missing here, so NONE of the Admin Panel report styling
// was in the bundle (package.json sets meteor.mainModule, so a CSS file that is
// never imported is simply not loaded). That is why the report search box and
// the prev/next pagination buttons fell back to the global `button` rule in
// forms.css and rendered with a black/grey background instead of the theme.
import '/client/components/settings/adminProblems.css';
import '/client/components/settings/attachments.css';
import '/client/components/settings/informationBody.css';
import '/client/components/settings/lockedUsersBody.css';
import '/client/components/settings/migrationProgress.css';
import '/client/components/settings/peopleBody.css';
import '/client/components/settings/settingBody.css';
import '/client/components/settings/settingHeader.css';
import '/client/components/settings/tablePage.css';
import '/client/components/settings/translationBody.css';