Skip to content

Commit

Permalink
Merge pull request #899 from koopjs/chore/layer-description
Browse files Browse the repository at this point in the history
Make specific default layer description
  • Loading branch information
rgwozdz authored Jan 25, 2024
2 parents ce9ed32 + 27b3719 commit 5c302df
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('FeatureLayerMetadata', () => {
type: 'Feature Layer',
displayField: '',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -185,7 +185,7 @@ describe('FeatureLayerMetadata', () => {
type: 'Feature Layer',
displayField: 'OBJECTID',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -353,7 +353,7 @@ describe('FeatureLayerMetadata', () => {
type: 'Feature Layer',
displayField: 'OBJECTID',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -513,7 +513,7 @@ describe('FeatureLayerMetadata', () => {
type: 'Feature Layer',
displayField: 'OBJECTID',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -669,7 +669,7 @@ describe('FeatureLayerMetadata', () => {
type: 'Feature Layer',
displayField: 'OBJECTID',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -831,7 +831,7 @@ describe('FeatureLayerMetadata', () => {
type: 'Feature Layer',
displayField: 'OBJECTID',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -972,7 +972,7 @@ describe('FeatureLayerMetadata', () => {
type: 'Feature Layer',
displayField: 'OBJECTID',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -1139,7 +1139,7 @@ describe('FeatureLayerMetadata', () => {
type: 'Feature Layer',
displayField: 'myField',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down
34 changes: 17 additions & 17 deletions packages/featureserver/src/helpers/table-layer-metadata.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('TableLayerMetadata', () => {
type: 'Table',
displayField: '',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -151,7 +151,7 @@ describe('TableLayerMetadata', () => {
type: 'Table',
displayField: 'OBJECTID',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -264,7 +264,7 @@ describe('TableLayerMetadata', () => {
type: 'Table',
displayField: 'OBJECTID',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -375,7 +375,7 @@ describe('TableLayerMetadata', () => {
type: 'Table',
displayField: 'OBJECTID',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -486,7 +486,7 @@ describe('TableLayerMetadata', () => {
type: 'Table',
displayField: 'hellow',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -597,7 +597,7 @@ describe('TableLayerMetadata', () => {
type: 'Table',
displayField: 'fluffy',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -708,7 +708,7 @@ describe('TableLayerMetadata', () => {
type: 'Table',
displayField: 'OBJECTID',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -819,7 +819,7 @@ describe('TableLayerMetadata', () => {
type: 'Table',
displayField: 'OBJECTID',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -930,7 +930,7 @@ describe('TableLayerMetadata', () => {
type: 'Table',
displayField: 'OBJECTID',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -1041,7 +1041,7 @@ describe('TableLayerMetadata', () => {
type: 'Table',
displayField: 'OBJECTID',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -1155,7 +1155,7 @@ describe('TableLayerMetadata', () => {
type: 'Table',
displayField: 'OBJECTID',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -1269,7 +1269,7 @@ describe('TableLayerMetadata', () => {
type: 'Table',
displayField: 'OBJECTID',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -1380,7 +1380,7 @@ describe('TableLayerMetadata', () => {
type: 'Table',
displayField: 'OBJECTID',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -1491,7 +1491,7 @@ describe('TableLayerMetadata', () => {
type: 'Table',
displayField: 'OBJECTID',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -1602,7 +1602,7 @@ describe('TableLayerMetadata', () => {
type: 'Table',
displayField: 'OBJECTID',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -1713,7 +1713,7 @@ describe('TableLayerMetadata', () => {
type: 'Table',
displayField: 'OBJECTID',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down Expand Up @@ -1824,7 +1824,7 @@ describe('TableLayerMetadata', () => {
type: 'Table',
displayField: 'OBJECTID',
description:
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.',
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.',
copyrightText:
'Copyright information varies by provider. For more information please contact the source of this data.',
defaultVisibility: true,
Expand Down
16 changes: 9 additions & 7 deletions packages/featureserver/src/metadata-defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ const _ = require('lodash');
const CURRENT_VERSION = 11.2;
const FULL_VERSION = '11.2.0';
const MAX_RECORD_COUNT = 2000;
const description =
const SERVICE_DESCRIPTION =
'This is a feature service exposed with Koop. For more information go to https://github.com/koopjs/koop.';
const copyrightText =
const LAYER_DESCRIPTION =
'This is a feature layer exposed with Koop. For more information go to https://github.com/koopjs/koop.';
const COPYRIGHT =
'Copyright information varies by provider. For more information please contact the source of this data.';
const SPATIAL_REFERENCE = {
wkid: 4326,
Expand All @@ -24,17 +26,17 @@ const defaultOverridables = {
fullVersion: FULL_VERSION,
maxRecordCount: MAX_RECORD_COUNT,
server: {
serviceDescription: description,
description,
copyrightText,
serviceDescription: SERVICE_DESCRIPTION,
description: SERVICE_DESCRIPTION,
copyrightText: COPYRIGHT,
fullExtent: EXTENT,
initialExtent: EXTENT,
hasStaticData: false,
spatialReference: SPATIAL_REFERENCE,
},
layer: {
description,
copyrightText,
description: LAYER_DESCRIPTION,
copyrightText: COPYRIGHT,
extent: EXTENT,
},
};
Expand Down
8 changes: 4 additions & 4 deletions test/geoservice-client-requests-no-geom.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const Koop = require('@koopjs/koop-core');
const provider = require('@koopjs/provider-file-geojson');
const request = require('supertest');
const VERSION = 11.2;
const CURRENT_VERSION = 11.2;
const COPYRIGHT_TEXT =
'Copyright information varies by provider. For more information please contact the source of this data.';

Expand Down Expand Up @@ -36,7 +36,7 @@ describe('Typical Geoservice Client request sequence: Dataset with no geometry',
);
const serverInfo = response.body;
expect(serverInfo).toEqual({
currentVersion: VERSION,
currentVersion: CURRENT_VERSION,
maxRecordCount: 2000,
serviceDescription: 'GeoJSON from no-geom-w-objectid.geojson',
description: 'GeoJSON from no-geom-w-objectid.geojson',
Expand Down Expand Up @@ -112,7 +112,7 @@ describe('Typical Geoservice Client request sequence: Dataset with no geometry',
layers: [],
tables: [
{
currentVersion: VERSION,
currentVersion: CURRENT_VERSION,
id: 0,
name: 'no-geom-w-objectid.geojson',
type: 'Table',
Expand Down Expand Up @@ -278,7 +278,7 @@ describe('Typical Geoservice Client request sequence: Dataset with no geometry',
expect(response.status).toBe(200);
const info = response.body;
expect(info).toEqual({
currentVersion: VERSION,
currentVersion: CURRENT_VERSION,
id: 0,
name: 'no-geom-w-objectid.geojson',
type: 'Table',
Expand Down
6 changes: 3 additions & 3 deletions test/helpers/client-response-fixtures.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const VERSION = 11.2;
const CURRENT_VERSION = 11.2;
const COPYRIGHT_TEXT =
'Copyright information varies by provider. For more information please contact the source of this data.';

function getServerInfo(id) {
return {
currentVersion: VERSION,
currentVersion: CURRENT_VERSION,
maxRecordCount: 2000,
serviceDescription: `GeoJSON from ${id}.geojson`,
description: `GeoJSON from ${id}.geojson`,
Expand Down Expand Up @@ -70,7 +70,7 @@ function getLayersInfo(filename, idField) {
return {
layers: [
{
currentVersion: VERSION,
currentVersion: CURRENT_VERSION,
id: 0,
name: `${filename}.geojson`,
type: 'Feature Layer',
Expand Down

0 comments on commit 5c302df

Please sign in to comment.