-
Notifications
You must be signed in to change notification settings - Fork 0
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
Archive explorer, removal of <CANDIDATE> #9
Open
danielmawhirter
wants to merge
4
commits into
main
Choose a base branch
from
archive-explorer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Archive</title> | ||
<link rel="icon" type="image/png" href="../favicon.ico"> | ||
|
||
<!-- Firebase --> | ||
<script src="../firebase-8.3.1/firebase-app.js"></script> | ||
<script src="../firebase-8.3.1/firebase-auth.js"></script> | ||
<script src="../firebase-8.3.1/firebase-database.js"></script> | ||
|
||
<style> | ||
html { height: 100%; } | ||
body { margin: 0; height: 100%; } | ||
#ref_list { | ||
display: block; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body onload="init()"> | ||
<div id="ref_list"></div> | ||
<script> | ||
function initList() { | ||
var ref_list = document.getElementById("ref_list"); | ||
var query = firebase.database().ref("public").orderByKey(); | ||
query.once("value") | ||
.then(function(snapshot) { | ||
snapshot.forEach(function(childSnapshot) { | ||
var key = childSnapshot.key; | ||
var elem = document.createElement("a"); | ||
elem.text = key; | ||
elem.href = "../#" + key; | ||
elem.style.display = "block"; | ||
ref_list.appendChild(elem); | ||
}); | ||
}); | ||
} | ||
|
||
function init() { | ||
var firebaseConfig = { | ||
apiKey: "AIzaSyCJ3plB5z_C1oFVUkjI3NgbnEXO5DWAGlM", | ||
authDomain: "katanagraph-interview.firebaseapp.com", | ||
projectId: "katanagraph-interview", | ||
storageBucket: "katanagraph-interview.appspot.com", | ||
messagingSenderId: "71531395473", | ||
appId: "1:71531395473:web:fc5aec90c2baa75fd7c230" | ||
}; | ||
|
||
var authInitialized = false; | ||
firebase.initializeApp(firebaseConfig); | ||
firebase.auth().onAuthStateChanged((user) => { | ||
if (user && !authInitialized) { | ||
authInitialized = true; | ||
initList(); | ||
} | ||
}); | ||
firebase.auth().signInAnonymously(); | ||
} | ||
</script> | ||
</body> | ||
</html> |
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
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.
I was actually thinking that we make past interviews harder to find rather than easier.
With this change it would technically be possible for a candidate to find old interviews more easily (if they could guess
/archive
as an interesting path) if I'm understanding it correctly.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.
Ok, understood, this is primarily a permission issue then. Here's what I'd like to do:
After a document is first created, anyone who knows the link can read or write it for 2? days. After that, you have to sign in with a Katana login (firebase can do it), then you can read anything (maybe not write).
I'm looking at some documentation to figure out how to do this, does it seem reasonable?
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 sounds great!