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

Replace gpn_id with planetary_feature_id #571

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/api/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export type SolrField =
| 'first_author_facet_hier'
| 'first_author_norm'
| 'planetary_feature'
| 'gpn_id'
| 'planetary_feature_id'
| 'grant'
| 'grant_agencies'
| 'grant_facet_hier'
Expand Down
2 changes: 1 addition & 1 deletion src/api/search/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const getAbstractParams = (id: string): IADSApiSearchParams => ({
'pubnote',
'book_author',
'planetary_feature',
'gpn_id',
'planetary_feature_id',
],
q: `identifier:"${id}"`,
});
Expand Down
2 changes: 1 addition & 1 deletion src/api/search/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export interface IDocsEntity {
first_author_norm?: string;
first_author?: string;
planetary_feature?: string[];
gpn_id?: string[];
planetary_feature_id?: string[];
grant_agencies?: string;
grant_facet_hier?: string;
grant_id?: string;
Expand Down
18 changes: 5 additions & 13 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,7 @@ const emitAnalytics = async (req: NextRequest): Promise<void> => {

// For abs/ routes we want to send emit an event to the link gateway
if (path.startsWith('/abs')) {
const url = `${process.env.BASE_URL}/link_gateway${path.replace(
'/abs',
'',
)}`;
const url = `${process.env.BASE_URL}/link_gateway${path.replace('/abs', '')}`;
log.debug({ path, url }, 'Emitting abs route event to link gateway');

try {
Expand All @@ -133,7 +130,8 @@ const getIp = (req: NextRequest) =>
(
req.headers.get('X-Original-Forwarded-For') ||
req.headers.get('X-Forwarded-For') ||
req.headers.get('X-Real-Ip')
req.headers.get('X-Real-Ip') ||
''
)
.split(',')
.shift() || 'unknown';
Expand Down Expand Up @@ -183,21 +181,15 @@ export async function middleware(req: NextRequest) {
return loginMiddleware(req, res);
}

if (
path.startsWith('/user/account/register') ||
path.startsWith('/user/forgotpassword')
) {
if (path.startsWith('/user/account/register') || path.startsWith('/user/forgotpassword')) {
return redirectIfAuthenticated(req, res);
}

if (path.startsWith('/user/libraries') || path.startsWith('/user/settings')) {
return protectedRoute(req, res);
}

if (
path.startsWith('/user/account/verify/change-email') ||
path.startsWith('/user/account/verify/register')
) {
if (path.startsWith('/user/account/verify/change-email') || path.startsWith('/user/account/verify/register')) {
return verifyMiddleware(req, res);
}

Expand Down
3 changes: 2 additions & 1 deletion src/middlewares/botCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const getIp = (req: NextRequest) =>
(
req.headers.get('X-Original-Forwarded-For') ||
req.headers.get('X-Forwarded-For') ||
req.headers.get('X-Real-Ip')
req.headers.get('X-Real-Ip') ||
''
)
.split(',')
.shift() || 'unknown';
Expand Down
4 changes: 2 additions & 2 deletions src/pages/abs/[id]/abstract.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import {
Tooltip,
Tr,
useDisclosure,
VisuallyHidden,
useToast,
VisuallyHidden,
} from '@chakra-ui/react';
import { EditIcon, ExternalLinkIcon, TriangleDownIcon } from '@chakra-ui/icons';

Expand Down Expand Up @@ -244,7 +244,7 @@ const Details = ({ doc }: IDetailsProps): ReactElement => {
)}
</Detail>
<Keywords keywords={doc.keyword} />
<PlanetaryFeatures features={doc.planetary_feature} ids={doc.gpn_id} />
<PlanetaryFeatures features={doc.planetary_feature} ids={doc.planetary_feature_id} />
<Detail label="Comment(s)" value={doc.comment} />
<Detail label="E-Print Comment(s)" value={doc.pubnote} />
</Tbody>
Expand Down
Loading