Skip to content

Commit

Permalink
Merge pull request #3507 from magda-io/v3-test-fixes
Browse files Browse the repository at this point in the history
Fix: The dynamically loaded icon might not display properly on Chrome due to cache issues
  • Loading branch information
t83714 authored Mar 12, 2024
2 parents 3258a07 + 2b84631 commit 290d381
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions magda-web-client/src/Components/Dataset/View/DistributionIcon.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
import defaultFormatIcon from "assets/format-passive-dark.svg";
import iconApi from "assets/data-types/api.svg";
import iconArchive from "assets/data-types/archive.svg";
import iconDocument from "assets/data-types/document.svg";
import iconGis from "assets/data-types/gis.svg";
import iconHtml from "assets/data-types/html.svg";
import iconImageRaster from "assets/data-types/image-raster.svg";
import iconImageVector from "assets/data-types/image-vector.svg";
import iconPresentation from "assets/data-types/presentation.svg";
import iconSpreadsheet from "assets/data-types/spreadsheet.svg";
import iconTabular from "assets/data-types/tabular.svg";

const formatIcons = {
default: defaultFormatIcon
default: defaultFormatIcon,
api: iconApi,
archive: iconArchive,
document: iconDocument,
gis: iconGis,
html: iconHtml,
"image-raster": iconImageRaster,
"image-vector": iconImageVector,
presentation: iconPresentation,
spreadsheet: iconSpreadsheet,
tabular: iconTabular
};

const dataFormatCategories = [
"api",
"archive",
"document",
"gis",
"html",
"image-raster",
"image-vector",
"presentation",
"spreadsheet",
"tabular"
];

(async function init() {
for (const item of dataFormatCategories) {
formatIcons[item] = (
await import(`assets/data-types/${item}.svg`)
).default;
}
})();

const CategoryDetermineConfigItems = [
{
regex: /wfs|wms|geojson|kml|kmz|shp|gdb|csv-geo-au|mpk|ArcGIS|ESRI REST/i,
Expand Down

0 comments on commit 290d381

Please sign in to comment.