-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix workspace urls to allow direct navigations to the workspace …
…relative pages (#120) * Revert "Revert "fix: Fix workspace urls to allow direct navigations to the workspace relative pages (#119)"" This reverts commit 22b3f46. * chore: Fix the github page redirect issue
- Loading branch information
1 parent
22b3f46
commit b38165d
Showing
65 changed files
with
984 additions
and
554 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
packages/threat-composer-app/src/components/GithubPagesNavigationHelper/index.tsx
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
packages/threat-composer-app/src/components/MarkdownEditorWithPrompt/index.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,35 @@ | ||
/** ******************************************************************************************************************* | ||
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"). | ||
You may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
******************************************************************************************************************** */ | ||
import { MarkdownEditor, MarkdownEditorProps } from '@aws/threat-composer'; | ||
import { FC, useState } from 'react'; | ||
import { unstable_usePrompt } from 'react-router-dom'; | ||
|
||
const MarkdownEditorWithPrompt: FC<MarkdownEditorProps> = ({ | ||
value, ...props | ||
}) => { | ||
const [previousValue] = useState(value); | ||
|
||
unstable_usePrompt({ | ||
message: 'You have unsaved changes, proceed anyway?', | ||
when: ({ currentLocation, nextLocation }) => | ||
previousValue !== value && | ||
currentLocation.pathname !== nextLocation.pathname, | ||
}); | ||
|
||
return <MarkdownEditor value={value} {...props} />; | ||
}; | ||
|
||
export default MarkdownEditorWithPrompt; |
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,28 @@ | ||
/** ******************************************************************************************************************* | ||
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"). | ||
You may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
******************************************************************************************************************** */ | ||
|
||
import { | ||
APP_MODE_BROWSER_EXTENSION, | ||
APP_MODE_IDE_EXTENSION, | ||
} from '@aws/threat-composer'; | ||
|
||
const appModeEnv = process.env.REACT_APP_APP_MODE; | ||
|
||
export const appMode = appModeEnv === APP_MODE_BROWSER_EXTENSION ? | ||
APP_MODE_BROWSER_EXTENSION : | ||
(appModeEnv === APP_MODE_IDE_EXTENSION ? | ||
APP_MODE_IDE_EXTENSION : undefined); | ||
|
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.