Skip to content

Commit 6cc046f

Browse files
authored
Merge pull request #217 from qubic/refactor/remove-voting-feature
2 parents 0007fd5 + 8ac4261 commit 6cc046f

31 files changed

+13
-2667
lines changed

src/app/app-routing.module.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,10 @@ import { BalanceComponent } from './balance/balance.component';
44
import { MainComponent } from './main/main.component';
55
import { SettingsComponent } from './settings/settings.component';
66
import { PaymentComponent } from './payment/payment.component';
7-
import { VotingComponent } from './voting/voting.component';
8-
import { VotingParticipateComponent } from './voting/participate/voting-participate.component';
9-
import { VotingCreateComponent } from './voting/create/voting-create.component';
107
import { IpoComponent } from './ipo/ipo.component';
118
import { PlaceBidComponent } from './ipo/place-bid/place-bid.component';
129
import { AssetsComponent } from './assets/assets.component';
1310
import { TransferRightsComponent } from './assets/transfer-rights/transfer-rights.component';
14-
import { NavigationComponent } from './navigation/navigation.component';
1511
import { WelcomeComponent } from './public/welcome/welcome.component';
1612
import { CreateVaultComponent } from './public/create-vault/create-vault.component';
1713
import { walletReadyGuard } from './guards/wallet-ready.guard';
@@ -61,22 +57,6 @@ const routes: Routes = [
6157
path : 'qearn',
6258
component: QearnComponent
6359
},
64-
{
65-
path : 'voting',
66-
component: VotingComponent
67-
},
68-
{
69-
path : 'voting/create',
70-
component: VotingCreateComponent
71-
},
72-
{
73-
path : 'voting/create/:computorId',
74-
component: VotingCreateComponent
75-
},
76-
{
77-
path : 'voting/participate/:index',
78-
component: VotingParticipateComponent
79-
},
8060
{
8161
path : 'settings',
8262
component: SettingsComponent

src/app/app.module.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,7 @@ import { MatTabsModule } from '@angular/material/tabs';
5555
import { AccountComponent } from './settings/account/account.component';
5656
import { ExportComponent } from './settings/export/export.component';
5757
import { NgxFileDropModule } from 'ngx-file-drop';
58-
import { VotingComponent } from './voting/voting.component';
59-
import { VotingParticipateComponent } from './voting/participate/voting-participate.component';
60-
import { VotingCreateComponent } from './voting/create/voting-create.component';
6158
import { MatStepperModule } from '@angular/material/stepper';
62-
import { VotingStatusComponent } from './voting/voting-status/voting-status.component';
6359
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
6460
import { IpoComponent } from './ipo/ipo.component';
6561
import { PlaceBidComponent } from './ipo/place-bid/place-bid.component';
@@ -130,10 +126,6 @@ export const httpInterceptorProviders = [{ provide: HTTP_INTERCEPTORS, useClass:
130126
LanguageChooserComponent,
131127
AccountComponent,
132128
ExportComponent,
133-
VotingComponent,
134-
VotingParticipateComponent,
135-
VotingCreateComponent,
136-
VotingStatusComponent,
137129
IpoComponent,
138130
PlaceBidComponent,
139131
TransferStatusComponent,

src/app/assets/assets.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ <h2>{{ t("assetsComponent.form.info") }}</h2>
314314
{{ t("assetsComponent.form.buttons.cancel") }}
315315
</button>
316316
<button *ngIf="!walletService.privateKey" mat-raised-button color="primary" type="button"
317-
(click)="loadKey()">{{ t("votingComponent.create.buttons.loadPrivateKey") }}
317+
(click)="loadKey()">{{ t("paymentComponent.buttons.loadPrivateKey") }}
318318
</button>
319319
<button *ngIf="walletService.privateKey" mat-raised-button color="primary" type="submit"
320320
[disabled]="!sendForm.valid || getBalanceAfterFees() < 0">

src/app/navigation/navigation.component.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@
8888
class="icon-color-link icon">toll</mat-icon>{{ t('general.navigation.qearn') }}</a>
8989
<a mat-list-item routerLink="assets-area" (click)="checkMobileToggle()" [class.selected-nav]="isAssetsSelected"><mat-icon
9090
class="icon-color-link icon">category</mat-icon>{{ t("general.navigation.assets") }}</a>
91-
<!-- <a mat-list-item routerLink="voting" (click)="checkMobileToggle()" [class.selected-nav]="isVotingSelected"><mat-icon
92-
class="icon-color-link icon">how_to_vote</mat-icon>{{ t("general.navigation.voting") }}</a> -->
9391
<a mat-list-item routerLink="ipo" (click)="checkMobileToggle()" [class.selected-nav]="isIpoSelected"><mat-icon
9492
class="icon-color-link icon">multiline_chart</mat-icon>{{ t("general.navigation.ipo") }}<span *ngIf="activeIpoCount > 0" class="nav-badge">{{ activeIpoCount }}</span></a>
9593
<a mat-list-item routerLink="settings" (click)="checkMobileToggle()" [class.selected-nav]="isSettingsSelected"><mat-icon

src/app/navigation/navigation.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ export class NavigationComponent implements OnInit, OnDestroy {
6565
public isBalanceSelected = false;
6666
public isQearnSelected = false;
6767
public isAssetsSelected = false;
68-
public isVotingSelected = false;
6968
public isIpoSelected = false;
7069
public activeIpoCount = 0;
7170
private destroy$ = new Subject<void>();
@@ -97,7 +96,6 @@ export class NavigationComponent implements OnInit, OnDestroy {
9796
this.isQearnSelected = currentUrl === '/qearn';
9897
this.isBalanceSelected = currentUrl === '/balance';
9998
this.isAssetsSelected = currentUrl === '/assets-area';
100-
this.isVotingSelected = currentUrl === '/voting';
10199
this.isIpoSelected = currentUrl === '/ipo';
102100
this.isSettingsSelected = currentUrl === '/settings';
103101

src/app/services/api.model.ts

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -93,58 +93,6 @@ export interface MarketInformation {
9393
currency: string
9494
}
9595

96-
export interface BallotDto {
97-
computorIndex?: number;
98-
computorId?: string | null;
99-
shortCode?: string | null;
100-
vote?: number;
101-
}
102-
103-
export interface ProposalDto {
104-
status: number;
105-
url?: string | null;
106-
computorIndex?: number;
107-
shortCode?: string | null;
108-
computorId: string;
109-
ballots?: Array<BallotDto> | null;
110-
readonly resultSummary?: { [key: string]: Array<BallotDto>; } | null;
111-
readonly mostVotes?: number;
112-
readonly sumOption1?: number;
113-
readonly sumOption2?: number;
114-
readonly sumOption3?: number;
115-
readonly sumOption4?: number;
116-
readonly sumOption5?: number;
117-
readonly sumOption6?: number;
118-
readonly sumOption7?: number;
119-
readonly isPublished: boolean;
120-
title?: string | null;
121-
description?: string | null;
122-
options?: string | null;
123-
readonly hasVotes?: boolean;
124-
published: Date | null;
125-
publishedTick: number | null;
126-
tickForPublish: number;
127-
}
128-
129-
export interface ProposalCreateRequest {
130-
computorId: string | null;
131-
title: string | null;
132-
description: string | null;
133-
option1: string | null;
134-
option2: string | null;
135-
option3?: string | null;
136-
option4?: string | null;
137-
option5?: string | null;
138-
option6?: string | null;
139-
option7?: string | null;
140-
}
141-
export interface ProposalCreateResponse {
142-
url: string;
143-
id: string;
144-
computorIndex: number;
145-
currentProtocol: number;
146-
}
147-
14896
export interface ContractDto {
14997
id: string;
15098
index: number;

src/app/services/api.service.ts

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Injectable } from '@angular/core';
2-
import { AuthResponse, BalanceResponse, ContractDto, CurrentTickResponse, MarketInformation, NetworkBalance, PeerDto, ProposalCreateRequest, ProposalCreateResponse, ProposalDto, QubicAsset, SmartContract, SubmitTransactionRequest, SubmitTransactionResponse, Transaction } from './api.model';
2+
import { AuthResponse, BalanceResponse, ContractDto, CurrentTickResponse, MarketInformation, NetworkBalance, PeerDto, QubicAsset, SmartContract, SubmitTransactionRequest, SubmitTransactionResponse, Transaction } from './api.model';
33
import {
44
HttpClient, HttpHeaders, HttpParams,
55
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
@@ -17,7 +17,6 @@ import { WalletService } from './wallet.service';
1717
})
1818
export class ApiService {
1919

20-
public currentProposals: BehaviorSubject<ProposalDto[]> = new BehaviorSubject<ProposalDto[]>([]);
2120
public currentIpoContracts: BehaviorSubject<ContractDto[]> = new BehaviorSubject<ContractDto[]>([]);
2221
public currentPeerList: BehaviorSubject<PeerDto[]> = new BehaviorSubject<PeerDto[]>([]);
2322
public currentProtocol: BehaviorSubject<number> = new BehaviorSubject<number>(0);
@@ -175,22 +174,6 @@ export class ApiService {
175174
}));
176175
}
177176

178-
public getProposals() {
179-
let localVarPath = `/Voting/Proposal`;
180-
return this.httpClient.request<ProposalDto[]>('get', `${this.basePath}${localVarPath}`,
181-
{
182-
context: new HttpContext(),
183-
headers: {
184-
"Content-Type": "application/json"
185-
},
186-
responseType: 'json'
187-
}
188-
).pipe(map((p) => {
189-
this.currentProposals.next(p);
190-
return p;
191-
}));
192-
}
193-
194177
public getIpoContracts() {
195178
let localVarPath = `/Wallet/IpoContracts`;
196179
return this.httpClient.request<ContractDto[]>('get', `${this.basePath}${localVarPath}`,
@@ -207,33 +190,6 @@ export class ApiService {
207190
}));
208191
}
209192

210-
public submitProposalCreateRequest(proposal: ProposalCreateRequest) {
211-
let localVarPath = `/Voting/Proposal`;
212-
return this.httpClient.request<ProposalCreateResponse>('post', `${this.basePath}${localVarPath}`,
213-
{
214-
context: new HttpContext(),
215-
headers: {
216-
"Content-Type": "application/json"
217-
},
218-
body: proposal,
219-
responseType: 'json'
220-
}
221-
);
222-
}
223-
224-
public submitProposalPublished(proposalId: string) {
225-
let localVarPath = `/Voting/Proposal/` + proposalId + "/publish";
226-
return this.httpClient.request<ProposalCreateResponse>('post', `${this.basePath}${localVarPath}`,
227-
{
228-
context: new HttpContext(),
229-
headers: {
230-
"Content-Type": "application/json"
231-
},
232-
responseType: 'json'
233-
}
234-
);
235-
}
236-
237193
public getPeerList() {
238194
let localVarPath = `/Public/Peers`;
239195
return this.httpClient.request<PeerDto[]>('get', `${this.basePath}${localVarPath}`,

src/app/services/apis/static/qubic-static.model.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export interface StaticSmartContract {
1818
address: string;
1919
procedures: SmartContractProcedure[];
2020
website?: string;
21-
proposalUrl?: string;
2221
}
2322

2423
export interface GetSmartContractsResponse {

0 commit comments

Comments
 (0)