Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check for sadata changes #572

Draft
wants to merge 43 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d24ef7f
configure production
tmfrnz Nov 3, 2018
2bce867
Merge branch 'master' into production
tmfrnz Nov 3, 2018
39d694f
Merge branch 'master' into production
tmfrnz Nov 3, 2018
6a15a5e
Merge branch 'master' into production
tmfrnz Nov 7, 2018
2e4a71f
Merge branch 'master' into production
tmfrnz Jun 27, 2021
3a5ce52
Merge pull request #57 from nmrf/master
tmfrnz Jun 28, 2021
9bd01cd
hotfix: delete-connection-issue #pullupstream
tmfrnz Jul 16, 2021
1d9df80
remove console log #pullupstream
tmfrnz Jul 16, 2021
4ea4b8e
fix conflicts
tmfrnz Feb 18, 2024
6cfbf98
update after install
tmfrnz Feb 18, 2024
928803c
fix role edit bug
tmfrnz Feb 18, 2024
9d3c3c9
inc version
tmfrnz Feb 18, 2024
c795486
add app version to footer
tmfrnz Feb 18, 2024
9a25c90
add serverinfo message to login
tmfrnz Feb 18, 2024
640ed6e
add serverinfo message to register
tmfrnz Feb 18, 2024
8b14322
fix category view undefined error, see https://github.com/impactoss/i…
tmfrnz Feb 25, 2024
93a3c45
fix category view undefined error, see https://github.com/impactoss/i…
tmfrnz Feb 25, 2024
e5eb956
inc version 2.0.3
tmfrnz Feb 25, 2024
8b914ba
merge master, resolve conflicts
tmfrnz Feb 25, 2024
ff1775d
change wording: not accepted > noted
tmfrnz Feb 25, 2024
370c6ff
inc version
tmfrnz Feb 25, 2024
8af9e44
fix indicator bug
tmfrnz Feb 27, 2024
b7d3be3
add pds taxonomies
tmfrnz Feb 27, 2024
5a6ba50
cleanup
tmfrnz Feb 27, 2024
16e4939
cleanup 2
tmfrnz Feb 27, 2024
b19bb2c
fix filter group order for nested taxonomies
tmfrnz Feb 27, 2024
1a5841e
update default list groupings
tmfrnz Feb 27, 2024
3fcd384
hide SDS taxonomies for public, add period to sds and pds taxonomies
tmfrnz Feb 28, 2024
b76c03a
add redirect
tmfrnz Mar 3, 2024
3ac2e00
remove firebase redirect
tmfrnz Mar 3, 2024
0fa72b2
add js redirect and canonical link
tmfrnz Mar 3, 2024
88afdde
default canonical link and google site verification
tmfrnz Mar 3, 2024
de51e8b
Merge branch 'redirect' into production
tmfrnz Mar 3, 2024
ab254de
use prod url
tmfrnz Mar 3, 2024
69afc69
inc version
tmfrnz Mar 3, 2024
603a98f
add robots.txt
tmfrnz Mar 3, 2024
2572428
remove obsolete manifest
tmfrnz Mar 3, 2024
91a0e74
add site verification for https://sadata-production.firebaseapp.com/
tmfrnz Mar 3, 2024
3c3bcfa
add other client urls
tmfrnz Mar 3, 2024
0d6aa69
Helmet to override canonical tag
tmfrnz Mar 3, 2024
1e3d861
Merge pull request #67 from nmrf/production
tmfrnz Mar 3, 2024
576ad29
prevent indexing (stage and dev sites only, do not merge into product…
tmfrnz Mar 4, 2024
9e87269
add prebuild
tmfrnz Mar 4, 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
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export class EntityListItemWrapper extends React.Component { // eslint-disable-l
}}
>
{this.state.wrapper
&& entity
&& (
<div>
<EntityListItem
Expand Down Expand Up @@ -131,7 +132,7 @@ export class EntityListItemWrapper extends React.Component { // eslint-disable-l
}

EntityListItemWrapper.propTypes = {
entity: PropTypes.instanceOf(Map).isRequired,
entity: PropTypes.instanceOf(Map),
taxonomies: PropTypes.instanceOf(Map),
connections: PropTypes.instanceOf(Map),
errors: PropTypes.instanceOf(Map),
Expand Down
98 changes: 43 additions & 55 deletions app/components/EntityListSidebar/filterGroupsFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,41 @@ import { qe } from 'utils/quasi-equals';

const checkFramework = (frameworks, attribute) => frameworks.some((fw) => fw.getIn(['attributes', attribute]));

const getTaxOptions = (taxonomies, activeFilterOption, messages) => {
const taxonomiesGrouped = taxonomies.groupBy((tax) => tax.getIn(['attributes', 'parent_id']) ? 'children' : 'parents');
const parentTaxonomies = taxonomiesGrouped.get('parents');
if (!parentTaxonomies) return null;
return sortEntities(parentTaxonomies, 'asc', 'priority')
.reduce(
(memo, taxonomy) => {
let res = memo.concat([
{
id: taxonomy.get('id'), // filterOptionId
label: messages.taxonomies(taxonomy.get('id')),
active: !!activeFilterOption && activeFilterOption.optionId === taxonomy.get('id'),
},
]);
if (taxonomiesGrouped.get('children') && taxonomiesGrouped.get('children').size > 0) {
res = sortEntities(taxonomiesGrouped.get('children'), 'asc', 'priority')
.filter((childTaxonomy) => qe(taxonomy.get('id'), childTaxonomy.getIn(['attributes', 'parent_id'])))
.reduce(
(memo2, childTaxonomy) => memo2.concat([
{
id: childTaxonomy.get('id'), // filterOptionId
label: messages.taxonomies(childTaxonomy.get('id')),
active: !!activeFilterOption && activeFilterOption.optionId === childTaxonomy.get('id'),
nested: true,
},
]),
res,
);
}
return res;
},
[],
);
};

// figure out filter groups for filter panel
export const makeFilterGroups = (
config,
Expand Down Expand Up @@ -42,96 +77,49 @@ export const makeFilterGroups = (
return taxFwIds.size === 1
&& taxFwIds.find((fwid) => qe(fwid, fw.get('id')));
});
const taxOptions = getTaxOptions(fwTaxonomies, activeFilterOption, messages);
filterGroups[`taxonomies_${fw.get('id')}`] = {
id: `taxonomies_${fw.get('id')}`, // filterGroupId
type: 'taxonomies',
label: messages.taxonomyGroupByFw(fw.get('id')),
show: true,
icon: 'categories',
options:
sortEntities(fwTaxonomies, 'asc', 'priority')
.reduce(
(memo, taxonomy) => memo.concat([
{
id: taxonomy.get('id'), // filterOptionId
label: messages.taxonomies(taxonomy.get('id')),
active: !!activeFilterOption && activeFilterOption.optionId === taxonomy.get('id'),
nested: taxonomy.getIn(['attributes', 'parent_id']),
},
]),
[],
),
options: taxOptions,
};
});
const commonTaxonomies = taxonomies.filter((tax) => tax.get('frameworkIds')
&& tax.get('frameworkIds').size > 1);
const taxOptions = getTaxOptions(commonTaxonomies, activeFilterOption, messages);
filterGroups.taxonomies = {
id: 'taxonomies', // filterGroupId
label: messages.taxonomyGroupByFw('common'),
show: true,
icon: 'categories',
options:
sortEntities(commonTaxonomies, 'asc', 'priority')
.reduce(
(memo, taxonomy) => memo.concat([
{
id: taxonomy.get('id'), // filterOptionId
label: messages.taxonomies(taxonomy.get('id')),
active: !!activeFilterOption && activeFilterOption.optionId === taxonomy.get('id'),
nested: taxonomy.getIn(['attributes', 'parent_id']),
},
]),
[],
),
options: taxOptions,
};
} else {
const taxOptions = getTaxOptions(taxonomies, activeFilterOption, messages);
// first prepare taxonomy options
filterGroups.taxonomies = {
id: 'taxonomies', // filterGroupId
label: messages.taxonomyGroup,
show: true,
icon: 'categories',
options:
sortEntities(taxonomies, 'asc', 'priority')
.reduce(
(memo, taxonomy) => memo.concat([
{
id: taxonomy.get('id'), // filterOptionId
label: messages.taxonomies(taxonomy.get('id')),
active: !!activeFilterOption && activeFilterOption.optionId === taxonomy.get('id'),
nested: taxonomy.getIn(['attributes', 'parent_id']),
},
]),
[],
),
options: taxOptions,
};
}
}

// connectedTaxonomies option group
if (config.connectedTaxonomies) {
// first prepare taxonomy options
const taxOptions = getTaxOptions(connectedTaxonomies, activeFilterOption, messages);
filterGroups.connectedTaxonomies = {
id: 'connectedTaxonomies', // filterGroupId
label: messages.connectedTaxonomies,
show: true,
icon: 'connectedCategories',
options:
sortEntities(connectedTaxonomies, 'asc', 'priority')
.reduce(
(taxOptionsMemo, taxonomy) => (config.connectedTaxonomies.exclude
&& taxonomy.getIn(['attributes', config.connectedTaxonomies.exclude]))
? taxOptionsMemo
: taxOptionsMemo.concat([
{
id: taxonomy.get('id'), // filterOptionId
label: messages.taxonomies(taxonomy.get('id')),
active: !!activeFilterOption && activeFilterOption.optionId === taxonomy.get('id'),
nested: taxonomy.getIn(['attributes', 'parent_id']),
},
]),
[],
),
options: taxOptions,
};
}

Expand Down
20 changes: 20 additions & 0 deletions app/components/HelmetCanonical/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import Helmet from 'react-helmet';
import { CLIENT_URL } from 'themes/config';

const HelmetCanonical = ({ ...props }) => {
let canonical = CLIENT_URL;
if (window && window.location) {
const { pathname, search } = window.location;
if (search !== '' || pathname !== '/') {
canonical = `${canonical}${pathname}${search}`;
}
}
return (
<Helmet {...props}>
<link rel="canonical" href={canonical} />
</Helmet>
);
};

export default HelmetCanonical;
4 changes: 2 additions & 2 deletions app/containers/ActionEdit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import Helmet from 'react-helmet';
import HelmetCanonical from 'components/HelmetCanonical';
import { FormattedMessage } from 'react-intl';
import { actions as formActions } from 'react-redux-form/immutable';
import { Map, fromJS } from 'immutable';
Expand Down Expand Up @@ -243,7 +243,7 @@ export class ActionEdit extends React.Component { // eslint-disable-line react/p

return (
<div>
<Helmet
<HelmetCanonical
title={`${intl.formatMessage(messages.pageTitle)}: ${reference}`}
meta={[
{ name: 'description', content: intl.formatMessage(messages.metaDescription) },
Expand Down
4 changes: 2 additions & 2 deletions app/containers/ActionImport/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import Helmet from 'react-helmet';
import HelmetCanonical from 'components/HelmetCanonical';
import { actions as formActions } from 'react-redux-form/immutable';

import { fromJS } from 'immutable';
Expand Down Expand Up @@ -67,7 +67,7 @@ export class ActionImport extends React.PureComponent { // eslint-disable-line r
const { intl } = this.context;
return (
<div>
<Helmet
<HelmetCanonical
title={`${intl.formatMessage(messages.pageTitle)}`}
meta={[
{
Expand Down
4 changes: 2 additions & 2 deletions app/containers/ActionList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import Helmet from 'react-helmet';
import HelmetCanonical from 'components/HelmetCanonical';
import { List, Map, fromJS } from 'immutable';

import { loadEntitiesIfNeeded, updatePath } from 'containers/App/actions';
Expand Down Expand Up @@ -92,7 +92,7 @@ export class ActionList extends React.PureComponent { // eslint-disable-line rea
}
return (
<div>
<Helmet
<HelmetCanonical
title={intl.formatMessage(messages.pageTitle)}
meta={[
{ name: 'description', content: intl.formatMessage(messages.metaDescription) },
Expand Down
4 changes: 2 additions & 2 deletions app/containers/ActionNew/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import Helmet from 'react-helmet';
import HelmetCanonical from 'components/HelmetCanonical';
import { actions as formActions } from 'react-redux-form/immutable';

import { Map, List, fromJS } from 'immutable';
Expand Down Expand Up @@ -186,7 +186,7 @@ export class ActionNew extends React.PureComponent { // eslint-disable-line reac
const { saveSending, saveError, submitValid } = viewDomain.get('page').toJS();
return (
<div>
<Helmet
<HelmetCanonical
title={`${intl.formatMessage(messages.pageTitle)}`}
meta={[
{
Expand Down
4 changes: 2 additions & 2 deletions app/containers/ActionView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import Helmet from 'react-helmet';
import HelmetCanonical from 'components/HelmetCanonical';
import { FormattedMessage } from 'react-intl';

import {
Expand Down Expand Up @@ -210,7 +210,7 @@ export class ActionView extends React.PureComponent { // eslint-disable-line rea

return (
<div>
<Helmet
<HelmetCanonical
title={metaTitle}
meta={[
{ name: 'description', content: intl.formatMessage(messages.metaDescription) },
Expand Down
17 changes: 17 additions & 0 deletions app/containers/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Helmet } from 'react-helmet';
import { CLIENT_URL } from 'themes/config';

import ReactModal from 'react-modal';
import GlobalStyle from 'global-styles';

Expand Down Expand Up @@ -69,6 +71,21 @@ const Main = styled.div`

class App extends React.PureComponent { // eslint-disable-line react/prefer-stateless-function
UNSAFE_componentWillMount() {
if (window && window.location) {
let canonical = CLIENT_URL;
const {
origin,
hostname,
pathname,
search,
} = window.location;
if (search !== '' || pathname !== '/') {
canonical = `${canonical}${pathname}${search}`;
}
if (origin !== CLIENT_URL && hostname !== 'localhost') {
window.location.replace(canonical);
}
}
this.props.validateToken();
this.props.loadEntitiesIfNeeded();
}
Expand Down
60 changes: 60 additions & 0 deletions app/containers/App/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -1348,6 +1348,58 @@ export default defineMessages({
defaultMessage: 'About tax 10',
},
},
12: {
single: {
id: 'app.containers.App.entities.taxonomies.12.single',
defaultMessage: 'Taxonomy 12',
},
plural: {
id: 'app.containers.App.entities.taxonomies.12.plural',
defaultMessage: 'Taxonomy 12s',
},
empty: {
id: 'app.containers.App.entities.taxonomies.12.empty',
defaultMessage: 'No Taxonomy 12 assigned yet',
},
shortSingle: {
id: 'app.containers.App.entities.taxonomies.12.shortSingle',
defaultMessage: 'Taxonomy 12',
},
shortPlural: {
id: 'app.containers.App.entities.taxonomies.12.shortPlural',
defaultMessage: 'Taxonomy 12s',
},
description: {
id: 'app.containers.App.entities.taxonomies.12.description',
defaultMessage: 'About tax 12',
},
},
13: {
single: {
id: 'app.containers.App.entities.taxonomies.13.single',
defaultMessage: 'Taxonomy 13',
},
plural: {
id: 'app.containers.App.entities.taxonomies.13.plural',
defaultMessage: 'Taxonomy 13s',
},
empty: {
id: 'app.containers.App.entities.taxonomies.13.empty',
defaultMessage: 'No Taxonomy 13 assigned yet',
},
shortSingle: {
id: 'app.containers.App.entities.taxonomies.13.shortSingle',
defaultMessage: 'Taxonomy 13',
},
shortPlural: {
id: 'app.containers.App.entities.taxonomies.13.shortPlural',
defaultMessage: 'Taxonomy 13s',
},
description: {
id: 'app.containers.App.entities.taxonomies.13.description',
defaultMessage: 'About tax 13',
},
},
},
due_dates: {
single: {
Expand Down Expand Up @@ -1445,6 +1497,14 @@ export default defineMessages({
id: 'app.containers.App.messages.createdAsGuest',
defaultMessage: '{entityType} created successfully. It will become publicly available once verified and published by an authorised user.',
},
signingInServer: {
id: 'app.containers.App.messages.signingInServer',
defaultMessage: 'Note: signing in to {server} database',
},
registeringServer: {
id: 'app.containers.App.messages.registeringServer',
defaultMessage: 'Note: registering for {server} database',
},
},
ui: {
userRoles: {
Expand Down
Loading