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

Upgrade to SkyPortal 582ddd01660c1fce1f131be5e30f24bf80ac0474 #79

Merged
merged 1 commit into from
Sep 15, 2023
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
42 changes: 42 additions & 0 deletions extensions/skyportal/static/js/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,42 @@ import * as favoritesActions from "./ducks/favorites";
import * as rejectedActions from "./ducks/rejected_candidates";
import * as tnsrobotsActions from "./ducks/tnsrobots";
import * as enumTypesActions from "./ducks/enum_types";
<<<<<<< extensions/skyportal/static/js/actions.js
import * as shiftActions from "./ducks/shifts";
=======
import * as usersActions from "./ducks/users";
import * as streamsActions from "./ducks/streams";
import * as analysisServicesActions from "./ducks/analysis_services";

// we also import actions that won't be hydrated, to make sure they are
// registered as reducers, to avoid conflicts with redux-state-sync
/* eslint-disable no-unused-vars */
import * as sourceActions from "./ducks/source";
import * as sourcesActions from "./ducks/sources";
import * as recentGcnEventsActions from "./ducks/recentGcnEvents";
import * as gcnTagsActions from "./ducks/gcnTags";
import * as gcnEventActions from "./ducks/gcnEvent";
import * as gcnEventsActions from "./ducks/gcnEvents";
import * as weatherActions from "./ducks/weather";
import * as spatialCatalogsActions from "./ducks/spatialCatalogs";
import * as photometryActions from "./ducks/photometry";
import * as classificationsActions from "./ducks/classifications";
import * as sourcesInGcnActions from "./ducks/sourcesingcn";
import * as candidateActions from "./ducks/candidate";
import * as candidatesActions from "./ducks/candidates";
import * as galaxiesActions from "./ducks/galaxies";
import * as observationsActions from "./ducks/observations";
import * as catalogQueriesActions from "./ducks/catalog_query";
import * as surveyEfficiencyObservationsActions from "./ducks/survey_efficiency_observations";
import * as surveyEfficiencyObservationPlansActions from "./ducks/survey_efficiency_observation_plans";
import * as localizationActions from "./ducks/localization";
import * as shiftActions from "./ducks/shift";
import * as shiftsActions from "./ducks/shifts";
import * as remindersActions from "./ducks/reminders";
import * as groupActions from "./ducks/group";
import * as instrumentActions from "./ducks/instrument";
/* eslint-enable no-unused-vars */
>>>>>>> skyportal/static/js/actions.js

export default function hydrate() {
return (dispatch) => {
Expand All @@ -47,10 +82,17 @@ export default function hydrate() {
dispatch(rejectedActions.fetchRejected());
dispatch(tnsrobotsActions.fetchTNSRobots());
dispatch(enumTypesActions.fetchEnumTypes());
dispatch(allocationsActions.fetchAllocationsApiClassname());
dispatch(observationPlansActions.fetchObservationPlanNames());
dispatch(defaultFollowupRequestsActions.fetchDefaultFollowupRequests());
dispatch(defaultObservationPlansActions.fetchDefaultObservationPlans());
dispatch(defaultSurveyEfficienciesActions.fetchDefaultSurveyEfficiencies());
<<<<<<< extensions/skyportal/static/js/actions.js
dispatch(shiftActions.fetchShifts());
=======
dispatch(usersActions.fetchUsers());
dispatch(streamsActions.fetchStreams());
dispatch(analysisServicesActions.fetchAnalysisServices());
>>>>>>> skyportal/static/js/actions.js
};
}
117 changes: 79 additions & 38 deletions extensions/skyportal/static/js/components/RecentSources.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ export const useSourceListStyles = makeStyles((theme) => ({
display: "flex",
flexFlow: "row nowrap",
alignItems: "center",
padding: "0 0.625rem",
padding: "0 0.325rem",
},
sourceInfo: {
display: "flex",
flexDirection: "row",
justifyContent: "space-between",
margin: "10px",
marginRight: 0,
width: "100%",
},
sourceNameContainer: {
Expand All @@ -80,25 +82,45 @@ export const useSourceListStyles = makeStyles((theme) => ({
},
sourceName: {
fontSize: "1rem",
paddingBottom: 0,
marginBottom: 0,
},
sourceNameLink: {
color:
theme.palette.mode === "dark"
? theme.palette.secondary.main
: theme.palette.primary.main,
},
classification: {
fontSize: "0.95rem",
color:
theme.palette.mode === "dark"
? theme.palette.secondary.main
: theme.palette.primary.main,
fontWeight: "bold",
fontStyle: "italic",
marginLeft: "-0.09rem",
marginTop: "-0.4rem",
},
sourceCoordinates: {
marginTop: "0.1rem",
display: "flex",
flexDirection: "column",
"& > span": {
marginTop: "-0.2rem",
},
},
link: {
color: theme.palette.warning.main,
},
quickViewContainer: {
display: "flex",
flexDirection: "column",
width: "45%",
alignItems: "center",
alignItems: "flex-end",
justifyContent: "space-between",
},
quickViewButton: {
minHeight: "30px",
visibility: "hidden",
textAlign: "center",
display: "none",
Expand Down Expand Up @@ -308,11 +330,16 @@ const RecentSourcesList = ({ sources, styles, search = false }) => {
<div className={styles.sourceListContainer}>
<ul className={styles.sourceList}>
{sources.map((source) => {
<<<<<<< extensions/skyportal/static/js/components/RecentSources.jsx
let recentSourceName = `${source.obj_id}`;
let grandma_source_classification = "I-care";
let confirmed_or_rejected = 'not_confirmed';
let grandma_obs_classification = null;
let obs_status = null;
=======
const recentSourceName = `${source.obj_id}`;
let classification = null;
>>>>>>> skyportal/static/js/components/RecentSources.jsx
if (source.classifications.length > 0) {
// Display the most recent non-zero probability class
const filteredClasses = source.classifications?.filter(
Expand All @@ -323,6 +350,7 @@ const RecentSourcesList = ({ sources, styles, search = false }) => {
);

if (sortedClasses.length > 0) {
<<<<<<< extensions/skyportal/static/js/components/RecentSources.jsx
const classification = sortedClasses[0].classification;
if (!rejected_classes.includes(classification) && !confirmed_classes.includes(classification) && !not_confirmed_classes.includes(classification) && !obs_classes.includes(classification)) {
recentSourceName += ` (${classification})`;
Expand Down Expand Up @@ -351,6 +379,9 @@ const RecentSourcesList = ({ sources, styles, search = false }) => {
} else if (grandma_obs_classification == 'STOP GRANDMA') {
obs_status = 'stop';
}
=======
classification = `(${sortedClasses[0].classification})`;
>>>>>>> skyportal/static/js/components/RecentSources.jsx
}

}
Expand Down Expand Up @@ -396,6 +427,7 @@ const RecentSourcesList = ({ sources, styles, search = false }) => {
</Link>
<div className={styles.sourceInfo}>
<div className={styles.sourceNameContainer}>
<<<<<<< extensions/skyportal/static/js/components/RecentSources.jsx
<span className={styles.sourceName}>
<Link to={`/source/${source.obj_id}`}>
<span className={styles.sourceNameLink}>
Expand All @@ -415,17 +447,60 @@ const RecentSourcesList = ({ sources, styles, search = false }) => {
source.ra
)} ${dec_to_dms(source.dec)}`}
</span>
=======
<Link
to={`/source/${source.obj_id}`}
className={styles.sourceName}
>
<span className={styles.sourceNameLink}>
{recentSourceName}
</span>
</Link>
{classification && (
<span className={styles.classification}>
{classification}
</span>
)}
<div className={styles.sourceCoordinates}>
<span
style={{ fontSize: "0.95rem", whiteSpace: "pre" }}
>
{`\u03B1: ${ra_to_hours(source.ra)}`}
</span>
<span
style={{ fontSize: "0.95rem", whiteSpace: "pre" }}
>
{`\u03B4: ${dec_to_dms(source.dec)}`}
</span>
</div>
>>>>>>> skyportal/static/js/components/RecentSources.jsx
{source.resaved && <span>(Source was re-saved)</span>}
</div>
<div className={styles.quickViewContainer}>
<span>
<span style={{ textAlign: "right" }}>
{dayjs().to(dayjs.utc(`${source.created_at}Z`))}
</span>
<<<<<<< extensions/skyportal/static/js/components/RecentSources.jsx
<SourceStatus source={source} />
<SourceQuickView
sourceId={source.obj_id}
className={styles.quickViewButton}
/>
=======
<div
style={{
minHeight: "3rem",
display: "flex",
justifyContent: "space-between",
alignItems: "flex-end",
}}
>
<SourceQuickView
sourceId={source.obj_id}
className={styles.quickViewButton}
/>
</div>
>>>>>>> skyportal/static/js/components/RecentSources.jsx
</div>
</div>
</div>
Expand Down Expand Up @@ -525,41 +600,7 @@ RecentSources.propTypes = {
};

RecentSourcesSearchbar.propTypes = {
recentSources: PropTypes.arrayOf(
PropTypes.shape({
obj_id: PropTypes.string.isRequired,
ra: PropTypes.number,
dec: PropTypes.number,
created_at: PropTypes.string.isRequired,
thumbnails: PropTypes.arrayOf(
PropTypes.shape({
public_url: PropTypes.string,
is_grayscale: PropTypes.bool,
type: PropTypes.string,
})
),
resaved: PropTypes.bool,
classifications: PropTypes.arrayOf(
PropTypes.shape({
author_name: PropTypes.string,
probability: PropTypes.number,
modified: PropTypes.string,
classification: PropTypes.string,
id: PropTypes.number,
obj_id: PropTypes.string,
author_id: PropTypes.number,
taxonomy_id: PropTypes.number,
created_at: PropTypes.string,
})
),
})
),
styles: PropTypes.shape(Object).isRequired,
filter: PropTypes.func.isRequired,
};

RecentSourcesSearchbar.defaultProps = {
recentSources: undefined,
};

export default RecentSources;
6 changes: 5 additions & 1 deletion extensions/skyportal/static/js/components/SourceDesktop.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,11 @@ const SourceDesktop = ({ source }) => {
<div key="tns_name">
<a
key={source.tns_name}
href={`https://www.wis-tns.org/object/${source.tns_name}`}
href={`https://www.wis-tns.org/object/${
source.tns_name.trim().includes(" ")
? source.tns_name.split(" ")[1]
: source.tns_name
}`}
target="_blank"
rel="noopener noreferrer"
>
Expand Down
2 changes: 1 addition & 1 deletion skyportal
Submodule skyportal updated 85 files
+1 −0 package.json
+45 −25 services/facility_queue/facility_queue.py
+12 −0 services/notification_queue/notification_queue.py
+1 −1 services/observation_plan_queue/observation_plan_queue.py
+20 −10 services/tns_retrieval_queue/tns_retrieval_queue.py
+35 −0 skyportal/facility_apis/observation_plan.py
+72 −1 skyportal/handlers/api/source.py
+3 −3 skyportal/handlers/api/tns.py
+3 −0 skyportal/tests/frontend/sources_and_followup_etc/test_source_list.py
+27 −1 skyportal/tests/frontend/sources_and_followup_etc/test_top_sources.py
+22 −0 skyportal/tests/frontend/test_notifications.py
+21 −5 skyportal/tests/frontend/test_profile.py
+14 −1 skyportal/tests/frontend/test_scanning_page.py
+57 −22 skyportal/utils/offset.py
+2 −2 skyportal/utils/tns.py
+36 −0 static/js/actions.js
+9 −3 static/js/components/AddCatalogQueryPage.jsx
+14 −3 static/js/components/AddSurveyEfficiencyObservationsPage.jsx
+2 −2 static/js/components/AllocationTable.jsx
+10 −19 static/js/components/AnalysisForm.jsx
+5 −2 static/js/components/CandidateList.jsx
+11 −9 static/js/components/CandidatesPreferences.jsx
+7 −3 static/js/components/CandidatesPreferencesForm.jsx
+1 −0 static/js/components/CentroidPlot.jsx
+19 −9 static/js/components/ClassificationForm.jsx
+1 −1 static/js/components/ClassificationList.jsx
+1 −1 static/js/components/CommentList.jsx
+2 −4 static/js/components/CommentListMobile.jsx
+1 −2 static/js/components/CompactCommentList.jsx
+2 −1 static/js/components/ConfirmSourceInGCN.jsx
+7 −3 static/js/components/CustomDataTable.jsx
+0 −1 static/js/components/DefaultObservationPlanTable.jsx
+1 −1 static/js/components/DeleteComment.jsx
+2 −1 static/js/components/DisplayPhotStats.jsx
+2 −1 static/js/components/DisplayTNSInfo.jsx
+7 −5 static/js/components/EarthquakeMap.jsx
+1 −1 static/js/components/EditComment.jsx
+0 −112 static/js/components/FavoriteSourcesNotificationPreferences.jsx
+30 −52 static/js/components/FilterCandidateList.jsx
+18 −6 static/js/components/FollowupRequestForm.jsx
+1 −1 static/js/components/GcnCirculars.jsx
+1 −9 static/js/components/GcnEventPage.jsx
+49 −22 static/js/components/GcnSelectionForm.jsx
+0 −1 static/js/components/InstrumentTable.jsx
+27 −18 static/js/components/InviteNewGroupUserForm.jsx
+18 −11 static/js/components/Main.jsx.template
+18 −6 static/js/components/NewDefaultFollowupRequest.jsx
+7 −10 static/js/components/NewDefaultObservationPlan.jsx
+9 −2 static/js/components/NewDefaultSurveyEfficiency.jsx
+5 −2 static/js/components/NewPhotometry.jsx
+4 −3 static/js/components/NewShift.jsx
+2 −3 static/js/components/NewsFeed.jsx
+90 −37 static/js/components/NotificationPreferences.jsx
+1 −3 static/js/components/Notifications.jsx
+50 −21 static/js/components/ObservationPlanRequestForm.jsx
+1 −1 static/js/components/PhotometryTable.jsx
+1 −1 static/js/components/QueueAPIDisplay.jsx
+0 −1 static/js/components/RecentGcnEvents.jsx
+67 −56 static/js/components/RecentSources.jsx
+1 −2 static/js/components/RegularCommentList.jsx
+1 −4 static/js/components/ShowSummaries.jsx
+5 −1 static/js/components/SourceDesktop.jsx
+5 −1 static/js/components/SourceMobile.jsx
+1 −7 static/js/components/SourceQuickView.jsx
+9 −6 static/js/components/SourceTable.jsx
+9 −3 static/js/components/SpatialCatalogPage.jsx
+11 −24 static/js/components/StartBotSummary.jsx
+6 −9 static/js/components/SummarySearch.jsx
+6 −3 static/js/components/TNSATForm.jsx
+10 −8 static/js/components/TNSRobots.jsx
+7 −3 static/js/components/TelescopeMap.jsx
+14 −14 static/js/components/TelescopePageMobile.jsx
+1 −0 static/js/components/TelescopeSearchBar.jsx
+79 −29 static/js/components/TopSources.jsx
+1 −1 static/js/components/UpdatePhotometry.jsx
+0 −1 static/js/components/UploadPhotometry.jsx
+7 −13 static/js/components/UploadSpectrum.jsx
+12 −12 static/js/components/UserInvitations.jsx
+17 −20 static/js/components/UserManagement.jsx
+7 −2 static/js/components/VegaFoldedPlot.jsx
+6 −1 static/js/components/WidgetPrefsDialog.jsx
+1 −1 static/js/ducks/observations.js
+4 −4 static/js/ducks/sources.js
+0 −0 static/js/ducks/sourcesingcn.js
+23 −2 static/js/store.js
Loading