Skip to content
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.

Commit

Permalink
Merge pull request #648 from GSA/646
Browse files Browse the repository at this point in the history
fixed ie bug
  • Loading branch information
DanielJDufour authored Sep 7, 2018
2 parents 1cfa984 + d6b01d3 commit 7c18d26
Show file tree
Hide file tree
Showing 5 changed files with 1,039 additions and 159 deletions.
23 changes: 20 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"@angularclass/hmr-loader": "~3.0.2",
"@code.gov/api-client": "^0.1.1",
"@code.gov/code-gov-font": "0.6.3",
"@code.gov/code-gov-style": "1.7.9",
"@code.gov/code-gov-style": "1.7.14",
"@ngx-meta/core": "^0.4.0-rc.2",
"@types/jasminewd2": "^2.0.2",
"angulartics2": "1.4.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class BaseFilterPageComponent {
if (selectedUsageTypes.length === 0) {
return true;
} else {
return selectedUsageTypes.includes(result.permissions.usageType);
return selectedUsageTypes.indexOf(result.permissions.usageType) > -1;
}
}

Expand All @@ -77,7 +77,7 @@ export class BaseFilterPageComponent {
if (orgTypes.length === 0) {
return true;
} else {
return orgTypes.includes(result.orgType || 'federal');
return orgTypes.indexOf(result.orgType || 'federal') > -1;
}
}

Expand All @@ -86,7 +86,7 @@ export class BaseFilterPageComponent {
if (names.length === 0) {
return true;
} else if (names.length > 0) {
return names.includes(result.agency.acronym);
return names.indexOf(result.agency.acronym) > -1;
}
}

Expand All @@ -98,7 +98,7 @@ export class BaseFilterPageComponent {
} else if (selectedLangs.length > 0) {
const repoLanguages = result.languages;
if (Array.isArray(repoLanguages)) {
return repoLanguages.some(repoLang => selectedLangs.includes(repoLang));
return repoLanguages.some(repoLang => selectedLangs.indexOf(repoLang) > -1);
}
}
}
Expand All @@ -113,7 +113,7 @@ export class BaseFilterPageComponent {
} else if (selectedLicenseIds.length > 0) {
if (Array.isArray(result.permissions.licenses)) {
const objLicenseNames = result.permissions.licenses.map(license => license.name);
return selectedLicenses.some(l => objLicenseNames.includes(l));
return selectedLicenses.some(l => objLicenseNames.indexOf(l) > -1);
} else {
return false;
}
Expand All @@ -136,7 +136,7 @@ export class BaseFilterPageComponent {
this.results.forEach(result => {
if (Array.isArray(result.languages)) {
result.languages.forEach(language => {
if (allLanguages.includes(language)) {
if (allLanguages.indexOf(language) > -1) {
languages.add(language);
}
});
Expand All @@ -155,7 +155,7 @@ export class BaseFilterPageComponent {
});
this.agencies = Array.from(names).sort().map(name => {
const acronym = nameToAcronym[name];
const checked = typeof initialAgencies === 'object' && initialAgencies.includes(acronym);
const checked = typeof initialAgencies === 'object' && initialAgencies.indexOf(acronym) > -1;
return { name: name, value: acronym, checked: checked };
});
}
Expand Down
6 changes: 3 additions & 3 deletions src/app/components/search-results/search-results.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ export class SearchResultsComponent extends BaseFilterPageComponent {
if (content.search && content.search.entities) {
const entities = content.search.entities;
repos = repos.filter(repo => {
return entities.includes(repo.agency.name)
|| entities.includes(repo.agency.acronym)
|| entities.includes(repo.organization);
return entities.indexOf(repo.agency.name) > -1
|| entities.indexOf(repo.agency.acronym) > -1
|| entities.indexOf(repo.organization) > -1;
});
}

Expand Down
Loading

0 comments on commit 7c18d26

Please sign in to comment.