removed no private files alert

This commit is contained in:
Martina 2022-01-27 15:13:48 -08:00
parent c26f24fbb1
commit eb20803b87
6 changed files with 112 additions and 96 deletions

View File

@ -131,15 +131,15 @@ export class Alert extends React.Component {
}
};
_handleDismissPrivacyAlert = (e) => {
Actions.updateViewer({ onboarding: { hidePrivacyAlert: true } });
this.props.onAction({
type: "UPDATE_VIEWER",
viewer: {
onboarding: { hidePrivacyAlert: true },
},
});
};
// _handleDismissPrivacyAlert = (e) => {
// Actions.updateViewer({ onboarding: { hidePrivacyAlert: true } });
// this.props.onAction({
// type: "UPDATE_VIEWER",
// viewer: {
// onboarding: { hidePrivacyAlert: true },
// },
// });
// };
render() {
//NOTE(martina): alert
@ -155,21 +155,21 @@ export class Alert extends React.Component {
}
//NOTE(martina): don't upload sensitive info alert
if (this.props.viewer && !this.props.noWarning) {
return (
<div css={STYLES_MESSAGE} style={this.props.style}>
<div css={STYLES_MESSAGE_BOX} style={{ fontSize: 14 }}>
Please don't upload sensitive information to Slate yet. Private storage is coming soon.
<span
style={{ position: "absolute", right: 24, padding: 4, cursor: "pointer" }}
onClick={this._handleDismissPrivacyAlert}
>
<SVG.Dismiss height="20px" />
</span>
</div>
</div>
);
}
// if (this.props.viewer && !this.props.noWarning) {
// return (
// <div css={STYLES_MESSAGE} style={this.props.style}>
// <div css={STYLES_MESSAGE_BOX} style={{ fontSize: 14 }}>
// Please don't upload sensitive information to Slate yet. Private storage is coming soon.
// <span
// style={{ position: "absolute", right: 24, padding: 4, cursor: "pointer" }}
// onClick={this._handleDismissPrivacyAlert}
// >
// <SVG.Dismiss height="20px" />
// </span>
// </div>
// </div>
// );
// }
return null;
}

View File

@ -161,21 +161,21 @@ export default class ApplicationPage extends React.Component {
}
}
if (viewer?.onboarding) {
this.setState(
{
viewer: {
...this.state.viewer,
...viewer,
onboarding: { ...this.state.viewer.onboarding, ...viewer.onboarding },
},
},
() => {
if (callback) callback();
}
);
return;
}
// if (viewer?.onboarding) {
// this.setState(
// {
// viewer: {
// ...this.state.viewer,
// ...viewer,
// onboarding: { ...this.state.viewer.onboarding, ...viewer.onboarding },
// },
// },
// () => {
// if (callback) callback();
// }
// );
// return;
// }
this.setState(
{
@ -251,31 +251,29 @@ export default class ApplicationPage extends React.Component {
this.setState({ online: navigator.onLine });
};
_withAuthenticationBehavior =
(authenticate) =>
async (href = "/_/data", state) => {
let response = await authenticate(state);
if (Events.hasError(response)) {
return response;
}
if (response.shouldMigrate) {
return response;
}
let viewer = await UserBehaviors.hydrate();
if (Events.hasError(viewer)) {
return viewer;
}
this.setState({ viewer });
await this._handleSetupWebsocket();
// if (!redirected) {
// this._handleAction({ type: "NAVIGATE", value: "NAV_DATA" });
// }
this._handleNavigateTo({ href, redirect: true });
_withAuthenticationBehavior = (authenticate) => async (href = "/_/data", state) => {
let response = await authenticate(state);
if (Events.hasError(response)) {
return response;
};
}
if (response.shouldMigrate) {
return response;
}
let viewer = await UserBehaviors.hydrate();
if (Events.hasError(viewer)) {
return viewer;
}
this.setState({ viewer });
await this._handleSetupWebsocket();
// if (!redirected) {
// this._handleAction({ type: "NAVIGATE", value: "NAV_DATA" });
// }
this._handleNavigateTo({ href, redirect: true });
return response;
};
_handleSelectedChange = (e) => {
this.setState({

View File

@ -198,8 +198,6 @@ export default class ApplicationLayout extends React.Component {
</Boundary>
);
}
const isHeaderInView =
this.props.page?.id === "NAV_SIGN_IN" || !this.props.viewer?.hasCompletedSurvey;
return (
<React.Fragment>
@ -212,14 +210,14 @@ export default class ApplicationLayout extends React.Component {
</>
)}
<Alert
noWarning={
this.props.page?.id === "NAV_SIGN_IN" || !this.props.viewer?.hasCompletedSurvey
? true
: !!this.props.viewer
}
// noWarning={
// this.props.page?.id === "NAV_SIGN_IN" || !this.props.viewer?.hasCompletedSurvey
// ? true
// : !!this.props.viewer
// }
onAction={this.props.onAction}
id={this.props.isMobile ? "slate-mobile-alert" : null}
viewer={this.props.viewer}
// viewer={this.props.viewer}
/>
{this.props.children}
</div>

View File

@ -140,7 +140,7 @@ export default class CTATransition extends React.Component {
page={this.props.page}
/>
<Alert
noWarning
// noWarning
id={this.props.isMobile ? "slate-mobile-alert" : null}
style={
this.props.isMobile

View File

@ -65,10 +65,10 @@ export const useSaveHandler = ({ file, viewer, onAction }) => {
return { isSaving: selectedFile?.status === "uploading", saveCopy: store.handlers.saveCopy };
});
const isSaved = React.useMemo(
() => viewer?.libraryCids[file.cid],
[viewer?.libraryCids, file.cid]
);
const isSaved = React.useMemo(() => viewer?.libraryCids[file.cid], [
viewer?.libraryCids,
file.cid,
]);
const handleSave = async () => {
if (!viewer) {
@ -196,17 +196,25 @@ function CarouselHeader({
{ showControl: showFileDescription, hideControl: hideFileDescription },
] = useCarouselJumperControls();
const [isMoreInfoVisible, { showControl: showMoreInfo, hideControl: hideMoreInfo }] =
useCarouselJumperControls();
const [
isMoreInfoVisible,
{ showControl: showMoreInfo, hideControl: hideMoreInfo },
] = useCarouselJumperControls();
const [isEditInfoVisible, { showControl: showEditInfo, hideControl: hideEditInfo }] =
useCarouselJumperControls();
const [
isEditInfoVisible,
{ showControl: showEditInfo, hideControl: hideEditInfo },
] = useCarouselJumperControls();
const [isShareFileVisible, { showControl: showShareFile, hideControl: hideShareFile }] =
useCarouselJumperControls();
const [
isShareFileVisible,
{ showControl: showShareFile, hideControl: hideShareFile },
] = useCarouselJumperControls();
const [isEditSlatesVisible, { showControl: showEditSlates, hideControl: hideEditSlates }] =
useCarouselJumperControls();
const [
isEditSlatesVisible,
{ showControl: showEditSlates, hideControl: hideEditSlates },
] = useCarouselJumperControls();
const hideOpenJumpers = () => {
if (isMoreInfoVisible) hideMoreInfo();
@ -584,17 +592,25 @@ const STYLES_ACTION_BUTTON_SELECTED = (theme) => css`
`;
function CarouselFooterMobile({ file, onAction, external, isOwner, data, viewer }) {
const [isEditInfoVisible, { showControl: showEditInfo, hideControl: hideEditInfo }] =
useCarouselJumperControls();
const [
isEditInfoVisible,
{ showControl: showEditInfo, hideControl: hideEditInfo },
] = useCarouselJumperControls();
const [isShareFileVisible, { showControl: showShareFile, hideControl: hideShareFile }] =
useCarouselJumperControls();
const [
isShareFileVisible,
{ showControl: showShareFile, hideControl: hideShareFile },
] = useCarouselJumperControls();
const [isMoreInfoVisible, { showControl: showMoreInfo, hideControl: hideMoreInfo }] =
useCarouselJumperControls();
const [
isMoreInfoVisible,
{ showControl: showMoreInfo, hideControl: hideMoreInfo },
] = useCarouselJumperControls();
const [isEditSlatesVisible, { showControl: showEditSlates, hideControl: hideEditSlates }] =
useCarouselJumperControls();
const [
isEditSlatesVisible,
{ showControl: showEditSlates, hideControl: hideEditSlates },
] = useCarouselJumperControls();
const hideOpenJumpers = () => {
if (isMoreInfoVisible) hideMoreInfo();
@ -900,7 +916,11 @@ export function CarouselContent({ objects, index, isMobile, viewer, style, onClo
return (
<>
<Alert viewer={viewer} noWarning id={isMobile ? "slate-mobile-alert" : null} />
<Alert
// viewer={viewer}
// noWarning
id={isMobile ? "slate-mobile-alert" : null}
/>
<div
css={STYLES_CONTENT}
style={style}

View File

@ -37,9 +37,9 @@ export default async (req, res) => {
}
}
if (updates.onboarding) {
updates.onboarding = { ...user.onboarding, ...updates.onboarding };
}
// if (updates.onboarding) {
// updates.onboarding = { ...user.onboarding, ...updates.onboarding };
// }
if (updates.email && updates.email !== user.email) {
if (!Validations.email(updates.email)) {