Make deploy button texts configurable from config.ts

This commit is contained in:
Kristóf Tóth 2018-10-02 11:26:39 +02:00
parent b3f7e65413
commit 79a4017386
3 changed files with 11 additions and 4 deletions

View File

@ -29,6 +29,12 @@ export const config = {
defaultCode: 'Loading your file...',
defaultLanguage: 'text',
deployProcessName: 'webservice',
deployButtonText: {
'TODEPLOY': 'Deploy',
'DEPLOYED': 'Deployed',
'DEPLOYING': 'Reloading app...',
'FAILED': 'Deployment failed. Retry'
},
showDeployButton: true,
reloadIframeOnDeploy: false,
showConsoleOnDeploy: true,

View File

@ -26,13 +26,13 @@
[class.deploy]="deployButtonState === DeployButtonState.DEPLOYING"
[class.disabled]="deployButtonState === DeployButtonState.DEPLOYING || deployButtonState === DeployButtonState.DEPLOYED"
[class.failed]="deployButtonState === DeployButtonState.FAILED">
<span *ngIf="deployButtonState === DeployButtonState.TODEPLOY">Deploy</span>
<span *ngIf="deployButtonState === DeployButtonState.TODEPLOY">{{deployButtonText['TODEPLOY']}}</span>
<span *ngIf="deployButtonState === DeployButtonState.DEPLOYED">
<img src="images/greentick_icon.svg"/>
<span>Deployed</span>
<span>{{deployButtonText['DEPLOYED']}}</span>
</span>
<span *ngIf="deployButtonState === DeployButtonState.DEPLOYING"><div class="loader"></div>Reloading app...</span>
<span *ngIf="deployButtonState === DeployButtonState.FAILED">Deployment failed. Retry</span>
<span *ngIf="deployButtonState === DeployButtonState.DEPLOYING"><div class="loader"></div>{{deployButtonText['DEPLOYING']}}</span>
<span *ngIf="deployButtonState === DeployButtonState.FAILED">{{deployButtonText['FAILED']}}</span>
</button>
</div>
</div>

View File

@ -44,6 +44,7 @@ export class IdeComponent implements OnInit {
codeState = CodeState.SAVED;
deployButtonState = DeployButtonState.DEPLOYED;
deployButtonText = config.ide.deployButtonText;
showDeployButton: boolean = config.ide.showDeployButton;
autosave = null;