Skip to content

Commit 9031d12

Browse files
authored
Merge pull request #875 from europeana/develop
Sandbox-13
2 parents 9dfc92d + 4db3ff9 commit 9031d12

File tree

54 files changed

+1784
-475
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1784
-475
lines changed

projects/sandbox/cypress/e2e/app-network-errors.cy.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ context('Sandbox', () => {
1616
cy.visit('/dataset');
1717
});
1818

19+
const closeErrors = (): void => {
20+
const selCloseErrors = '.close-errors';
21+
cy.get(selCloseErrors).should('have.length', 1);
22+
cy.get(selCloseErrors).click();
23+
cy.get(selCloseErrors).should('not.exist');
24+
};
25+
1926
it('should show an error when the data upload fails', () => {
2027
const code = '404';
2128
cy.get(selectorLinkDatasetForm).click();
@@ -24,6 +31,7 @@ context('Sandbox', () => {
2431
cy.get(selectorErrors)
2532
.contains(code)
2633
.should('have.length', 1);
34+
closeErrors();
2735
});
2836

2937
it('should show an error when the progress data load fails', () => {
@@ -33,6 +41,7 @@ context('Sandbox', () => {
3341
cy.get(selectorErrors)
3442
.contains(code)
3543
.should('have.length', 1);
44+
closeErrors();
3645
});
3746

3847
it('should show an error when the (dateset) problem-pattern load fails', () => {
@@ -43,6 +52,7 @@ context('Sandbox', () => {
4352
cy.get(selectorErrors)
4453
.contains(code)
4554
.should('have.length', 1);
55+
closeErrors();
4656
});
4757

4858
it('should show an error when the record report load fails', () => {
@@ -54,6 +64,7 @@ context('Sandbox', () => {
5464
cy.get(selectorErrors)
5565
.contains(code)
5666
.should('have.length', 1);
67+
closeErrors();
5768
});
5869

5970
it('should show an error when the (record) problem-pattern load fails', () => {
@@ -65,6 +76,24 @@ context('Sandbox', () => {
6576
cy.get(selectorErrors)
6677
.contains(code)
6778
.should('have.length', 1);
79+
closeErrors();
80+
});
81+
82+
it('should clear the file field after an error', () => {
83+
const noFileChosen = 'No file chosen';
84+
const selFileUpload = '.file-upload';
85+
cy.get(selectorLinkDatasetForm).click();
86+
fillUploadForm('404');
87+
cy.get(selectorBtnSubmitData).click();
88+
cy.get(selFileUpload)
89+
.contains(noFileChosen)
90+
.filter(':visible')
91+
.should('not.exist');
92+
closeErrors();
93+
cy.get(selFileUpload)
94+
.contains(noFileChosen)
95+
.filter(':visible')
96+
.should('exist');
6897
});
6998

7099
it('should remember the errors for each step', () => {
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
context('Sandbox', () => {
2+
describe('Debias', () => {
3+
const force = { force: true };
4+
const selCsvDownload = '.csv-download';
5+
const selDebiasLink = 'li .debias-link';
6+
const txtNoDetections = 'No Biases Found';
7+
const pollInterval = 2000;
8+
const urlEmptyReport = '/dataset/28';
9+
10+
it('should toggle the info', () => {
11+
cy.visit('/dataset/3');
12+
cy.wait(pollInterval);
13+
cy.get(selDebiasLink)
14+
.last()
15+
.click(force);
16+
cy.wait(pollInterval);
17+
cy.get(selDebiasLink)
18+
.last()
19+
.click(force);
20+
cy.wait(pollInterval);
21+
22+
const selHeader = '.debias-header';
23+
const selInfoToggle = '.debias .open-info';
24+
const selOverlay = '.debias-overlay.active';
25+
26+
cy.get(selHeader).should('have.class', 'closed');
27+
cy.get(selOverlay).should('not.exist');
28+
29+
cy.get(selInfoToggle).click(force);
30+
31+
cy.get(selHeader).should('not.have.class', 'closed');
32+
cy.get(selOverlay).should('exist');
33+
});
34+
35+
it('should not allow debias checks for failed datasets', () => {
36+
cy.visit('/dataset/909');
37+
cy.wait(1000);
38+
cy.get(selDebiasLink).should('not.exist');
39+
});
40+
41+
it('should show an empty report', () => {
42+
cy.visit(urlEmptyReport);
43+
cy.wait(pollInterval);
44+
cy.get(selDebiasLink)
45+
.last()
46+
.click(force);
47+
cy.wait(1);
48+
cy.get(selDebiasLink)
49+
.last()
50+
.click(force);
51+
cy.contains(txtNoDetections).should('exist');
52+
});
53+
54+
it('should show a report', () => {
55+
cy.visit('/dataset/3');
56+
cy.wait(pollInterval);
57+
cy.get(selDebiasLink)
58+
.last()
59+
.click(force);
60+
cy.contains(txtNoDetections).should('not.exist');
61+
});
62+
63+
it('should show the download link', () => {
64+
cy.visit('/dataset/3');
65+
cy.get(selDebiasLink)
66+
.first()
67+
.click(force);
68+
cy.get(selCsvDownload)
69+
.filter(':visible')
70+
.should('exist');
71+
});
72+
73+
it('should not show the download link when there is no data', () => {
74+
cy.visit(urlEmptyReport);
75+
cy.get(selDebiasLink)
76+
.first()
77+
.click(force);
78+
cy.get(selCsvDownload).should('not.exist');
79+
});
80+
});
81+
});

projects/sandbox/src/app/_data/static-data.ts

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,190 @@ export const problemPatternData = {
4242
problemPatternTitle: 'Extremely long values'
4343
}
4444
};
45+
46+
export const isoLanguageNames: { [key: string]: string } = {
47+
aa: 'Afar',
48+
ab: 'Abkhazian',
49+
ae: 'Avestan',
50+
af: 'Afrikaans',
51+
ak: 'Akan',
52+
am: 'Amharic',
53+
an: 'Aragonese',
54+
ar: 'Arabic',
55+
as: 'Assamese',
56+
av: 'Avaric',
57+
ay: 'Aymara',
58+
az: 'Azerbaijani',
59+
ba: 'Bashkir',
60+
be: 'Belarusian',
61+
bg: 'Bulgarian',
62+
bh: 'Bihari languages',
63+
bi: 'Bislama',
64+
bm: 'Bambara',
65+
bn: 'Bengali',
66+
bo: 'Tibetan',
67+
br: 'Breton',
68+
bs: 'Bosnian',
69+
ca: 'Catalan; Valencian',
70+
ce: 'Chechen',
71+
ch: 'Chamorro',
72+
co: 'Corsican',
73+
cr: 'Cree',
74+
cs: 'Czech',
75+
cu: 'Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic',
76+
cv: 'Chuvash',
77+
cy: 'Welsh',
78+
da: 'Danish',
79+
de: 'German',
80+
dv: 'Divehi; Dhivehi; Maldivian',
81+
dz: 'Dzongkha',
82+
ee: 'Ewe',
83+
el: 'Greek, Modern (1453-)',
84+
en: 'English',
85+
eo: 'Esperanto',
86+
es: 'Spanish; Castilian',
87+
et: 'Estonian',
88+
eu: 'Basque',
89+
fa: 'Persian',
90+
ff: 'Fulah',
91+
fi: 'Finnish',
92+
fj: 'Fijian',
93+
fo: 'Faroese',
94+
fr: 'French',
95+
fy: 'Western Frisian',
96+
ga: 'Irish',
97+
gd: 'Gaelic; Scomttish Gaelic',
98+
gl: 'Galician',
99+
gn: 'Guarani',
100+
gu: 'Gujarati',
101+
gv: 'Manx',
102+
ha: 'Hausa',
103+
he: 'Hebrew',
104+
hi: 'Hindi',
105+
ho: 'Hiri Motu',
106+
hr: 'Croatian',
107+
ht: 'Haitian; Haitian Creole',
108+
hu: 'Hungarian',
109+
hy: 'Armenian',
110+
hz: 'Herero',
111+
ia: 'Interlingua (International Auxiliary Language Association)',
112+
id: 'Indonesian',
113+
ie: 'Interlingue; Occidental',
114+
ig: 'Igbo',
115+
ii: 'Sichuan Yi; Nuosu',
116+
ik: 'Inupiaq',
117+
io: 'Ido',
118+
is: 'Icelandic',
119+
it: 'Italian',
120+
iu: 'Inuktitut',
121+
ja: 'Japanese',
122+
jv: 'Javanese',
123+
ka: 'Georgian',
124+
kg: 'Kongo',
125+
ki: 'Kikuyu; Gikuyu',
126+
kj: 'Kuanyama; Kwanyama',
127+
kk: 'Kazakh',
128+
kl: 'Kalaallisut; Greenlandic',
129+
km: 'Central Khmer',
130+
kn: 'Kannada',
131+
ko: 'Korean',
132+
kr: 'Kanuri',
133+
ks: 'Kashmiri',
134+
ku: 'Kurdish',
135+
kv: 'Komi',
136+
kw: 'Cornish',
137+
ky: 'Kirghiz; Kyrgyz',
138+
la: 'Latin',
139+
lb: 'Luxembourgish; Letzeburgesch',
140+
lg: 'Ganda',
141+
li: 'Limburgan; Limburger; Limburgish',
142+
ln: 'Lingala',
143+
lo: 'Lao',
144+
lt: 'Lithuanian',
145+
lu: 'Luba-Katanga',
146+
lv: 'Latvian',
147+
mg: 'Malagasy',
148+
mh: 'Marshallese',
149+
mi: 'Maori',
150+
mk: 'Macedonian',
151+
ml: 'Malayalam',
152+
mn: 'Mongolian',
153+
mr: 'Marathi',
154+
ms: 'Malay',
155+
mt: 'Maltese',
156+
my: 'Burmese',
157+
na: 'Nauru',
158+
nb: 'Bokmål, Norwegian; Norwegian Bokmål',
159+
nd: 'Ndebele, North; North Ndebele',
160+
ne: 'Nepali',
161+
ng: 'Ndonga',
162+
nl: 'Dutch; Flemish',
163+
nn: 'Norwegian Nynorsk; Nynorsk, Norwegian',
164+
no: 'Norwegian',
165+
nr: 'Ndebele, South; South Ndebele',
166+
nv: 'Navajo; Navaho',
167+
ny: 'Chichewa; Chewa; Nyanja',
168+
oc: 'Occitan (post 1500)',
169+
oj: 'Ojibwa',
170+
om: 'Oromo',
171+
or: 'Oriya',
172+
os: 'Ossetian; Ossetic',
173+
pa: 'Panjabi; Punjabi',
174+
pi: 'Pali',
175+
pl: 'Polish',
176+
ps: 'Pushto; Pashto',
177+
pt: 'Portuguese',
178+
qu: 'Quechua',
179+
rm: 'Romansh',
180+
rn: 'Rundi',
181+
ro: 'Romanian; Moldavian; Moldovan',
182+
ru: 'Russian',
183+
rw: 'Kinyarwanda',
184+
sa: 'Sanskrit',
185+
sc: 'Sardinian',
186+
sd: 'Sindhi',
187+
se: 'Northern Sami',
188+
sg: 'Sango',
189+
si: 'Sinhala; Sinhalese',
190+
sk: 'Slovak',
191+
sl: 'Slovenian',
192+
sm: 'Samoan',
193+
sn: 'Shona',
194+
so: 'Somali',
195+
sq: 'Albanian',
196+
sr: 'Serbian',
197+
ss: 'Swati',
198+
st: 'Sotho, Southern',
199+
su: 'Sundanese',
200+
sv: 'Swedish',
201+
sw: 'Swahili',
202+
ta: 'Tamil',
203+
te: 'Telugu',
204+
tg: 'Tajik',
205+
th: 'Thai',
206+
ti: 'Tigrinya',
207+
tk: 'Turkmen',
208+
tl: 'Tagalog',
209+
tn: 'Tswana',
210+
to: 'Tonga (Tonga Islands)',
211+
tr: 'Turkish',
212+
ts: 'Tsonga',
213+
tt: 'Tatar',
214+
tw: 'Twi',
215+
ty: 'Tahitian',
216+
ug: 'Uighur; Uyghur',
217+
uk: 'Ukrainian',
218+
ur: 'Urdu',
219+
uz: 'Uzbek',
220+
ve: 'Venda',
221+
vi: 'Vietnamese',
222+
vo: 'Volapük',
223+
wa: 'Walloon',
224+
wo: 'Wolof',
225+
xh: 'Xhosa',
226+
yi: 'Yiddish',
227+
yo: 'Yoruba',
228+
za: 'Zhuang; Chuang',
229+
zh: 'Chinese',
230+
zu: 'Zulu'
231+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
export * from './is-scrollable';
12
export * from './text-copy';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './is-scrollable.directive';

0 commit comments

Comments
 (0)