-
Notifications
You must be signed in to change notification settings - Fork 8
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
[CP-2191] I want only supported files to be uploaded #1393
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5ea429d
omit files with wrong extenstions
OskarMichalkiewicz f5137f3
fix tests and lint
OskarMichalkiewicz 3519ee6
Merge branch 'master' into Cp-2191
OskarMichalkiewicz 79aad76
Merge branch 'master' into CP-2191
OskarMichalkiewicz 49ea624
simplification of translations and text inside the modal
OskarMichalkiewicz f0eedf9
Merge branch 'CP-2191' of github.com:mudita/mudita-center into CP-2191
OskarMichalkiewicz 3e69085
review fix
OskarMichalkiewicz 7a1850e
lint fix
OskarMichalkiewicz bfdfeb7
Merge branch 'master' into CP-2191
OskarMichalkiewicz d4c4dd0
Merge branch 'master' into CP-2191
OskarMichalkiewicz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion
2
packages/app/src/__deprecated__/renderer/locales/default/pl-PL.json
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"component.collectingDataModalBody": "I agree on sending anonymized data to Mudita" | ||
} | ||
} |
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
97 changes: 97 additions & 0 deletions
97
...es/app/src/files-manager/components/invalid-files-modal/invalid-files-modal.component.tsx
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,97 @@ | ||
/** | ||
* Copyright (c) Mudita sp. z o.o. All rights reserved. | ||
* For licensing, see https://github.com/mudita/mudita-center/blob/master/LICENSE.md | ||
*/ | ||
|
||
import { defineMessages } from "react-intl" | ||
import { FunctionComponent } from "App/__deprecated__/renderer/types/function-component.interface" | ||
import { useDispatch, useSelector } from "react-redux" | ||
import { getInvalidFiles } from "App/files-manager/selectors/get-invalid-files.selector" | ||
import { | ||
ModalContent, | ||
ModalDialog, | ||
RoundIconWrapper, | ||
} from "App/ui/components/modal-dialog" | ||
import React from "react" | ||
import { ModalSize } from "App/__deprecated__/renderer/components/core/modal/modal.interface" | ||
import { intl } from "App/__deprecated__/renderer/utils/intl" | ||
import Icon from "App/__deprecated__/renderer/components/core/icon/icon.component" | ||
import { IconType } from "App/__deprecated__/renderer/components/core/icon/icon-type" | ||
import Text, { | ||
TextDisplayStyle, | ||
} from "App/__deprecated__/renderer/components/core/text/text.component" | ||
import { resetUploadingState } from "App/files-manager/actions" | ||
import styled from "styled-components" | ||
import { | ||
fontWeight, | ||
textColor, | ||
} from "App/__deprecated__/renderer/styles/theming/theme-getters" | ||
import { ipcRenderer } from "electron-better-ipc" | ||
import { HelpActions } from "App/__deprecated__/common/enums/help-actions.enum" | ||
|
||
const messages = defineMessages({ | ||
title: { | ||
id: "module.filesManager.invalidFiledModalTitle", | ||
}, | ||
filesInfo: { | ||
id: "module.filesManager.invalidFiledModalFilesInfo", | ||
}, | ||
helpInfo: { | ||
id: "module.filesManager.invalidFiledModalHelpInfo", | ||
}, | ||
}) | ||
|
||
const StyledLink = styled.a` | ||
text-decoration: underline; | ||
cursor: pointer; | ||
font-size: 1.4rem; | ||
font-weight: ${fontWeight("default")}; | ||
color: ${textColor("action")}; | ||
` | ||
const StyledModalContent = styled(ModalContent)` | ||
p { | ||
text-align: left; | ||
} | ||
` | ||
|
||
export const InvalidFilesModal: FunctionComponent = ({ ...props }) => { | ||
const invalidFiles = useSelector(getInvalidFiles) | ||
const openHelpWindow = () => ipcRenderer.callMain(HelpActions.OpenWindow) | ||
|
||
const dispatch = useDispatch() | ||
return ( | ||
<ModalDialog | ||
size={ModalSize.Small} | ||
title={intl.formatMessage(messages.title)} | ||
open={!!invalidFiles.length} | ||
closeButton | ||
onCloseButton={() => { | ||
dispatch(resetUploadingState()) | ||
}} | ||
{...props} | ||
> | ||
<StyledModalContent> | ||
<RoundIconWrapper> | ||
<Icon type={IconType.Info} width={3.2} /> | ||
</RoundIconWrapper> | ||
<Text | ||
displayStyle={TextDisplayStyle.Paragraph4} | ||
color="secondary" | ||
message={messages.filesInfo} | ||
/> | ||
<Text | ||
displayStyle={TextDisplayStyle.Paragraph4} | ||
color="secondary" | ||
message={{ | ||
...messages.helpInfo, | ||
values: { | ||
link: ( | ||
<StyledLink onClick={openHelpWindow}>help pages</StyledLink> | ||
), | ||
}, | ||
}} | ||
/> | ||
</StyledModalContent> | ||
</ModalDialog> | ||
) | ||
} |
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't it suppose to be in polish? :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that was synced with phrase, i guess that's some legacy data that still lingers there