diff --git a/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/controller/UserController.java b/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/controller/UserController.java index 553654b1..9d430b61 100644 --- a/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/controller/UserController.java +++ b/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/controller/UserController.java @@ -5,6 +5,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; @@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import eu.dnetlib.organizations.model.utils.VocabularyTerm; import eu.dnetlib.organizations.model.view.UserView; import eu.dnetlib.organizations.repository.UserRepository; import eu.dnetlib.organizations.repository.readonly.UserViewRepository; @@ -55,7 +57,10 @@ public class UserController { // IMPORTANT: a national admin can manage ONLY the users where ALL the countries are under his control final List res = new ArrayList<>(); - final List myCountries = dbUtils.listCountriesForUser(authentication.getName()); + final List myCountries = dbUtils.listCountriesForUser(authentication.getName()) + .stream() + .map(VocabularyTerm::getValue) + .collect(Collectors.toList()); for (final UserView uw : userViewRepository.findAll()) { if (uw.getCountries() != null && uw.getCountries().length > 0 && myCountries.containsAll(Arrays.asList(uw.getCountries()))) { diff --git a/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/controller/VocabulariesController.java b/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/controller/VocabulariesController.java index d4045814..9c32a61e 100644 --- a/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/controller/VocabulariesController.java +++ b/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/controller/VocabulariesController.java @@ -12,6 +12,7 @@ import org.springframework.security.core.Authentication; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; +import eu.dnetlib.organizations.model.utils.VocabularyTerm; import eu.dnetlib.organizations.utils.DatabaseUtils; import eu.dnetlib.organizations.utils.DatabaseUtils.VocabularyTable; import eu.dnetlib.organizations.utils.RelationType; @@ -24,28 +25,34 @@ public class VocabulariesController { private DatabaseUtils databaseUtils; @GetMapping("/api/vocabularies") - public Map> ListVocabularies(final Authentication authentication) { - final Map> vocs = new HashMap<>(); + public Map> ListVocabularies(final Authentication authentication) { + final Map> vocs = new HashMap<>(); vocs.put("orgTypes", databaseUtils.listValuesOfVocabularyTable(VocabularyTable.org_types)); vocs.put("idTypes", databaseUtils.listValuesOfVocabularyTable(VocabularyTable.id_types)); vocs.put("languages", databaseUtils.listValuesOfVocabularyTable(VocabularyTable.languages)); - vocs.put("relTypes", Arrays.stream(RelationType.values()).map(Object::toString).collect(Collectors.toList())); - vocs.put("similaritiesType", Arrays.stream(SimilarityType.values()).map(Object::toString).collect(Collectors.toList())); + vocs.put("relTypes", Arrays.stream(RelationType.values()) + .map(t -> new VocabularyTerm(t.toString(), t.toString())) + .collect(Collectors.toList())); + vocs.put("similaritiesType", Arrays.stream(SimilarityType.values()) + .map(t -> new VocabularyTerm(t.toString(), t.toString())) + .collect(Collectors.toList())); if (UserInfo.isSimpleUser(authentication) || UserInfo.isNationalAdmin(authentication)) { vocs.put("countries", databaseUtils.listCountriesForUser(authentication.getName())); } else if (UserInfo.isSuperAdmin(authentication)) { vocs.put("countries", databaseUtils.listValuesOfVocabularyTable(VocabularyTable.countries)); } else { - vocs.put("countries", new ArrayList()); + vocs.put("countries", new ArrayList()); } return vocs; } - @GetMapping({ "/api/voc/allCountries", "/registration_api/voc/allCountries" }) - public List allCountries() { + @GetMapping({ + "/api/voc/allCountries", "/registration_api/voc/allCountries" + }) + public List allCountries() { return databaseUtils.listValuesOfVocabularyTable(VocabularyTable.countries); } diff --git a/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/model/utils/BrowseEntry.java b/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/model/utils/BrowseEntry.java index c77259fb..8647374c 100644 --- a/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/model/utils/BrowseEntry.java +++ b/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/model/utils/BrowseEntry.java @@ -10,6 +10,7 @@ public class BrowseEntry implements Serializable { private static final long serialVersionUID = 8854955977257064470L; private String value; + private String name; private int approved; private int pending; @@ -21,6 +22,14 @@ public class BrowseEntry implements Serializable { this.value = value; } + public String getName() { + return name; + } + + public void setName(final String name) { + this.name = name; + } + public int getApproved() { return approved; } diff --git a/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/model/utils/VocabularyTerm.java b/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/model/utils/VocabularyTerm.java new file mode 100644 index 00000000..f792dcf6 --- /dev/null +++ b/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/model/utils/VocabularyTerm.java @@ -0,0 +1,37 @@ +package eu.dnetlib.organizations.model.utils; + +import java.io.Serializable; + +public class VocabularyTerm implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -524482434889131310L; + + private String name; + private String value; + + public VocabularyTerm() {} + + public VocabularyTerm(final String name, final String value) { + this.name = name; + this.value = value; + } + + public String getName() { + return name; + } + + public void setName(final String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(final String value) { + this.value = value; + } +} diff --git a/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/utils/DatabaseUtils.java b/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/utils/DatabaseUtils.java index 7bf3467f..ba5327b7 100644 --- a/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/utils/DatabaseUtils.java +++ b/apps/dnet-orgs-database-application/src/main/java/eu/dnetlib/organizations/utils/DatabaseUtils.java @@ -39,6 +39,7 @@ import eu.dnetlib.organizations.model.User; import eu.dnetlib.organizations.model.UserCountry; import eu.dnetlib.organizations.model.utils.BrowseEntry; import eu.dnetlib.organizations.model.utils.OrganizationConflict; +import eu.dnetlib.organizations.model.utils.VocabularyTerm; import eu.dnetlib.organizations.model.view.OrganizationView; import eu.dnetlib.organizations.model.view.UserView; import eu.dnetlib.organizations.repository.AcronymRepository; @@ -159,13 +160,16 @@ public class DatabaseUtils { } @Cacheable("vocs") - public List listValuesOfVocabularyTable(final VocabularyTable table) { - return jdbcTemplate.queryForList("select val from " + table, String.class); + public List listValuesOfVocabularyTable(final VocabularyTable table) { + final String sql = "select val as value, name as name from " + table; + return jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(VocabularyTerm.class)); } @Cacheable("countries_for_user") - public List listCountriesForUser(final String name) { - return jdbcTemplate.queryForList("select country from user_countries where email = ?", String.class, name); + public List listCountriesForUser(final String name) { + final String sql = + "select uc.country as value, c.name as name from user_countries uc left outer join countries c on (c.val = uc.country) where uc.email = ?"; + return jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(VocabularyTerm.class), name); } @Transactional @@ -276,27 +280,27 @@ public class DatabaseUtils { // BROWSE BY COUNTRY public List browseCountries() { final String sql = - "select country as value, sum(case when status='approved' then 1 else 0 end) as approved, sum(case when status='pending' then 1 else 0 end) as pending from organizations group by country order by approved desc"; + "select o.country as value, c.name as name, sum(case when status='approved' then 1 else 0 end) as approved, sum(case when status='pending' then 1 else 0 end) as pending from organizations o left outer join countries c on (o.country = c.val) group by o.country, c.name order by approved desc"; return jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(BrowseEntry.class)); } // BROWSE BY COUNTRY FOR USER public List browseCountriesForUser(final String email) { final String sql = - "select o.country as value, sum(case when status='approved' then 1 else 0 end) as approved, sum(case when status='pending' then 1 else 0 end) as pending from user_countries uc left outer join organizations o on (uc.country = o.country) where uc.email=? group by o.country order by approved desc"; + "select o.country as value, c.name as name, sum(case when status='approved' then 1 else 0 end) as approved, sum(case when status='pending' then 1 else 0 end) as pending from user_countries uc left outer join organizations o on (uc.country = o.country) left outer join countries c on (o.country = c.val) where uc.email=? group by o.country, c.name order by approved desc"; return jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(BrowseEntry.class), email); } // BROWSE BY ORG TYPE public List browseTypes() { final String sql = - "select type as value, sum(case when status='approved' then 1 else 0 end) as approved, sum(case when status='pending' then 1 else 0 end) as pending from organizations group by type order by approved desc"; + "select type as value, type as name, sum(case when status='approved' then 1 else 0 end) as approved, sum(case when status='pending' then 1 else 0 end) as pending from organizations group by type order by approved desc"; return jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(BrowseEntry.class)); } // BROWSE BY ORG TYPE FOR USER public List browseTypesForUser(final String email) { - final String sql = "select o.type as value, " + final String sql = "select o.type as value, o.type as name," + "sum(case when status='approved' then 1 else 0 end) as approved, " + "sum(case when status='pending' then 1 else 0 end) as pending " + "from organizations o " diff --git a/apps/dnet-orgs-database-application/src/main/resources/sql/schema.sql b/apps/dnet-orgs-database-application/src/main/resources/sql/schema.sql index 2ef5cf08..d6843c71 100644 --- a/apps/dnet-orgs-database-application/src/main/resources/sql/schema.sql +++ b/apps/dnet-orgs-database-application/src/main/resources/sql/schema.sql @@ -26,32 +26,285 @@ DROP TABLE IF EXISTS languages; DROP SEQUENCE IF EXISTS organizations_id_seq; -CREATE TABLE org_types (val text PRIMARY KEY); -INSERT INTO org_types VALUES ('Archive'), ('Company'), ('Education'), ('Facility'), ('Government'), ('Healthcare'), ('Nonprofit'), ('Other'), ('UNKNOWN'); +CREATE TABLE org_types (val text PRIMARY KEY, name text); +INSERT INTO org_types(val) VALUES ('Archive'), ('Company'), ('Education'), ('Facility'), ('Government'), ('Healthcare'), ('Nonprofit'), ('Other'), ('UNKNOWN'); +UPDATE org_types SET name = val; -CREATE TABLE id_types (val text PRIMARY KEY); -INSERT INTO id_types VALUES ('CNRS'), ('FundRef'), ('HESA'), ('ISNI'), ('LinkedIn'), ('OrgRef'), ('UCAS'), ('UKPRN'), ('Wikidata'), ('GRID'), ('ROR'); +CREATE TABLE id_types (val text PRIMARY KEY, name text); +INSERT INTO id_types(val) VALUES ('CNRS'), ('FundRef'), ('HESA'), ('ISNI'), ('LinkedIn'), ('OrgRef'), ('UCAS'), ('UKPRN'), ('Wikidata'), ('GRID'), ('ROR'); +UPDATE id_types SET name = val; -CREATE TABLE languages (val text PRIMARY KEY); -INSERT INTO languages VALUES ('UNKNOWN'), +CREATE TABLE languages (val text PRIMARY KEY, name text); +INSERT INTO languages(val) VALUES ('UNKNOWN'), ('aa'),('af'),('am'),('ar'),('as'),('az'),('ba'),('be'),('bg'),('bn'),('br'),('bs'),('ca'),('ch'),('co'),('cs'),('cy'),('da'),('de'),('dv'), ('dz'),('el'),('en'),('eo'),('es'),('et'),('eu'),('fa'),('fi'),('fo'),('fr'),('fy'),('ga'),('gd'),('gl'),('gu'),('he'),('hi'),('hr'),('ht'), ('hu'),('hy'),('id'),('is'),('it'),('iu'),('ja'),('jv'),('ka'),('kk'),('kl'),('km'),('kn'),('ko'),('ku'),('ky'),('la'),('lb'),('lo'),('lt'), ('lv'),('mg'),('mi'),('mk'),('ml'),('mn'),('mr'),('ms'),('mt'),('my'),('nb'),('ne'),('nl'),('no'),('oc'),('om'),('or'),('pa'),('pl'),('ps'), ('pt'),('rm'),('ro'),('ru'),('rw'),('sa'),('sd'),('si'),('sk'),('sl'),('sm'),('so'),('sq'),('sr'),('sv'),('sw'),('ta'),('te'),('tg'),('th'), ('tk'),('tl'),('tr'),('tt'),('ug'),('uk'),('ur'),('uz'),('vi'),('xh'),('yo'),('zh'),('zu'); +UPDATE languages SET name = val; + +CREATE TABLE countries (val text PRIMARY KEY, name text); +INSERT INTO countries(val, name) VALUES + ('AD', 'Andorra'), + ('AE', 'United Arab Emirates'), + ('AF', 'Afghanistan'), + ('AG', 'Antigua and Barbuda'), + ('AI', 'Anguilla'), + ('AL', 'Albania'), + ('AM', 'Armenia'), + ('AN', 'Netherlands Antilles'), + ('AO', 'Angola'), + ('AQ', 'Antarctica'), + ('AR', 'Argentina'), + ('AS', 'American Samoa'), + ('AT', 'Austria'), + ('AU', 'Australia'), + ('AW', 'Aruba'), + ('AX', 'Åland Islands'), + ('AZ', 'Azerbaijan'), + ('BA', 'Bosnia and Herzegovina'), + ('BB', 'Barbados'), + ('BD', 'Bangladesh'), + ('BE', 'Belgium'), + ('BF', 'Burkina Faso'), + ('BG', 'Bulgaria'), + ('BH', 'Bahrain'), + ('BI', 'Burundi'), + ('BJ', 'Benin'), + ('BL', 'Saint-Barthélemy'), + ('BM', 'Bermuda'), + ('BN', 'Brunei Darussalam'), + ('BO', 'Bolivia'), + ('BQ', 'Bonaire, Sint Eustatius and Saba'), + ('BR', 'Brazil'), + ('BS', 'Bahamas'), + ('BT', 'Bhutan'), + ('BV', 'Bouvet Island'), + ('BW', 'Botswana'), + ('BY', 'Belarus'), + ('BZ', 'Belize'), + ('CA', 'Canada'), + ('CC', 'Cocos (Keeling) Islands'), + ('CD', 'Congo (Democratic Republic of)'), + ('CF', 'Central African Republic'), + ('CG', 'Congo'), + ('CH', 'Switzerland'), + ('CI', 'Cote d''Ivoire'), + ('CK', 'Cook Islands'), + ('CL', 'Chile'), + ('CM', 'Cameroon'), + ('CN', 'China (People''s Republic of)'), + ('CO', 'Colombia'), + ('CR', 'Costa Rica'), + ('CS', 'Serbia and Montenegro'), + ('CU', 'Cuba'), + ('CV', 'Cape Verde'), + ('CW', 'Curaçao'), + ('CX', 'Christmas Island'), + ('CY', 'Cyprus'), + ('CZ', 'Czech Republic'), + ('DE', 'Germany'), + ('DJ', 'Djibouti'), + ('DK', 'Denmark'), + ('DM', 'Dominica'), + ('DO', 'Dominican Republic'), + ('DZ', 'Algeria'), + ('EC', 'Ecuador'), + ('EE', 'Estonia'), + ('EG', 'Egypt'), + ('EH', 'Western Sahara'), + ('ER', 'Eritrea'), + ('ES', 'Spain'), + ('ET', 'Ethiopia'), + ('EU', 'European Union'), + ('FI', 'Finland'), + ('FJ', 'Fiji'), + ('FK', 'Falkland Islands (Malvinas)'), + ('FM', 'Micronesia, Federated States of'), + ('FO', 'Faroe Islands'), + ('FR', 'France'), + ('GA', 'Gabon'), + ('GB', 'United Kingdom'), + ('GD', 'Grenada'), + ('GE', 'Georgia'), + ('GF', 'French Guiana'), + ('GG', 'Guernsey'), + ('GH', 'Ghana'), + ('GI', 'Gibraltar'), + ('GL', 'Greenland'), + ('GM', 'Gambia'), + ('GN', 'Guinea'), + ('GP', 'Guadeloupe'), + ('GQ', 'Equatorial Guinea'), + ('GR', 'Greece'), + ('GS', 'South Georgia and the South Sandwich Islands'), + ('GT', 'Guatemala'), + ('GU', 'Guam'), + ('GW', 'Guinea-Bissau'), + ('GY', 'Guyana'), + ('HK', 'Hong Kong'), + ('HM', 'Heard Island and McDonald Islands'), + ('HN', 'Honduras'), + ('HR', 'Croatia'), + ('HT', 'Haiti'), + ('HU', 'Hungary'), + ('ID', 'Indonesia'), + ('IE', 'Ireland'), + ('IL', 'Israel'), + ('IM', 'Isle of Man'), + ('IN', 'India'), + ('IO', 'British Indian Ocean Territory'), + ('IQ', 'Iraq'), + ('IR', 'Iran (Islamic Republic of)'), + ('IS', 'Iceland'), + ('IT', 'Italy'), + ('JE', 'Jersey'), + ('JM', 'Jamaica'), + ('JO', 'Jordan'), + ('JP', 'Japan'), + ('KE', 'Kenya'), + ('KG', 'Kyrgyzstan'), + ('KH', 'Cambodia'), + ('KI', 'Kiribati'), + ('KM', 'Comoros'), + ('KN', 'Saint Kitts and Nevis'), + ('KO', 'Kosovo * UN resolution'), + ('KP', 'Korea, Democatric People''s Republic of'), + ('KR', 'Korea (Republic of)'), + ('KW', 'Kuwait'), + ('KY', 'Cayman Islands'), + ('KZ', 'Kazakhstan'), + ('LA', 'Lao (People''s Democratic Republic)'), + ('LB', 'Lebanon'), + ('LC', 'Saint Lucia'), + ('LI', 'Liechtenstein'), + ('LK', 'Sri Lanka'), + ('LR', 'Liberia'), + ('LS', 'Lesotho'), + ('LT', 'Lithuania'), + ('LU', 'Luxembourg'), + ('LV', 'Latvia'), + ('LY', 'Libyan Arab Jamahiriya'), + ('MA', 'Morocco'), + ('MC', 'Monaco'), + ('MD', 'Moldova (Republic of)'), + ('ME', 'Montenegro'), + ('MF', 'Saint Martin (French Part)'), + ('MG', 'Madagascar'), + ('MH', 'Marshall Islands'), + ('MK', 'Former Yugoslav Republic of Macedonia'), + ('ML', 'Mali'), + ('MM', 'Myanmar'), + ('MN', 'Mongolia'), + ('MO', 'Macao'), + ('MP', 'Northern Mariana Islands'), + ('MQ', 'Martinique'), + ('MR', 'Mauritania'), + ('MS', 'Montserrat'), + ('MT', 'Malta'), + ('MU', 'Mauritius'), + ('MV', 'Maldives'), + ('MW', 'Malawi'), + ('MX', 'Mexico'), + ('MY', 'Malaysia'), + ('MZ', 'Mozambique'), + ('NA', 'Namibia'), + ('NC', 'New Caledonia'), + ('NE', 'Niger'), + ('NF', 'Norfolk Island'), + ('NG', 'Nigeria'), + ('NI', 'Nicaragua'), + ('NL', 'Netherlands'), + ('NO', 'Norway'), + ('NP', 'Nepal'), + ('NR', 'Nauru'), + ('NU', 'Niue'), + ('NZ', 'New Zealand'), + ('OC', 'Oceania'), + ('OM', 'Oman'), + ('PA', 'Panama'), + ('PE', 'Peru'), + ('PF', 'French Polynesia'), + ('PG', 'Papua New Guinea'), + ('PH', 'Philippines'), + ('PK', 'Pakistan'), + ('PL', 'Poland'), + ('PM', 'Saint Pierre and Miquelon'), + ('PN', 'Pitcairn'), + ('PR', 'Puerto Rico'), + ('PS', 'Palestinian-administered areas'), + ('PT', 'Portugal'), + ('PW', 'Palau'), + ('PY', 'Paraguay'), + ('QA', 'Qatar'), + ('RE', 'Réunion'), + ('RO', 'Romania'), + ('RS', 'Serbia'), + ('RU', 'Russian Federation'), + ('RW', 'Rwanda'), + ('SA', 'Saudi Arabia'), + ('SB', 'Solomon Islands'), + ('SC', 'Seychelles'), + ('SD', 'Sudan'), + ('SE', 'Sweden'), + ('SG', 'Singapore'), + ('SH', 'Saint Helena, Ascension and Tristan da Cunha'), + ('SI', 'Slovenia'), + ('SJ', 'Svalbard and Jan Mayen'), + ('SK', 'Slovakia'), + ('SL', 'Sierra Leone'), + ('SM', 'San Marino'), + ('SN', 'Senegal'), + ('SO', 'Somalia'), + ('SR', 'Suriname'), + ('SS', 'South Sudan'), + ('ST', 'São Tomé and Príncipe'), + ('SV', 'El Salvador'), + ('SX', 'Sint Maarten (Dutch Part)'), + ('SY', 'Syrian Arab Republic'), + ('SZ', 'Swaziland'), + ('TC', 'Turks and Caicos Islands'), + ('TD', 'Chad'), + ('TF', 'French Southern Territories'), + ('TG', 'Togo'), + ('TH', 'Thailand'), + ('TJ', 'Tajikistan'), + ('TK', 'Tokelau'), + ('TL', 'Timor-Leste'), + ('TM', 'Turkmenistan'), + ('TN', 'Tunisia'), + ('TO', 'Tonga'), + ('TR', 'Turkey'), + ('TT', 'Trinidad and Tobago'), + ('TV', 'Tuvalu'), + ('TW', 'Taiwan'), + ('TZ', 'Tanzania (United Republic of)'), + ('UA', 'Ukraine'), + ('UG', 'Uganda'), + ('UK', 'United Kingdom'), + ('UM', 'United States Minor Outlying Islands'), + ('UNKNOWN', 'UNKNOWN'), + ('US', 'United States'), + ('UY', 'Uruguay'), + ('UZ', 'Uzbekistan'), + ('VA', 'Holy See (Vatican City State)'), + ('VC', 'Saint Vincent and the Grenadines'), + ('VE', 'Venezuela'), + ('VG', 'Virgin Islands (British)'), + ('VI', 'Virgin Islands, U.S.'), + ('VN', 'Viet Nam'), + ('VU', 'Vanuatu'), + ('WF', 'Wallis and Futuna'), + ('WS', 'Samoa'), + ('XK', 'Kosovo * UN resolution'), + ('YE', 'Yemen'), + ('YT', 'Mayotte'), + ('YU', 'Yugoslavia'), + ('ZA', 'South Africa'), + ('ZM', 'Zambia'), + ('ZW', 'Zimbabwe'); -CREATE TABLE countries (val text PRIMARY KEY); -INSERT INTO countries VALUES ('UNKNOWN'), ('AD'), ('AE'), ('AF'), ('AG'), ('AL'), ('AM'), ('AO'), ('AR'), ('AT'), ('AU'), ('AW'), ('AX'), ('AZ'), ('BA'), ('BB'), ('BD'), ('BE'), ('BF'), ('BG'), ('BH'), ('BI'), - ('BJ'), ('BM'), ('BN'), ('BO'), ('BQ'), ('BR'), ('BS'), ('BT'), ('BW'), ('BY'), ('BZ'), ('CA'), ('CD'), ('CF'), ('CG'), ('CH'), ('CI'), ('CL'), ('CM'), ('CN'), ('CO'), ('CR'), - ('CU'), ('CV'), ('CW'), ('CY'), ('CZ'), ('DE'), ('DJ'), ('DK'), ('DM'), ('DO'), ('DZ'), ('EC'), ('EE'), ('EG'), ('EH'), ('ER'), ('ES'), ('ET'), ('FI'), ('FJ'), ('FM'), ('FO'), - ('FR'), ('GA'), ('GB'), ('GD'), ('GE'), ('GF'), ('GH'), ('GI'), ('GL'), ('GM'), ('GN'), ('GP'), ('GQ'), ('GR'), ('GT'), ('GW'), ('GY'), ('HN'), ('HR'), ('HT'), ('HU'), ('ID'), - ('IE'), ('IL'), ('IM'), ('IN'), ('IQ'), ('IR'), ('IS'), ('IT'), ('JE'), ('JM'), ('JO'), ('JP'), ('KE'), ('KG'), ('KH'), ('KN'), ('KP'), ('KR'), ('KW'), ('KY'), ('KZ'), ('LA'), - ('LB'), ('LC'), ('LI'), ('LK'), ('LR'), ('LS'), ('LT'), ('LU'), ('LV'), ('LY'), ('MA'), ('MC'), ('MD'), ('ME'), ('MG'), ('MK'), ('ML'), ('MM'), ('MN'), ('MO'), ('MQ'), ('MR'), - ('MS'), ('MT'), ('MU'), ('MV'), ('MW'), ('MX'), ('MY'), ('MZ'), ('NA'), ('NC'), ('NE'), ('NG'), ('NI'), ('NL'), ('NO'), ('NP'), ('NU'), ('NZ'), ('OM'), ('PA'), ('PE'), ('PF'), - ('PG'), ('PH'), ('PK'), ('PL'), ('PS'), ('PT'), ('PW'), ('PY'), ('QA'), ('RE'), ('RO'), ('RS'), ('RU'), ('RW'), ('SA'), ('SB'), ('SC'), ('SD'), ('SE'), ('SG'), ('SI'), ('SJ'), - ('SK'), ('SL'), ('SM'), ('SN'), ('SO'), ('SR'), ('SS'), ('ST'), ('SV'), ('SX'), ('SY'), ('SZ'), ('TC'), ('TD'), ('TG'), ('TH'), ('TJ'), ('TL'), ('TM'), ('TN'), ('TO'), ('TR'), - ('TT'), ('TV'), ('TW'), ('TZ'), ('UA'), ('UG'), ('US'), ('UY'), ('UZ'), ('VA'), ('VC'), ('VE'), ('VG'), ('VN'), ('WS'), ('XK'), ('YE'), ('ZA'), ('ZM'), ('ZW'); CREATE TABLE user_roles(role text PRIMARY KEY); INSERT INTO user_roles VALUES ('ADMIN'), ('NATIONAL_ADMIN'), ('USER'), ('PENDING'), ('NOT_AUTHORIZED'); diff --git a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/browse.html b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/browse.html index c012c2bf..f58a31ea 100644 --- a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/browse.html +++ b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/browse.html @@ -1,14 +1,14 @@ - +
- - + + - + diff --git a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/forms/org_metadata.html b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/forms/org_metadata.html index c6987786..d8ed4e96 100644 --- a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/forms/org_metadata.html +++ b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/forms/org_metadata.html @@ -24,7 +24,7 @@ required="required" ng-class="{'is-invalid' : organizationForm.org_tp.$error.required}"> - + @@ -47,7 +47,7 @@ required="required" ng-class="{'is-invalid' : organizationForm.org_cntr.$error.required}"> - +
lat
@@ -131,7 +131,7 @@
{{field}}# approved# pending# approved# pending
{{e.value}}{{e.name}} ({{e.value}}) {{e.approved}} {{e.pending}}
diff --git a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/users.html b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/users.html index 0443b9e6..4a82ea01 100644 --- a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/users.html +++ b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/users.html @@ -91,10 +91,10 @@
Countries
-
+
- - + +
diff --git a/apps/dnet-orgs-database-application/src/main/resources/templates/authorizationRequest.html b/apps/dnet-orgs-database-application/src/main/resources/templates/authorizationRequest.html index f12edabc..58d29e6a 100644 --- a/apps/dnet-orgs-database-application/src/main/resources/templates/authorizationRequest.html +++ b/apps/dnet-orgs-database-application/src/main/resources/templates/authorizationRequest.html @@ -44,10 +44,10 @@
-
+
- - + +