-
Notifications
You must be signed in to change notification settings - Fork 224
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
[feature] [playground] add guided tour #934
Merged
Merged
Changes from 2 commits
Commits
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
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,67 @@ | ||
import React, { useState } from "react"; | ||
import { Tour } from "antd"; | ||
|
||
export default function GuidedTour({ refSchemaEditor, refRelationshipsAndAttributes, refEnforcement }) { | ||
const [open, setOpen] = useState(!(localStorage.getItem("hasSeenGuidedTour") === "true")); | ||
|
||
const onTourClose = () => { | ||
localStorage.setItem("hasSeenGuidedTour", "true"); | ||
setOpen(false); | ||
}; | ||
|
||
const steps = [ | ||
{ | ||
title: "Welcome to the Permify Playground!", | ||
placement: "center", | ||
description: ( | ||
<p> | ||
This environment enables you to create and test your authorization schema within a browser. The Permify playground comprises three main sections: Schema (Authorization Model), Authorization Data, and Enforcement. While we cover these | ||
sections in this tour, you can find the complete documentation at | ||
<a href="https://docs.permify.co/" target="_blank" rel="noreferrer noopener"> | ||
docs.permify.co | ||
</a> | ||
</p> | ||
), | ||
}, | ||
{ | ||
title: "Schema (Authorization Model)", | ||
target: refSchemaEditor.current, | ||
description: ( | ||
<p> | ||
You can create your authorization model in this section with using our domain specific language. We already have a couple of use cases and example that you can choose from the dropdown above. Also, you can check our | ||
<a href="https://docs.permify.co/docs/getting-started/modeling/" target="_blank" rel="noreferrer noopener"> | ||
docs | ||
</a> | ||
to learn more about how to model authorization in Permify. | ||
</p> | ||
), | ||
}, | ||
{ | ||
title: "Authorization Data", | ||
target: refRelationshipsAndAttributes.current, | ||
description: ( | ||
<p> | ||
You can create sample authorization data to test your authorization logic. For instance, to create a relationship between your defined entities, simply click the 'Add Relationship' button. For further information on data creation, please | ||
refer to | ||
<a href="https://docs.permify.co/docs/getting-started/sync-data/" target="_blank" rel="noreferrer noopener"> | ||
docs | ||
</a> | ||
</p> | ||
), | ||
}, | ||
{ | ||
title: "Enforcement", | ||
target: refEnforcement.current, | ||
description: ( | ||
<p> | ||
Now that we have sample data and a defined schema, let's perform an access check! The YAML in the Enforcement section represents a test scenario for conducting access checks. To learn more about the capabilities of this YAML, refer to: | ||
| ||
<a href="https://docs.permify.co/docs/playground/#enforcement-access-check-scenarios" target="_blank" rel="noreferrer noopener"> | ||
access check scenarios | ||
</a> | ||
</p> | ||
), | ||
}, | ||
]; | ||
return <Tour open={open} steps={steps} onClose={onTourClose} />; | ||
} |
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.
This is unrelated to my changes, but build was failing so had to fix it