Public Access
feat(freelancer-edit): add the missing GitHub link field
The edit form carried LinkedIn/Upwork/Fiverr but not GitHub, though the application form, the webhook and the card renderer already do. Add a fourth optional link field mirroring the other three, under the live wire key verbatim (lower-case github; never normalised), pre-filled from the record and added to the save loop with the same rules: a key is written only when the input has a value, an empty optional field never invents "" on a record that never had one, and a link the owner cleared sends "". No new URL check — the card's isLink() stays the only url predicate.
This commit is contained in:
1 parent
1b0198913c
commit
cdf166632a
1 file changed
+14
-11
+14
-11
@@ -183,11 +183,12 @@
|
||||
description: ["description", "Description"],
|
||||
Country: ["Country", "country"],
|
||||
OCA_link: ["OCA_link", "oca_link"],
|
||||
// The three profile links. The primary name is the LIVE wire key, casing and all —
|
||||
// "Linkedin", "upwork", "fiverr" are deliberately mixed and must never be normalised
|
||||
// (a normalised key is the silent-drop class that ate odoo_versions). A same-word
|
||||
// casing variant is the identical fallback, the way Name/name already works.
|
||||
Linkedin: ["Linkedin", "linkedin"], upwork: ["upwork", "Upwork"], fiverr: ["fiverr", "Fiverr"],
|
||||
// The four profile links. The primary name is the LIVE wire key, casing and all —
|
||||
// "Linkedin", "github", "upwork", "fiverr" are deliberately mixed and must never be
|
||||
// normalised (a normalised key is the silent-drop class that ate odoo_versions). A
|
||||
// same-word casing variant is the identical fallback, the way Name/name already works;
|
||||
// "github" is lower-case on the wire, so it is read exactly as it is, with no variant.
|
||||
Linkedin: ["Linkedin", "linkedin"], github: ["github"], upwork: ["upwork", "Upwork"], fiverr: ["fiverr", "Fiverr"],
|
||||
functional: ["functional"], system: ["system"], modules: ["modules"],
|
||||
integration: ["integration"], ai: ["ai"],
|
||||
english: ["english"], german: ["german"], spanish: ["spanish"]
|
||||
@@ -560,12 +561,14 @@
|
||||
form.appendChild(textField("edOcaLink", "OCA member profile link", readField(record, "OCA_link"),
|
||||
0, "Your OCA profile URL, if you have one: https://apps.odoo-community.org/community/…"));
|
||||
|
||||
// The three profile links — parity with the application form. Keys are the LIVE wire
|
||||
// keys verbatim ("Linkedin" capital L, "upwork" and "fiverr" lower) and the labels and
|
||||
// placeholders are the application form's own. Each is optional and pre-filled from the
|
||||
// record.
|
||||
// The four profile links — parity with the application form. Keys are the LIVE wire
|
||||
// keys verbatim ("Linkedin" capital L; "github", "upwork" and "fiverr" lower) and the
|
||||
// labels and placeholders are the application form's own. Each is optional and
|
||||
// pre-filled from the record.
|
||||
form.appendChild(linkField("edLinkedin", "Linkedin", "LinkedIn URL",
|
||||
readField(record, "Linkedin"), "https://www.linkedin.com/in/…"));
|
||||
form.appendChild(linkField("edGithub", "github", "GitHub URL",
|
||||
readField(record, "github"), "https://github.com/…"));
|
||||
form.appendChild(linkField("edUpwork", "upwork", "Upwork URL",
|
||||
readField(record, "upwork"), "https://www.upwork.com/freelancers/…"));
|
||||
form.appendChild(linkField("edFiverr", "fiverr", "Fiverr URL",
|
||||
@@ -669,12 +672,12 @@
|
||||
payload.OCA_link = document.getElementById("edOcaLink").value.trim();
|
||||
C.focusAxes.forEach(function (axis) { payload[axis] = num(document.getElementById("ed-" + axis).value, 0); });
|
||||
C.langs.forEach(function (pair) { payload[pair[0]] = num(document.getElementById("ed-" + pair[0]).value, 0); });
|
||||
// The three links, read from their inputs. Only a key we actually have a value for is
|
||||
// The four links, read from their inputs. Only a key we actually have a value for is
|
||||
// touched: an empty optional field must NOT invent an empty string on a record that
|
||||
// never had one — the record's own value (null, or absent) is already in the payload
|
||||
// and is left as it is. A link the record DID carry and the owner cleared is a
|
||||
// deliberate clear and sends "".
|
||||
[["edLinkedin", "Linkedin"], ["edUpwork", "upwork"], ["edFiverr", "fiverr"]].forEach(function (pair) {
|
||||
[["edLinkedin", "Linkedin"], ["edGithub", "github"], ["edUpwork", "upwork"], ["edFiverr", "fiverr"]].forEach(function (pair) {
|
||||
var input = document.getElementById(pair[0]);
|
||||
if (!input) return;
|
||||
var v = input.value.trim();
|
||||
|
||||
Reference in new issue
Block a user