Skip to content

Commit

Permalink
Merge pull request #230 from zimmerman-team/develop
Browse files Browse the repository at this point in the history
Production release
  • Loading branch information
stephanoshadjipetrou authored Oct 26, 2020
2 parents 8d12eef + a526b74 commit 6df5bfe
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 25 deletions.
29 changes: 13 additions & 16 deletions cypress/integration/apiDocNavigation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,19 @@ const categories: string[] = [
// 'Transaction List',
// 'Transaction Aggregations',
// 'DataStore Search Engine',
// 'Budget List',
// 'Budget Aggregations',
// 'Codelist Meta List',
// 'Country List',
// 'Dataset List',
// 'Location List',
// 'Organisation List',
// 'Publisher List',
// 'Region List',
// 'Result List',
// 'Result Aggregations',
// 'Sector List',
// 'Transaction List',
'API Version 1 (Django REST API)',
'API Version 2 (Solr API)',
'Budget List',
'Budget Aggregations',
'Codelist Meta List',
'Country List',
'Dataset List',
'Location List',
'Organisation List',
'Publisher List',
'Region List',
'Result List',
'Result Aggregations',
'Sector List',
'Transaction List',
];

describe('API Documentation - navigation', function () {
Expand All @@ -51,7 +49,6 @@ describe('API Documentation - navigation', function () {

it('should navigate to correct item when clicked', function () {
// Weird behavior in headless browser, therefore checking on url instead of content.
cy.contains('API Version 1 (Django REST API)').click();
cy.contains('Activity List').click();
cy.contains('Request parameters').click();
cy.contains('GET iati_identifier (optional)').click();
Expand Down
5 changes: 1 addition & 4 deletions cypress/integration/apiDocSearch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ describe('API Documentation - search', function () {
it('should be able to type in "Activity List" and only get results with "Activity List" in it', function () {
cy.get('[class*= ApiDocSearchBoxContainer]').should('exist');
cy.get('.MuiInputBase-input').type('Activity List');
cy.get('[class*= MuiTreeView-root]')
.should('contain.text', 'API Version 1 (Django REST API)')
.click();
cy.get('[class*= MuiTreeItem-label]').should(
cy.get('[class*= MuiTreeView-root]').should(
'contain.text',
'Activity List'
);
Expand Down
2 changes: 2 additions & 0 deletions cypress/integration/qbAdditionalFilters.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@ function testSelect(
optionNumber: number
) {
cy.findByText(selector).click({ force: true });

cy.get(`#react-select-${selectNumber}-option-${optionNumber}`).then(
($span) => {
const selectText: string = $span.text();
cy.get(`#react-select-${selectNumber}-option-${optionNumber}`).click({
force: true,
});
cy.wait(5000);
cy.get(`[class*=multiValue]`).last().should('have.text', selectText);
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const CoreFiltersFragment = () => {
<ConnectedSelect
{...fragmentConfig.organisations}
value={store.get('organisations')}
options={fetchedsectorOrganisations}
options={fetchedsectorOrganisations.sort((a, b) => a.reporting_organisation.localeCompare(b.reporting_organisation))}
onChange={(e) => store.set('organisations')(e)}
// placeholder={`All (${fetchedsectorOrganisations.length})`}
placeholder={`All organisations`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const fragmentConfig: FragmentModel = {
// helperTextUrl: 'http://reference.iatistandard.org/203/codelists/Sector/',
placeholder: 'All (0)',
getOptionLabel: (option: OrganisationModel) =>
`${option.reporting_organisation_identifier}: ${option.reporting_organisation}`,
`${option.reporting_organisation} (${option.reporting_organisation_identifier})`,
getOptionValue: (option: OrganisationModel) =>
option.reporting_organisation_identifier,
},
Expand Down
14 changes: 11 additions & 3 deletions src/app/modules/querybuilder-module/state/effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ export const withEffects: StoreEffect = (store) => {
get(sectors, 'length', 0) && rowFormat === 'activity'
? ((temp_string = sectors && sectors.join(' ')),
(output = `"${temp_string.split(' ').join('" "')}"`),
`sector_code:(${output})`)
`(sector_code:(${output}) OR transaction_sector_code:(${output}))`)
: null,
get(sectors, 'length', 0) && rowFormat === 'transaction'
? ((temp_string = sectors && sectors.join(' ')),
Expand All @@ -544,7 +544,11 @@ export const withEffects: StoreEffect = (store) => {
: null,
get(countries, 'length', 0) &&
(rowFormat === 'activity' || rowFormat === 'budget')
? `recipient_country_code:(${countries && countries.join(' ')})`
? `(recipient_country_code:(${
countries && countries.join(' ')
}) OR transaction_recipient_country_code:(${
countries && countries.join(' ')
}))`
: null,
get(countries, 'length', 0) && rowFormat === 'transaction'
? `transaction_recipient_country_code:(${
Expand All @@ -553,7 +557,11 @@ export const withEffects: StoreEffect = (store) => {
: null,

get(regions, 'length', 0) && rowFormat === 'activity'
? `recipient_region_code:(${regions && regions.join(' ')})`
? `(recipient_region_code:(${
regions && regions.join(' ')
} OR transaction_recipient_region_code:(${
regions && regions.join(' ')
})))`
: null,
get(regions, 'length', 0) && rowFormat === 'transaction'
? `transaction_recipient_region_code:(${regions && regions.join(' ')})`
Expand Down

0 comments on commit 6df5bfe

Please sign in to comment.