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...', defaultCode: 'Loading your file...',
defaultLanguage: 'text', defaultLanguage: 'text',
deployProcessName: 'webservice', deployProcessName: 'webservice',
deployButtonText: {
'TODEPLOY': 'Deploy',
'DEPLOYED': 'Deployed',
'DEPLOYING': 'Reloading app...',
'FAILED': 'Deployment failed. Retry'
},
showDeployButton: true, showDeployButton: true,
reloadIframeOnDeploy: false, reloadIframeOnDeploy: false,
showConsoleOnDeploy: true, showConsoleOnDeploy: true,

View File

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

View File

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