From c598143f868d4a0936a6096f1170bd15e5c637f4 Mon Sep 17 00:00:00 2001 From: Akash negi Date: Wed, 11 Dec 2024 10:12:41 +0530 Subject: [PATCH 1/5] #10516 added ellipsis if more than 5 warnings occurs --- data/languages.json | 20 ++++++---- data/territory_languages.json | 24 +++++------ modules/ui/commit_warnings.js | 75 ++++++++++++++++++++++++++++++++--- 3 files changed, 94 insertions(+), 25 deletions(-) diff --git a/data/languages.json b/data/languages.json index cb1d815832..4b0692c7f8 100644 --- a/data/languages.json +++ b/data/languages.json @@ -48,7 +48,7 @@ "ba": {"nativeName": "башҡорт теле"}, "bal": {"nativeName": "بلۆچی"}, "bal-Arab": {"base": "bal", "script": "Arab"}, - "bal-Latn": {"base": "bal", "script": "Latn"}, + "bal-Latn": {"base": "bal", "script": "Latn", "nativeName": "Balóchi (Látin)"}, "ban": {}, "bar": {}, "bas": {"nativeName": "Ɓàsàa"}, @@ -165,7 +165,7 @@ "dz": {"nativeName": "རྫོང་ཁ"}, "dzg": {}, "ebu": {"nativeName": "Kĩembu"}, - "ee": {"nativeName": "Eʋegbe"}, + "ee": {"nativeName": "eʋegbe"}, "efi": {}, "egl": {}, "egy": {}, @@ -221,7 +221,6 @@ "gmh": {}, "gn": {"nativeName": "avañe’ẽ"}, "goh": {}, - "gom": {}, "gon": {}, "gor": {}, "got": {}, @@ -291,7 +290,8 @@ "jut": {}, "jv": {"nativeName": "Jawa"}, "ka": {"nativeName": "ქართული"}, - "kaa": {}, + "kaa": {"nativeName": "қарақалпақша"}, + "kaa-Cyrl": {"base": "kaa", "script": "Cyrl"}, "kab": {"nativeName": "Taqbaylit"}, "kac": {}, "kaj": {"nativeName": "Kaje"}, @@ -314,6 +314,8 @@ "kiu": {}, "kj": {}, "kk": {"nativeName": "қазақ тілі"}, + "kk-Arab": {"base": "kk", "script": "Arab", "nativeName": "قازاق ءتىلى (توتە)"}, + "kk-Cyrl": {"base": "kk", "script": "Cyrl"}, "kkj": {"nativeName": "kakɔ"}, "kl": {"nativeName": "kalaallisut"}, "kln": {"nativeName": "Kalenjin"}, @@ -325,6 +327,8 @@ "ko-Latn": {"base": "ko", "script": "Latn"}, "koi": {}, "kok": {"nativeName": "कोंकणी"}, + "kok-Deva": {"base": "kok", "script": "Deva"}, + "kok-Latn": {"base": "kok", "script": "Latn"}, "kos": {}, "kpe": {"nativeName": "Kpɛlɛɛ"}, "kr": {}, @@ -365,7 +369,7 @@ "lil": {}, "liv": {}, "lkt": {"nativeName": "Lakȟólʼiyapi"}, - "lld": {"nativeName": "Ladin"}, + "lld": {"nativeName": "ladin"}, "lmo": {"nativeName": "Lombard"}, "ln": {"nativeName": "lingála"}, "lo": {"nativeName": "ລາວ"}, @@ -458,7 +462,7 @@ "nov": {}, "nqo": {"nativeName": "ߒߞߏ"}, "nr": {}, - "nso": {}, + "nso": {"nativeName": "Sesotho sa Leboa"}, "nus": {"nativeName": "Thok Nath"}, "nv": {"nativeName": "Diné Bizaad"}, "nwc": {}, @@ -525,7 +529,7 @@ "rue": {}, "rug": {}, "rup": {}, - "rw": {"nativeName": "Kinyarwanda"}, + "rw": {"nativeName": "Ikinyarwanda"}, "rwk": {"nativeName": "Kiruwa"}, "sa": {"nativeName": "संस्कृत भाषा"}, "sad": {}, @@ -626,7 +630,7 @@ "tli": {}, "tly": {}, "tmh": {}, - "tn": {}, + "tn": {"nativeName": "Setswana"}, "to": {"nativeName": "lea fakatonga"}, "tog": {}, "tok": {"nativeName": "toki pona"}, diff --git a/data/territory_languages.json b/data/territory_languages.json index d110b4eb25..8546933313 100644 --- a/data/territory_languages.json +++ b/data/territory_languages.json @@ -2,7 +2,7 @@ "ac": ["en"], "ad": ["ca", "es", "fr"], "ae": ["ar", "en", "ml", "ps", "bal", "fa"], - "af": ["fa", "ps", "haz", "uz-Arab", "tk", "prd", "bgn", "ug", "kk-Arab"], + "af": ["fa", "ps", "haz", "uz-Arab", "tk", "prd", "bgn", "kaa", "ug", "kk-Arab"], "ag": ["en", "pt"], "ai": ["en"], "al": ["sq", "el", "mk"], @@ -37,7 +37,7 @@ "bw": ["en", "tn", "af"], "by": ["be", "ru"], "bz": ["en", "es"], - "ca": ["en", "fr", "zh", "yue", "es", "pa", "ar", "fil", "it", "de", "ur", "fa", "pt", "ru", "hi", "ta", "vi", "pl", "ko", "gu", "el", "ro", "bn", "pdt", "uk", "sr", "nl", "ja", "hu", "so", "hr", "iu", "iu-Latn", "tr", "oj", "ojs", "chp", "moe", "cr", "mic", "atj", "bla", "crk", "den", "dgr", "csw", "moh", "nsk", "dak", "clc", "hur", "crg", "war", "lil", "oka", "pqm", "crl", "kwk", "gwi"], + "ca": ["en", "fr", "zh", "yue", "es", "pa", "ar", "fil", "it", "de", "ur", "fa", "pt", "ru", "hi", "ta", "vi", "pl", "ko", "gu", "el", "ro", "bn", "pdt", "uk", "sr", "nl", "ja", "hu", "so", "hr", "iu", "iu-Latn", "tr", "oj", "ojs", "chp", "moe", "cr", "mic", "atj", "bla", "crk", "den", "dgr", "csw", "moh", "nsk", "dak", "clc", "crg", "hur", "war", "lil", "oka", "pqm", "crl", "kwk", "gwi"], "cc": ["ms-Arab", "en"], "cd": ["sw", "lua", "fr", "ln", "lu", "kg", "lol", "rw"], "cf": ["fr", "sg", "ln"], @@ -47,7 +47,7 @@ "ck": ["en"], "cl": ["es", "en", "arn"], "cm": ["fr", "en", "bum", "ff", "ewo", "ybb", "bbj", "nnh", "bkm", "bas", "bax", "byv", "mua", "maf", "bfd", "bss", "kkj", "dua", "mgo", "ar", "jgo", "ksf", "ken", "agq", "ha-Arab", "nmg", "yav", "ff-Adlm"], - "cn": ["zh", "wuu", "yue-Hans", "hsn", "hak", "nan", "gan", "ii", "ug", "za", "mn-Mong", "bo", "ko", "kk-Arab", "lis", "ky-Arab", "nxq", "khb", "tdd", "lcp", "en", "hnj", "ru", "vi", "uz-Cyrl", "lzh"], + "cn": ["zh", "wuu", "yue", "yue-Hans", "hsn", "hak", "nan", "gan", "ii", "ug", "za", "mn-Mong", "bo", "ko", "kk-Arab", "lis", "ky-Arab", "nxq", "khb", "tdd", "lcp", "en", "hnj", "ru", "vi", "uz-Cyrl", "lzh"], "co": ["es", "guc", "yrl"], "cp": ["und"], "cq": ["en"], @@ -80,7 +80,7 @@ "fo": ["fo"], "fr": ["fr", "en", "es", "de", "oc", "it", "pt", "pcd", "gsw", "br", "co", "hnj", "ca", "eu", "nl", "frp", "ia"], "ga": ["fr", "puu"], - "gb": ["en", "fr", "de", "es", "pl", "pa", "ur", "ta", "gu", "sco", "cy", "bn", "ar", "zh-Hant", "it", "lt", "pt", "so", "tr", "ga", "gd", "kw", "en-Shaw"], + "gb": ["en", "fr", "de", "es", "pl", "pa", "ur", "ta", "gu", "sco", "cy", "ro", "bn", "ar", "zh-Hant", "it", "lt", "pt", "so", "tr", "ga", "gd", "kw", "en-Shaw"], "gd": ["en"], "ge": ["ka", "xmf", "ru", "hy", "ab", "os", "ku"], "gf": ["fr", "gcr", "zh-Hant", "hnj"], @@ -109,18 +109,18 @@ "ie": ["en", "ga", "fr"], "il": ["he", "en", "ar", "apc", "ru", "ro", "yi", "pl", "lad", "hu", "am", "ti", "ml"], "im": ["en", "gv"], - "in": ["hi", "en", "bn", "te", "mr", "ta", "ur", "gu", "kn", "ml", "or", "pa", "bho", "awa", "as", "bgc", "mag", "mai", "mwr", "hne", "dcc", "bjj", "ne", "sat", "wtm", "rkt", "ks", "kok", "gom", "swv", "gbm", "lmn", "sd", "gon", "kfy", "doi", "kru", "sck", "wbq", "xnr", "khn", "tcy", "wbr", "brx", "sd-Deva", "noe", "bhb", "mni", "hi-Latn", "raj", "hoc", "mtr", "unr", "bhi", "hoj", "kha", "kfr", "grt", "unx", "bfy", "srx", "saz", "ccp", "bfq", "njo", "ria", "bo", "bpy", "bft", "bra", "lep", "kxv", "btv", "lif", "lah", "sa", "kht", "dv", "dz"], + "in": ["hi", "en", "bn", "te", "mr", "ta", "ur", "gu", "kn", "ml", "or", "pa", "bho", "awa", "as", "bgc", "mag", "mai", "mwr", "hne", "dcc", "bjj", "ne", "sat", "wtm", "rkt", "ks", "knn", "kok", "swv", "gbm", "lmn", "sd", "gon", "kfy", "doi", "kru", "sck", "wbq", "xnr", "khn", "tcy", "wbr", "brx", "sd-Deva", "noe", "bhb", "mni", "hi-Latn", "raj", "hoc", "mtr", "unr", "bhi", "hoj", "kha", "kfr", "grt", "unx", "bfy", "srx", "saz", "ccp", "bfq", "njo", "ria", "bo", "bpy", "bft", "bra", "lep", "kxv", "btv", "lif", "lah", "sa", "kht", "dv", "dz"], "io": ["en"], "iq": ["ar", "en", "ckb", "az-Arab", "fa", "lrc", "syr"], - "ir": ["fa", "az-Arab", "mzn", "glk", "ckb", "sdh", "tk", "lrc", "ar", "bal", "rmt", "bqi", "luz", "lki", "bgn", "prd", "hy", "ps", "ka", "gbz", "kk-Arab"], + "ir": ["fa", "az-Arab", "mzn", "glk", "ckb", "sdh", "tk", "lrc", "ar", "bal", "rmt", "bqi", "luz", "lki", "kaa", "bgn", "prd", "hy", "ps", "ka", "gbz", "kk-Arab"], "is": ["is", "da"], - "it": ["it", "en", "fr", "lmo", "sc", "de", "vec", "nap", "lij", "scn", "sdc", "sl", "fur", "egl", "ca", "el", "pms", "hr", "rgn", "lld"], + "it": ["it", "en", "fr", "lmo", "sc", "de", "vec", "nap", "lij", "scn", "sdc", "sl", "fur", "egl", "lld", "ca", "el", "pms", "hr", "mhn", "rgn", "lld"], "je": ["en"], "jm": ["en", "jam"], "jo": ["ar", "apc", "en"], "jp": ["ja", "ryu", "ko"], "ke": ["sw", "en", "ki", "luy", "luo", "kam", "kln", "guz", "mer", "mas", "ebu", "so", "dav", "teo", "pko", "om", "saq", "ar", "pa", "gu"], - "kg": ["ky", "ru"], + "kg": ["ky", "ru", "kaa"], "kh": ["km", "cja", "kdt"], "ki": ["en", "gil"], "km": ["ar", "fr", "zdj", "wni"], @@ -129,7 +129,7 @@ "kr": ["ko"], "kw": ["ar"], "ky": ["en"], - "kz": ["ru", "kk", "en", "de", "ug-Cyrl"], + "kz": ["ru", "kk", "en", "de", "ug-Cyrl", "kaa"], "la": ["lo", "kjg", "hnj", "kdt"], "lb": ["apc", "ar", "en", "hy", "ku-Arab", "fr"], "lc": ["en"], @@ -195,7 +195,7 @@ "re": ["fr", "rcf", "ta"], "ro": ["ro", "en", "fr", "es", "hu", "de", "tr", "sr-Latn", "bg", "el", "pl"], "rs": ["sr", "sr-Latn", "sq", "hu", "ro", "hr", "sk", "uk"], - "ru": ["ru", "tt", "ba", "cv", "hy", "ce", "av", "udm", "chm", "os", "sah", "kbd", "myv", "dar", "bua", "mdf", "kum", "kv", "lez", "krc", "inh", "tyv", "az-Cyrl", "ady", "krl", "lbe", "koi", "mrj", "alt", "fi", "sr-Latn", "vep", "mn", "izh", "cu", "vot"], + "ru": ["ru", "tt", "ba", "cv", "hy", "ce", "av", "udm", "chm", "os", "sah", "kbd", "myv", "dar", "bua", "mdf", "kum", "kv", "lez", "krc", "inh", "tyv", "az-Cyrl", "ady", "krl", "lbe", "koi", "mrj", "alt", "fi", "sr-Latn", "vep", "mn", "kaa", "izh", "cu", "vot"], "rw": ["rw", "en", "fr"], "sa": ["ar", "ars"], "sb": ["en", "pis", "rug"], @@ -227,10 +227,10 @@ "tj": ["tg", "ru", "fa", "ar"], "tk": ["en", "tkl"], "tl": ["pt", "tet"], - "tm": ["tk", "ru", "uz", "ku"], + "tm": ["tk", "ru", "uz", "ku", "kaa"], "tn": ["aeb", "ar", "fr"], "to": ["to", "en"], - "tr": ["tr", "en", "ku", "apc", "zza", "kbd", "az", "az-Arab", "ar", "bgx", "bg", "ady", "kiu", "hy", "ka", "lzz", "sr-Latn", "sq", "ab", "el", "tru", "uz", "ky-Latn", "kk"], + "tr": ["tr", "en", "ku", "apc", "zza", "kbd", "az", "az-Arab", "ar", "bgx", "bg", "ady", "kiu", "kaa", "hy", "ka", "lzz", "sr-Latn", "sq", "ab", "el", "tru", "uz", "ky-Latn", "kk"], "tt": ["en", "es"], "tv": ["tvl", "en"], "tw": ["zh-Hant", "trv"], diff --git a/modules/ui/commit_warnings.js b/modules/ui/commit_warnings.js index 71c9f8a4ee..19f2ea1d19 100644 --- a/modules/ui/commit_warnings.js +++ b/modules/ui/commit_warnings.js @@ -19,11 +19,16 @@ export function uiCommitWarnings(context) { issues = issues.filter(function(issue) { return issue.type !== 'help_request'; }); } + var displayIssues = issues.slice(0, 5); // Display only the first warning + var hiddenIssues = issues.slice(5); // Remaining warnings + var hasMoreIssues = issues.length > 5; // Check if there are more than 5 issues + + var section = severity + '-section'; var issueItem = severity + '-item'; var container = selection.selectAll('.' + section) - .data(issues.length ? [0] : []); + .data(displayIssues.length ? [0] : []); container.exit() .remove(); @@ -45,7 +50,7 @@ export function uiCommitWarnings(context) { var items = container.select('ul').selectAll('li') - .data(issues, function(d) { return d.key; }); + .data(displayIssues, function(d) { return d.key; }); items.exit() .remove(); @@ -92,12 +97,72 @@ export function uiCommitWarnings(context) { items.selectAll('.issue-message') .text('') - .each(function(d) { + .each(function(d){ return d.message(context)(d3_select(this)); - }); + }); + + // Adding ellipsis if there are more issues + if (hasMoreIssues) { + // IIFE to create a new scope for each instance + (function(localContainer) { + + var ellipsisItem = localContainer.select('ul').selectAll('.ellipsis') + .data([0]); + + ellipsisItem.enter() + .append('div') + .attr('class', 'ellipsis') + .append('button') + .text('...More warnings') + .on('click', function() { + var hiddenItems = localContainer.select('ul').selectAll('.hidden-warning'); + if (!hiddenItems.empty()) { + var isHidden = hiddenItems.style('display') === 'none'; + hiddenItems.style('display', isHidden ? 'block' : 'none'); + d3_select(this).text(isHidden ? 'Show less' : '...More warnings'); // Change button text + } + }); + + ellipsisItem.exit().remove(); + + var hiddenItems = localContainer.select('ul').selectAll('.hidden-warning') + .data(hiddenIssues, function(d) { return d.key; }); + + var hiddenItemsEnter = hiddenItems.enter() + .append('li') + .attr('class', 'hidden-warning ' + issueItem) + .style('display', 'none'); // Hide the additional warnings initially + + hiddenItemsEnter.append('button') + .on('mouseover', function(d3_event, d) { + if (d.entityIds) { + context.surface().selectAll( + utilEntityOrMemberSelector( + d.entityIds, + context.graph() + ) + ).classed('hover', true); + } + }) + .on('mouseout', function() { + context.surface().selectAll('.hover').classed('hover', false); + }) + .on('click', function(d3_event, d) { + context.validator().focusIssue(d); + }) + .call(svgIcon('#iD-icon-alert', 'pre-text')) + .append('strong') + .attr('class', 'issue-message') + .text('') + .each(function(d) { + return d.message(context)(d3_select(this)); + }); + + hiddenItems.exit().remove(); + })(container); // Pass the container to the IIFE + } } } - return commitWarnings; } From 03e4d02df266313e552b0e2b6faf100de83e3bf6 Mon Sep 17 00:00:00 2001 From: Akash negi Date: Thu, 12 Dec 2024 15:21:26 +0530 Subject: [PATCH 2/5] added chevron icon UI to commitWarning --- modules/ui/commit_warnings.js | 218 ++++++++++++---------------------- 1 file changed, 74 insertions(+), 144 deletions(-) diff --git a/modules/ui/commit_warnings.js b/modules/ui/commit_warnings.js index 19f2ea1d19..9803569d94 100644 --- a/modules/ui/commit_warnings.js +++ b/modules/ui/commit_warnings.js @@ -1,168 +1,98 @@ import { select as d3_select } from 'd3-selection'; - import { t } from '../core/localizer'; import { svgIcon } from '../svg/icon'; -import { uiTooltip } from './tooltip'; +import { uiSection } from '../ui/section'; import { utilEntityOrMemberSelector } from '../util'; - export function uiCommitWarnings(context) { + var _issuesBySeverity = {}; + function commitWarnings(selection) { - var issuesBySeverity = context.validator() + // Load issues by severity + _issuesBySeverity = context.validator() .getIssuesBySeverity({ what: 'edited', where: 'all', includeDisabledRules: true }); - for (var severity in issuesBySeverity) { - var issues = issuesBySeverity[severity]; + for (let severity in _issuesBySeverity) { + let issues = _issuesBySeverity[severity]; - if (severity !== 'error') { // exclude 'fixme' and similar - #8603 + if (severity !== 'error') { // exclude 'fixme' and similar - #8603 issues = issues.filter(function(issue) { return issue.type !== 'help_request'; }); } - var displayIssues = issues.slice(0, 5); // Display only the first warning - var hiddenIssues = issues.slice(5); // Remaining warnings - var hasMoreIssues = issues.length > 5; // Check if there are more than 5 issues - - - var section = severity + '-section'; - var issueItem = severity + '-item'; - - var container = selection.selectAll('.' + section) - .data(displayIssues.length ? [0] : []); - - container.exit() - .remove(); - - var containerEnter = container.enter() - .append('div') - .attr('class', 'modal-section ' + section + ' fillL2'); - - containerEnter - .append('h3') - .call(severity === 'warning' ? t.append('commit.warnings') : t.append('commit.errors')); + if (!issues.length) continue; - containerEnter - .append('ul') - .attr('class', 'changeset-list'); - - container = containerEnter - .merge(container); - - - var items = container.select('ul').selectAll('li') - .data(displayIssues, function(d) { return d.key; }); - - items.exit() - .remove(); - - var itemsEnter = items.enter() - .append('li') - .attr('class', issueItem); - - var buttons = itemsEnter - .append('button') - .on('mouseover', function(d3_event, d) { - if (d.entityIds) { - context.surface().selectAll( - utilEntityOrMemberSelector( - d.entityIds, - context.graph() - ) - ).classed('hover', true); - } + // Create a collapsible section for each severity level + var section = uiSection('issues-'+ severity , context) + .label(() => { + var count = issues.length; + return t.append( + 'inspector.title_count', + { title: t('issues.' + severity + 's.list_title'), count: count } + ); }) - .on('mouseout', function() { - context.surface().selectAll('.hover') - .classed('hover', false); + .disclosureContent(function(selection) { + return renderIssuesList(selection, severity, issues); }) - .on('click', function(d3_event, d) { - context.validator().focusIssue(d); + .shouldDisplay(function() { + return issues && issues.length; }); - buttons - .call(svgIcon('#iD-icon-alert', 'pre-text')); - - buttons - .append('strong') - .attr('class', 'issue-message'); - - buttons.filter(function(d) { return d.tooltip; }) - .call(uiTooltip() - .title(function(d) { return d.tooltip; }) - .placement('top') - ); - - items = itemsEnter - .merge(items); - - items.selectAll('.issue-message') - .text('') - .each(function(d){ - return d.message(context)(d3_select(this)); - }); - - // Adding ellipsis if there are more issues - if (hasMoreIssues) { - // IIFE to create a new scope for each instance - (function(localContainer) { - - var ellipsisItem = localContainer.select('ul').selectAll('.ellipsis') - .data([0]); - - ellipsisItem.enter() - .append('div') - .attr('class', 'ellipsis') - .append('button') - .text('...More warnings') - .on('click', function() { - var hiddenItems = localContainer.select('ul').selectAll('.hidden-warning'); - if (!hiddenItems.empty()) { - var isHidden = hiddenItems.style('display') === 'none'; - hiddenItems.style('display', isHidden ? 'block' : 'none'); - d3_select(this).text(isHidden ? 'Show less' : '...More warnings'); // Change button text - } - }); - - ellipsisItem.exit().remove(); - - var hiddenItems = localContainer.select('ul').selectAll('.hidden-warning') - .data(hiddenIssues, function(d) { return d.key; }); - - var hiddenItemsEnter = hiddenItems.enter() - .append('li') - .attr('class', 'hidden-warning ' + issueItem) - .style('display', 'none'); // Hide the additional warnings initially - - hiddenItemsEnter.append('button') - .on('mouseover', function(d3_event, d) { - if (d.entityIds) { - context.surface().selectAll( - utilEntityOrMemberSelector( - d.entityIds, - context.graph() - ) - ).classed('hover', true); - } - }) - .on('mouseout', function() { - context.surface().selectAll('.hover').classed('hover', false); - }) - .on('click', function(d3_event, d) { - context.validator().focusIssue(d); - }) - .call(svgIcon('#iD-icon-alert', 'pre-text')) - .append('strong') - .attr('class', 'issue-message') - .text('') - .each(function(d) { - return d.message(context)(d3_select(this)); - }); - - hiddenItems.exit().remove(); - })(container); // Pass the container to the IIFE - } + selection.call(section.render); } } + function renderIssuesList(selection, severity, issues) { + selection.selectAll('.issues-list').remove(); + var container = selection + .append('ul') + .attr('class', 'changeset-list issues-list ' + severity + '-list'); + + container.exit().remove(); + + var items = container.selectAll('li') + .data(issues, function(d) { return d.key; }); + + items.exit().remove(); + + var itemsEnter = items.enter() + .append('li') + .attr('class', severity + '-item'); + + var buttons = itemsEnter + .append('button') + .on('mouseover', function(d3_event, d) { + if (d.entityIds) { + context.surface().selectAll( + utilEntityOrMemberSelector( + d.entityIds, + context.graph() + ) + ).classed('hover', true); + } + }) + .on('mouseout', function() { + context.surface().selectAll('.hover').classed('hover', false); + }) + .on('click', function(d3_event, d) { + context.validator().focusIssue(d); + }); + + buttons + .call(svgIcon('#iD-icon-alert', 'pre-text')); + + buttons + .append('strong') + .attr('class', 'issue-message'); + + itemsEnter + .merge(items) + .selectAll('.issue-message') + .text('') + .each(function(d) { + return d.message(context)(d3_select(this)); + }); + } + return commitWarnings; } From 7c5b0bbcd4d7442126fdeec60e018d30bb564f35 Mon Sep 17 00:00:00 2001 From: Akash negi Date: Thu, 12 Dec 2024 15:32:58 +0530 Subject: [PATCH 3/5] removed unrelated changes from data directory --- data/languages.json | 20 ++++++++------------ data/territory_languages.json | 24 ++++++++++++------------ 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/data/languages.json b/data/languages.json index 4b0692c7f8..cb1d815832 100644 --- a/data/languages.json +++ b/data/languages.json @@ -48,7 +48,7 @@ "ba": {"nativeName": "башҡорт теле"}, "bal": {"nativeName": "بلۆچی"}, "bal-Arab": {"base": "bal", "script": "Arab"}, - "bal-Latn": {"base": "bal", "script": "Latn", "nativeName": "Balóchi (Látin)"}, + "bal-Latn": {"base": "bal", "script": "Latn"}, "ban": {}, "bar": {}, "bas": {"nativeName": "Ɓàsàa"}, @@ -165,7 +165,7 @@ "dz": {"nativeName": "རྫོང་ཁ"}, "dzg": {}, "ebu": {"nativeName": "Kĩembu"}, - "ee": {"nativeName": "eʋegbe"}, + "ee": {"nativeName": "Eʋegbe"}, "efi": {}, "egl": {}, "egy": {}, @@ -221,6 +221,7 @@ "gmh": {}, "gn": {"nativeName": "avañe’ẽ"}, "goh": {}, + "gom": {}, "gon": {}, "gor": {}, "got": {}, @@ -290,8 +291,7 @@ "jut": {}, "jv": {"nativeName": "Jawa"}, "ka": {"nativeName": "ქართული"}, - "kaa": {"nativeName": "қарақалпақша"}, - "kaa-Cyrl": {"base": "kaa", "script": "Cyrl"}, + "kaa": {}, "kab": {"nativeName": "Taqbaylit"}, "kac": {}, "kaj": {"nativeName": "Kaje"}, @@ -314,8 +314,6 @@ "kiu": {}, "kj": {}, "kk": {"nativeName": "қазақ тілі"}, - "kk-Arab": {"base": "kk", "script": "Arab", "nativeName": "قازاق ءتىلى (توتە)"}, - "kk-Cyrl": {"base": "kk", "script": "Cyrl"}, "kkj": {"nativeName": "kakɔ"}, "kl": {"nativeName": "kalaallisut"}, "kln": {"nativeName": "Kalenjin"}, @@ -327,8 +325,6 @@ "ko-Latn": {"base": "ko", "script": "Latn"}, "koi": {}, "kok": {"nativeName": "कोंकणी"}, - "kok-Deva": {"base": "kok", "script": "Deva"}, - "kok-Latn": {"base": "kok", "script": "Latn"}, "kos": {}, "kpe": {"nativeName": "Kpɛlɛɛ"}, "kr": {}, @@ -369,7 +365,7 @@ "lil": {}, "liv": {}, "lkt": {"nativeName": "Lakȟólʼiyapi"}, - "lld": {"nativeName": "ladin"}, + "lld": {"nativeName": "Ladin"}, "lmo": {"nativeName": "Lombard"}, "ln": {"nativeName": "lingála"}, "lo": {"nativeName": "ລາວ"}, @@ -462,7 +458,7 @@ "nov": {}, "nqo": {"nativeName": "ߒߞߏ"}, "nr": {}, - "nso": {"nativeName": "Sesotho sa Leboa"}, + "nso": {}, "nus": {"nativeName": "Thok Nath"}, "nv": {"nativeName": "Diné Bizaad"}, "nwc": {}, @@ -529,7 +525,7 @@ "rue": {}, "rug": {}, "rup": {}, - "rw": {"nativeName": "Ikinyarwanda"}, + "rw": {"nativeName": "Kinyarwanda"}, "rwk": {"nativeName": "Kiruwa"}, "sa": {"nativeName": "संस्कृत भाषा"}, "sad": {}, @@ -630,7 +626,7 @@ "tli": {}, "tly": {}, "tmh": {}, - "tn": {"nativeName": "Setswana"}, + "tn": {}, "to": {"nativeName": "lea fakatonga"}, "tog": {}, "tok": {"nativeName": "toki pona"}, diff --git a/data/territory_languages.json b/data/territory_languages.json index 8546933313..d110b4eb25 100644 --- a/data/territory_languages.json +++ b/data/territory_languages.json @@ -2,7 +2,7 @@ "ac": ["en"], "ad": ["ca", "es", "fr"], "ae": ["ar", "en", "ml", "ps", "bal", "fa"], - "af": ["fa", "ps", "haz", "uz-Arab", "tk", "prd", "bgn", "kaa", "ug", "kk-Arab"], + "af": ["fa", "ps", "haz", "uz-Arab", "tk", "prd", "bgn", "ug", "kk-Arab"], "ag": ["en", "pt"], "ai": ["en"], "al": ["sq", "el", "mk"], @@ -37,7 +37,7 @@ "bw": ["en", "tn", "af"], "by": ["be", "ru"], "bz": ["en", "es"], - "ca": ["en", "fr", "zh", "yue", "es", "pa", "ar", "fil", "it", "de", "ur", "fa", "pt", "ru", "hi", "ta", "vi", "pl", "ko", "gu", "el", "ro", "bn", "pdt", "uk", "sr", "nl", "ja", "hu", "so", "hr", "iu", "iu-Latn", "tr", "oj", "ojs", "chp", "moe", "cr", "mic", "atj", "bla", "crk", "den", "dgr", "csw", "moh", "nsk", "dak", "clc", "crg", "hur", "war", "lil", "oka", "pqm", "crl", "kwk", "gwi"], + "ca": ["en", "fr", "zh", "yue", "es", "pa", "ar", "fil", "it", "de", "ur", "fa", "pt", "ru", "hi", "ta", "vi", "pl", "ko", "gu", "el", "ro", "bn", "pdt", "uk", "sr", "nl", "ja", "hu", "so", "hr", "iu", "iu-Latn", "tr", "oj", "ojs", "chp", "moe", "cr", "mic", "atj", "bla", "crk", "den", "dgr", "csw", "moh", "nsk", "dak", "clc", "hur", "crg", "war", "lil", "oka", "pqm", "crl", "kwk", "gwi"], "cc": ["ms-Arab", "en"], "cd": ["sw", "lua", "fr", "ln", "lu", "kg", "lol", "rw"], "cf": ["fr", "sg", "ln"], @@ -47,7 +47,7 @@ "ck": ["en"], "cl": ["es", "en", "arn"], "cm": ["fr", "en", "bum", "ff", "ewo", "ybb", "bbj", "nnh", "bkm", "bas", "bax", "byv", "mua", "maf", "bfd", "bss", "kkj", "dua", "mgo", "ar", "jgo", "ksf", "ken", "agq", "ha-Arab", "nmg", "yav", "ff-Adlm"], - "cn": ["zh", "wuu", "yue", "yue-Hans", "hsn", "hak", "nan", "gan", "ii", "ug", "za", "mn-Mong", "bo", "ko", "kk-Arab", "lis", "ky-Arab", "nxq", "khb", "tdd", "lcp", "en", "hnj", "ru", "vi", "uz-Cyrl", "lzh"], + "cn": ["zh", "wuu", "yue-Hans", "hsn", "hak", "nan", "gan", "ii", "ug", "za", "mn-Mong", "bo", "ko", "kk-Arab", "lis", "ky-Arab", "nxq", "khb", "tdd", "lcp", "en", "hnj", "ru", "vi", "uz-Cyrl", "lzh"], "co": ["es", "guc", "yrl"], "cp": ["und"], "cq": ["en"], @@ -80,7 +80,7 @@ "fo": ["fo"], "fr": ["fr", "en", "es", "de", "oc", "it", "pt", "pcd", "gsw", "br", "co", "hnj", "ca", "eu", "nl", "frp", "ia"], "ga": ["fr", "puu"], - "gb": ["en", "fr", "de", "es", "pl", "pa", "ur", "ta", "gu", "sco", "cy", "ro", "bn", "ar", "zh-Hant", "it", "lt", "pt", "so", "tr", "ga", "gd", "kw", "en-Shaw"], + "gb": ["en", "fr", "de", "es", "pl", "pa", "ur", "ta", "gu", "sco", "cy", "bn", "ar", "zh-Hant", "it", "lt", "pt", "so", "tr", "ga", "gd", "kw", "en-Shaw"], "gd": ["en"], "ge": ["ka", "xmf", "ru", "hy", "ab", "os", "ku"], "gf": ["fr", "gcr", "zh-Hant", "hnj"], @@ -109,18 +109,18 @@ "ie": ["en", "ga", "fr"], "il": ["he", "en", "ar", "apc", "ru", "ro", "yi", "pl", "lad", "hu", "am", "ti", "ml"], "im": ["en", "gv"], - "in": ["hi", "en", "bn", "te", "mr", "ta", "ur", "gu", "kn", "ml", "or", "pa", "bho", "awa", "as", "bgc", "mag", "mai", "mwr", "hne", "dcc", "bjj", "ne", "sat", "wtm", "rkt", "ks", "knn", "kok", "swv", "gbm", "lmn", "sd", "gon", "kfy", "doi", "kru", "sck", "wbq", "xnr", "khn", "tcy", "wbr", "brx", "sd-Deva", "noe", "bhb", "mni", "hi-Latn", "raj", "hoc", "mtr", "unr", "bhi", "hoj", "kha", "kfr", "grt", "unx", "bfy", "srx", "saz", "ccp", "bfq", "njo", "ria", "bo", "bpy", "bft", "bra", "lep", "kxv", "btv", "lif", "lah", "sa", "kht", "dv", "dz"], + "in": ["hi", "en", "bn", "te", "mr", "ta", "ur", "gu", "kn", "ml", "or", "pa", "bho", "awa", "as", "bgc", "mag", "mai", "mwr", "hne", "dcc", "bjj", "ne", "sat", "wtm", "rkt", "ks", "kok", "gom", "swv", "gbm", "lmn", "sd", "gon", "kfy", "doi", "kru", "sck", "wbq", "xnr", "khn", "tcy", "wbr", "brx", "sd-Deva", "noe", "bhb", "mni", "hi-Latn", "raj", "hoc", "mtr", "unr", "bhi", "hoj", "kha", "kfr", "grt", "unx", "bfy", "srx", "saz", "ccp", "bfq", "njo", "ria", "bo", "bpy", "bft", "bra", "lep", "kxv", "btv", "lif", "lah", "sa", "kht", "dv", "dz"], "io": ["en"], "iq": ["ar", "en", "ckb", "az-Arab", "fa", "lrc", "syr"], - "ir": ["fa", "az-Arab", "mzn", "glk", "ckb", "sdh", "tk", "lrc", "ar", "bal", "rmt", "bqi", "luz", "lki", "kaa", "bgn", "prd", "hy", "ps", "ka", "gbz", "kk-Arab"], + "ir": ["fa", "az-Arab", "mzn", "glk", "ckb", "sdh", "tk", "lrc", "ar", "bal", "rmt", "bqi", "luz", "lki", "bgn", "prd", "hy", "ps", "ka", "gbz", "kk-Arab"], "is": ["is", "da"], - "it": ["it", "en", "fr", "lmo", "sc", "de", "vec", "nap", "lij", "scn", "sdc", "sl", "fur", "egl", "lld", "ca", "el", "pms", "hr", "mhn", "rgn", "lld"], + "it": ["it", "en", "fr", "lmo", "sc", "de", "vec", "nap", "lij", "scn", "sdc", "sl", "fur", "egl", "ca", "el", "pms", "hr", "rgn", "lld"], "je": ["en"], "jm": ["en", "jam"], "jo": ["ar", "apc", "en"], "jp": ["ja", "ryu", "ko"], "ke": ["sw", "en", "ki", "luy", "luo", "kam", "kln", "guz", "mer", "mas", "ebu", "so", "dav", "teo", "pko", "om", "saq", "ar", "pa", "gu"], - "kg": ["ky", "ru", "kaa"], + "kg": ["ky", "ru"], "kh": ["km", "cja", "kdt"], "ki": ["en", "gil"], "km": ["ar", "fr", "zdj", "wni"], @@ -129,7 +129,7 @@ "kr": ["ko"], "kw": ["ar"], "ky": ["en"], - "kz": ["ru", "kk", "en", "de", "ug-Cyrl", "kaa"], + "kz": ["ru", "kk", "en", "de", "ug-Cyrl"], "la": ["lo", "kjg", "hnj", "kdt"], "lb": ["apc", "ar", "en", "hy", "ku-Arab", "fr"], "lc": ["en"], @@ -195,7 +195,7 @@ "re": ["fr", "rcf", "ta"], "ro": ["ro", "en", "fr", "es", "hu", "de", "tr", "sr-Latn", "bg", "el", "pl"], "rs": ["sr", "sr-Latn", "sq", "hu", "ro", "hr", "sk", "uk"], - "ru": ["ru", "tt", "ba", "cv", "hy", "ce", "av", "udm", "chm", "os", "sah", "kbd", "myv", "dar", "bua", "mdf", "kum", "kv", "lez", "krc", "inh", "tyv", "az-Cyrl", "ady", "krl", "lbe", "koi", "mrj", "alt", "fi", "sr-Latn", "vep", "mn", "kaa", "izh", "cu", "vot"], + "ru": ["ru", "tt", "ba", "cv", "hy", "ce", "av", "udm", "chm", "os", "sah", "kbd", "myv", "dar", "bua", "mdf", "kum", "kv", "lez", "krc", "inh", "tyv", "az-Cyrl", "ady", "krl", "lbe", "koi", "mrj", "alt", "fi", "sr-Latn", "vep", "mn", "izh", "cu", "vot"], "rw": ["rw", "en", "fr"], "sa": ["ar", "ars"], "sb": ["en", "pis", "rug"], @@ -227,10 +227,10 @@ "tj": ["tg", "ru", "fa", "ar"], "tk": ["en", "tkl"], "tl": ["pt", "tet"], - "tm": ["tk", "ru", "uz", "ku", "kaa"], + "tm": ["tk", "ru", "uz", "ku"], "tn": ["aeb", "ar", "fr"], "to": ["to", "en"], - "tr": ["tr", "en", "ku", "apc", "zza", "kbd", "az", "az-Arab", "ar", "bgx", "bg", "ady", "kiu", "kaa", "hy", "ka", "lzz", "sr-Latn", "sq", "ab", "el", "tru", "uz", "ky-Latn", "kk"], + "tr": ["tr", "en", "ku", "apc", "zza", "kbd", "az", "az-Arab", "ar", "bgx", "bg", "ady", "kiu", "hy", "ka", "lzz", "sr-Latn", "sq", "ab", "el", "tru", "uz", "ky-Latn", "kk"], "tt": ["en", "es"], "tv": ["tvl", "en"], "tw": ["zh-Hant", "trv"], From d11014d6cf370f23a046a596394612d77580b0e7 Mon Sep 17 00:00:00 2001 From: Akash negi Date: Sat, 14 Dec 2024 07:24:29 +0530 Subject: [PATCH 4/5] fixed CSS of the warning section --- modules/ui/commit_warnings.js | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/modules/ui/commit_warnings.js b/modules/ui/commit_warnings.js index 9803569d94..d99f5e412e 100644 --- a/modules/ui/commit_warnings.js +++ b/modules/ui/commit_warnings.js @@ -5,10 +5,12 @@ import { uiSection } from '../ui/section'; import { utilEntityOrMemberSelector } from '../util'; export function uiCommitWarnings(context) { - var _issuesBySeverity = {}; function commitWarnings(selection) { + // Wrap the selection in a div with the class modal-section + selection = selection.append('div').attr('class', 'modal-section'); + // Load issues by severity _issuesBySeverity = context.validator() .getIssuesBySeverity({ what: 'edited', where: 'all', includeDisabledRules: true }); @@ -23,7 +25,7 @@ export function uiCommitWarnings(context) { if (!issues.length) continue; // Create a collapsible section for each severity level - var section = uiSection('issues-'+ severity , context) + var section = uiSection('issues-' + severity, context) .label(() => { var count = issues.length; return t.append( @@ -38,7 +40,10 @@ export function uiCommitWarnings(context) { return issues && issues.length; }); - selection.call(section.render); + // Add the appropriate class for styling based on severity + selection + .call(section.render) + .classed(severity + '-section', true); } } @@ -46,9 +51,9 @@ export function uiCommitWarnings(context) { selection.selectAll('.issues-list').remove(); var container = selection .append('ul') - .attr('class', 'changeset-list issues-list ' + severity + '-list'); + .attr('class', 'layer-list issues-list ' + severity + 's-list'); - container.exit().remove(); + container.exit().remove(); var items = container.selectAll('li') .data(issues, function(d) { return d.key; }); @@ -57,7 +62,7 @@ export function uiCommitWarnings(context) { var itemsEnter = items.enter() .append('li') - .attr('class', severity + '-item'); + .attr('class', function (d) { return 'issue severity-' + d.severity; }); var buttons = itemsEnter .append('button') @@ -78,11 +83,21 @@ export function uiCommitWarnings(context) { context.validator().focusIssue(d); }); - buttons - .call(svgIcon('#iD-icon-alert', 'pre-text')); + var textEnter = buttons + .append('span') + .attr('class', 'issue-text'); + + textEnter + .append('span') + .attr('class', 'issue-icon') + .each(function(d) { + var iconName = '#iD-icon-' + (d.severity === 'warning' ? 'alert' : 'error'); + d3_select(this) + .call(svgIcon(iconName)); + }); - buttons - .append('strong') + textEnter + .append('span') .attr('class', 'issue-message'); itemsEnter From 6b2ee66542ee8a84dc1af1301bb114683b1ebf6a Mon Sep 17 00:00:00 2001 From: Akash negi Date: Wed, 18 Dec 2024 22:22:23 +0530 Subject: [PATCH 5/5] restored the css class of the
    to changeset-list --- modules/ui/commit_warnings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ui/commit_warnings.js b/modules/ui/commit_warnings.js index d99f5e412e..09da9ab784 100644 --- a/modules/ui/commit_warnings.js +++ b/modules/ui/commit_warnings.js @@ -51,7 +51,7 @@ export function uiCommitWarnings(context) { selection.selectAll('.issues-list').remove(); var container = selection .append('ul') - .attr('class', 'layer-list issues-list ' + severity + 's-list'); + .attr('class', 'changeset-list'); container.exit().remove();