Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
93b655f
feat: site consideration in isActionAllowed function
Dorin-RFL Jul 17, 2024
3a6abbf
feat: request to dr sites
Dorin-RFL Jul 21, 2024
1fb09b7
feat: 'synchronize' dr sites
Dorin-RFL Jul 23, 2024
acf4b58
fix: slaves url suffix
EllaMartirosyan Jul 24, 2024
575f7ca
fix: current url for switch
EllaMartirosyan Jul 24, 2024
6e3db94
feat: current site indication in titles
Dorin-RFL Jul 24, 2024
afdd401
Merge branch ''site_consideration_isActionAllowed'' of https://github…
Dorin-RFL Jul 24, 2024
3088448
fix: scaffold + i18n
Dorin-RFL Jul 24, 2024
2262cbd
fix: isActionAllowed bug
Dorin-RFL Jul 24, 2024
3cbc4b6
chore: validate for master
EllaMartirosyan Jul 24, 2024
1475617
fix: better use in currentSite function (cr)
Dorin-RFL Jul 25, 2024
da8c37f
fix: format document for helper siteUrl.ts
Dorin-RFL Jul 25, 2024
db7dcfb
fix: changing of function name and user configuration value
Dorin-RFL Jul 25, 2024
f2f235e
chore: master error
EllaMartirosyan Jul 25, 2024
aae6f0a
feat: master error
EllaMartirosyan Jul 25, 2024
f17208f
Merge branch ''site_consideration_isActionAllowed''
Dorin-RFL Jul 28, 2024
05f938c
chore: checkbox
EllaMartirosyan Jul 28, 2024
39d2e42
Merge branch ''site_consideration_isActionAllowed'' of github.com:Map…
EllaMartirosyan Jul 28, 2024
cfb0444
fix: add rawRequest and fix loggingClient function
Dorin-RFL Jul 28, 2024
ce3a1ac
Merge branch ''site_consideration_isActionAllowed''
Dorin-RFL Jul 28, 2024
360a02f
chore: fix
EllaMartirosyan Jul 28, 2024
3d9cb80
Merge branch ''site_consideration_isActionAllowed'' of github.com:Map…
EllaMartirosyan Jul 28, 2024
b5e3ee5
chore: merge
EllaMartirosyan Jul 28, 2024
2801b6e
fix: remove first directory - layerSources
EllaMartirosyan Jul 28, 2024
3a1da71
chore: handle validation api exception
EllaMartirosyan Jul 28, 2024
88b682f
feat: add try catch to loggingClient requests
Dorin-RFL Jul 29, 2024
12868f6
Merge branch ''site_consideration_isActionAllowed'' of https://github…
Dorin-RFL Jul 29, 2024
8fee077
fix: logging client treats all the use cases
Dorin-RFL Jul 29, 2024
64b1bd0
feat: dr warning
EllaMartirosyan Jul 29, 2024
62be892
feat: clear code
Dorin-RFL Jul 30, 2024
9304f7e
feat: add comment about setObject in syncSlaves function
Dorin-RFL Jul 30, 2024
5647a90
feat: add sessionStorageMessage optional property to SYNC_QUERY
Dorin-RFL Jul 30, 2024
d47d90a
chore: missing warning tooltip and fix session storage watch callback…
EllaMartirosyan Jul 30, 2024
6a97bee
Merge branch ''site_consideration_isActionAllowed'' of github.com:Map…
EllaMartirosyan Jul 30, 2024
e1386bb
fix: current site bug
Dorin-RFL Jul 30, 2024
84c9440
fix: tooltip for dir comparison validation plus watch bug
EllaMartirosyan Jul 30, 2024
04dcc75
Merge branch ''site_consideration_isActionAllowed'' of github.com:Map…
EllaMartirosyan Jul 30, 2024
d415f4b
fix: remove comment
Dorin-RFL Jul 30, 2024
9b8b48b
Merge branch ''site_consideration_isActionAllowed'' of https://github…
Dorin-RFL Jul 30, 2024
b921b5f
feat: add new message to session storage (Invalid DR)
Dorin-RFL Jul 30, 2024
64a2a01
fix: display indication in case there is a problem with a slave site
EllaMartirosyan Jul 30, 2024
d6216ef
fix: slaves filter
EllaMartirosyan Jul 30, 2024
c7da5ba
fix: siteName
EllaMartirosyan Jul 31, 2024
72caa6c
fix: sync only for raster plus errors indentation problem
EllaMartirosyan Jul 31, 2024
cdf0fa9
chore: helm
EllaMartirosyan Jul 31, 2024
0106c38
chore: fix helm values
EllaMartirosyan Jul 31, 2024
88fb323
chore: check isValid
EllaMartirosyan Jul 31, 2024
89d3acf
chore: isRaster function
EllaMartirosyan Jul 31, 2024
6f9992a
fix: clientGraphQL object name and sites colors
Dorin-RFL Jul 31, 2024
cb47a1c
Merge branch ''site_consideration_isActionAllowed''
Dorin-RFL Jul 31, 2024
ddf3e2d
fix: validations in case DR is not available
EllaMartirosyan Jul 31, 2024
32f18d2
chore: merge
EllaMartirosyan Jul 31, 2024
e671347
fix: when checkbox is displayed
EllaMartirosyan Jul 31, 2024
8c5cd12
fix: clear DR synch messages from sessionStorage
EllaMartirosyan Jul 31, 2024
6857c1b
fix: when to display warning with checkbox
EllaMartirosyan Jul 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion confd/production.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,11 @@ window._env_ = {
},
SERVED_ENTITY_TYPES: '{{ getv "/configuration/served/entity/types" "RECORD_ALL,RECORD_RASTER,RECORD_3D,RECORD_DEM" }}',
PROJECT_VERSION: '{{getv "/configuration/project/version" ""}}',
WHATSNEW_URL: '{{getv "/configuration/whatsnew/url" "http://whatsnew-URL"}}'
WHATSNEW_URL: '{{getv "/configuration/whatsnew/url" "http://whatsnew-URL"}}',
SITES_CONFIG: {
masters:'{{getv "/configuration/sites/config/masters" "[{ dns: 'http://localhost:3000', isAlias: false }]"}}',
slaves:'{{getv "/configuration/sites/config/slaves" "[{ dns: 'http://localhost:8090', isAlias: false }]"}}',
generics:'{{getv "/configuration/sites/config/generics" "[{ dns: 'https://catalog.mapcolonies.net', isAlias: false }]"}}',
},
BFF_PATH: '{{getv "/configuration/bff/path" "/graphql"}}'
};
4 changes: 4 additions & 0 deletions confd/production.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,8 @@ keys = [
"/configuration/admin/password",
"/configuration/project/version",
"/configuration/whatsnew/url",
"/configuration/sites/config/masters",
"/configuration/sites/config/slaves",
"/configuration/sites/config/generics",
"/configuration/bff/path"
]
4 changes: 4 additions & 0 deletions helm/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,8 @@ data:
CONFIGURATION_ACTIVE_LAYER_PROPERTIES_URL_PATTERN_PARAMS_STYLE: {{ quote .Values.ui.env.activeLayerPropeties.urlPattern.style }}
CONFIGURATION_ACTIVE_LAYER_PROPERTIES_URL_PATTERN_PARAMS_PROJECTION: {{ quote .Values.ui.env.activeLayerPropeties.urlPattern.projection }}
CONFIGURATION_WHATSNEW_URL: {{ quote .Values.ui.env.whatsnewUrl }}
CONFIGURATION_SITES_CONFIG_MASTERS: {{ quote .Values.ui.env.sitesConfig.masters }}
CONFIGURATION_SITES_CONFIG_SLAVES: {{ quote .Values.ui.env.sitesConfig.slaves }}
CONFIGURATION_SITES_CONFIG_GENERICS: {{ quote .Values.ui.env.sitesConfig.generics }}
CONFIGURATION_BFF_PATH: {{ quote .Values.ui.env.bffPath }}
{{- end }}
5 changes: 5 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ ui:
matrixSet: ''
style: ''
projection: ''
sitesConfig:
masters: '[]'
slaves: '[]'
generics: '[]'
bffPath: ''
resources:
enabled: true
limits:
Expand Down
8 changes: 8 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ button.cesium-infoBox-close:hover {
text-align: center;
}

.appVersionContainer-master {
color: var(--mdc-theme-gc-site-master);
}

.appVersionContainer-slave {
color: var(--mdc-theme-gc-site-slave);
}

title.rtl {
direction: rtl;
}
Expand Down
8 changes: 7 additions & 1 deletion src/__mocks__/confEnvShim.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ if (!window._env_) {
tokenValue: 'TOKEN'
},
SERVED_ENTITY_TYPES: 'RECORD_ALL,RECORD_RASTER,RECORD_3D,RECORD_DEM',
WHATSNEW_URL: 'http://whatsnew-URL'
WHATSNEW_URL: 'http://whatsnew-URL',
SITES_CONFIG: {
masters: [{ dns: 'http://localhost:3000', isAlias: false }],
slaves: [{ dns: 'http://localhost:8090', isAlias: false }],
generics: [{ dns: 'https://catalog.mapcolonies.net', isAlias: false }],
},
BFF_PATH: '/graphql'
};
})(void 0);
}
4 changes: 4 additions & 0 deletions src/common/components/error/error-presentor.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@
body[dir='rtl'] .errorContainer {
flex-direction: row-reverse;
}

.error {
color: var(--mdc-theme-gc-error-high) !important;
}
10 changes: 5 additions & 5 deletions src/common/components/error/graphql.error-presentor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface IServerErrorResponse {
statusText?: string;
}

export const GraphQLError: React.FC<IGpaphQLError> = (props) => {
export const GraphQLError: React.FC<IGpaphQLError> = ({ error }) => {

const intl = useIntl();

Expand All @@ -49,20 +49,20 @@ export const GraphQLError: React.FC<IGpaphQLError> = (props) => {
return (
<>
{
!isEmpty(props.error?.response) &&
!isEmpty(error?.response) &&
<AutoDirectionBox className="errorContainer">
<IconButton className="errorIcon mc-icon-Status-Warnings" />
<ul className="errorsList">
{
props.error.response.errors?.map((error: IServerError, index: number) => {
error.response.errors?.map((error: IServerError, index: number) => {
return (
<li dir="auto" key={index} dangerouslySetInnerHTML={{__html: formatMessage(error)}}></li>
);
})
}
{
props.error.response.status >= SERVER_ERROR_RESPONSE_CODE &&
<li dir="auto" key={props.error.response.status as number}><FormattedMessage id="general.server.error"/></li>
error.response.status >= SERVER_ERROR_RESPONSE_CODE &&
<li dir="auto" key={error.response.status as number}><FormattedMessage id="general.server.error"/></li>
}
</ul>
</AutoDirectionBox>
Expand Down
10 changes: 9 additions & 1 deletion src/common/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ const ACCESS_TOKEN = (window as any)._env_.ACCESS_TOKEN;
const SERVED_ENTITY_TYPES = (window as any)._env_.SERVED_ENTITY_TYPES;
const PROJECT_VERSION = (window as any)._env_.PROJECT_VERSION;
const WHATSNEW_URL = (window as any)._env_.WHATSNEW_URL;
const SITES_CONFIG = (window as any)._env_.SITES_CONFIG;
const BFF_PATH = (window as any)._env_.BFF_PATH;

const enrichBaseMaps = (baseMaps: IBaseMaps): IBaseMaps => {
return {
Expand Down Expand Up @@ -186,7 +188,13 @@ const APP_CONFIG = {
}
}
},
WHATSNEW_URL: WHATSNEW_URL
WHATSNEW_URL: WHATSNEW_URL,
SITES_CONFIG: {
masters: SITES_CONFIG.masters,
slaves: SITES_CONFIG.slaves,
generics: SITES_CONFIG.generics,
},
BFF_PATH: BFF_PATH
};

export default APP_CONFIG;
22 changes: 22 additions & 0 deletions src/common/helpers/siteUrl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { GraphQLClient } from 'mst-gql/node_modules/graphql-request';
import { createHttpClient } from 'mst-gql';
import { site, siteName } from '../../discrete-layer/models/userStore';
import CONFIG from '../config';

export const currentBffUrl = `${CONFIG.SERVICE_PROTOCOL as string}${CONFIG.SERVICE_NAME as string}`;

export const currentClientUrl = window.location.origin;

export const currentSite = (): siteName => {
return CONFIG.SITES_CONFIG.slaves.map((slave: site) => slave.dns).includes(currentClientUrl)
? 'slave'
: CONFIG.SITES_CONFIG.masters.map((master: site) => master.dns).includes(currentClientUrl)
? 'master'
: CONFIG.SITES_CONFIG.generics.map((generic: site) => generic.dns).includes(currentClientUrl)
? 'generic'
: 'undefined';
};

export const syncSlavesDns: GraphQLClient[] = CONFIG.SITES_CONFIG.slaves?.filter((slave: site) => !slave.isAlias)
.map((slave: site) => createHttpClient(slave.dns + CONFIG.BFF_PATH)
);
37 changes: 37 additions & 0 deletions src/common/helpers/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ export interface IStorage {
remove: (key: string) => void;
clear: () => void;
key: (index: number) => string | null;
watchMethods: ( methods: string[],
callbackBefore?: (method: string, key: string, ...args: any[]) => void,
callbackAfter?: (method: string, key: string, ...args: any[]) => void
) => void,
unWatchMethods: () => void,
length: number;
}

Expand Down Expand Up @@ -87,6 +92,36 @@ function storageFactory(storage: Storage, prefix = ''): IStorage {
}
}

let originalMethods: Record<string, () => void> = {};

function watchMethods (
methods: string[] = [],
callbackBefore: (method: string, key: string, ...args: any[]) => void = function () {},
callbackAfter: (method: string, key: string, ...args: any[]) => void = function () {},
) {
for (let method of methods) {
const original = storage[method].bind(storage);
originalMethods[method] = original;
const newMethod = function (...args: any[]) {
// @ts-ignore
callbackBefore(method, ...args);
const result = original.apply(null, args);
// @ts-ignore
callbackAfter(method, ...args);
return result;
};
storage[method] = newMethod.bind(storage);
}
}

function unWatchMethods () {
Object.keys(originalMethods).forEach(method => {
storage[method] = originalMethods[method];
});
originalMethods={};
}


return {
get,
set,
Expand All @@ -95,6 +130,8 @@ function storageFactory(storage: Storage, prefix = ''): IStorage {
remove,
clear,
key,
watchMethods,
unWatchMethods,
length,
};
}
Expand Down
9 changes: 9 additions & 0 deletions src/common/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@

"tab-views.search-results": "Search results",
"tab-views.catalog": "Catalog",
"tab-views.catalog.site.master": "Main",
"tab-views.catalog.site.slave": "Secondary",
"tab-views.create-best": "BEST edit",
"tab-views.export-layer": "Export Layer",

Expand Down Expand Up @@ -206,8 +208,15 @@

"field-names.ingestion.directory": "Directory",
"field-names.ingestion.fileNames": "File names",
"ingestion.warning.title": "Warning:",
"ingestion.warning.invalid-secondary-file": "{title} file validation failed on secondary site",
"ingestion.error.invalid-source-file": "Selected file error: {value}",
"ingestion.error.source-file-exception": "Cannot run validation api: {value}",
"ingestion.error.directory-comparison": "Warning: directory content is not the same between current and secondary sites",
"ingestion.error.invalid-metadata": "Metadata file format is not valid",
"ingestion.error.not-available": "is not available",
"ingestion.button.import-metadata": "Import Metadata",
"ingestion.checkbox.label": "Operation failed on secondary site, please check to continue with operation on main site only",

"field-names.raster.id": "ID",
"field-names.raster.productId": "Ext. ID",
Expand Down
9 changes: 9 additions & 0 deletions src/common/i18n/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@

"tab-views.search-results": "תוצאות חיפוש",
"tab-views.catalog": "קטלוג",
"tab-views.catalog.site.master": "ראשי",
"tab-views.catalog.site.slave": "משני",
"tab-views.create-best": "עריכת טיוטת BEST",
"tab-views.export-layer": "ייצוא שכבה",

Expand Down Expand Up @@ -210,8 +212,15 @@

"field-names.ingestion.directory": "נתיב מלא",
"field-names.ingestion.fileNames": "שמות הקבצים",
"ingestion.warning.title": "אזהרה:",
"ingestion.warning.invalid-secondary-file": "{title} אירעה שגיאה בוולידציה של הקובץ באתר המשני",
"ingestion.error.invalid-source-file": "שגיאה בקובץ הנבחר: {value}",
"ingestion.error.source-file-exception": "שירות ולידציה אינו תקין: {value}",
"ingestion.error.directory-comparison": "אזהרה: תוכן הסיפרייה אינו זהה בין האתר הראשי והאתר המשני",
"ingestion.error.invalid-metadata": "קובץ מטא-דאטה בפורמט לא תקין",
"ingestion.error.not-available": "לא זמין",
"ingestion.button.import-metadata": "בחר מטא-דאטה",
"ingestion.checkbox.label": "לא ניתן לבצע את הפעולה באתר המשני, יש לסמן כדי להמשיך ולבצע את הפעולה באתר הראשי בלבד",

"field-names.raster.id": "מזהה",
"field-names.raster.productId": "מזהה חיצוני",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ body[dir='rtl'] .exportOptionsSelect .mdc-select__dropdown-icon {

.exportFieldLabelContainer .requiredAsterisk {
color: var(--mdc-theme-gc-error-high);

}

.exportActionMenu {
Expand Down
3 changes: 3 additions & 0 deletions src/discrete-layer/components/layer-details/entity.dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ import { DialogContent } from '@material-ui/core';
import { Dialog, DialogTitle, IconButton } from '@map-colonies/react-core';
import { Box } from '@map-colonies/react-components';
import { emphasizeByHTML } from '../../../common/helpers/formatters';
import { sessionStore } from '../../../common/helpers/storage';
import { getStatusColoredBackground } from '../../../common/helpers/style';
import { Mode } from '../../../common/models/mode.enum';
import { SYNC_QUERY, syncQueries } from '../../../syncHttpClientGql';
import {
BestRecordModelType,
EntityDescriptorModelType,
Expand Down Expand Up @@ -462,6 +464,7 @@ export const EntityDialog: React.FC<EntityDialogProps> = observer(
const closeDialog = useCallback(() => {
onSetOpen(false);
store.discreteLayersStore.resetUpdateMode();
syncQueries.map((query: SYNC_QUERY) => query.queryName).forEach((key: string) => sessionStore.remove(key));
}, [onSetOpen, store.discreteLayersStore]);

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,11 @@ body[dir='rtl'] .moreTooltip {
width: 60ch;
overflow: hidden;
text-overflow: ellipsis;
}
display: flex;
flex-direction: row-reverse;
direction: rtl;
}

body[dir='rtl'] .filesPathContainer {
direction: ltr;
}
Loading