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
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
const graphqlHttp = require('express-graphql'); | |
const {buildSchema} = require('graphql'); | |
const mongoose = require('mongoose'); | |
const movieSchema = require('./models/movie-schema'); | |
const Movie = require('./models/movie'); | |
var app = express(); |
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
router.post('/SlackAppDemo',function(req,res) { | |
try { | |
const response = { | |
response_type: 'in_channel', | |
channel: req.body.channel_id, | |
text: 'Hey there...:', | |
attachments: [{ | |
text: 'What would you like to know in this project?', | |
fallback: 'What would you like to know in this project?', | |
color: '#2c963f', |
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
const queryOptions = [{ | |
text: 'Open Issues', | |
value: 'opneIssues' | |
}, { | |
text: 'Closed Issues', | |
value: 'closedIssues' | |
}, { | |
text: 'Milestones', | |
value: 'milestones' | |
}, { |
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
router.post('/actions', async (req, res) => { | |
try { | |
const payload = JSON.parse(req.body.payload); | |
console.log("###slack request is "+payload); | |
var response = ""; | |
if (payload.callback_id === 'query_selection') { | |
console.log("option selected is "+payload.actions[0].selected_options[0].value); | |
switch (payload.actions[0].selected_options[0].value) { | |
case "openIssues": |
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
import UIKit | |
import AuthenticationServices | |
class LoginViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
setupAppleSignIn() | |
} | |
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
import Foundation | |
struct MovieInfo: Codable { | |
let name: String? | |
let releaseDate: String? | |
let daysSinceRelease: Int? | |
let collection: String? | |
let posterUrl: String? | |
enum CodingKeys: String, CodingKey { |
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
struct MovieInfoEntry: TimelineEntry { | |
public let date: Date | |
public let movieInfo: MovieInfo | |
} |
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
struct Provider: TimelineProvider { | |
let dummyData = MovieInfo(name: "Some latest movie", releaseDate: "Release Date", daysSinceRelease: 1, collection: "Collection in Cr", posterUrl: "https://popcornusa.s3.amazonaws.com/placeholder-movieimage.png") | |
func placeholder(in context: Context) -> MovieInfoEntry { | |
MovieInfoEntry(date: Date(), movieInfo: dummyData) | |
} | |
func getSnapshot(in context: Context, completion: @escaping (MovieInfoEntry) -> ()) { | |
let entry = MovieInfoEntry(date: Date(), movieInfo: dummyData) |
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
struct BoxOfficeWidgetEntryView : View { | |
var entry: Provider.Entry | |
@Environment(\.widgetFamily) var family | |
@ViewBuilder | |
var body: some View { | |
switch family { | |
case .systemSmall: | |
ZStack { | |
moviePosterView() |
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
@main | |
struct BoxOfficeWidget: Widget { | |
let kind: String = "BoxOfficeWidget" | |
var body: some WidgetConfiguration { | |
StaticConfiguration(kind: kind, provider: Provider()) { entry in | |
BoxOfficeWidgetEntryView(entry: entry) | |
} | |
.configurationDisplayName("Box Office") | |
.description("Box office collection of latest movies") |