From 672b9dbac01c70aa5d629c5ea3ca989bdb1b45ce Mon Sep 17 00:00:00 2001 From: missytake Date: Sat, 18 Mar 2023 17:02:57 +0100 Subject: [PATCH] [misc] Remove twitter from frontend --- frontend/src/app/core/api/api.module.ts | 1 - frontend/src/app/core/api/api/api.ts | 4 +- .../src/app/core/api/api/twitter.service.ts | 595 ------------------ .../board/hoodpage/hoodpage.component.html | 4 +- .../board/platforms/platforms.component.html | 1 - .../app/dashboard/dashboard-routing.module.ts | 3 - .../platforms-info-page.component.html | 1 - .../src/app/platforms/platforms.module.ts | 13 - .../twitter-bot-card.component.html | 46 -- .../twitter-bot-card.component.scss | 11 - .../twitter-bot-card.component.spec.ts | 24 - .../twitter-bot-card.component.ts | 27 - .../twitter-bot-info-dialog.component.html | 51 -- .../twitter-bot-info-dialog.component.scss | 4 - .../twitter-bot-info-dialog.component.ts | 12 - .../twitter-callback.component.html | 3 - .../twitter-callback.component.scss | 4 - .../twitter-callback.component.spec.ts | 24 - .../twitter-callback.component.ts | 47 -- .../twitter-corpses.pipe.ts | 10 - .../twitter-info-dialog.component.html | 41 -- .../twitter-info-dialog.component.scss | 9 - .../twitter-info-dialog.component.ts | 12 - .../twitter-settings.component.html | 64 -- .../twitter-settings.component.scss | 22 - .../twitter-settings.component.spec.ts | 24 - .../twitter-settings.component.ts | 77 --- .../homepage/faq/faq.component.html | 11 - .../homepage/homepage.component.html | 4 +- 29 files changed, 5 insertions(+), 1144 deletions(-) delete mode 100644 frontend/src/app/core/api/api/twitter.service.ts delete mode 100644 frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-card.component.html delete mode 100644 frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-card.component.scss delete mode 100644 frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-card.component.spec.ts delete mode 100644 frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-card.component.ts delete mode 100644 frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-info-dialog/twitter-bot-info-dialog.component.html delete mode 100644 frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-info-dialog/twitter-bot-info-dialog.component.scss delete mode 100644 frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-info-dialog/twitter-bot-info-dialog.component.ts delete mode 100644 frontend/src/app/platforms/twitter/twitter-callback/twitter-callback.component.html delete mode 100644 frontend/src/app/platforms/twitter/twitter-callback/twitter-callback.component.scss delete mode 100644 frontend/src/app/platforms/twitter/twitter-callback/twitter-callback.component.spec.ts delete mode 100644 frontend/src/app/platforms/twitter/twitter-callback/twitter-callback.component.ts delete mode 100644 frontend/src/app/platforms/twitter/twitter-corpses-pipe/twitter-corpses.pipe.ts delete mode 100644 frontend/src/app/platforms/twitter/twitter-settings/twitter-info-dialog/twitter-info-dialog.component.html delete mode 100644 frontend/src/app/platforms/twitter/twitter-settings/twitter-info-dialog/twitter-info-dialog.component.scss delete mode 100644 frontend/src/app/platforms/twitter/twitter-settings/twitter-info-dialog/twitter-info-dialog.component.ts delete mode 100644 frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.html delete mode 100644 frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.scss delete mode 100644 frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.spec.ts delete mode 100644 frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.ts diff --git a/frontend/src/app/core/api/api.module.ts b/frontend/src/app/core/api/api.module.ts index b3a7ddb..3760153 100644 --- a/frontend/src/app/core/api/api.module.ts +++ b/frontend/src/app/core/api/api.module.ts @@ -10,7 +10,6 @@ import { MastodonService } from './api/mastodon.service'; import { TelegramService } from './api/telegram.service'; import { TestService } from './api/test.service'; import { TriggersService } from './api/triggers.service'; -import { TwitterService } from './api/twitter.service'; @NgModule({ imports: [], diff --git a/frontend/src/app/core/api/api/api.ts b/frontend/src/app/core/api/api/api.ts index 69e9b19..832c9d7 100644 --- a/frontend/src/app/core/api/api/api.ts +++ b/frontend/src/app/core/api/api/api.ts @@ -14,6 +14,4 @@ export * from './test.service'; import { TestService } from './test.service'; export * from './triggers.service'; import { TriggersService } from './triggers.service'; -export * from './twitter.service'; -import { TwitterService } from './twitter.service'; -export const APIS = [AdminService, BadwordsService, EmailService, HoodsService, MastodonService, TelegramService, TestService, TriggersService, TwitterService]; +export const APIS = [AdminService, BadwordsService, EmailService, HoodsService, MastodonService, TelegramService, TestService, TriggersService]; diff --git a/frontend/src/app/core/api/api/twitter.service.ts b/frontend/src/app/core/api/api/twitter.service.ts deleted file mode 100644 index b686fe9..0000000 --- a/frontend/src/app/core/api/api/twitter.service.ts +++ /dev/null @@ -1,595 +0,0 @@ -/** - * FastAPI - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -/* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; - -import { HTTPValidationError } from '../model/models'; - -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; - - - -@Injectable({ - providedIn: 'root' -}) -export class TwitterService { - - protected basePath = 'http://localhost/api'; - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - public encoder: HttpParameterCodec; - - constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { - if (configuration) { - this.configuration = configuration; - } - if (typeof this.configuration.basePath !== 'string') { - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); - } - - - private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { - if (typeof value === "object" && value instanceof Date === false) { - httpParams = this.addToHttpParamsRecursive(httpParams, value); - } else { - httpParams = this.addToHttpParamsRecursive(httpParams, value, key); - } - return httpParams; - } - - private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { - if (value == null) { - return httpParams; - } - - if (typeof value === "object") { - if (Array.isArray(value)) { - (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, - (value as Date).toISOString().substr(0, 10)); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( - httpParams, value[k], key != null ? `${key}.${k}` : k)); - } - } else if (key != null) { - httpParams = httpParams.append(key, value); - } else { - throw Error("key may not be null if value is not object or array"); - } - return httpParams; - } - - /** - * Twitter Read Callback - * @param oauthToken - * @param oauthVerifier - * @param hoodId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public callbackTwitter(oauthToken: string, oauthVerifier: string, hoodId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public callbackTwitter(oauthToken: string, oauthVerifier: string, hoodId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public callbackTwitter(oauthToken: string, oauthVerifier: string, hoodId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public callbackTwitter(oauthToken: string, oauthVerifier: string, hoodId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { - if (oauthToken === null || oauthToken === undefined) { - throw new Error('Required parameter oauthToken was null or undefined when calling callbackTwitter.'); - } - if (oauthVerifier === null || oauthVerifier === undefined) { - throw new Error('Required parameter oauthVerifier was null or undefined when calling callbackTwitter.'); - } - if (hoodId === null || hoodId === undefined) { - throw new Error('Required parameter hoodId was null or undefined when calling callbackTwitter.'); - } - - let queryParameters = new HttpParams({encoder: this.encoder}); - if (oauthToken !== undefined && oauthToken !== null) { - queryParameters = this.addToHttpParams(queryParameters, - oauthToken, 'oauth_token'); - } - if (oauthVerifier !== undefined && oauthVerifier !== null) { - queryParameters = this.addToHttpParams(queryParameters, - oauthVerifier, 'oauth_verifier'); - } - if (hoodId !== undefined && hoodId !== null) { - queryParameters = this.addToHttpParams(queryParameters, - hoodId, 'hood_id'); - } - - let headers = this.defaultHeaders; - - let credential: string | undefined; - // authentication (OAuth2PasswordBearer) required - credential = this.configuration.lookupCredential('OAuth2PasswordBearer'); - if (credential) { - headers = headers.set('Authorization', 'Bearer ' + credential); - } - - let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (httpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - - let responseType: 'text' | 'json' = 'json'; - if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { - responseType = 'text'; - } - - return this.httpClient.get(`${this.configuration.basePath}/api/twitter/callback`, - { - params: queryParameters, - responseType: responseType, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); - } - - /** - * Twitter Create - * `https://api.twitter.com/oauth/authorize?oauth_token=` - * @param hoodId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public createTwitter(hoodId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public createTwitter(hoodId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public createTwitter(hoodId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public createTwitter(hoodId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { - if (hoodId === null || hoodId === undefined) { - throw new Error('Required parameter hoodId was null or undefined when calling createTwitter.'); - } - - let headers = this.defaultHeaders; - - let credential: string | undefined; - // authentication (OAuth2PasswordBearer) required - credential = this.configuration.lookupCredential('OAuth2PasswordBearer'); - if (credential) { - headers = headers.set('Authorization', 'Bearer ' + credential); - } - - let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (httpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - - let responseType: 'text' | 'json' = 'json'; - if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { - responseType = 'text'; - } - - return this.httpClient.post(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/twitter/`, - null, - { - responseType: responseType, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); - } - - /** - * Twitter Delete - * @param twitterId - * @param hoodId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public deleteTwitter(twitterId: number, hoodId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public deleteTwitter(twitterId: number, hoodId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public deleteTwitter(twitterId: number, hoodId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public deleteTwitter(twitterId: number, hoodId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { - if (twitterId === null || twitterId === undefined) { - throw new Error('Required parameter twitterId was null or undefined when calling deleteTwitter.'); - } - if (hoodId === null || hoodId === undefined) { - throw new Error('Required parameter hoodId was null or undefined when calling deleteTwitter.'); - } - - let headers = this.defaultHeaders; - - let credential: string | undefined; - // authentication (OAuth2PasswordBearer) required - credential = this.configuration.lookupCredential('OAuth2PasswordBearer'); - if (credential) { - headers = headers.set('Authorization', 'Bearer ' + credential); - } - - let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (httpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - - let responseType: 'text' | 'json' = 'json'; - if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { - responseType = 'text'; - } - - return this.httpClient.delete(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/twitter/${encodeURIComponent(String(twitterId))}`, - { - responseType: responseType, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); - } - - /** - * Twitter Read - * @param twitterId - * @param hoodId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTwitter(twitterId: number, hoodId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public getTwitter(twitterId: number, hoodId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getTwitter(twitterId: number, hoodId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getTwitter(twitterId: number, hoodId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { - if (twitterId === null || twitterId === undefined) { - throw new Error('Required parameter twitterId was null or undefined when calling getTwitter.'); - } - if (hoodId === null || hoodId === undefined) { - throw new Error('Required parameter hoodId was null or undefined when calling getTwitter.'); - } - - let headers = this.defaultHeaders; - - let credential: string | undefined; - // authentication (OAuth2PasswordBearer) required - credential = this.configuration.lookupCredential('OAuth2PasswordBearer'); - if (credential) { - headers = headers.set('Authorization', 'Bearer ' + credential); - } - - let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (httpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - - let responseType: 'text' | 'json' = 'json'; - if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { - responseType = 'text'; - } - - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/twitter/${encodeURIComponent(String(twitterId))}`, - { - responseType: responseType, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); - } - - /** - * Twitter Read All - * @param hoodId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTwitters(hoodId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public getTwitters(hoodId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getTwitters(hoodId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getTwitters(hoodId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { - if (hoodId === null || hoodId === undefined) { - throw new Error('Required parameter hoodId was null or undefined when calling getTwitters.'); - } - - let headers = this.defaultHeaders; - - let credential: string | undefined; - // authentication (OAuth2PasswordBearer) required - credential = this.configuration.lookupCredential('OAuth2PasswordBearer'); - if (credential) { - headers = headers.set('Authorization', 'Bearer ' + credential); - } - - let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (httpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - - let responseType: 'text' | 'json' = 'json'; - if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { - responseType = 'text'; - } - - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/twitter/`, - { - responseType: responseType, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); - } - - /** - * Twitter Read All Public - * @param hoodId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTwittersPublic(hoodId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public getTwittersPublic(hoodId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getTwittersPublic(hoodId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public getTwittersPublic(hoodId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { - if (hoodId === null || hoodId === undefined) { - throw new Error('Required parameter hoodId was null or undefined when calling getTwittersPublic.'); - } - - let headers = this.defaultHeaders; - - let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (httpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - - let responseType: 'text' | 'json' = 'json'; - if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { - responseType = 'text'; - } - - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/twitter/public`, - { - responseType: responseType, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); - } - - /** - * Twitter Start - * @param twitterId - * @param hoodId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public startTwitter(twitterId: number, hoodId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public startTwitter(twitterId: number, hoodId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public startTwitter(twitterId: number, hoodId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public startTwitter(twitterId: number, hoodId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { - if (twitterId === null || twitterId === undefined) { - throw new Error('Required parameter twitterId was null or undefined when calling startTwitter.'); - } - if (hoodId === null || hoodId === undefined) { - throw new Error('Required parameter hoodId was null or undefined when calling startTwitter.'); - } - - let headers = this.defaultHeaders; - - let credential: string | undefined; - // authentication (OAuth2PasswordBearer) required - credential = this.configuration.lookupCredential('OAuth2PasswordBearer'); - if (credential) { - headers = headers.set('Authorization', 'Bearer ' + credential); - } - - let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (httpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - - let responseType: 'text' | 'json' = 'json'; - if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { - responseType = 'text'; - } - - return this.httpClient.post(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/twitter/${encodeURIComponent(String(twitterId))}/start`, - null, - { - responseType: responseType, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); - } - - /** - * Twitter Status - * @param twitterId - * @param hoodId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public statusTwitter(twitterId: number, hoodId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public statusTwitter(twitterId: number, hoodId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public statusTwitter(twitterId: number, hoodId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public statusTwitter(twitterId: number, hoodId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { - if (twitterId === null || twitterId === undefined) { - throw new Error('Required parameter twitterId was null or undefined when calling statusTwitter.'); - } - if (hoodId === null || hoodId === undefined) { - throw new Error('Required parameter hoodId was null or undefined when calling statusTwitter.'); - } - - let headers = this.defaultHeaders; - - let credential: string | undefined; - // authentication (OAuth2PasswordBearer) required - credential = this.configuration.lookupCredential('OAuth2PasswordBearer'); - if (credential) { - headers = headers.set('Authorization', 'Bearer ' + credential); - } - - let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (httpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - - let responseType: 'text' | 'json' = 'json'; - if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { - responseType = 'text'; - } - - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/twitter/${encodeURIComponent(String(twitterId))}/status`, - { - responseType: responseType, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); - } - - /** - * Twitter Stop - * @param twitterId - * @param hoodId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public stopTwitter(twitterId: number, hoodId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; - public stopTwitter(twitterId: number, hoodId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public stopTwitter(twitterId: number, hoodId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; - public stopTwitter(twitterId: number, hoodId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { - if (twitterId === null || twitterId === undefined) { - throw new Error('Required parameter twitterId was null or undefined when calling stopTwitter.'); - } - if (hoodId === null || hoodId === undefined) { - throw new Error('Required parameter hoodId was null or undefined when calling stopTwitter.'); - } - - let headers = this.defaultHeaders; - - let credential: string | undefined; - // authentication (OAuth2PasswordBearer) required - credential = this.configuration.lookupCredential('OAuth2PasswordBearer'); - if (credential) { - headers = headers.set('Authorization', 'Bearer ' + credential); - } - - let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (httpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - - let responseType: 'text' | 'json' = 'json'; - if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { - responseType = 'text'; - } - - return this.httpClient.post(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/twitter/${encodeURIComponent(String(twitterId))}/stop`, - null, - { - responseType: responseType, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); - } - -} diff --git a/frontend/src/app/dashboard/board/hoodpage/hoodpage.component.html b/frontend/src/app/dashboard/board/hoodpage/hoodpage.component.html index 5acf7d2..dd41c53 100644 --- a/frontend/src/app/dashboard/board/hoodpage/hoodpage.component.html +++ b/frontend/src/app/dashboard/board/hoodpage/hoodpage.component.html @@ -49,8 +49,8 @@

Share the hood page: Just send the link to your hood page to your community. We also recommend to link it in your platform - account description (e.g. Twitter description) to give the users - context and more information. + account description (e.g. Mastodon account description) to give the + users context and more information.

diff --git a/frontend/src/app/dashboard/board/platforms/platforms.component.html b/frontend/src/app/dashboard/board/platforms/platforms.component.html index d4c4987..c3d050d 100644 --- a/frontend/src/app/dashboard/board/platforms/platforms.component.html +++ b/frontend/src/app/dashboard/board/platforms/platforms.component.html @@ -37,7 +37,6 @@
-
diff --git a/frontend/src/app/dashboard/dashboard-routing.module.ts b/frontend/src/app/dashboard/dashboard-routing.module.ts index 927e068..483a1d7 100644 --- a/frontend/src/app/dashboard/dashboard-routing.module.ts +++ b/frontend/src/app/dashboard/dashboard-routing.module.ts @@ -4,7 +4,6 @@ import { DashboardComponent } from './dashboard.component'; import { HoodsComponent } from './hoods/hoods.component'; import { AuthGuard } from '../core/auth/auth.guard'; import { BoardComponent } from './board/board.component'; -import { TwitterCallbackComponent } from '../platforms/twitter/twitter-callback/twitter-callback.component'; import { AccountSettingsComponent } from './account-settings/account-settings.component'; const routes: Routes = [ @@ -15,8 +14,6 @@ const routes: Routes = [ { path: '', component: HoodsComponent }, { path: 'hoods/:id', component: BoardComponent }, { path: 'settings', component: AccountSettingsComponent }, - // Platform-specific Routes - { path: 'twitter-callback', component: TwitterCallbackComponent }, ], canActivate: [AuthGuard], }, diff --git a/frontend/src/app/platforms/platforms-info-page/platforms-info-page.component.html b/frontend/src/app/platforms/platforms-info-page/platforms-info-page.component.html index 3d3b646..3c4f29a 100644 --- a/frontend/src/app/platforms/platforms-info-page/platforms-info-page.component.html +++ b/frontend/src/app/platforms/platforms-info-page/platforms-info-page.component.html @@ -1,6 +1,5 @@

Platforms - choose one, get all hood messages

- diff --git a/frontend/src/app/platforms/platforms.module.ts b/frontend/src/app/platforms/platforms.module.ts index b9bb530..32802fe 100644 --- a/frontend/src/app/platforms/platforms.module.ts +++ b/frontend/src/app/platforms/platforms.module.ts @@ -2,22 +2,16 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { TelegramSettingsComponent } from './telegram/telegram-settings/telegram-settings.component'; import { SharedModule } from '../shared/shared.module'; -import { TwitterSettingsComponent } from './twitter/twitter-settings/twitter-settings.component'; import { EmailSettingsComponent } from './email/email-settings/email-settings.component'; import { EmailDialogComponent } from './email/email-settings/email-dialog/email-dialog.component'; import { EmailInfoDialogComponent } from './email/email-settings/email-info-dialog/email-info-dialog.component'; import { TelegramInfoDialogComponent } from './telegram/telegram-settings/telegram-info-dialog/telegram-info-dialog.component'; import { TelegramDialogComponent } from './telegram/telegram-settings/telegram-dialog/telegram-dialog.component'; -import { TwitterInfoDialogComponent } from './twitter/twitter-settings/twitter-info-dialog/twitter-info-dialog.component'; -import { TwitterCallbackComponent } from './twitter/twitter-callback/twitter-callback.component'; -import { TwitterCorpsesPipe } from './twitter/twitter-corpses-pipe/twitter-corpses.pipe'; import { PlatformsInfoPageComponent } from './platforms-info-page/platforms-info-page.component'; import { EmailBotCardComponent } from './email/email-bot-card/email-bot-card.component'; import { TelegramBotCardComponent } from './telegram/telegram-bot-card/telegram-bot-card.component'; -import { TwitterBotCardComponent } from './twitter/twitter-bot-card/twitter-bot-card.component'; import { EmailBotInfoDialogComponent } from './email/email-bot-card/email-bot-info-dialog/email-bot-info-dialog.component'; import { TelegramBotInfoDialogComponent } from './telegram/telegram-bot-card/telegram-bot-info-dialog/telegram-bot-info-dialog.component'; -import { TwitterBotInfoDialogComponent } from './twitter/twitter-bot-card/twitter-bot-info-dialog/twitter-bot-info-dialog.component'; import { EmailConfirmationComponent } from './email/email-confirmation/email-confirmation.component'; import { EmailUnsubscribeComponent } from './email/email-unsubscribe/email-unsubscribe.component'; import { MastodonBotCardComponent } from './mastodon/mastodon-bot-card/mastodon-bot-card.component'; @@ -28,22 +22,16 @@ import { MastodonBotInfoDialogComponent } from './mastodon/mastodon-bot-card/mas @NgModule({ declarations: [ TelegramSettingsComponent, - TwitterSettingsComponent, EmailSettingsComponent, EmailDialogComponent, EmailInfoDialogComponent, TelegramInfoDialogComponent, TelegramDialogComponent, - TwitterInfoDialogComponent, - TwitterCallbackComponent, - TwitterCorpsesPipe, PlatformsInfoPageComponent, EmailBotCardComponent, TelegramBotCardComponent, - TwitterBotCardComponent, EmailBotInfoDialogComponent, TelegramBotInfoDialogComponent, - TwitterBotInfoDialogComponent, EmailConfirmationComponent, EmailUnsubscribeComponent, MastodonBotCardComponent, @@ -55,7 +43,6 @@ import { MastodonBotInfoDialogComponent } from './mastodon/mastodon-bot-card/mas exports: [ TelegramSettingsComponent, MastodonSettingsComponent, - TwitterSettingsComponent, EmailSettingsComponent, PlatformsInfoPageComponent, ], diff --git a/frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-card.component.html b/frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-card.component.html deleted file mode 100644 index a668aad..0000000 --- a/frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-card.component.html +++ /dev/null @@ -1,46 +0,0 @@ -
- - - - - - Twitter - - - - - - - - @{{ twitter.username }} - - - - - - - - - Unfortunately your hood admin has not configured Twitter as platform - yet. - - - - warning - - - -
diff --git a/frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-card.component.scss b/frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-card.component.scss deleted file mode 100644 index 71cb1d3..0000000 --- a/frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-card.component.scss +++ /dev/null @@ -1,11 +0,0 @@ -.twitter { - background-image: url("../../../../assets/twitter.png"); - background-size: cover; -} - -.platform-title { - display: grid; - grid-template-columns: 1fr 40px; - width: 100%; - align-items: center; -} diff --git a/frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-card.component.spec.ts b/frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-card.component.spec.ts deleted file mode 100644 index 2312ffc..0000000 --- a/frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-card.component.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; - -import { TwitterBotCardComponent } from './twitter-bot-card.component'; - -describe('TwitterBotCardComponent', () => { - let component: TwitterBotCardComponent; - let fixture: ComponentFixture; - - beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ - declarations: [TwitterBotCardComponent], - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(TwitterBotCardComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-card.component.ts b/frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-card.component.ts deleted file mode 100644 index ffd2673..0000000 --- a/frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-card.component.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Component, OnInit, Input } from '@angular/core'; -import { TwitterService } from 'src/app/core/api'; -import { TwitterBotInfoDialogComponent } from './twitter-bot-info-dialog/twitter-bot-info-dialog.component'; -import { MatDialog } from '@angular/material/dialog'; - -@Component({ - selector: 'app-twitter-bot-card', - templateUrl: './twitter-bot-card.component.html', - styleUrls: ['./twitter-bot-card.component.scss'], -}) -export class TwitterBotCardComponent implements OnInit { - @Input() hoodId; - twitters$; - - constructor( - private twitterService: TwitterService, - private dialog: MatDialog - ) {} - - ngOnInit(): void { - this.twitters$ = this.twitterService.getTwittersPublic(this.hoodId); - } - - onInfoClick() { - this.dialog.open(TwitterBotInfoDialogComponent); - } -} diff --git a/frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-info-dialog/twitter-bot-info-dialog.component.html b/frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-info-dialog/twitter-bot-info-dialog.component.html deleted file mode 100644 index dd7d2d8..0000000 --- a/frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-info-dialog/twitter-bot-info-dialog.component.html +++ /dev/null @@ -1,51 +0,0 @@ - -
-

How to communicate with the hood via Twitter?

- - - - How to subscribe to the hood via Twitter? - -

- Click on the twitter bot name that is shown in the twitter card. Just - follow the twitter account that the link leads to. -

-
- - - How to send a broadcast message to the hood? - -

You have two options:

-
    -
  • - Mention the bot in your tweet. The message of your tweet will be - broadcasted. -
  • -
  • - Write a direct message to the bot. The message will be broadcasted. -
  • -
-

Both options have the equal result.

-
- - - How to receive messages? - -

- Follow one of the twitter accounts in the twitter card. It will - broadcast all messages it receives by tweeting the content. -

-
- - - How to stop receiving messages? - -

Just unfollow the twitter accounts that you previously followed.

-
-
-
-
diff --git a/frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-info-dialog/twitter-bot-info-dialog.component.scss b/frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-info-dialog/twitter-bot-info-dialog.component.scss deleted file mode 100644 index 79cc5e7..0000000 --- a/frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-info-dialog/twitter-bot-info-dialog.component.scss +++ /dev/null @@ -1,4 +0,0 @@ -.container { - margin-top: 10px; - margin-bottom: 10px; -} diff --git a/frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-info-dialog/twitter-bot-info-dialog.component.ts b/frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-info-dialog/twitter-bot-info-dialog.component.ts deleted file mode 100644 index f7ac2e0..0000000 --- a/frontend/src/app/platforms/twitter/twitter-bot-card/twitter-bot-info-dialog/twitter-bot-info-dialog.component.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-twitter-bot-info-dialog', - templateUrl: './twitter-bot-info-dialog.component.html', - styleUrls: ['./twitter-bot-info-dialog.component.scss'], -}) -export class TwitterBotInfoDialogComponent implements OnInit { - constructor() {} - - ngOnInit(): void {} -} diff --git a/frontend/src/app/platforms/twitter/twitter-callback/twitter-callback.component.html b/frontend/src/app/platforms/twitter/twitter-callback/twitter-callback.component.html deleted file mode 100644 index 113e652..0000000 --- a/frontend/src/app/platforms/twitter/twitter-callback/twitter-callback.component.html +++ /dev/null @@ -1,3 +0,0 @@ -
- -
diff --git a/frontend/src/app/platforms/twitter/twitter-callback/twitter-callback.component.scss b/frontend/src/app/platforms/twitter/twitter-callback/twitter-callback.component.scss deleted file mode 100644 index 86c0c51..0000000 --- a/frontend/src/app/platforms/twitter/twitter-callback/twitter-callback.component.scss +++ /dev/null @@ -1,4 +0,0 @@ -.spinner { - display: block; - margin: auto; -} diff --git a/frontend/src/app/platforms/twitter/twitter-callback/twitter-callback.component.spec.ts b/frontend/src/app/platforms/twitter/twitter-callback/twitter-callback.component.spec.ts deleted file mode 100644 index 2a6abf0..0000000 --- a/frontend/src/app/platforms/twitter/twitter-callback/twitter-callback.component.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; - -import { TwitterCallbackComponent } from './twitter-callback.component'; - -describe('TwitterCallbackComponent', () => { - let component: TwitterCallbackComponent; - let fixture: ComponentFixture; - - beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ - declarations: [TwitterCallbackComponent], - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(TwitterCallbackComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/frontend/src/app/platforms/twitter/twitter-callback/twitter-callback.component.ts b/frontend/src/app/platforms/twitter/twitter-callback/twitter-callback.component.ts deleted file mode 100644 index ef0fde3..0000000 --- a/frontend/src/app/platforms/twitter/twitter-callback/twitter-callback.component.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { TwitterService } from 'src/app/core/api'; - -@Component({ - selector: 'app-twitter-callback', - templateUrl: './twitter-callback.component.html', - styleUrls: ['./twitter-callback.component.scss'], -}) -export class TwitterCallbackComponent implements OnInit { - constructor( - private route: ActivatedRoute, - private router: Router, - private twitterService: TwitterService - ) {} - - ngOnInit(): void { - if ( - this.route.snapshot.queryParams.hood && - this.route.snapshot.queryParams.oauth_token && - this.route.snapshot.queryParams.oauth_verifier - ) { - this.twitterService - .callbackTwitter( - this.route.snapshot.queryParams.oauth_token, - this.route.snapshot.queryParams.oauth_verifier, - this.route.snapshot.queryParams.hood - ) - .subscribe(() => { - this.router.navigate([ - '/dashboard/hoods', - this.route.snapshot.queryParams.hood, - ]); - }); - } else if ( - this.route.snapshot.queryParams.hood && - this.route.snapshot.queryParams.denied - ) { - this.router.navigate([ - '/dashboard/hoods', - this.route.snapshot.queryParams.hood, - ]); - } else { - this.router.navigate(['/404']); - } - } -} diff --git a/frontend/src/app/platforms/twitter/twitter-corpses-pipe/twitter-corpses.pipe.ts b/frontend/src/app/platforms/twitter/twitter-corpses-pipe/twitter-corpses.pipe.ts deleted file mode 100644 index b7b8791..0000000 --- a/frontend/src/app/platforms/twitter/twitter-corpses-pipe/twitter-corpses.pipe.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Pipe, PipeTransform } from '@angular/core'; - -@Pipe({ - name: 'twitterCorpses', -}) -export class TwitterCorpsesPipe implements PipeTransform { - transform(twitters) { - return twitters.filter((x) => x.verified === 1); - } -} diff --git a/frontend/src/app/platforms/twitter/twitter-settings/twitter-info-dialog/twitter-info-dialog.component.html b/frontend/src/app/platforms/twitter/twitter-settings/twitter-info-dialog/twitter-info-dialog.component.html deleted file mode 100644 index 2c0180e..0000000 --- a/frontend/src/app/platforms/twitter/twitter-settings/twitter-info-dialog/twitter-info-dialog.component.html +++ /dev/null @@ -1,41 +0,0 @@ - -

How to add an twitter bot to your hood

-

What is a twitter bot?

-

- Twitter bots are twitter accounts operated by software. In our case we will - show you how to add a bot for users to subscribe to, so they can send - messages into your hood system by mentioning the bot or direct messaging it, - which get distributed to the other platforms. Also they can receive messages - from other platforms by reading the tweets of the bot. -

-

- Example: You as a hood admin added the bot - @kibicara-my-hood to your hood. John wants to send a message to all hood - subscribers. He then uses his twitter account to follow to the bot - @kibicara-my-hood and sends his message to the bot by sending a tweet. His - message will be distributed to the other platforms and Sandra who is - subscribed to your email hood bot gets John's message via email. -

-

How to add a twitter bot to your hood?

-
    -
  1. - Create a twitter account - for the twitter bot and log in. We recommend NOT to use - your own personal twitter account but to create a new seperate hood - account since you will give full access to the account to our software. -
  2. -
  3. - Click on the Add a new platform connection!-Button. This - will redirect you to the twitter page to authorize access to the twitter - account. Click the - Authorize app - Button. You will be redirected back here. Done! -
  4. -
- -

Can I stop relaying twitter messages?

-

- Yes, if you want to stop relaying twitter messages from a specific twitter - bot, just use the switch to the bot to stop relaying. -

-
diff --git a/frontend/src/app/platforms/twitter/twitter-settings/twitter-info-dialog/twitter-info-dialog.component.scss b/frontend/src/app/platforms/twitter/twitter-settings/twitter-info-dialog/twitter-info-dialog.component.scss deleted file mode 100644 index 6002fed..0000000 --- a/frontend/src/app/platforms/twitter/twitter-settings/twitter-info-dialog/twitter-info-dialog.component.scss +++ /dev/null @@ -1,9 +0,0 @@ -.example-image { - margin-left: 10%; - margin-right: 10%; - @media screen and (max-width: 600px) { - width: 100%; - margin-left: 0%; - margin-right: 0%; - } -} diff --git a/frontend/src/app/platforms/twitter/twitter-settings/twitter-info-dialog/twitter-info-dialog.component.ts b/frontend/src/app/platforms/twitter/twitter-settings/twitter-info-dialog/twitter-info-dialog.component.ts deleted file mode 100644 index 121a43a..0000000 --- a/frontend/src/app/platforms/twitter/twitter-settings/twitter-info-dialog/twitter-info-dialog.component.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-twitter-info-dialog', - templateUrl: './twitter-info-dialog.component.html', - styleUrls: ['./twitter-info-dialog.component.scss'], -}) -export class TwitterInfoDialogComponent implements OnInit { - constructor() {} - - ngOnInit(): void {} -} diff --git a/frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.html b/frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.html deleted file mode 100644 index c0519b6..0000000 --- a/frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - Twitter - - - - - - - - - - - -
- @{{ twitter.username }} - - -
- - - - - -
-
- warning - - - -
-
-
diff --git a/frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.scss b/frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.scss deleted file mode 100644 index 4a48207..0000000 --- a/frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.scss +++ /dev/null @@ -1,22 +0,0 @@ -.entry { - display: grid; - grid-template-columns: 4fr 40px 20px; - width: 100%; - align-items: center; -} - -.platform-title { - display: grid; - grid-template-columns: 1fr 40px; - width: 100%; - align-items: center; -} - -.platform-heading { - align-self: flex-end; -} - -.twitter { - background-image: url("../../../../assets/twitter.png"); - background-size: cover; -} diff --git a/frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.spec.ts b/frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.spec.ts deleted file mode 100644 index 57b8462..0000000 --- a/frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; - -import { TwitterSettingsComponent } from './twitter-settings.component'; - -describe('TwitterSettingsComponent', () => { - let component: TwitterSettingsComponent; - let fixture: ComponentFixture; - - beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ - declarations: [TwitterSettingsComponent], - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(TwitterSettingsComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.ts b/frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.ts deleted file mode 100644 index 76eedf7..0000000 --- a/frontend/src/app/platforms/twitter/twitter-settings/twitter-settings.component.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { Component, OnInit, Input } from '@angular/core'; -import { Observable } from 'rxjs'; -import { TwitterService } from 'src/app/core/api'; -import { TwitterInfoDialogComponent } from './twitter-info-dialog/twitter-info-dialog.component'; -import { MatDialog } from '@angular/material/dialog'; -import { MatSnackBar } from '@angular/material/snack-bar'; - -@Component({ - selector: 'app-twitter-settings', - templateUrl: './twitter-settings.component.html', - styleUrls: ['./twitter-settings.component.scss'], -}) -export class TwitterSettingsComponent implements OnInit { - @Input() hoodId; - twitters$: Observable>; - - constructor( - private twitterService: TwitterService, - public dialog: MatDialog, - private snackBar: MatSnackBar - ) {} - - ngOnInit(): void { - this.reload(); - } - - private reload() { - this.twitters$ = this.twitterService.getTwitters(this.hoodId); - } - - onInfoClick() { - this.dialog.open(TwitterInfoDialogComponent); - } - - onDelete(twitterId) { - this.twitterService.deleteTwitter(twitterId, this.hoodId).subscribe(() => { - this.reload(); - }); - } - - onCreate() { - this.twitterService.createTwitter(this.hoodId).subscribe((twitter) => { - if (twitter && twitter.access_token) { - const redirectUrl = - 'https://api.twitter.com/oauth/authorize?oauth_token=' + - twitter.access_token; - window.location.href = redirectUrl; - } - }); - } - - onChange(twitter) { - if (twitter.enabled === 0) { - this.twitterService.startTwitter(twitter.id, this.hoodId).subscribe( - () => {}, - (error) => { - this.snackBar.open('Could not start. Check your settings.', 'Close', { - duration: 2000, - }); - } - ); - } else if (twitter.enabled === 1) { - this.twitterService.stopTwitter(twitter.id, this.hoodId).subscribe( - () => {}, - (error) => { - this.snackBar.open('Could not stop. Check your settings.', 'Close', { - duration: 2000, - }); - } - ); - } - // TODO yeah i know this is bad, implement disabling/enabling - setTimeout(() => { - this.reload(); - }, 100); - } -} diff --git a/frontend/src/app/public-pages/homepage/faq/faq.component.html b/frontend/src/app/public-pages/homepage/faq/faq.component.html index 2ce4474..0214bd5 100644 --- a/frontend/src/app/public-pages/homepage/faq/faq.component.html +++ b/frontend/src/app/public-pages/homepage/faq/faq.component.html @@ -112,11 +112,6 @@ use. If you are a normal user:

    -
  • - Twitter: We save the id of the last received message (mentions and - direct messages). This can be a message of yours if you sent the - latest message. -
  • Telegram: We save your telegram username.
  • E-Mail: We save your e-mail address.
@@ -130,12 +125,6 @@

For hood admins:

  • We save your e-mail address and your password.
  • -
  • - Twitter: We save oauth tokens provided by twitter that give us access - to the twitter account and the username of the twitter account. We - disadvice the use of your private twitter account for acting as - Kibicara platform bot. Please create a new twitter account. -
  • Telegram: We save the telegram API token to the provided telegram bot and a welcome message. Also we retrieve the name of the telegram bot. diff --git a/frontend/src/app/public-pages/homepage/homepage.component.html b/frontend/src/app/public-pages/homepage/homepage.component.html index 30d56e3..62c6d08 100644 --- a/frontend/src/app/public-pages/homepage/homepage.component.html +++ b/frontend/src/app/public-pages/homepage/homepage.component.html @@ -31,7 +31,7 @@

    Inclusive and easy

    - Messages sent with Kibicara reach people via Telegram, Twitter and even + Messages sent with Kibicara reach people via Telegram, Mastodon and even E-Mail - perfect for announcing the next neighborhood meetings, creating news tickers or even providing disaster warnings.

    @@ -47,7 +47,7 @@ community-administrated instances of Kibicara, being able to customize different platform accounts and filters. You subscribe to a Kibicara hood through your service of choice. This can either be E-Mail, Telegram or - Twitter. + Mastodon.

    Discover hoods!