Skip to content

Commit

Permalink
Merge pull request #45 from HackGT/apollo-client2
Browse files Browse the repository at this point in the history
Refactoring - Remove unused endpoints and use Apollo Client 2.0
  • Loading branch information
kexin-zhang authored Jun 10, 2018
2 parents 1321839 + 30b92fa commit 8cc6108
Show file tree
Hide file tree
Showing 11 changed files with 1,562 additions and 2,395 deletions.
2 changes: 1 addition & 1 deletion api.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type TagState {
# Date when the attendee was checked in
checked_in_date: String
# The username of the admin that checked the attendee in
checked_in_by: String
checked_in_by: String!
}

# NOTE: Type names that forward to registration must match the type names
Expand Down
9 changes: 9 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,18 @@ curl -s 'https://raw.githubusercontent.com/HackGT/registration/master/api.graphq
./node_modules/.bin/graphql-typewriter -i ./api.graphql
mv ./api.graphql.types.ts ./server/graphql.types.ts

# Generate types for client side queries and responses
./node_modules/.bin/apollo-codegen introspect-schema \
./api.graphql \
--output ./apis/checkin.schema.json
./node_modules/.bin/gql2ts \
-o ./apis/checkin.d.ts \
./apis/checkin.schema.json

# Compile
./node_modules/typescript/bin/tsc -p server/
./node_modules/typescript/bin/tsc -p client/
./node_modules/typescript/bin/tsc -p test/

# Bundle client side js
./node_modules/.bin/browserify ./client/js/main.js -o ./client/js/bundle.js
73 changes: 0 additions & 73 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,10 @@ <h1 class="mdc-typography--title">HackGT Check In</h1>
{{/each}}
</select>
</a>
<a class="mdc-list-item" href="#attendees" id="open-attendees">
<i class="material-icons mdc-list-item__start-detail" aria-hidden="true">playlist_add</i>
Add attendees
</a>
<a class="mdc-list-item" href="#tags" id="open-tags">
<i class="material-icons mdc-list-item__start-detail" aria-hidden="true">mode_edit</i>
Edit tags
</a>
<a class="mdc-list-item" href="#" style="display: none;">
<i class="material-icons mdc-list-item__start-detail" aria-hidden="true">delete_sweep</i>
<select class="mdc-list-item tags" id="tag-delete">
<option selected value="">Choose tag to delete</option>
{{#each tags}}
<option>{{this}}</option>
{{/each}}
</select>
</a>
<a class="mdc-list-item" href="#users" id="open-users">
<i class="material-icons mdc-list-item__start-detail" aria-hidden="true">account_box</i>
Configure users
Expand Down Expand Up @@ -123,65 +110,6 @@ <h1 class="mdc-typography--title">HackGT Check In</h1>
</div>
</section>

<section id="import" style="display: none;">
<div class="card">
<div class="card-content">
<section class="center">
<h1 class="mdc-typography--headline">Import attendees</h1>

<div class="mdc-textfield" data-mdc-auto-init="MDCTextfield">
<input class="mdc-textfield__input" type="text" id="import-tag">
<label class="mdc-textfield__label" for="import-tag">Tag(s) for this import (comma delimited)</label>
</div>

<input class="mdc-textfield__input" type="file" name="import">

<!-- Default header values match up with HackGTeeny survey headers -->
<div class="mdc-textfield mdc-textfield--upgraded">
<label class="mdc-textfield__label mdc-textfield__label--float-above" for="name-header">CSV name header</label>
<input class="mdc-textfield__input" type="text" id="name-header" placeholder="name">
</div>

<div class="mdc-textfield mdc-textfield--upgraded">
<input class="mdc-textfield__input" type="text" id="email-headers" placeholder="gt email address, email address">
<label class="mdc-textfield__label mdc-textfield__label--float-above" for="email-headers">CSV email headers (comma delimited)</label>
</div>
<button class="mdc-button mdc-button--primary mdc-ripple-surface mdc-button--raised" data-mdc-auto-init="MDCRipple" id="import-attendees">
Import
</button>
</section>
</div>
</div>
<div class="card">
<div class="card-content">
<section class="center">
<h1 class="mdc-typography--headline">Add an attendee</h1>

<div class="mdc-textfield" data-mdc-auto-init="MDCTextfield">
<input class="mdc-textfield__input" type="text" id="add-tag" list="autocomplete-tags">
<datalist id="autocomplete-tags">
{{#each tags}}
<option value="{{this}}"></option>
{{/each}}
</datalist>
<label class="mdc-textfield__label" for="add-tag">Tag(s) (comma delimited)</label>
</div>
<div class="mdc-textfield" data-mdc-auto-init="MDCTextfield">
<input class="mdc-textfield__input" type="text" id="add-name">
<label class="mdc-textfield__label" for="add-name">Name</label>
</div>
<div class="mdc-textfield" data-mdc-auto-init="MDCTextfield">
<input class="mdc-textfield__input" type="text" id="add-email">
<label class="mdc-textfield__label" for="add-email">Email(s) (comma delimited)</label>
</div>
<button class="mdc-button mdc-button--primary mdc-ripple-surface mdc-button--raised" data-mdc-auto-init="MDCRipple" id="add-attendee">
Add
</button>
</section>
</div>
</div>
</section>

<section id="manage-users" style="display: none;">
<div class="card">
<div class="card-content">
Expand Down Expand Up @@ -276,7 +204,6 @@ <h1 class="mdc-typography--headline">Add Tags</h1>
<label for="my-checkbox">Label</label>
</div>
</template>
<script src="https://unpkg.com/subscriptions-transport-ws@0.8.3/browser/client.js"></script>
<script src="/node_modules/material-components-web/dist/material-components-web.js"></script>
<script src="/js/bundle.js"></script>
</body>
Expand Down
Loading

0 comments on commit 8cc6108

Please sign in to comment.