mirror of
https://github.com/filecoin-project/slate.git
synced 2024-09-11 22:07:08 +03:00
removed no private files alert
This commit is contained in:
parent
c26f24fbb1
commit
eb20803b87
@ -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;
|
||||
}
|
||||
|
@ -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({
|
||||
|
@ -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>
|
||||
|
@ -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
|
||||
|
@ -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}
|
||||
|
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user