Skip to content
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

fix: Simplifies the form, set the default api to v2, pre-selected the desired options, text fixes #2349

Merged
merged 2 commits into from
Oct 13, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 12 additions & 26 deletions src/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
</ul> -->
<!-- changes-2 removed till here -->
<!-- changes-2 added from here -->
<ul style="list-style-type:none;postion: relative;">
<ul style="list-style-type:none; position: relative;">
<li>
<input name="session" required="" type="radio" value="single" id="single">
<label for="single">Single</label>
Expand All @@ -308,34 +308,20 @@
<!-- Map Integration-->
<label>Choose Map Integration</label>

<ul style="list-style-type:none;postion: relative;">
<ul style="list-style-type:none; position: relative;">
<li>
<input id="google" name="map" type="radio" value="googleMap">
<label for="google">Google_Map</label>
<label for="google">Google Map</label>
</li>

<li>
<input id="open_street" name="map" type="radio" value="openStreetMap">
<label for="open_street">Open_Street_Map</label>
</li>
</ul>


<label>Choose your API version</label>
<ul style="list-style-type:none">
<!--<li><input type="radio" name="datasource" value="mockjson"> Default mock API </input></li>-->
<li>
<input id="version1" name="apiVersion" type="radio" value="api_v1">
<label for="version1">API_v1</label>
</li>
<li>
<input id="version2" name="apiVersion" type="radio" value="api_v2">
<label for="version2">API_v2</label>
<label for="open_street">Open Street Map</label>
</li>
</ul>

<!-- changes-2 added till here -->
<label>Choose your data source</label>
<label>Choose Your Data Source</label>
<ul style="list-style-type:none">
<!--<li><input type="radio" name="datasource" value="mockjson"> Default mock API </input></li>-->
<li id="uploadJSON">
Expand All @@ -344,15 +330,15 @@
</li>
<li id="endpointAPI">
<input name="datasource" id="eventapi" type="radio" value="eventapi">
<label for="endpointAPI">API endpoint of event on OpenEvent</label>
<label for="endpointAPI">API Endpoint</label>
</li>
</ul>
<section id="eventapi-input" style="display:none;">
<label for="apiendpoint">Link to Open Event API endpoint</label>
<label style="font-weight: 400;" for="apiendpoint">Link to Open Event API Endpoint</label>
<input class="form-control" id="apiendpoint" name="apiendpoint" required="true" type="url">
</section>
<section id="jsonupload-input" style="display:none;">
<label for="siofu_input">Zip file containing resources for the event</label>
<label style="font-weight: 400;" for="siofu_input">Zip file containing resources for the event</label>
<input accept="application/zip" class="form-control" id="siofu_input" name="singlefileUpload" required="true" type="file">
<div id="message">
<p>File has been successfully uploaded</p>
Expand Down Expand Up @@ -392,14 +378,14 @@
<input id="enable-google-analytics" title="Enable Google Analytics" type="checkbox">
<label for="enable-google-analytics">Enable Google Analytics</label>
<div id="ganalytics-id-container" style="display: none">
<input class="form-control" style="width: 49.2%; display: inline" id="ganalytics-id" placeholder="google analytics id" type="text">
<input class="form-control" style="width: 49.2%; display: inline" id="ganalytics-id" placeholder="Google Analytics ID" type="text">
</div>
</section>
<section>
<input id="enable-google-calendar" title="Enable Google Calendar" type="checkbox"> <label for="enable-google-calendar">Enable Google Calendar</label>
<div id="gcalendar-id-container" style="display: none">
<input class="form-control" style="width: 100%; display: inline" id="gcalendar-key" placeholder="google calendar API Key" type="text">
<input class="form-control" style="width: 100%; display: inline; margin-top: 5px" id="gcalendar-id" placeholder="google calendar Client ID" type="text">
<input class="form-control" style="width: 100%; display: inline" id="gcalendar-key" placeholder="Google Calendar API Key" type="text">
<input class="form-control" style="width: 100%; display: inline; margin-top: 5px" id="gcalendar-id" placeholder="Google Calendar Client ID" type="text">
</div>
</section>
<section>
Expand All @@ -413,7 +399,7 @@
<div id="status" style="margin-bottom:10px;"></div><a id="aLog" style="cursor:pointer;">-Logs-</a>
<pre id="buildLog" style="display:none;">
</pre><br>
<button class="download btn btn-default" disabled id="btnGenerate" style="margin-top:7px" title="Upload zip or use API mode to enable" type="button" value="Validate">GENERATE WEBAPP</button> <button class="download btn btn-default" id="btnLive" type="button">PREVIEW</button> <button class="download btn btn-default" id="btnDownload" type="button">DOWNLOAD</button> <a class="btn btn-default" id="deploy" style="display:none">DEPLOY</a>
<button class="download btn btn-default" id="btnGenerate" style="margin-top:7px" title="Upload zip or use API mode to enable" type="button" value="Validate">GENERATE WEBAPP</button> <button class="download btn btn-default" id="btnLive" type="button">PREVIEW</button> <button class="download btn btn-default" id="btnDownload" type="button">DOWNLOAD</button> <a class="btn btn-default" id="deploy" style="display:none">DEPLOY</a>
</center>
</div>
</form>
Expand Down
10 changes: 6 additions & 4 deletions src/www/js/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,11 +490,14 @@ function updateStatus(statusMsg) {
}

function initialState() {
$('#expandable').prop('checked', true);
$('#open_street').prop('checked', true);
$('input:radio[name="datasource"]').prop('checked', false);
$("#eventapi").prop('checked', true);
$('#eventapi-input').show(100);
$('#upload-ftp').prop('checked', false);
$('#enable-google-analytics').prop('checked', false);
$('#enable-google-calendar').prop('checked', false);
$('#btnGenerate').prop('disabled', true);
uploadFinished = false;
}

Expand Down Expand Up @@ -523,6 +526,8 @@ function getFile() {
function getData(initValue) {
const data = initValue;
const formData = $('#form').serializeArray();

data.apiVersion= 'api_v2';

formData.forEach(function(field) {
if (field.name === 'email') {
Expand All @@ -543,9 +548,6 @@ function getData(initValue) {
if (field.name === 'session') {
data.sessionMode = field.value;
}
if (field.name === 'apiVersion') {
data.apiVersion = field.value;
}
if (field.name === 'map') {
data.map = field.value;
}
Expand Down