Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux Dynamic readonly #3186

Merged
merged 1 commit into from
Sep 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,11 @@
<div class="alert alert-warning alert-dismissible" role="alert"
[innerHtml]="('readOnlyLocalCache' | translate)">
</div>
</div>

<div *ngIf="readOnlyLinuxDynamic">
<br />
<div class="alert alert-warning alert-dismissible" role="alert"
[innerHtml]="('readOnlyLinuxDynamic' | translate)">
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class EditModeWarningComponent implements OnInit {
public readWriteVSGenerated = false;
public readOnlyRunFromZip = false;
public readOnlyLocalCache = false;
public readOnlyLinuxDynamic = false;

constructor(private _functionAppService: FunctionAppService, private _broadcastService: BroadcastService) { }

Expand All @@ -50,6 +51,8 @@ export class EditModeWarningComponent implements OnInit {
this.readOnlyRunFromZip = true;
} else if (editMode === FunctionAppEditMode.ReadOnlyLocalCache) {
this.readOnlyLocalCache = true;
} else if (editMode === FunctionAppEditMode.ReadOnlyLinuxDynamic) {
this.readOnlyLinuxDynamic = true;
}
}
});
Expand All @@ -60,7 +63,7 @@ export class EditModeWarningComponent implements OnInit {
this._broadcastService.broadcastEvent<TreeUpdateEvent>(BroadcastEvent.TreeUpdate, {
operation: 'navigate',
resourceId: this.context.site.id,
data: SiteTabIds.functionRuntime
data: SiteTabIds.functionRuntime,
});
}
}
15 changes: 9 additions & 6 deletions client/src/app/shared/Utilities/edit-mode.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@ import { FunctionAppEditMode } from 'app/shared/models/function-app-edit-mode';

export class EditModeHelper {
public static isReadOnly(editMode: FunctionAppEditMode): boolean {
return editMode === FunctionAppEditMode.ReadOnly ||
editMode === FunctionAppEditMode.ReadOnlySourceControlled ||
editMode === FunctionAppEditMode.ReadOnlySlots ||
editMode === FunctionAppEditMode.ReadOnlyVSGenerated ||
editMode === FunctionAppEditMode.ReadOnlyRunFromZip ||
editMode === FunctionAppEditMode.ReadOnlyLocalCache;
return editMode === FunctionAppEditMode.ReadOnly
|| editMode === FunctionAppEditMode.ReadOnlySourceControlled
|| editMode === FunctionAppEditMode.ReadOnlySlots
|| editMode === FunctionAppEditMode.ReadOnlyVSGenerated
|| editMode === FunctionAppEditMode.ReadOnlyRunFromZip
|| editMode === FunctionAppEditMode.ReadOnlyLocalCache
|| editMode === FunctionAppEditMode.ReadOnlyLinuxDynamic;
}

public static getWarningIfForced(editMode: FunctionAppEditMode): string {
if (editMode === FunctionAppEditMode.ReadOnlyRunFromZip) {
return 'readOnlyRunFromZip';
} else if (editMode === FunctionAppEditMode.ReadOnlyLocalCache) {
return 'readOnlyLocalCache';
} else if (editMode === FunctionAppEditMode.ReadOnlyLinuxDynamic) {
return 'readOnlyLinuxDynamic';
} else {
return null;
}
Expand Down
3 changes: 2 additions & 1 deletion client/src/app/shared/models/function-app-edit-mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ export enum FunctionAppEditMode {
ReadOnlyVSGenerated,
ReadWriteVSGenerated,
ReadOnlyRunFromZip,
ReadOnlyLocalCache
ReadOnlyLocalCache,
ReadOnlyLinuxDynamic,
}
1 change: 1 addition & 0 deletions client/src/app/shared/models/portal-resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1323,4 +1323,5 @@
public static dynamicLinuxPreview = 'dynamicLinuxPreview';
public static formIsInvalid = 'formIsInvalid';
public static finishAndDeploy = 'finishAndDeploy';
public static readOnlyLinuxDynamic = 'readOnlyLinuxDynamic';
}
3 changes: 3 additions & 0 deletions client/src/app/shared/services/function-app.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,7 @@ export class FunctionAppService {
: '';
const usingLocalCache = appSettings && appSettings.properties[Constants.localCacheOptionSettingName] === Constants.localCacheOptionSettingValue;
const hasSlots = result.hasSlots.result;
const isLinuxDynamic = ArmUtil.isLinuxDynamic(context.site);

const resolveReadOnlyMode = () => {
if (sourceControlled) {
Expand Down Expand Up @@ -857,6 +858,8 @@ export class FunctionAppService {
return FunctionAppEditMode.ReadOnlyRunFromZip;
} else if (usingLocalCache) {
return FunctionAppEditMode.ReadOnlyLocalCache;
} else if (isLinuxDynamic) {
return FunctionAppEditMode.ReadOnlyLinuxDynamic;
} else if (editModeSettingString === Constants.ReadWriteMode) {
return resolveReadWriteMode();
} else if (editModeSettingString === Constants.ReadOnlyMode) {
Expand Down
3 changes: 3 additions & 0 deletions server/Resources/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4111,4 +4111,7 @@ Set to "External URL" to use an API definition that is hosted elsewhere.</value>
<data name="finishAndDeploy" xml:space="preserve">
<value>Finish and go to Deployment Center</value>
</data>
<data name="readOnlyLinuxDynamic" xml:space="preserve">
<value>Editing functions in the portal is not supported for Linux Consumption Function Apps (Preview).</value>
</data>
</root>