-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
literatureSearch: add snv messages box
* Requested here: https://cern.service-now.com/nav_to.do?uri=u_request_fulfillment.do?sysparm_query=number=RQF2420536
- Loading branch information
Showing
12 changed files
with
7,042 additions
and
11,272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
ui/src/overridden/frontsite/Document/DocumentDetails/DocumentItemsHeader.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from "react"; | ||
import { Divider, Message } from "semantic-ui-react"; | ||
import { Link } from "react-router-dom"; | ||
import PropTypes from "prop-types"; | ||
|
||
export const DocumentItemsHeader = ({ document }) => { | ||
const snvLink = ( | ||
<Link | ||
href="https://sis.web.cern.ch/search-and-read/online-resources/snv-connect" | ||
taget="_blank" | ||
> | ||
SNV-Connect | ||
</Link> | ||
); | ||
return document.metadata.document_type === "STANDARD" ? ( | ||
<> | ||
<Divider horizontal>Where to find</Divider> | ||
<Message attached="top" className="warning center"> | ||
<Message.Content> | ||
For standards, please directly search on {snvLink}. Please contact | ||
[email protected] in case you cannot find what you are looking for. | ||
</Message.Content> | ||
</Message> | ||
</> | ||
) : ( | ||
"" | ||
); | ||
}; | ||
|
||
DocumentItemsHeader.propTypes = { | ||
document: PropTypes.object.isRequired, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
ui/src/overridden/frontsite/LiteratureSearch/SearchResultExtra.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React from "react"; | ||
import { Message, List } from "semantic-ui-react"; | ||
import { FrontSiteRoutes } from "@inveniosoftware/react-invenio-app-ils"; | ||
import { Link } from "react-router-dom"; | ||
import Qs from "qs"; | ||
|
||
export const SearchResultExtra = () => { | ||
const onClickBookRequestLink = () => { | ||
const params = Qs.parse(window.location.search); | ||
const queryString = params["?q"]; | ||
return { | ||
pathname: FrontSiteRoutes.documentRequestForm, | ||
state: { queryString }, | ||
}; | ||
}; | ||
|
||
const snvLink = ( | ||
<Link | ||
href="https://sis.web.cern.ch/search-and-read/online-resources/snv-connect" | ||
taget="_blank" | ||
> | ||
SNV-Connect | ||
</Link> | ||
); | ||
const requestFormLink = ( | ||
<Link className="primary" to={onClickBookRequestLink()}> | ||
request form | ||
</Link> | ||
); | ||
return ( | ||
<Message.Content> | ||
<Message.Header> | ||
Couldn't find the literature you were looking for? | ||
</Message.Header> | ||
<List className="mt-5"> | ||
<List.Item>For standards, please directly search on {snvLink}.</List.Item> | ||
<List.Item> | ||
Please fill in {requestFormLink} to request new additions or purchases to the | ||
catalogue. (Login required) | ||
</List.Item> | ||
</List> | ||
</Message.Content> | ||
); | ||
}; |
35 changes: 35 additions & 0 deletions
35
ui/src/overridden/frontsite/LiteratureSearch/SearchResultHeader.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from "react"; | ||
import { Message } from "semantic-ui-react"; | ||
import { Link } from "react-router-dom"; | ||
import { withState } from "react-searchkit"; | ||
import PropTypes from "prop-types"; | ||
|
||
const SearchResultHeaderCmp = ({ currentQueryState }) => { | ||
const snvLink = ( | ||
<Link | ||
href="https://sis.web.cern.ch/search-and-read/online-resources/snv-connect" | ||
taget="_blank" | ||
> | ||
SNV-Connect | ||
</Link> | ||
); | ||
|
||
const filters = currentQueryState.filters; | ||
|
||
console.log("test", currentQueryState); | ||
return filters.some((item) => item.includes("STANDARD")) ? ( | ||
<Message attached="top" className="warning center"> | ||
<Message.Content> | ||
For standards, please directly search on {snvLink}. | ||
</Message.Content> | ||
</Message> | ||
) : ( | ||
"" | ||
); | ||
}; | ||
|
||
SearchResultHeaderCmp.propTypes = { | ||
currentQueryState: PropTypes.object.isRequired, | ||
}; | ||
|
||
export const SearchResultHeader = withState(SearchResultHeaderCmp); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters