-
Notifications
You must be signed in to change notification settings - Fork 1
8. Final Build
Once the content has been finalized, it is necessary to upload a final build of the wiki so that the content is no longer editable. Due to iGEM restrictions, the content for the site cannot be hosted separately on firebase. This requires updating the code with data from firebase, updating the code to serve this data instead of using firebase, and redeploying the main.js build file.
The first portion of the final build process is copying the data stored on firebase into the code so that all the data can be uploaded to the iGEM website.
- Navigate to the project Firebase Console Realtime Database
- Expand the igem-wikis dropdown, expand the dropdown corresponding to the current year, and click
Content Datato view that json object - Click the 3 dots aligned vertically in the upper right corner of the box in the center of the screen to expand the options menu, and click
Export JSON. This will initiate a download of the ContentData JSON object - Copy the ContentData object, which consists of the entire downloaded file, and paste it into the contentData constant assignment at the bottom of the
src\components\_data\Data.tsfile
This portion includes updating the code to read the local contentData object instead of reading it from firebase.
- Navigate to
src\index.tsxin the code - Under the comment that says
COMMENT/UNCOMMENT BELOW TO ENABLE OR DISABLE FIREBASE TO THE PROJECTcomment out lines related to firebase, and uncomment the line setting firebase to null. For Example:
// COMMENT/UNCOMMENT BELOW TO ENABLE OR DISABLE FIREBASE TO THE PROJECT
// import * as firebase from 'firebase/app';
// import 'firebase/app'
// import 'firebase/messaging';
// import 'firebase/database';
// import 'firebase/auth';
// const firebaseConfig = {
// apiKey: "AIzaSyBkr6jirFdzkMofucO2z_KzN13hMDeWkVI",
// authDomain: "uwigem-wikis.firebaseapp.com",
// databaseURL: "https://uwigem-wikis.firebaseio.com",
// projectId: "uwigem-wikis",
// storageBucket: "uwigem-wikis.appspot.com",
// messagingSenderId: "131891776719",
// appId: "1:131891776719:web:0bf2382aec94dcdf"
// };
// firebase.initializeApp(firebaseConfig);
let firebase = null;
// firebase.auth().signInWithPopup(provider);- Navigate to
src\App.tsx - Under the comment that says
Comment out this in final buildcomment out the lines below like so:
{/** Comment out this in final build */}
// {pageTitle === "/Editor" &&
// <ContentEditor
// contentData={contentData}
// currYear={currYear}
// />}This process may be able to be automated. We can attempt to create tools to do this. For now, it is a manual process.
- Run
npm run buildNote: If there are type errors when building, try setting the type of the contentData constant at the bottom of thesrc\components\_data\Data.tsfile toany - Navigate to the build folder and find
static/js/main.js - copy paste that into
http://2020.igem.org/Template:Washington/JavaScript. (Note the capital S in JavaScript. This assumes that the CSS has already been uploaded) - Save the changes, and the JavaScript should now be updated to use the included data instead of Firebase data. This means that future changes in the editor will not be visible unless this process is repeated with the new data, or the firebase editor is re-enabled.